Good–Turing Estimator

The Good–Turing estimator answers a question that plain frequency counting cannot: after observing a sample, how much probability should be reserved for things that did not appear in it? Its central result is that the total probability of unseen outcomes is estimated by the fraction of the sample made up of outcomes that appeared exactly once.

The problem it solves

Estimate the probability of each word from counts, \(\hat p(w)=c(w)/N\), where \(c(w)\) is the number of times \(w\) occurred and \(N\) is the sample size. Every word that was not observed gets probability zero, and the observed words' probabilities sum to 1. But a new sample will contain words not in the first one, so zero is wrong and the seen words are collectively over-weighted. The same issue arises for unseen facts in a training corpus, unseen species in a survey, and unseen n-grams in a language model. The estimator originates with I. J. Good, who credited A. M. Turing, and was developed further in the statistical language-modeling literature (Gale and Sampson give an accessible simplified version).

The estimate

Let \(N_r\) be the number of distinct outcomes that occurred exactly \(r\) times. Then \(N_1\) is the number of singletons, and \(N=\sum_r rN_r\). The estimate of the total probability of all unseen outcomes is

\[ P_{\text{unseen}} \approx \frac{N_1}{N}. \]

In words: if a fifth of your observations were the first and only sighting of something, expect roughly a fifth of the next observations to be sightings of things not yet seen. The intuition is a leave-one-out argument. Remove each observation in turn. An observation that was the only occurrence of its outcome would, once removed, leave an outcome unseen in the remaining data. The share of such observations is \(N_1/N\), and it estimates how often a fresh draw lands on an outcome absent from the rest.

The estimator also shrinks the counts of seen outcomes to make room. An outcome seen \(r\) times gets an adjusted count

\[ r^{*}=(r+1)\frac{N_{r+1}}{N_r}, \qquad \hat p = \frac{r^{*}}{N}. \]

The adjusted count is smaller than \(r\) when \(N_{r+1}/N_r < r/(r+1)\). A ratio below 1 alone is not enough, because the formula also multiplies by \(r+1\). This adjustment makes room for unseen outcomes, but sparse count tables can produce unstable or even increasing adjusted counts.

A worked example

Take a hypothetical sample of 16 word tokens: a b a c a b d e a b f c g h a b. The counts are a:5, b:4, c:2, and d, e, f, g, h each once, so \(N=16\), \(N_1=5\), \(N_2=1\), \(N_4=1\), \(N_5=1\), and \(N_3=0\).

  • Unseen mass: \(N_1/N = 5/16 = 0.3125\). The five seen words that appeared once collectively say that roughly 31% of fresh draws are expected to be new words.
  • Adjusted count for singletons: \(r^{*}=2\cdot N_2/N_1=2\cdot1/5=0.4\), so each singleton gets \(0.4/16=0.025\) instead of the raw \(1/16=0.0625\).
  • For \(r=2\) the formula needs \(N_3\), which is 0 in this tiny sample, so the estimate would assign probability 0 to the word c that occurs twice. The raw formula breaks down when the count-of-counts table is sparse.

That last point is a limitation, not a footnote. Practical versions (Simple Good–Turing) smooth the \(N_r\) values with a fitted curve before applying the formula, and apply the adjustment only to small \(r\), keeping raw frequencies for large \(r\).

When it holds and when it fails

  • It assumes the sample is drawn independently from a fixed distribution. A corpus that shifts in topic over time does not satisfy this, and new words appearing in a later period are not explained by the early singletons.
  • It estimates the total unseen mass, not which unseen outcomes are likely. Dividing that mass among unseen outcomes needs a separate assumption, such as a uniform split or a lower-order model.
  • It is least reliable for tiny samples, as shown above, and for very heavy tails, where the \(N_r\) values are noisy.

Why it matters for language models

For a heavy-tailed distribution of facts or words, many items are mentioned once and many never. If new queries draw facts from the same fixed distribution as the training mentions, the singleton fraction estimates how often a query concerns an unseen fact. More data reduces expected unseen mass, but a heavy tail leaves many rare facts sparsely observed. Unseen mass measures missing coverage, not answer accuracy: an unseen fact may be inferred from a rule, while a seen fact may be recalled incorrectly.

References


Discover more from Insightful Data Lab

Subscribe to get the latest posts sent to your email.

Similar Posts

Questions, corrections, or additional insights?

This site uses Akismet to reduce spam. Learn how your comment data is processed.