ModelRefs / Query Expansion — AI Glossary
Query Expansion — AI Glossary
Generating additional search terms or sub-queries from the original query to improve recall from the vector database.
Overview
Query expansion generates synonyms, related terms, or hypothetical answers (HyDE) to augment the original query. Multiple expansions are searched in parallel and results merged. Improves recall for under-specified queries. Pseudo-relevance feedback—expanding using top retrieved documents—is a classic IR technique adapted for dense retrieval.
Reference details
| Topic | rag |
|---|---|
| Last reviewed | 2026-06-24 |
Related terms
How it works
- The original query is kept, and additional forms are generated beside it — synonyms, related terms, or a hypothetical answer whose wording resembles the target documents.
- Each form is searched independently, so a document matching any one of them becomes reachable.
- Result sets are merged and deduplicated, usually with reciprocal rank fusion so a document ranked moderately by several forms can outrank one ranked highly by a single form.
- Recall rises because the union of several searches is at least as large as any one of them.
- Precision can fall for the same reason, so the merged set normally needs reranking before it reaches the prompt.
Example: The union is the mechanism, and the cost
One query returns 10 results, 6 relevant: precision 0.60. Three expansions return 10 each; after deduplication the union is 22 results containing 11 relevant. Recall has risen from 6 to 11 relevant documents found, nearly double. Precision has fallen to 11/22 = 0.50. Both moved, in opposite directions, from the same operation — which is why expansion is paired with a reranker rather than used alone, and why it costs three searches instead of one.
Commonly confused with
Adds to the query rather than replacing it: synonyms, related terms or generated variants, all searched to widen recall. That distinguishes it from rewriting, which produces one better query, and from decomposition, which produces several that each answer part of the question. HyDE is a specific expansion technique — it expands into a hypothetical answer rather than into extra terms.
When to use it
Reach for it when:
- Queries are short or under-specified and recall is the binding problem.
- Corpus vocabulary differs from user phrasing, so one form cannot match everything relevant.
- A reranker exists downstream to restore precision over the wider candidate set.
Reach for something else when:
- Precision is the problem — expansion makes it worse, not better.
- Latency cannot absorb several searches plus a merge.
- Queries are already precise, such as exact identifiers, where variants add only noise.
Continue your research
Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to Query Expansion — AI Glossary.
Frequently asked questions
What is Query Expansion?
Generating additional search terms or sub-queries from the original query to improve recall from the vector database.
What concepts are related to Query Expansion?
Closely related concepts include query rewriting, hyde, multi query retrieval.