The query a user types is rarely the query the index needs. Query transformation — rewriting, expanding, and synthesizing before retrieval — is the highest-leverage, lowest-cost upgrade to any RAG pipeline, because it fixes the mismatch where it originates.

The canonical techniques form a ladder. Multi-query expansion paraphrases the question several ways and unions the results, smoothing over vocabulary mismatch. Step-back prompting abstracts the question to its general principle first — "why did my deployment fail?" becomes "what are common causes of deployment failures?" — retrieving principles before specifics. HyDE (Gao et al., 2023) is the counter-intuitive star: generate a hypothetical answer first, then retrieve neighbors of that. A hypothetical document sits closer to real documents in embedding space than a question does — questions and documents are different distributions, and HyDE translates between them. Its reported gains over plain dense retrieval were substantial precisely because it fixes the asymmetry everyone had been tolerating.

Transformation also covers decomposition for multi-hop questions ("who is the CEO of the company that acquired X?" has no single-chunk answer) and routing — classifying the query to choose the right index, filter set, or retrieval strategy at all. The failure mode to manage is drift: each transformation is another model call that can distort intent, and the pipeline can confidently retrieve for a question nobody asked.

Deployment Notes

  • Use a cheap model for transformation: rewrites and expansions are mechanical; they do not need the frontier model.
  • Preserve the original query: always include the verbatim question in the candidate pool — transformations augment retrieval, they must not replace it.
  • Cache aggressively: real user queries repeat; transformed queries are a cache key like any other.
  • Evaluate end-to-end: judge transformation by downstream answer quality, not by retrieval recall alone — an expansion that retrieves more but answers worse is a regression.

Among all RAG upgrades, query transformation has the best effort-to-reward ratio in the field: an afternoon of work, no new infrastructure, and consistently measurable lift. It should be the first thing implemented after — or honestly, before — a vector database.