Query Expansion

Query expansion is the retrieval technique of transforming a user's raw query into one or more enriched queries before searching, so that documents which express the same idea in different words are still found. It exists because the query a person types and the passage that answers it are rarely written in the same vocabulary: a user asks "why is my invoice wrong", the documentation says "proration on mid-cycle plan changes", and a single-shot search over either lexical or vector indexes can miss the match entirely. Expansion narrows that gap on the query side rather than on the corpus side. There are several forms, and they compose. Synonym and term expansion adds lexical variants and domain vocabulary, which mainly helps keyword retrieval. Multi-query expansion asks a language model to generate several rephrasings of the question, retrieves for each, and merges the result sets — usually with reciprocal rank fusion, so a document ranked moderately well by many variants outranks one ranked highly by a single outlier. Decomposition splits a compound question into its parts and retrieves separately for each, which is what makes multi-hop questions answerable at all. Step-back expansion generates a more general version of the question to pull in background context the specific phrasing would never surface. Hypothetical document expansion goes the other way, generating a plausible answer and embedding that instead of the question, on the theory that answers sit closer to answers than questions do. The costs are real and worth stating plainly. Every extra query is another retrieval round trip and, where a model does the rewriting, another inference call before the user sees anything — so expansion buys recall with latency and spend. It can also hurt precision: a rewriting model that misreads an ambiguous query pulls in confidently irrelevant material, and unlike a plain miss, that material reaches the generation step and gets used. Expansion is therefore usually paired with a reranker, which restores precision over the larger, noisier candidate set. Practical note: measure recall before and after on a fixed evaluation set rather than judging by feel, and cache the expansions themselves — user queries repeat, and rewriting the same question with a model on every request is the easiest avoidable cost in a retrieval pipeline.

Related terms

More Core AI terms