1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
51 small wins to finish your pathNext question →
Explain query transformation techniques: rewriting, multi-query, HyDE, step-back, and decomposition.
30-second answerSay your answer out loud first, then reveal.

The techniques compared
| Technique | How | Helps when | Cost |
|---|---|---|---|
| Rewrite / expand | LLM fixes typos, expands acronyms, adds domain terms | Vague or short queries ("PF withdrawl rules") | 1 small LLM call |
| Multi-query | Generate N paraphrases, retrieve for each, fuse | Vocabulary mismatch | N retrievals |
| HyDE (Gao et al. 2022) | LLM writes a fake answer; embed that (answers look like documents) | Question-vs-document style mismatch | 1 LLM call; risky if the fake answer is wrong-headed |
| Step-back | Ask a higher-level question ("What's the leave policy?") alongside the specific one | Specific questions needing background principles | Extra retrieval |
| Decomposition | "Compare Q2 vs Q3 churn" → two queries | Multi-part / comparison / multi-hop questions | Multiple retrievals, maybe sequential |
| Conversational condensation | Turn a follow-up into a standalone question (Q24) | Chat interfaces | 1 small LLM call |
Trade-offs
Every transformation adds latency and cost and can drift from the user's intent. Measure the recall gain on your eval set, and consider routing: only transform when the query looks ambiguous or complex.
Common mistakes
- Applying HyDE everywhere. For exact-match queries (IDs, names) it can hurt.
Related
Little by little, you're building something great.