Relevance Feedback

Improving a query from the searcher's judgments of initial results. Rocchio's vector-space method drawn in two dimensions, Ide's variants, probabilistic reweighting with the Robertson–Spärck Jones weight worked on a real query, choosing expansion terms by offer weight, evaluating on the residual collection, experiments on the Cranfield collection, and why explicit feedback is rarely used. The Rocchio formula derived as the practical form of the optimal query, the difference of centroids. Worked problems from the course text's chapter 9 and on query 180.

Relevance feedback rebuilds a query from the searcher's judgments of the first results. Rocchio's formula moves a vector-space query toward the centroid of the judged relevant documents and away from that of the nonrelevant ones; it is the practical form of the optimal query, proved to be the difference of the two centroids. The Robertson–Spärck Jones weight is the BIM's term weight with both probabilities estimated from the judged counts. Judging the top 10 of each of Cranfield's 225 queries and scoring on the residual collection, one round raised residual MAP in every method tried: BM25 from 0.115 to 0.157 by RSJ reweighting and to 0.204 with ten offer-weight terms added, TF-IDF from 0.114 to 0.258 by Rocchio. Expansion gains more than reweighting.

A searcher who types Cranfield query 185, experimental studies on panel flutter, and reads the Binary Independence Model's top ten finds six of the nine relevant abstracts there. Recognizing a relevant abstract takes a moment's reading. Writing a query that would find the other three is much harder, because the searcher does not know what words those abstracts use. The judgments, though, are evidence about exactly that. Can a system turn "this one is relevant, that one is not" into a better query?

Relevance feedback is the family of methods that do. The system shows initial results, the searcher marks some of them relevant or not, and the system uses those judgments to build a better query and search again. The judgments supply what the original query lacked: examples of the vocabulary that relevant documents actually use. Relevance feedback dates from the SMART experiments of the 1960s. It has been effective in experiment after experiment, and it connects the course's two families of models. This article is the full treatment; the limits of the vector space model introduces Rocchio's method briefly, and pseudo-relevance feedback builds on this article.

Here is the route. First we separate reweighting a query from expanding it. Then we work Rocchio's and Ide's methods in the vector space model, in two dimensions. Next we re-estimate the Binary Independence Model's weights from judgments and choose expansion terms. Finally we evaluate feedback fairly on all 225 Cranfield queries and ask why searchers rarely use it.

Two ways to use judgments

Judgments can improve a query in two ways:

  • Reweighting changes the weights of the terms already in the query. A query term found in most of the judged relevant documents should count for more, and one found mostly in nonrelevant documents for less.
  • Expansion adds new terms drawn from the relevant documents. Suppose the relevant documents keep using nozzle and thrust while the query said rocket engine. Adding those words lets the query find relevant documents that never use the original ones. That addresses vocabulary mismatch directly.

The vector space model comes first, because there the whole method can be drawn.

In the vector space model: Rocchio

Here is the idea in one sentence: move the query toward the average of the documents judged relevant, and a little away from the average of those judged nonrelevant. Rocchio's method (Rocchio, 1971) treats the query as a vector in the same space as the documents. The revised query is

$$\vec{q}_m = \alpha\, \vec{q}_0 + \beta\, \frac{1}{\lvert D_r \rvert} \sum_{\vec{d} \in D_r} \vec{d} \;-\; \gamma\, \frac{1}{\lvert D_{nr} \rvert} \sum_{\vec{d} \in D_{nr}} \vec{d},$$

where:

  • $\vec{q}_0$ is the original query;
  • $D_r$ and $D_{nr}$ are the documents judged relevant and nonrelevant;
  • $\alpha$, $\beta$, $\gamma$ set how much each part counts.

The two sums divided by the set sizes are centroids, the average vectors of the judged relevant and nonrelevant documents. The limits of the vector space model works the formula on two small examples: a four-term query jaguar drifting toward cat, and a query for car insurance that learns auto. The centroids contain every term of the judged documents, so Rocchio both reweights and expands. In practice the expansion is usually limited to the highest-weighted new terms.

Where the formula comes from

Here is the idea in one sentence: if every relevant and nonrelevant document were known, the best direction for a query would be the difference of their two centroids, and Rocchio's formula is that difference computed from the judged documents only and added to the original query.

The formal version. Let $C_r$ and $C_{nr}$ be the sets of all relevant and all nonrelevant documents, with centroids $\vec{\mu}_r = \frac{1}{\lvert C_r \rvert}\sum_{\vec{d} \in C_r} \vec{d}$ and $\vec{\mu}_{nr} = \frac{1}{\lvert C_{nr} \rvert}\sum_{\vec{d} \in C_{nr}} \vec{d}$. The course text asks for the query that maximizes similarity to the relevant documents minus similarity to the nonrelevant ones (Manning, Raghavan, and Schütze, 2008, §9.1.1, eq. 9.1). Take the similarity of a query and a document to be their inner product $\vec{q} \cdot \vec{d}$, with every document vector length-normalized and the query of length 1 (the ranking ignores the query's length). The inner product is then the cosine, which is the similarity the course text uses in eq. 9.1. The objective is then the average similarity to the relevant documents minus the average similarity to the nonrelevant ones:

$$J(\vec{q}) = \frac{1}{\lvert C_r \rvert}\sum_{\vec{d} \in C_r} \vec{q} \cdot \vec{d} \;-\; \frac{1}{\lvert C_{nr} \rvert}\sum_{\vec{d} \in C_{nr}} \vec{q} \cdot \vec{d}.$$

  1. The objective is one inner product. The inner product is linear, so the query can be taken outside both sums: $J(\vec{q}) = \vec{q} \cdot \left(\vec{\mu}_r - \vec{\mu}_{nr}\right)$.
  2. An inner product with a unit vector is largest in the direction of the other vector. By the Cauchy–Schwarz inequality, $\vec{q} \cdot \vec{v} \le \lVert \vec{q} \rVert\, \lVert \vec{v} \rVert = \lVert \vec{v} \rVert$ for a unit vector $\vec{q}$, with equality exactly when $\vec{q} = \vec{v} / \lVert \vec{v} \rVert$ (for $\vec{v} \ne \vec{0}$).
  3. The optimum. With $\vec{v} = \vec{\mu}_r - \vec{\mu}_{nr}$, the objective is at most $\lVert \vec{\mu}_r - \vec{\mu}_{nr} \rVert$, and the only unit query that reaches it points along the difference of the centroids:

$$\vec{q}_{\mathrm{opt}} \;\propto\; \vec{\mu}_r - \vec{\mu}_{nr} = \frac{1}{\lvert C_r \rvert}\sum_{\vec{d} \in C_r} \vec{d} \;-\; \frac{1}{\lvert C_{nr} \rvert}\sum_{\vec{d} \in C_{nr}} \vec{d}.$$

This is the course text's optimal query (eq. 9.2). If the documents are not length-normalized, the same three steps maximize the difference of average inner products instead, and the optimum is the difference of the centroids of the raw vectors. The optimal query cannot be used as it stands, because the full set of relevant documents is what the search is trying to find. Rocchio's algorithm, the practical form (eq. 9.3), makes three changes:

  • The unknown sets $C_r$ and $C_{nr}$ are replaced by the judged sets $D_r$ and $D_{nr}$.
  • The original query is kept, with weight $\alpha$. A handful of judged documents is a small sample of the relevant set, and the query is the only other evidence of what the searcher wants.
  • The two centroids get separate weights $\beta$ and $\gamma$. The course text suggests $\alpha = 1$, $\beta = 0.75$ and $\gamma = 0.15$ as reasonable values, with $\gamma < \beta$ because positive feedback has proved more valuable than negative. It notes that many systems allow only positive feedback, $\gamma = 0$. Negative components of the result are set to zero (§9.1.1).

Example (which objective the centroid difference maximizes). The difference of the centroids is the exact maximizer of $J$ above, the difference of average inner products. It is not in general the maximizer of $\cos(\vec{q}, \vec{\mu}_r) - \cos(\vec{q}, \vec{\mu}_{nr})$, the difference of the cosines with the two centroids. The same two steps applied to that objective, which equals $\vec{q} \cdot \left(\vec{\mu}_r / \lVert \vec{\mu}_r \rVert - \vec{\mu}_{nr} / \lVert \vec{\mu}_{nr} \rVert\right)$ for a unit query, give the difference of the unit-length centroids. The two directions coincide when the centroids have equal lengths. The plane below gives a case where they differ.

Rocchio in two dimensions

With only two terms, the whole method can be drawn. Let the axes be the weights of rocket and nozzle. The searcher typed rocket, so $\vec{q}_0 = (1, 0)$. The system returned four documents, and the searcher judged them. Two more documents have not been seen yet:

Document rocket nozzle Judgment Cosine with $\vec{q}_0$
R1 0.6 0.8 relevant 0.600
R2 0.2 0.9 relevant 0.217
N1 0.9 0.1 nonrelevant 0.994
N2 0.7 0.0 nonrelevant 1.000
U1 0.1 0.7 not yet seen 0.141
U2 0.8 0.3 not yet seen 0.936

The relevant documents are about nozzles; the nonrelevant ones mention rockets and little else. Two unseen documents complete the example: U1, which resembles the relevant ones, and U2, which resembles the nonrelevant ones. The original query ranks U2 far above U1.

The computation, with $\alpha = 1$, $\beta = 0.75$, $\gamma = 0.15$:

  1. Relevant centroid: $\frac{1}{2}\left((0.6, 0.8) + (0.2, 0.9)\right) = (0.40, 0.85)$.
  2. Nonrelevant centroid: $\frac{1}{2}\left((0.9, 0.1) + (0.7, 0.0)\right) = (0.80, 0.05)$.
  3. $\vec{q}_m = (1, 0) + 0.75\,(0.40, 0.85) - 0.15\,(0.80, 0.05) = (1 + 0.30 - 0.12,\; 0 + 0.6375 - 0.0075) = (1.18, 0.63)$.

The revised query points 28.1 degrees above the rocket axis.

Example (one round does not reorder the unseen documents). After one round of Rocchio, U1 does not overtake U2. Before feedback, U2's cosine with the query is 0.936 and U1's is 0.141. Afterward U1's cosine has risen to 0.591, but U2's has also risen, from 0.936 to 0.991. With these weights, one round turns the query only part of the way. What has changed is that nozzle, a word the searcher never typed, now carries 0.63 of weight. A document that uses only nozzle is no longer invisible.

Left: the Rocchio update in the rocket-nozzle plane. The original query q0 (blue) points along the rocket axis; adding 0.75 times the relevant centroid (green cross, dashed green step) and subtracting 0.15 times the nonrelevant centroid (orange cross, short orange step) gives qm, turned 28 degrees toward the relevant documents R1 and R2. Notice how short the orange step is next to the green one. Right: Ide dec-hi, which adds the relevant vectors whole and subtracts only the top-ranked nonrelevant document N2, turns the query to 57 degrees, past U2 and toward U1; the Rocchio direction is dotted for comparison.
Left: the Rocchio update in the rocket-nozzle plane. The original query q0 (blue) points along the rocket axis; adding 0.75 times the relevant centroid (green cross, dashed green step) and subtracting 0.15 times the nonrelevant centroid (orange cross, short orange step) gives qm, turned 28 degrees toward the relevant documents R1 and R2. Notice how short the orange step is next to the green one. Right: Ide dec-hi, which adds the relevant vectors whole and subtracts only the top-ranked nonrelevant document N2, turns the query to 57 degrees, past U2 and toward U1; the Rocchio direction is dotted for comparison.

Two properties of the formula are visible here:

  • Only the ratios matter for ranking. Documents are ranked by cosine, which ignores the query vector's length. Multiplying $\alpha$, $\beta$, and $\gamma$ by the same number changes the length of $\vec{q}_m$ but not its direction. So only $\beta/\alpha$ and $\gamma/\alpha$ affect the results. With $\alpha = 1$, $\beta = 0.5$, $\gamma = 0.5$ the query is $(0.80, 0.40)$, at 26.6 degrees.
  • Negative feedback is weak by design. The nonrelevant centroid lies almost on the original query. Subtracting it mostly shortens the query along the rocket axis, which tilts it only slightly. With $\gamma = 0$ the angle is 26.1 degrees instead of 28.1. Nonrelevant documents can be wrong in many different ways, so their centroid is a poor description of what to avoid. That is one reason $\gamma$ is usually set much smaller than $\beta$.

Example (the optimal query in the plane). Treat the four judged documents as the whole of $C_r$ and $C_{nr}$. The difference of the centroids is $(0.40, 0.85) - (0.80, 0.05) = (-0.40, 0.80)$, which points 116.6 degrees from the rocket axis and has length 0.894. That length is the largest value $J$ can take, and a search over every direction in steps of 0.01 degree finds the maximum at 116.57 degrees. The original query has $J = (1, 0) \cdot (-0.40, 0.80) = -0.40$: it is more similar to the nonrelevant documents than to the relevant ones. Rocchio's revised query, at 28.1 degrees, has $J = 0.024$, just past zero. The optimal direction has a negative rocket weight. It would rank documents by how little they say about rockets, which separates these four documents and is not what the searcher asked for. Keeping $\alpha\,\vec{q}_0$ and clipping negative weights holds the revised query near the request. For the other objective, the difference of cosines with the centroids, the maximizer is $(0.4258, 0.9048) - (0.9981, 0.0624) = (-0.5723, 0.8424)$, at 124.2 degrees, not 116.6: the relevant centroid is longer than the nonrelevant one (0.939 against 0.802).

The four document vectors of this example are not of length 1 (their lengths are 1.000, 0.922, 0.906 and 0.700), so $J$ here is the inner-product objective. Scaling each document to length 1 first makes $J$ the average cosine of the course text's eq. 9.1. Its optimum is the difference of the centroids of the scaled documents, $(0.4085, 0.8881) - (0.9969, 0.0552) = (-0.5885, 0.8329)$, at 125.2 degrees, where the objective is 1.020. Under that objective Rocchio's revised query scores $-0.127$: it is still closer, on average, to the nonrelevant documents. The conclusion is the same under all three readings. The optimum points away from rocket, and the practical form stops well short of it.

The rocket-nozzle example, live. Change the method, move the α, β, and γ sliders (they apply to Rocchio), or press a document's button to change its judgment, and watch the revised query turn. The readout gives the revised vector, its angle, and the cosine ranking of all six documents, with the unjudged ones starred. With the defaults it shows (1.18, 0.63) at 28.1 degrees.

Ide's variants

Rocchio divides each sum by the number of documents in it. Ide (1971) proposed adding the document vectors without that division. The two forms below follow the descriptions and names in Salton and Buckley's later review (1990, p. 292 and Table 3):

  • Ide regular: $\vec{q}_m = \vec{q}_0 + \sum_{\vec{d} \in D_r} \vec{d} - \sum_{\vec{d} \in D_{nr}} \vec{d}$.
  • Ide dec-hi: $\vec{q}_m = \vec{q}_0 + \sum_{\vec{d} \in D_r} \vec{d} - \vec{d}_{\mathrm{top}}$, where $\vec{d}_{\mathrm{top}}$ is the highest-ranked nonrelevant document. All relevant documents are used, but only one nonrelevant one, which gives "a definite point in the vector space from which the new feedback query is removed" (Salton and Buckley, 1990, p. 292).

In the plane, Ide regular gives $(1, 0) + (0.8, 1.7) - (1.6, 0.1) = (0.2, 1.6)$, at 82.9 degrees. Two relevant documents added at full strength overwhelm a query of length 1. Ide dec-hi subtracts only N2, the nonrelevant document the original query ranked first, giving $(1.1, 1.7)$ at 57.1 degrees. Both put U1 above U2. Without the division, the more documents are judged, the less the original query counts. So Ide's methods trust the judgments more than Rocchio's defaults do.

Salton and Buckley (1990) compared twelve feedback methods on six collections, one of them Cranfield. They evaluated each on the residual collection described below. Ide dec-hi was the best overall method (p. 293). On Cranfield it raised average precision at three recall levels from 0.116 for the initial search to 0.301 (their Table 4). They noted that the method is also cheap, since only one nonrelevant document must be processed.

Back to the BIM, which ranked query 185 without judgments. What it lacked was an estimate of how often each term occurs in relevant documents, and judgments supply one.

In the probabilistic model: the RSJ weight

The Binary Independence Model was designed for feedback. Its Robertson–Spärck Jones term weight, derived in that article, is

$$c_t = \ln \frac{(s + \tfrac12) \,/\, (S - s + \tfrac12)}{(\mathrm{df}_t - s + \tfrac12) \,/\, (N - \mathrm{df}_t - S + s + \tfrac12)},$$

where $S$ is the number of documents judged relevant and $s$ the number of those that contain the term.

Where the judgments enter. The BIM's weight for a query term is a log odds ratio, $c_t = \ln \frac{p_t\,(1 - u_t)}{u_t\,(1 - p_t)}$, where $p_t$ is the probability that a relevant document contains the term and $u_t$ the probability that a nonrelevant one does. Feedback re-estimates both from counts. Of the $S$ judged relevant documents, $s$ contain the term. Every other document, judged nonrelevant or not judged at all, is counted as nonrelevant: there are $N - S$ of them, and $\mathrm{df}_t - s$ contain the term. Adding one half to each count, as the primer derives from a Beta prior, gives

$$p_t = \frac{s + \tfrac12}{S + 1}, \qquad u_t = \frac{\mathrm{df}_t - s + \tfrac12}{N - S + 1}$$

(the first is the course text's smoothed estimate, Manning, Raghavan, and Schütze, 2008, §11.3.4). The complements are $1 - p_t = \frac{S - s + \frac12}{S + 1}$ and $1 - u_t = \frac{N - S - \mathrm{df}_t + s + \frac12}{N - S + 1}$. In each odds the denominators cancel:

$$\frac{p_t}{1 - p_t} = \frac{s + \tfrac12}{S - s + \tfrac12}, \qquad \frac{1 - u_t}{u_t} = \frac{N - \mathrm{df}_t - S + s + \tfrac12}{\mathrm{df}_t - s + \tfrac12}.$$

Their product is the ratio inside the logarithm above. So the Robertson–Spärck Jones weight is exactly the BIM's weight with $p_t$ and $u_t$ estimated from the judged documents, and nothing else in the model changes.

Without judgments, $S = s = 0$ and the weight reduces to $\ln \frac{N - \mathrm{df}_t + 0.5}{\mathrm{df}_t + 0.5}$, an IDF. With judgments, terms that occur in many relevant documents gain weight and terms that occur in none lose it. The BIM article works the weight with full knowledge of a query's relevant documents. In feedback the judgments are partial: only what the searcher saw. In BM25, the same weight replaces the IDF component.

Why query 185 cannot show it

On query 185 the judged top 10 holds six relevant abstracts, so $S = 6$. Panel and flutter occur in all six and gain weight; studi, in only two, loses some. But the three unseen relevant abstracts keep their places among the unseen documents, 1st, 6th and 8th, and their average precision stays at 0.569 (feedback_detail.py 185). With only four terms, and panel and flutter in all nine relevant abstracts, reweighting has little to change. A query with more varied terms shows the mechanism better.

A worked example: Cranfield query 180

Query 180 of the Cranfield collection asks "how does scale height vary with altitude in an atmosphere". It analyzes to seven terms, how, doe, scale, height, vari, altitud, and atmospher. The collection has $N = 1{,}400$ documents, and 7 are relevant to this query. The BIM without judgments ranks them. The searcher judges the top 10 and finds three relevant (documents 617, 616, and 622), so $S = 3$.

Example (two rare function words lose the most). Feedback takes 1.948 from the weight of how and from that of doe (the stem of does), the largest loss of any term. Before feedback these two had the highest weights of all, because they are rare words in a collection of technical abstracts. Neither occurs in any of the three judged relevant documents. For each query term, with natural logarithms, rounded to three decimals:

Term $\mathrm{df}_t$ $s$ (of 3) Weight before Weight after Change
height 34 3 3.679 5.716 +2.037
scale 51 3 3.266 5.272 +2.006
atmospher 77 3 2.838 4.823 +1.985
vari 144 2 2.163 2.687 +0.524
altitud 45 1 3.394 2.904 −0.490
how 31 0 3.772 1.824 −1.948
doe 46 0 3.372 1.424 −1.948

For height, the estimates are $p_t = 3.5/4 = 0.875$ and $u_t = 31.5/1{,}398 = 0.0225$, and the weight is $\ln \frac{3.5/0.5}{31.5/1{,}366.5} = \ln(7 \times 43.38) = \ln 303.7 = 5.716$.

An IDF has no way to tell a rare function word from a rare content word. The judgments tell them apart. A term in every judged relevant document gains about 2.0, and a term in none loses about 1.9, whatever its document frequency. The change is driven by the first half of the log odds ratio, $\ln \frac{s + 0.5}{S - s + 0.5}$. With $S = 3$ it goes from $\ln 1 = 0$ to $\ln 7 = 1.946$ or $\ln(1/7) = -1.946$. The second half, the odds for nonrelevant documents, barely moves, because three documents are a small part of 1,400: it accounts for $+0.091$ of the $+2.037$ gained by height and for $-0.002$ of the $-1.948$ lost by how. Altitud drops a little, since only one of the three relevant documents uses it.

The effect shows on the documents the searcher has not seen. Of the four remaining relevant documents, document 621 moves from rank 10 to the top of the residual ranking. It stands there in a three-way tie at the highest score with two nonrelevant documents, 799 and 1166. Ties are broken by document number throughout these experiments, which puts 621 first. Average precision over the unseen documents rises from 0.086 to 0.306. Part of that figure is the tie-break: it would be 0.139 with 621 placed last of the three, and it is 0.209 averaged over the three positions. The BIM's binary scores tie often, so the same convention is at work in the Cranfield tables below.

Choosing expansion terms

Reweighting cannot find a relevant document that shares no words with the query. For expansion, candidate terms from the relevant documents must be ranked. Robertson (1990) analyzed term selection. He proposed ranking candidates by $c_t (p_t - u_t)$, a term's weight times the difference between its probabilities in relevant and nonrelevant documents. The Okapi experiments used an approximation, the offer weight $s \times c_t$ (Robertson and Spärck Jones, 1994). It balances how strongly a term indicates relevance against how many relevant documents it would help find. Robertson and Spärck Jones advise adding the top 10 or 20 candidates.

The approximation is two substitutions. Estimate $p_t$ by the fraction $s/S$ of judged relevant documents that contain the term, and neglect $u_t$, which is small for any term that is not common in the collection. Then $c_t\,(p_t - u_t) \approx c_t\, s / S$. Within one query $S$ is the same for every candidate, so ranking by $c_t\, s/S$ is ranking by $s \times c_t$. What the offer weight leaves out is the term $-c_t\,u_t$, which matters only for frequent candidates.

For query 180, the ten best candidates from the three judged relevant documents are:

Term $s$ (of 3) $\mathrm{df}_t$ $c_t$ Offer weight $s \times c_t$
km 3 10 7.168 21.505
perige 3 10 7.168 21.505
orbit 3 17 6.504 19.512
satellit 3 32 5.783 17.349
upper 3 41 5.510 16.530
densiti 3 88 4.677 14.031
chang 3 122 4.316 12.948
200 2 7 6.045 12.090
air 3 184 3.848 11.545
determin 3 299 3.258 9.775

The judged documents are about measuring the density of the upper atmosphere from satellite orbits, and the candidates say so: perigee, orbit, satellite, density. None of these appear in the query. The offer weight favors terms found in all three documents: nine of the ten have $s = 3$. A term in only two needs a much higher weight to compete, as 200 does (presumably an altitude in kilometers, and in only 7 documents). The list also shows the method's weakness. Generic words such as chang and determin qualify simply by being in every judged document.

Example (the two selection rules on query 180). Ranking the same candidates by Robertson's $c_t\,(p_t - u_t)$, with $p_t = s/S$ and $u_t = (\mathrm{df}_t - s)/(N - S)$, gives nearly the same list. The first six terms are the same in the same order. Then 200 (value 4.008) moves ahead of chang (3.948), air stays ninth, and h (3.115) takes tenth place from determin (2.568). The differences are where the neglected term predicts: chang, air and determin occur in 122, 184 and 299 documents, so their $u_t$ is not negligible, and the full rule marks them down. For km, in only 10 documents, $c_t\,s/S = 7.168$ and $c_t\,(p_t - u_t) = 7.133$ hardly differ.

That rise from 0.086 to 0.306 was measured in a particular way, and the way matters.

Evaluating feedback fairly

Example (a gain that finds nothing new). Average precision over the whole collection usually goes up after feedback even when the feedback query finds no new relevant document at all. After feedback, the documents the searcher judged relevant rank at the top of the new results, so measures computed over the whole ranking improve even if the new query finds nothing new. The searcher has already seen those documents, so their reappearance is worth nothing. Measuring feedback naively overstates it.

The standard remedy is residual collection evaluation (Manning, Raghavan, and Schütze, 2008, §9.1.5). Remove the documents the searcher judged from the collection. Then evaluate both the original ranking and the feedback ranking on what remains. The question becomes whether feedback helps find relevant documents the searcher has not yet seen. Residual scores are lower than full-collection scores, because the easiest relevant documents have been removed. So only before-and-after comparisons on the same residual collection are meaningful. In query 180, the residual collection is the 1,390 documents outside the top 10, and the four relevant documents among them.

Experiments on Cranfield

The Cranfield collection has 1,400 documents and 225 queries with relevance judgments. Each query was run with three models, using the setup of comparing ranking models. The judgments for the top 10 documents were then treated as the searcher's feedback, and feedback queries were evaluated on the residual collection:

Method Residual MAP before Residual MAP after Queries improved Queries harmed
BIM, reweighted with the RSJ weight 0.095 0.140 111 32
BM25, with the RSJ weight replacing IDF 0.115 0.157 133 59
TF-IDF, with Rocchio ($\alpha = 1$, $\beta = 0.75$, $\gamma = 0.15$) 0.114 0.258 151 45

All three improvements are statistically significant by a paired randomization test (see significance testing).

Residual average precision of each Cranfield query before (horizontal) and after (vertical) one round of feedback on the top 10. Points above the dashed diagonal improved. Left: BM25 with RSJ reweighting, which changes only the weights of the query's own terms; most points move up a little. Right: Rocchio on TF-IDF, which also adds terms. Notice the many queries that started near zero and jump to 0.3 or more.
Residual average precision of each Cranfield query before (horizontal) and after (vertical) one round of feedback on the top 10. Points above the dashed diagonal improved. Left: BM25 with RSJ reweighting, which changes only the weights of the query's own terms; most points move up a little. Right: Rocchio on TF-IDF, which also adds terms. Notice the many queries that started near zero and jump to 0.3 or more.

A second set of runs varies the method within each family, starting from the same initial rankings:

Method Residual MAP before Residual MAP after Improved Harmed
Rocchio, $\beta = 0.75$, $\gamma = 0$ 0.114 0.258 144 22
Rocchio, $\beta = 0.5$, $\gamma = 0.5$ 0.114 0.236 152 44
Ide regular 0.114 0.158 84 112
Ide dec-hi 0.114 0.247 131 66
BM25, RSJ reweighting plus 10 offer-weight terms 0.115 0.204 128 67
BM25, RSJ reweighting plus 20 offer-weight terms 0.115 0.216 124 72

The expansion terms are added with their RSJ weights as BM25 term weights. MAP values are rounded to three decimals, and all the changes are significant at the 0.01 level. Several observations follow:

  • Feedback works. Even reweighting alone, without adding any terms, raises the BIM's residual effectiveness by nearly half, and BM25's by more than a third.
  • Expansion matters more than reweighting. Within BM25, adding the ten best offer-weight terms to the reweighted query raises residual MAP from 0.157 to 0.204 ($p = 0.001$), and twenty terms reach 0.216. Rocchio, which expands with every term of the relevant documents, more than doubles residual MAP. On technical abstracts, relevant documents use vocabulary the query may not, so new terms are the larger gain.
  • Negative feedback adds little. Rocchio with $\gamma = 0$ reaches the same residual MAP as with $\gamma = 0.15$. The difference is in the counts, taken up below.
  • How much to trust the judgments depends on how many are negative. Ide dec-hi, using one nonrelevant document, comes close to Rocchio, as Salton and Buckley found. Ide regular gains far less (0.158) and harms more queries than it helps, unlike in their experiments. Cranfield's top 10 contains on average 2.3 relevant documents and 7.7 nonrelevant ones (TF-IDF's precision at 10 is 0.228). Ide regular subtracts all of the nonrelevant ones at full strength, which cancels much of the relevant evidence. Their weighting of documents and queries also differed from the lnc.ltc weighting used here.
  • Feedback needs something to learn from. For 56 of the 225 queries, the BIM's top 10 contained no relevant document. The RSJ reweighting then has no positive examples. It falls back to the IDF weights and leaves the ranking unchanged.

The $\gamma$ runs measure what negative feedback adds. With $\gamma = 0$, a query whose top 10 contains no relevant document (34 of the 225 under TF-IDF) is left unchanged, and 59 queries in all are neither improved nor harmed. With $\gamma = 0.15$, those queries are pushed away from their nonrelevant documents. The counts become 151 improved and 45 harmed: 7 more improved, 23 more harmed. On Cranfield, moving away from what is known to be wrong, without knowing what is right, was more often harmful than helpful.

Why searchers rarely use it

Despite these results, explicit relevance feedback is rarely used in practice. A study of the Excite search engine's logs found that few searchers used its "more like this" feedback option, even though it was offered with every result (Spink, Jansen, and Ozmultu, 2000). Judging documents takes effort, and searchers prefer to reformulate the query themselves. Feedback queries are also long, which makes them slower to evaluate. And searchers may not understand why the new results differ, which reduces trust.

The idea survived in less demanding forms:

  • Implicit feedback infers judgments from behavior, such as clicks and dwell time, rather than asking for them (see online evaluation).
  • Interactive query expansion suggests expansion terms, or related queries, and lets the searcher choose (query expansion covers it, with expansion from thesauri built before any query is seen).
  • Pseudo-relevance feedback assumes the top results are relevant and applies feedback with no searcher involvement at all.
  • Professional search still uses explicit feedback heavily. Technology-assisted review in legal discovery is relevance feedback run until a recall target is met (see search in professional domains).

Worked problems

Problems 1 to 3 are exercises from chapter 9 of the course text (Manning, Raghavan, and Schütze, 2008), restated here with their data and solved in our own words. Problems 4 and 5 are posed on this article's two examples, the rocket-nozzle plane and Cranfield query 180. The scripts tools/experiments/feedback/rocchio2d.py and tools/experiments/cranfield/feedback_detail.py check every number.

Problem 1 (Exercise 9.5 of the course text). A searcher's query is cheap CDs cheap DVDs extremely cheap CDs. She judges document $d_1$, CDs cheap software cheap CDs, relevant, and document $d_2$, cheap thrills DVDs, nonrelevant. Weights are raw term frequencies, with no scaling, no document frequency and no length normalization. Find the revised query under Rocchio's formula with $\alpha = 1$, $\beta = 0.75$, $\gamma = 0.25$.

Solution. There is one judged document of each kind, so each centroid is that document's vector. Term by term, $\vec{q}_m = \vec{q}_0 + 0.75\,\vec{d}_1 - 0.25\,\vec{d}_2$:

Term $\vec{q}_0$ $\vec{d}_1$ $\vec{d}_2$ $\vec{q}_0 + 0.75\,\vec{d}_1 - 0.25\,\vec{d}_2$ Revised query
CDs 2 2 0 $2 + 1.5 - 0 = 3.5$ 3.5
cheap 3 2 1 $3 + 1.5 - 0.25 = 4.25$ 4.25
DVDs 1 0 1 $1 + 0 - 0.25 = 0.75$ 0.75
extremely 1 0 0 1 1
software 0 1 0 $0 + 0.75 - 0 = 0.75$ 0.75
thrills 0 0 1 $0 + 0 - 0.25 = -0.25$ 0

The negative weight of thrills is set to zero. The revised query has gained one term, software, and its weight on DVDs has fallen because the nonrelevant document contains that word.

Problem 2 (Exercise 9.6 of the course text). A search system applies relevance feedback to the words of result titles only, with term frequency weights and neither length normalization nor IDF. For the query banana slug, the top three titles are banana slug Ariolimax columbianus, Santa Cruz mountains banana slug and Santa Cruz Campus Mascot. The searcher judges the first two relevant and the third nonrelevant. Find the revised query under Rocchio's formula with $\alpha = \beta = \gamma = 1$, listing the terms in alphabetical order.

Solution. The relevant centroid is half the sum of the first two titles: banana 1, slug 1, and 0.5 each for Ariolimax, columbianus, Santa, Cruz and mountains. The nonrelevant centroid is the third title: Santa, Cruz, Campus and Mascot, 1 each. Then $\vec{q}_m = \vec{q}_0 + \vec{\mu}_r - \vec{\mu}_{nr}$:

Term $\vec{q}_0$ Relevant centroid Nonrelevant centroid Sum Revised query
Ariolimax 0 0.5 0 0.5 0.5
banana 1 1 0 2 2
Campus 0 0 1 −1 0
columbianus 0 0.5 0 0.5 0.5
Cruz 0 0.5 1 −0.5 0
Mascot 0 0 1 −1 0
mountains 0 0.5 0 0.5 0.5
Santa 0 0.5 1 −0.5 0
slug 1 1 0 2 2

The revised query is Ariolimax 0.5, banana 2, columbianus 0.5, mountains 0.5, slug 2, with the other four terms at zero. Santa and Cruz occur in a relevant title, yet they are removed: with $\gamma = \beta$ the single nonrelevant title outweighs the half share each word has in the relevant centroid.

Problem 3 (Exercise 9.3 of the course text). State when the revised query $\vec{q}_m$ of Rocchio's formula equals the original query $\vec{q}_0$, and decide whether in every other case $\vec{q}_m$ is closer than $\vec{q}_0$ to the centroid of the relevant documents.

Solution. Subtracting $\vec{q}_0$ from the formula gives $\vec{q}_m - \vec{q}_0 = (\alpha - 1)\,\vec{q}_0 + \beta\,\vec{\mu}_r - \gamma\,\vec{\mu}_{nr}$, where the centroids are those of the judged documents. So $\vec{q}_m = \vec{q}_0$ exactly when that vector is zero. With $\alpha = 1$ the condition is $\beta\,\vec{\mu}_r = \gamma\,\vec{\mu}_{nr}$. It holds when $\beta = \gamma = 0$, when no documents are judged (both sums are empty), and in the coincidence that the two weighted centroids are equal, for example $\beta = \gamma$ with relevant and nonrelevant documents that have the same centroid. If negative weights are clipped, $\vec{q}_m$ can also equal $\vec{q}_0$ when the change falls only on terms whose weight is zero in $\vec{q}_0$ and is negative there. For ranking by cosine, only the direction matters, and the direction is unchanged whenever $\vec{q}_m$ is a positive multiple of $\vec{q}_0$, which adds the case $\beta = \gamma = 0$ with any $\alpha > 0$.

The exercise does not say how closeness is measured. It is measured here by angle (equivalently, by cosine), since ranking ignores a query's length. The answer to the second part is no. The formula moves the query toward the relevant centroid and away from the nonrelevant one, and the second movement can carry it away from the relevant centroid too. In the plane of this article, take $\vec{q}_0 = (1, 0.5)$, the relevant documents R1 and R2 with centroid $(0.40, 0.85)$, one judged nonrelevant document at $(0.1, 0.7)$, and $\alpha = 1$, $\beta = 0.1$, $\gamma = 0.5$. Then

$$\vec{q}_m = (1, 0.5) + 0.1\,(0.40, 0.85) - 0.5\,(0.1, 0.7) = (0.99, 0.235).$$

The original query points at 26.6 degrees and the revised one at 13.4 degrees, while the relevant centroid lies at 64.8 degrees. The cosine with the relevant centroid falls from 0.785 to 0.623. The Euclidean distance to the centroid also grows, from 0.695 to 0.852. A nonrelevant document that lies in the direction of the relevant ones, weighted more heavily than they are, pushes the query the wrong way. With $\gamma = 0$ and $\beta > 0$ this cannot happen in angle: $\vec{q}_0 + \beta\,\vec{\mu}_r$ lies between $\vec{q}_0$ and $\vec{\mu}_r$ in angle whenever the two are not already parallel, since it is a combination of the two with positive coefficients. In Euclidean distance it can: if $\vec{q}_0 = \vec{\mu}_r$, any $\beta > 0$ moves the query away from the centroid.

The chapter's two shorter exercises on Rocchio are answered by the body of this article. Exercise 9.1 asks which weights a "find pages like this one" search corresponds to: the chosen page is the whole of the feedback and the typed query is dropped, so $\alpha = 0$, $\beta = 1$, $\gamma = 0$, with $D_r$ holding that one page. Exercise 9.4 asks why positive feedback is worth more than negative, and why one nonrelevant document can serve better than several. The plane gave the reason for the first: nonrelevant documents are wrong in many different ways, so their centroid is a poor description of what to avoid. Ide dec-hi is the second, a single definite point to move away from, and on Cranfield it gained far more than Ide regular, which subtracts every judged nonrelevant document.

Problem 4 (how strong positive feedback must be). In the rocket-nozzle plane, with $\alpha = 1$ and $\gamma = 0.15$, find the values of $\beta$ for which one round of Rocchio ranks U1 above U2.

Solution. The revised query is $\vec{q}(\beta) = (1, 0) + \beta\,(0.40, 0.85) - 0.15\,(0.80, 0.05) = (0.88 + 0.40\,\beta,\; 0.85\,\beta - 0.0075)$. Its cosines with U1 and U2 are equal when it is perpendicular to the difference of their unit vectors. Those are $(0.1, 0.7)/0.7071 = (0.1414, 0.9899)$ and $(0.8, 0.3)/0.8544 = (0.9363, 0.3511)$, and their difference is $\vec{w} = (-0.7949, 0.6388)$. U1 ranks higher when $\vec{q}(\beta) \cdot \vec{w} > 0$:

$$-0.7949\,(0.88 + 0.40\,\beta) + 0.6388\,(0.85\,\beta - 0.0075) = 0.2250\,\beta - 0.7043 > 0,$$

that is, $\beta > 3.130$. At $\beta = 3.0$ the cosines are 0.8558 for U1 and 0.8646 for U2; at $\beta = 3.2$ they are 0.8625 and 0.8579. The default $\beta = 0.75$ is far below the threshold, which is why one round left U2 ahead. Ide's methods, which add the relevant vectors whole, are the equivalent of a large $\beta$, and they do reorder the two.

Problem 5 (query 180 by hand). Using the counts in the table for query 180 ($N = 1{,}400$, $S = 3$): (a) compute the weight of vari after feedback; (b) the four unseen relevant documents stand at ranks 10, 19, 25 and 200 of the residual ranking before feedback and at ranks 1, 23, 29 and 119 after it; compute the residual average precision in each case; (c) explain from the weights why document 621 rises to rank 1.

Solution. (a) Vari has $\mathrm{df}_t = 144$ and $s = 2$. The relevant odds are $\frac{2.5}{1.5} = 1.667$. The nonrelevant odds are $\frac{144 - 2 + 0.5}{1{,}400 - 144 - 3 + 2 + 0.5} = \frac{142.5}{1{,}255.5} = 0.1135$. The weight is $\ln(1.667 / 0.1135) = \ln 14.684 = 2.687$, as in the table.

(b) Average precision averages the precision at the rank of each relevant document. Before feedback:

$$\frac{1}{4}\left(\frac{1}{10} + \frac{2}{19} + \frac{3}{25} + \frac{4}{200}\right) = \frac{0.1000 + 0.1053 + 0.1200 + 0.0200}{4} = 0.086.$$

After feedback:

$$\frac{1}{4}\left(\frac{1}{1} + \frac{2}{23} + \frac{3}{29} + \frac{4}{119}\right) = \frac{1.0000 + 0.0870 + 0.1034 + 0.0336}{4} = 0.306.$$

Nearly all of the gain is the first term: one relevant document at rank 1 contributes 0.25 on its own. Two of the other three documents moved down, from 19 to 23 and from 25 to 29.

(c) Document 621 contains two of the query's terms, height and scale. Before feedback its score is $3.679 + 3.266 = 6.945$. After feedback both weights have risen by about 2, and its score is $5.716 + 5.272 = 10.988$. Nine unseen documents stood above it before feedback. Seven of them matched through how or doe, each of which lost 1.948; the best of the seven now scores 9.382. The other two contain altitud, atmospher and vari, and rise from 8.395 to 10.414, still below 10.988. So 621 passes all nine. Two nonrelevant documents with the same two terms tie with it at 10.988, and the tie is broken by document number.

What we have learned

A few judged results tell a system what vocabulary relevant documents use. Rocchio and Ide turn the query vector toward them, and Rocchio's formula is the practical form of a provable optimum, the difference of the relevant and nonrelevant centroids. The RSJ weight re-estimates each term's two probabilities from the judged counts, which on query 180 demoted how and doe and lifted document 621 from rank 10 into a tie for first place, and offer weights add terms the searcher never typed. Measured on the residual collection, one round of feedback raised Cranfield's residual MAP in every method tried, and expansion gained more than reweighting.

The catch is the searcher, who rarely wants to judge anything. Pseudo-relevance feedback removes the searcher by assuming that the system's own top results are relevant. That article shows which queries gain, which lose, and how a query drifts.

References

  • Ide, E. (1971). New experiments in relevance feedback. In G. Salton (Ed.), The SMART Retrieval System: Experiments in Automatic Document Processing, 337–354. Prentice-Hall. record
  • Manning, C. D., Raghavan, P., and Schütze, H. (2008). Introduction to Information Retrieval, chapters 9 and 11. Cambridge University Press. record · 102 pages
  • Robertson, S. E. (1990). On term selection for query expansion. Journal of Documentation, 46(4), 359–364. record
  • Robertson, S. E., and Spärck Jones, K. (1976). Relevance weighting of search terms. Journal of the American Society for Information Science, 27(3), 129–146. record · 4 pages
  • Robertson, S. E., and Spärck Jones, K. (1994). Simple, proven approaches to text retrieval. Technical Report UCAM-CL-TR-356, University of Cambridge Computer Laboratory. record
  • Rocchio, J. J. (1971). Relevance feedback in information retrieval. In G. Salton (Ed.), The SMART Retrieval System: Experiments in Automatic Document Processing, 313–323. Prentice-Hall. record · 3 pages
  • Salton, G., and Buckley, C. (1990). Improving retrieval performance by relevance feedback. Journal of the American Society for Information Science, 41(4), 288–297. record
  • Spink, A., Jansen, B. J., and Ozmultu, H. C. (2000). Use of query reformulation and relevance feedback by Excite users. Internet Research, 10(4), 317–328. record

Reviewed: verified, 16 Nov 2026 · citations checked, 16 Nov 2026 · editorial review, 23 Nov 2026 · 10 revisions