Skip to content

Learning path · Retrieval & Ranking · 47

Query Transformation

Rewriting user queries—expansion, decomposition, or step-back—for better retrieval against the index.

Why it matters

  • Raw user messages are often vague or conversational.
  • Multi-hop questions need sub-queries.
  • Transforms add latency and must be eval-covered.

Key ideas

  • Query expansion
  • Sub-query decomposition
  • Hypothetical documents

Video

Query transformation uses an LLM to turn a complaint about a bill into sub-queries against billing docs, or to expand acronyms from a glossary. Template it, and refuse when the transform invents constraints. Cache repeats. Measure Recall@K with and without the extra call so you know it earns its keep.

Updated 2026-08-09 · Full learning path