
How HyDE, Multi-Query, and Step-Back Improve RAG Retrieval Recall
Query transformation rewrites user prompts before retrieval. Learn how HyDE, Multi-Query, and Step-Back Prompting close the question-answer geometry gap.
A RAG system is only as good as the search step in the middle. If a user types a vague question, uses different vocabulary than the source documents, or asks something multi-hop, the vector search returns weak matches and the model answers from thin context. Query transformation is the fix — a small step that sits between the user’s input and the retriever, reshaping the question into one or more forms that are more likely to find the relevant passages.
Four families dominate the technique. Hypothetical Document Embeddings (HyDE) asks the model to draft an imagined answer first, then searches the vector store using that draft instead of the question itself. Multi-Query expansion generates several rewordings of the original question, runs each search, and merges the results. Step-Back Prompting zooms out, asking a more abstract version of the question to retrieve background concepts before drilling into specifics. Decomposition splits a complex multi-hop question into sub-queries that each get their own retrieval pass.
Each family targets a different failure mode. Short queries fail because they don’t carry enough signal — HyDE compensates by inventing the missing context. Ambiguous queries fail because one phrasing only hits one phrasing — Multi-Query covers more of the embedding space. Specific factual questions sometimes fail because the supporting concept lives in a different part of the corpus — Step-Back surfaces that context first. The choice depends less on which technique is “best” and more on which failure mode keeps showing up in production logs.
Most teams meet query transformation through a RAG framework rather than building it from scratch. According to LangChain Docs, the MultiQueryRetriever generates several query variants from a single user question and returns the unique union of their search results — making it close to a one-line addition on top of an existing retrieval setup. According to LlamaIndex Docs, the equivalent abstraction is HyDEQueryTransform paired with TransformQueryEngine, which wraps any retriever and applies the transformation transparently. Both patterns show up in production RAG chatbots, internal Q&A tools, and document search assistants where users phrase questions in their own words and the system has to find the right passage anyway. The transformation step is invisible to the user; only the better answers are.
Log both the original query and the transformed query (or queries) for every request from day one. When retrieval starts returning irrelevant results, you need to know whether the model invented a misleading rewrite or whether the embedding similarity itself was the bottleneck — and you can’t reconstruct that after the fact.
Start with what query transformation is and how HyDE, multi-query, and step-back prompting improve RAG recall — it separates the three core rewrite strategies before any guide asks you to pick one. When users ask compound questions a single rewrite cannot cover, query decomposition and routing explains how splitting a question into sub-queries and fusing the results with RAG-Fusion recovers recall a single rewrite loses.
Before wiring anything into production, read the hard technical limits of query transformation — every rewrite pays a latency tax, and one failure mode matters more than the rest: a hypothetical document plausible enough to ground retrieval in fiction. With that ceiling in view, the LangChain build guide wires HyDE and multi-query into a working pipeline, and the HyDE vs. multi-query vs. step-back decision guide turns query shape into a routing rule instead of a guess.

Two neighbours get folded into the same mental bucket, and each mixing sends debugging in the wrong direction.
Query transformation acts before retrieval, widening what gets found by rephrasing the question; reranking acts after retrieval, reordering what already came back. A transformation problem shows up as documents that were never retrieved at all; a reranking problem shows up as the right document buried at position eight. Query transformation also targets a different side of the pipeline than contextual retrieval: transformation rewrites the question, while contextual retrieval enriches the document side by prepending context to each chunk before it is ever indexed. One fixes what you ask; the other fixes what got stored.
That two-sided view also explains where production practice moved in 2026 — teams shifted from a fixed rewrite step to router-selected transformation that picks a technique per query instead of running the same one on everything.
| Scenario | Use | Avoid |
|---|---|---|
| Users ask short, vague, or conversational questions | ✅ | |
| Sub-200ms total latency budget per request | ❌ | |
| Corpus vocabulary differs sharply from user phrasing | ✅ | |
| Per-query cost must stay near zero | ❌ | |
| Multi-hop question answering on long technical documents | ✅ | |
| Highly structured queries (exact-match lookups, SQL-like filters) | ❌ |
Q: Should I run HyDE on every query by default? A: No — treat it as a routed choice, not a default. Production teams that ran HyDE always-on hit a recall trap on structured corpora and a latency tax on smaller models; selective routing is now the standard practice, reserving the rewrite for the query shapes it actually helps.
Q: Can a rewritten query change what the user is actually asking? A: Yes, and that is the deeper risk, not just latency. An LLM that rewrites a question before retrieval effectively answers a different question than the one typed, often without telling the user it happened — an accountability question worth weighing before shipping the rewrite silently.
Q: Is a failed query rewrite easy to catch before it reaches the retriever? A: Not automatically — a hallucinated HyDE document reads like plausible prose, so nothing flags it before it grounds retrieval in fabricated text. The three structural costs — latency, drift, and hallucination — stay silent until you measure recall directly, not the rewrite’s fluency.
Q: If I add query transformation, does the reranker score the original question or the rewritten one? A: The reranker should always score the original user query, not the rewrite — HyDE retrieves with the hypothetical document, but ranking still has to answer what the user actually asked. Reranking against the rewrite is a common pipeline mistake that quietly drifts relevance.
Part of the retrieval-augmented generation theme · closest neighbour: reranking. Coming to this from a software background? Start with the story: Debugging RAG Failures: Why Developers Need a New Diagnostic Model.
User questions and indexed documents rarely use the same words, and that gap quietly destroys recall. Query transformation closes it by letting an LLM reshape the question before the retriever ever sees it.
Concepts covered

Query transformation rewrites user prompts before retrieval. Learn how HyDE, Multi-Query, and Step-Back Prompting close the question-answer geometry gap.

Vector retrievers lose compound questions to a single point. Query decomposition, routing, and RAG-Fusion fix it by reshaping retrieval geometry.

Query transformation in RAG hits three hard limits: latency tax from extra LLM calls, query drift on simple inputs, and hallucinated documents from HyDE.
These guides show how to wire HyDE, multi-query, and step-back prompting into a working RAG pipeline, and how to pick the right technique for the kind of questions your users actually ask.
Tools & techniques

Pick the right RAG query transformation. When HyDE beats multi-query, step-back outperforms decomposition, and routing wins over RAG-Fusion.

Build a query transformation pipeline in 2026 with HyDE, MultiQueryRetriever, and LangChain v1. Decide when each strategy fits — with specs that ship.
Query transformation is moving from a single rewrite step toward agentic routing, RAG-fusion, and adaptive pipelines that decide on the fly how to reformulate a question.
Models & benchmarks
Updated April 2026

Query transformation in 2026: agentic routers dispatch per query, RAG-Fusion gets reranked into a tie, and pipelines collapse into reflective agent loops.

HyDE and Step-Back Prompting moved from research to LangChain primitives. The trend in 2026: production teams route them selectively, not always-on.
An LLM that rewrites queries can also amplify bias, hallucinate fictional documents, and silently change what the user was asking.
Risks & metrics

When LLMs silently rewrite your query before retrieval, who is accountable for the answer? An ethical look at RAG bias and invisible authorship.