Sistava

What is Query Expansion?

Query expansion adds extra terms to a search query in order to retrieve documents that express the same idea in different words. The additions can come from synonym lists, from terms found in top ranked initial results, or from a language model asked to generate related vocabulary. It raises recall at some risk to precision.

The classical form is pseudo relevance feedback. The system runs the original query, assumes the top few results are relevant, extracts distinctive terms from them, and reruns an enriched query. This requires no external resources and often works, but it fails badly when the first results are off topic, because the expansion then pulls the second search further away from the user's intent.

Knowledge driven expansion uses curated resources instead: a domain thesaurus, an ontology, a product catalog, or a table of abbreviations and their expansions. It is more controlled and easier to audit than automatic feedback, and in specialized domains such as medicine or law it is often the higher quality option. The cost is ongoing curation as vocabulary changes.

Language model expansion is now common. The model is asked to list alternative phrasings, related concepts, or a hypothetical answer passage whose vocabulary is then used for search. The hypothetical document approach is often labeled HyDE. These techniques help most when the query is short and underspecified, and they add latency plus a source of drift, since a model can invent terminology the corpus never uses.

Expansion mainly benefits lexical retrieval, where vocabulary mismatch is the dominant failure. With dense retrieval the embedding already absorbs some paraphrase, so gains are smaller and can turn negative when added terms blur the query vector. Because the effect varies by corpus, expansion should be switched on only after measuring precision as well as recall on real queries.

Key points

In practice

A user searches an HR corpus for time off. Expansion adds leave, vacation, annual leave, and PTO from a curated abbreviation table, so the policy page titled Annual Leave Entitlement now matches, where the original two-word query found nothing. The team excludes the model-suggested term sabbatical after testing shows it surfaces an unrelated academic policy on most expanded queries.

Related terms

Back to the AI Glossary