Techniquecore
Absolute discounting
Also called absolute discount smoothing, interpolated absolute discounting.
Subtract a fixed discount D from every nonzero n-gram count and give the freed mass to the lower-order model, with D often set to N_1 / (N_1 + 2 N_2).
Absolute discounting is a way to fill the zeros of an n-gram language model by taking the same small amount , usually less than 1, from the count of every n-gram that was seen and giving the total to the estimate of a shorter history. It rests on a fact found in large text collections: an n-gram seen times in one half of a corpus is seen about times, on average, in a second half of the same size, nearly the same amount less for every . Unlike Laplace smoothing, it takes away a fixed amount, not a share; unlike Katz backoff, its discount does not depend on ; and unlike Kneser-Ney smoothing, which is built on it, it uses the plain lower-order estimate.
In plain words
A count from a sample is a little too high for the things you saw, because you saw them partly by luck. The surprise is that the excess is about the same for things seen twice and things seen twenty times. So take the same small amount off every count you have. For a word seen after some context, its count drops by, say, three quarters.
The amounts you took away add up. Give that total to a simpler model that looks at less context, and let it share the total among all words, also the words never seen in this context. A context followed by many different words gives away more, because more counts were cut.
When it applies
It applies to any table of counts of the form "how often followed " where most counts are small and a simpler model of exists: word and character n-gram models, models of DNA or protein sequences, and the escape estimates of text compressors. It needs a closed vocabulary that holds every predicted token, with </s> and <unk>. The discount is one number per order, set from the counts of counts or tuned on held-out text.
The template
For a history with , write for the number of distinct words seen after and for without its first token. With a discount , the interpolated form is
and when . The recursion ends at the unigrams, which are interpolated with the uniform distribution in the same way. Each seen n-gram gives up exactly , so the first terms sum to , and the lower order gets exactly the rest. Since and , the weight lies in .
Ney, Essen and Kneser (1994) estimated the discount of each order from the numbers and of n-grams seen once and twice:
It comes from leaving one n-gram out at a time and maximizing the likelihood of the left-out n-grams; the formula is an approximation to that optimum that is easy to compute.
The backoff form uses the first term alone for seen words, and gives the freed mass only to the unseen words, in proportion to the lower order and normalized as in Katz backoff.
Classic examples
A bigram model. Train on "a b", "a c" and "b c", padded with <s> and </s>. There are 9 predicted tokens and 7 bigram types: <s> a and c </s> twice each, and <s> b, a b, a c, b c and b </s> once each. So , and . For a simple example, let the lower order be the unigram estimate : a, b and c get and </s> gets . After <s>, with and , the freed mass is . The rows give :
| history | = </s> |
= a | = b | = c |
|---|---|---|---|---|
<s> |
10/81 | 137/243 | 56/243 | 20/243 |
| a | 5/27 | 10/81 | 28/81 | 28/81 |
| b | 11/27 | 10/81 | 10/81 | 28/81 |
| c | 22/27 | 5/81 | 5/81 | 5/81 |
For example, . The history c was followed only by </s>, so it frees only of its mass. Each row sums to 1.
Kneser-Ney smoothing. Kneser-Ney smoothing is interpolated absolute discounting with one change: the lower order counts the number of distinct contexts of a word, not its frequency. On the same corpus with , it gives .
Good-Turing as a near-constant discount. For English bigrams, Church and Gale (1991) found that the Good-Turing adjusted counts satisfy for . Absolute discounting uses this constant directly, which avoids the noise of the at large .
Variations
- Several discounts. Modified Kneser-Ney smoothing uses three discounts, , and , for the counts 1, 2 and 3 or more, set from to . The freed mass is then .
- Tuned discounts. Choose for each order to minimize the perplexity of held-out text, by a line search.
- Backoff instead of interpolation. Use the discounted count alone for seen words and normalize the lower order over the unseen words. The two forms give different numbers, so say which one a result uses.
- Discounts per history count. Let depend on a bucket of , in the spirit of deleted interpolation.
Pitfalls
- above 1. A count of 1 cannot give up more than 1. With the clipped term frees less than per n-gram, and the rows no longer sum to 1. Keep , or free per n-gram and use that total.
- No n-gram seen twice. If , the formula gives , so the n-grams seen once get nothing from their own count. Check the counts of counts on small data.
- Unseen histories. If , the template has . Use the lower order directly.
- The lower order. The plain lower order gives a word like "Francisco", common but only after "San", a high probability after every history. Kneser-Ney smoothing fixes this with continuation counts.
- One per order. The n-grams of each order have their own and , so each order gets its own discount.
Exercises
- Show that the row of a history with sums to 1 when and the lower order is a distribution on .
- In the example above, compute step by step and check the value .
- A model has bigram types seen once and seen twice. Compute . How much mass does a history seen 100 times with 40 different followers give to the lower order?
- Show that always lies in when , and find when it equals 1.
- Write the backoff form for a bigram model and give the backoff weight that makes each row sum to 1.
References
- Ney, Essen and Kneser 1994, absolute discounting with interpolation and with backoff, and the estimate of the discount from the counts of counts by leaving one out
- Stanley F. Chen and Joshua Goodman, An empirical study of smoothing techniques for language modeling, Computer Speech and Language 13(4), 1999, pages 359 to 394, interpolated absolute discounting, the discount D = N_1/(N_1 + 2 N_2), and its relation to Kneser-Ney smoothing
- Church and Gale 1991, the measurement that held-out counts of English bigrams are close to the training counts minus a constant
- Daniel Jurafsky and James H. Martin, Speech and Language Processing, third edition draft, chapter N-gram Language Models (draft of January 2026), absolute discounting and Kneser-Ney smoothing
Where this leads
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.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag 5979BC Edit this page History Report an error Markdown