Part 3 of 6 · 2 min read
HyDE and decomposition
Search with a made-up answer, or split one question into several.
HyDE: search with a made-up answer
HyDE (hypothetical document embeddings)
Ask a model to write a short imaginary answer to the question, then search with that text (often together with the original question). The imaginary answer need not be true; it only needs to sound like the real passage.
A question and its answer use different words. "Everything feels laggy" is a complaint; the passage is "the dashboard may be slow or show high latency". A made-up answer carries the passage's vocabulary, so it sits closer to the passage in embedding space.
hyde("everything feels laggy")
# 'The dashboard may be slow or show high latency and delay; clearing the cache or upgrading can help.'
In the results below HyDE rescues the vocabulary-gap questions (100 percent) but hurts follow-ups and compound ones: its template has no way to fill in a missing subject, and it replaces precise words such as E-4290 with generic ones. That is the general shape of the risk: the invention can drown the part of the question that was already precise. A real model may also invent wrong facts; that is acceptable for searching and dangerous if the made-up text is ever shown to the user as an answer.
Decomposition: one question, several searches
Query decomposition
Splitting a compound question into focused sub-questions, retrieving for each, and combining the results.
Take "What does E-4290 mean and how do I reset my password?". One query blends two topics, and with only two slots in the top results one topic can crowd out the other. Splitting gives each its own search, then results are merged round-robin so each part gets a slot.
decompose("What does E-4290 mean and how do I reset my password?")
# ['What does E-4290 mean?', 'how do I reset my password?']
Decomposition also applies to multi-hop questions, where the answer to part one is needed to ask part two. That is what the agentic retrieval loop of module 8 is for; this static split only handles independent parts.