Algorithm Search⌘K

Modeladvanced

Divergence from randomness

Also called DFR framework.

Weights a term by how far its frequency in a document diverges from a random model, normalized for information gain and document length.

Divergence from randomness is a framework of term weights in which a term gets a high weight in a document when its frequency there would be very improbable if the occurrences of the term were spread over the documents at random. Amati and van Rijsbergen (2002) build each weight from three choices: a basic model of randomness, such as the Poisson distribution, whose improbability is measured in bits; a first normalization, the after effect, which discounts the gain once the term is known to occur; and a second normalization of the term frequency for document length. The choices give names such as PL2 and InL2, and InL2 is close to BM25 with k1≈1k_1 \approx 1 and b≈0.72b \approx 0.72. The framework keeps the eliteness idea of the two-Poisson model with no parameter to fit for the basic models.

The machine

Statistics. For a term tt and a document dd: NN documents, F=cf(t)F = \mathrm{cf}(t) occurrences of tt in the collection, n=df(t)n = \mathrm{df}(t) documents that contain it, l=∣d∣l = |d| and the average length avg_l\mathrm{avg\_l}. All logs on this page are log⁡2\log_2, so the weights are in bits.

The weight. Equations 1 and 3 of Amati and van Rijsbergen define

w(t,d)=Inf1⋅Inf2=(−log⁡2Prob1(tfn))⋅(1−Prob2(tfn)),w(t, d) = \mathrm{Inf}_1 \cdot \mathrm{Inf}_2 = \left(-\log_2 \mathrm{Prob}_1(\mathrm{tfn})\right) \cdot \left(1 - \mathrm{Prob}_2(\mathrm{tfn})\right),

and the score is R(q,d)=∑t∈qqtf(t,q)⋅w(t,d)R(q, d) = \sum_{t \in q} \mathrm{qtf}(t, q) \cdot w(t, d) (equation 43). Three choices fill it in.

1. Second normalization: length. The raw tf\mathrm{tf} is first mapped to a normalized frequency tfn\mathrm{tfn}:

  • H1 (equation 41): tfn=tf⋅avg_l/l\mathrm{tfn} = \mathrm{tf} \cdot \mathrm{avg\_l}/l, a uniform density of the term over the document;
  • H2 (equation 42): tfn=tf⋅log⁡2(1+avg_l/l)\mathrm{tfn} = \mathrm{tf} \cdot \log_2(1 + \mathrm{avg\_l}/l), a density that falls more slowly with length.

The paper introduces a free parameter later (equation 46), tfn=tf⋅log⁡2(1+c⋅avg_l/l)\mathrm{tfn} = \mathrm{tf} \cdot \log_2(1 + c \cdot \mathrm{avg\_l}/l), and uses c=7c = 7 for TREC-10. The base form H2 is the case c=1c = 1.

2. Basic model: Inf1=−log⁡2Prob1\mathrm{Inf}_1 = -\log_2 \mathrm{Prob}_1. Prob1(tfn)\mathrm{Prob}_1(\mathrm{tfn}) is the probability that a document gets tfn\mathrm{tfn} occurrences of tt when the FF occurrences fall into the NN documents at random. With λ=F/N\lambda = F/N:

  • P, Poisson (equation 6), with Stirling's formula for the factorial: Inf1=tfnlog⁡2tfnλ+(λ+112 tfn−tfn)log⁡2e+12log⁡2(2π tfn)\mathrm{Inf}_1 = \mathrm{tfn} \log_2 \frac{\mathrm{tfn}}{\lambda} + \left(\lambda + \frac{1}{12\,\mathrm{tfn}} - \mathrm{tfn}\right) \log_2 e + \frac{1}{2} \log_2(2\pi\,\mathrm{tfn});
  • G, the geometric limit of the Bose-Einstein model (equation 17): Inf1=−log⁡211+λ−tfnlog⁡2λ1+λ\mathrm{Inf}_1 = -\log_2 \frac{1}{1 + \lambda} - \mathrm{tfn} \log_2 \frac{\lambda}{1 + \lambda};
  • I(n), the tf-idf model (equation 19): Inf1=tfnlog⁡2N+1n+0.5\mathrm{Inf}_1 = \mathrm{tfn} \log_2 \frac{N + 1}{n + 0.5};
  • I(ne) (equation 20): the same with nn replaced by the expected number of documents that contain tt, ne=N(1−((N−1)/N)F)n_e = N(1 - ((N - 1)/N)^F), and I(F) (equation 21) with FF in place of nn;
  • D, the divergence approximation of the binomial (equation 8), and BE, the Bose-Einstein model (equation 18).

3. First normalization: the after effect, Inf2=1−Prob2\mathrm{Inf}_2 = 1 - \mathrm{Prob}_2. Once a term occurs in a document, more occurrences are less surprising. Prob2\mathrm{Prob}_2 is the probability of one more occurrence, given tfn\mathrm{tfn} of them, in the elite set of the term:

  • L, Laplace's law of succession (equation 24): Inf2=1/(tfn+1)\mathrm{Inf}_2 = 1/(\mathrm{tfn} + 1);
  • B, a ratio of two binomials (equation 27): Inf2=(F+1)/(n (tfn+1))\mathrm{Inf}_2 = (F + 1)/(n\,(\mathrm{tfn} + 1)).

Names. A model is named by its three letters: basic model, after effect, length normalization. PL2 is Poisson with Laplace and H2, InL2 is I(n) with Laplace and H2, and BB2 is Bose-Einstein with B and H2 (Table I of the paper).

A check on the paper's example. For the term "progress" Amati and van Rijsbergen take F=22789F = 22789, N=567529N = 567529 and tf=11\mathrm{tf} = 11, so λ=0.040155\lambda = 0.040155. Model P gives 11log⁡2(11/0.040155)=89.074911 \log_2(11/0.040155) = 89.0749, then (0.040155+1/132−11)log⁡2e=−15.8008(0.040155 + 1/132 - 11) \log_2 e = -15.8008, then 12log⁡2(22π)=3.0555\frac{1}{2}\log_2(22\pi) = 3.0555, which sum to 76.3296. The paper prints 76.3295.

Example on the toy collection. In the toy collection of the information retrieval pages, N=8N = 8, avg_l=9.875\mathrm{avg\_l} = 9.875, ∣d1∣=9|d_1| = 9 and every other document has 10 tokens. With H2 and c=1c = 1, tfn=log⁡2(1+9.875/9)=1.0685\mathrm{tfn} = \log_2(1 + 9.875/9) = 1.0685 for one occurrence in d1d_1, 0.99100.9910 for one occurrence in a document of 10 tokens and 1.98191.9819 for two. For q1 = "sorted array search" the values of λ=F/N\lambda = F/N are 5/8=0.6255/8 = 0.625, 3/8=0.3753/8 = 0.375 and 2/8=0.252/8 = 0.25. In d1d_1, for "search":

Inf1=1.0685log⁡21.06850.25+(0.25+112.822−1.0685)log⁡2e+12log⁡2(2π⋅1.0685)=2.2391−1.0683+1.3735=2.5443,\mathrm{Inf}_1 = 1.0685 \log_2 \frac{1.0685}{0.25} + \left(0.25 + \frac{1}{12.822} - 1.0685\right) \log_2 e + \frac{1}{2} \log_2(2\pi \cdot 1.0685) = 2.2391 - 1.0683 + 1.3735 = 2.5443,

and Inf2=1/2.0685=0.4834\mathrm{Inf}_2 = 1/2.0685 = 0.4834, so the PL2 weight is 1.2300. The same steps give 0.8087 for "sorted" and 1.0150 for "array" in d1d_1.

rank document PL2 InL2
1 d1d_1 3.0538 2.1750
2 d2d_2 2.0555 1.3428
3 d8d_8 1.7643 1.1759
4 d7d_7 1.1755 0.9198
5 d4d_4 0.7893 0.4977

For InL2 the I(n) factors log⁡2(9/(n+0.5))\log_2(9/(n + 0.5)) are 1.0 for "sorted", 1.3626 for "array" and 1.8480 for "search", so in d1d_1 the weight is (1.0+1.3626+1.8480)⋅1.0685⋅0.4834=2.1750(1.0 + 1.3626 + 1.8480) \cdot 1.0685 \cdot 0.4834 = 2.1750. On q2 = "posting list merge" InL2 ties d3d_3 and d5d_5 at 1.5980, like BM25, because it uses nn, and "list" and "merge" both have n=2n = 2. PL2 separates them, d5d_5 2.1505 above d3d_3 1.9499, because it uses FF: "list" occurs 3 times in the collection (d4d_4 holds it twice) and "merge" only 2 times, so one occurrence of "merge" is less likely by chance.

What it counts

  • Information in bits. Inf1\mathrm{Inf}_1 is the information content, in the sense of Shannon, of seeing tfn\mathrm{tfn} occurrences under the random model. Inf2\mathrm{Inf}_2 is the fraction of that information that counts as gain.
  • Parameters. None for the basic models and the after effects, which use only NN, FF and nn. The length normalization H2 has cc in its later form, tuned for each collection.
  • Statistics and cost. Each posting needs tf\mathrm{tf}, each document its length, and each term nn and FF. Scoring reads the posting lists of the query terms, O(∑t∈qdf(t))O(\sum_{t \in q} \mathrm{df}(t)) postings, as for BM25.

Relation to other models

  • Two-Poisson model. The two-Poisson model fits two Poisson parts for each term, elite and non-elite. Divergence from randomness keeps one random part, fitted to the whole collection, and measures how far a document is from it. The after effect plays the role of the elite set: it is computed as if the document were already elite for the term.
  • BM25. For InL2 the length and tf part is tfn/(tfn+1)\mathrm{tfn}/(\mathrm{tfn} + 1) with tfn=tflog⁡2(1+avg_l/l)\mathrm{tfn} = \mathrm{tf} \log_2(1 + \mathrm{avg\_l}/l). Amati and van Rijsbergen expand it (Section 6, equation 45) as about tf/(tf+0.2786+0.7213 l/avg_l)\mathrm{tf}/(\mathrm{tf} + 0.2786 + 0.7213\, l/\mathrm{avg\_l}). That is the tf part of BM25 with k1(1−b)=0.2786k_1 (1 - b) = 0.2786 and k1b=0.7213k_1 b = 0.7213, so k1≈1k_1 \approx 1 and b≈0.72b \approx 0.72. At l/avg_l=0.8l/\mathrm{avg\_l} = 0.8 and tf=1\mathrm{tf} = 1 the exact value is 0.5392 and the approximation 0.5389. The paper also notes that the tf formula of the INQUERY system matches k1=2k_1 = 2 (equation 34).
  • Tf-idf. The I(n) basic model is tfn\mathrm{tfn} times an idf in bits, so InL2 is a tf-idf weight with a saturating tf part.
  • Pivoted normalization. H2 is another length correction. It divides by a logarithm of the relative length, not by the straight line of pivoted normalization.
  • Divergence measures. Model D approximates the binomial probability through the Kullback-Leibler divergence of the term's share of the document from its share of the collection.

Known results in the model

  • InL2 approximates BM25. The expansion above (Amati and van Rijsbergen 2002, equation 45) shows that a weight derived from three independent choices with no tuned constant lands close to BM25 with k1=1k_1 = 1 and b=0.72b = 0.72.
  • The after effect is needed. Without it, the basic models grow at least linearly in tfn\mathrm{tfn}. With L, the PL2 weight grows only like log⁡2(tfn/λ)\log_2(\mathrm{tfn}/\lambda): for λ=0.625\lambda = 0.625 and no length normalization it is 0.7915 at tf=1\mathrm{tf} = 1, 2.6794 at tf=10\mathrm{tf} = 10 and 5.8760 at tf=100\mathrm{tf} = 100. With I(n) and L the weight is bounded by the idf, as in BM25.
  • A family of models. The paper evaluates many combinations of basic model, after effect and normalization on TREC collections, and its Table I names them. The Terrier search engine implements the framework, and PL2, InL2 and I(ne)B2 are among its standard models.
  • Length parameter. The base form of H2 has no free parameter. The constant cc of equation 46 was added afterwards and is tuned for each collection.

References

  1. Gianni Amati and Cornelis Joost van Rijsbergen, Probabilistic models of information retrieval based on measuring the divergence from randomness, ACM Transactions on Information Systems 20(4), 357 to 389, 2002, the weight (1 - Prob2) times (-log2 Prob1) in equations 1 and 3; the basic models P, D, G, BE, I(n), I(ne) and I(F) in equations 6 to 21; the first normalizations L and B in equations 24 and 27; the second normalizations H1 and H2 in equations 41 and 42 and the parameter c in equation 46; the score of equation 43; the names of Table I; and the comparison with BM25 in Section 6, equation 45
  2. Stefan Buettcher, Charles L. A. Clarke and Gordon V. Cormack, Information Retrieval, Implementing and Evaluating Search Engines, MIT Press, 2010, Chapter 9 (language modeling and related methods, with divergence from randomness)

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/84Z020/text.yaml