Query Expansion Techniques
Users rarely phrase questions the same way documents phrase answers.
Query expansion improves retrieval by creating better search queries from the user's intent.
Common techniques
| Technique | Idea |
|---|---|
| rewrite | clean up ambiguous wording |
| multi-query | generate several query variants |
| HyDE | generate a hypothetical answer, then retrieve against it |
| step-back | ask a broader conceptual query |
| decomposition | split a complex question into subquestions |
Example
User asks:
text
Can I get money back if I cancel late?
Expanded queries:
text
refund policy after cancellation deadline
late cancellation refund exception
subscription cancellation refund window
Guardrail
Expansion must not change the question.
Bad expansion:
text
legal claim for unfair cancellation
That may retrieve dramatic but irrelevant documents.
Evaluate expansion
Track whether expansion improves:
- recall
- top result quality
- answer groundedness
- latency
- cost
Knowledge check
Q1: Why does query expansion help RAG?
It bridges the vocabulary gap between user questions and source documents.
Q2: What is the main risk?
Query drift: searching for a different question than the user asked.