Query Expansion and Pseudo-Relevance Feedback
Adding terms to a query to bridge vocabulary mismatch, and the drift failure that occurs when the terms are harvested from results that were wrong to begin with.
A query for "heart attack" misses every document that says "myocardial infarction". Expansion adds terms to the query so that lexical matching can reach documents the original wording could not. It is the oldest answer to vocabulary mismatch and it remains useful, including inside pipelines that also use dense retrieval.
Pseudo-relevance feedback
Relevance feedback in its original form asks the user which results were good and reformulates using their terms. It works well and users do not do it. Pseudo-relevance feedback removes the user: assume the top \(k\) results are relevant, extract discriminative terms from them, and re-run the expanded query.
Rocchio's formulation moves the query vector toward the centroid of assumed-relevant documents and away from assumed-irrelevant ones:
The language-modelling version, relevance models such as RM3, estimates a term distribution from the feedback documents and interpolates it with the original query's distribution. The interpolation weight is the safety valve: it caps how far the expanded query can move from what the user asked.
The drift failure
The assumption is that the top \(k\) are relevant. When they are not, expansion harvests terms from the wrong topic and amplifies the initial error, and the second retrieval is confidently more wrong than the first. This is query drift, and it is the characteristic failure of the whole family.
Its danger is that it is asymmetric in visibility: expansion helps modestly on queries that were already working and hurts severely on queries that were failing, which is the opposite of where help was needed. Average metric improvements can therefore mask a per-query distribution with a bad tail, and reporting the win/loss counts rather than the mean is essential when evaluating an expansion method.
The standard mitigations are all forms of restraint. Keep the interpolation weight on the original query high. Take few feedback documents, typically 5 to 10, since deeper feedback sets contain more noise. Select expansion terms by a discriminative criterion rather than raw frequency, so that common words do not dominate. And predict query difficulty first, applying expansion only where the initial retrieval looks confident, using signals such as the score distribution's shape or the clarity of the retrieved set relative to the corpus.
Document expansion instead
The alternative is to expand at index time. Doc2query trains a model to generate the questions a passage answers and appends them to the document before indexing (Nogueira et al., 2019, Document Expansion by Query Prediction, arXiv:1904.08375). The vocabulary gap is closed on the document side, retrieval remains a plain lexical lookup, and query latency is untouched because all the work happened offline.
This trades query-time cost for index-time cost and storage, and it is the same trade learned sparse retrieval makes with a different mechanism. Where query latency is the binding constraint, which is most production systems, document-side expansion is the better default.
When it breaks
Expansion multiplies query cost. A three-term query expanded to twenty terms touches twenty postings lists and weakens dynamic pruning, since the bound over more terms is looser. Latency increases superlinearly in a way that is easy to miss in an offline evaluation.
It cannot help when the initial retrieval returns nothing. Pseudo-relevance feedback needs results to feed on. For a zero-result query, which is where vocabulary mismatch bites hardest, there is nothing to expand from, and only a knowledge resource or a generative model can bridge the gap.
Modern LLM-based expansion changes the failure mode, not the risk. Generating a hypothetical answer document and retrieving with it, the HyDE pattern, works well and can hallucinate a plausible wrong topic, producing drift with more fluent terms. It also adds a model call to the query path, which is a large latency change.
Dense retrieval does not make it obsolete. Hybrid systems still benefit from expansion on the lexical side, and expansion remains the only mechanism that improves matching without a model in the query path.
7 flashcards for this concept
Click a card to reveal the answer.