What is query expansion?
Query expansion is an information retrieval technique that adds synonyms, related or corrected terms to a user's query so search also finds relevant documents written in different words.
It differs from query rewriting in keeping the original query: query expansion adds terms to it, while query rewriting turns it into a new form. Multi-query retrieval instead generates several independent queries and searches each.
- Topic
- Embeddings, document processing and RAG
- Also known as
- Query enrichment
How query expansion works
- Query terms are examined; abbreviations, typos and in-house names are identified.
- Terms to add come from a synonym list, word embeddings, first-pass results or a language model.
- New terms are added with lower weight than the original ones.
- The expanded query runs; the number of added terms is capped, since too many of them lower precision.
In more detail
Pseudo-relevance feedback (PRF and RM3) and generative expansion
A foundational classical method is Pseudo-Relevance Feedback (PRF), such as Rocchio or RM3: the engine runs an initial search, assumes the top-k results are relevant and extracts frequent discriminating terms from them to build an expanded query. Modern LLM-based methods such as Query2doc and HyDE (Hypothetical Document Embeddings) invert this by generating a synthetic answer or passage first and using it to enrich sparse or dense retrieval.
Query drift and ambiguity risk
Uncontrolled expansion causes query drift, where added terms pull the search away from the user's true intent toward a broader or unrelated topic. Because a single ambiguous word (for example, 'bank' or 'POS') can expand in the wrong sense, enterprise systems weight original terms higher (e.g. boost 2.0 versus 0.5) and scope synonym dictionaries by domain or department.
How expansion affects sparse and dense search
While classic query expansion primarily addresses lexical mismatch in sparse keyword engines like BM25, learned sparse models such as SPLADE automatically expand documents and queries with contextual vocabulary weights at encoding time. For dense vector search, simple synonym injection adds little value because embeddings already map synonyms closely; instead, generating rich hypothetical passages (HyDE) or sub-concepts bridges query-document style asymmetry.
Stemming and suffix handling in agglutinative languages such as Turkish
For agglutinative languages such as Turkish, surface-form synonym lists fail unless combined with morphological normalisation (lemmatisation or stemming) and ASCII/diacritic folding (e.g. matching 'odeme' with 'ödeme'). Ignoring inflectional suffixes causes both missed expansions and noisy matches.
Commonly confused terms
| Term | How it differs |
|---|---|
| Multi-query retrieval | Multi-query retrieval asks a model to generate several separate query variations and fuses their search results (e.g. via Reciprocal Rank Fusion), whereas classic query expansion executes a single augmented query with weighted terms. |
| Query relaxation | Query relaxation drops or softens strict filters and constraints when too few results return, whereas query expansion adds extra related terms to bridge vocabulary mismatch. |
Why query expansion matters for on-premises AI
Inside an organisation the same thing goes by different names: one unit says “purchase request”, another “PR”, while old documents use old product names. Query expansion bridges these gaps, finding documents missed especially by sparse retrieval. The organisation's own abbreviation and term list is often the most effective source. Expansion with a language model is powerful but adds a model call per query and can produce irrelevant terms, so the effect of added terms is measured on the organisation's question set.
A retail chain's internal support portal adds “payment terminal” and “card reader” to a staff query for “POS”, also finding fault instructions named differently in older manuals.
Common questions
How does query expansion differ from query rewriting?
Query expansion keeps the original query and adds terms. Query rewriting turns it into a new form, such as making an incomplete question in a chat a full one.
How many terms should be added?
A few highly relevant ones. Too many push irrelevant documents up; the right number is found by testing on the organisation's question set.
Related terms
- Query rewriting
- Multi-query retrieval
- Hypothetical Document Embeddings
- Sparse retrieval
- Word embedding
- Keyword search
- Query decomposition
Sources
- Carpineto and Romano, A Survey of Automatic Query Expansion in Information Retrieval, 2012
- Wang, Yang and Wei, Query2doc: Query Expansion with Large Language Models, 2023
In the glossary: Glossary, M to Q