Notes

Backoff

Ask an n-gram model how likely the phrase “quantum sommelier recommends” is and it will answer zero — not because the phrase is impossible, but because nobody wrote it in the training text. Backoff is the fix: when a long context was never observed, fall back on a shorter one that was.

How it works
A trigram model estimates the probability of a word from the two words before it, using counts. If that trigram count is zero, a backoff model drops to the bigram estimate; if that is also unseen, it drops to the unigram. The shorter estimate is multiplied by a backoff weight chosen so the distribution still sums to one — the probability mass handed to unseen continuations has to come from somewhere, so observed counts are discounted first. Katz backoff is the classic formulation, pairing Good-Turing discounting with this recursive fallback.

Backoff versus interpolation
Both attack the same problem differently. Interpolation always blends every order together; backoff consults a lower order only when the higher one has no evidence at all. Kneser-Ney smoothing, the strongest count-based method, exists in both forms, and the lower-order estimate it falls back to is deliberately not a plain unigram frequency — it counts how many distinct contexts a word appears in, which is why “Francisco” gets a low backoff probability despite being common.

Why it matters
Without it one unseen n-gram drives the probability of an entire sentence to zero and leaves perplexity undefined. Backoff is what made n-gram models usable in speech recognition and statistical machine translation, and it still ships in toolkits such as SRILM and KenLM.

Backoff is a smoothing strategy for n-gram language models: when a context has no observed count, the estimate falls back to a shorter context — trigram to bigram to unigram — scaled by a weight that keeps the distribution normalised. Higher-order counts are discounted to free the probability mass this requires. Without it, any unseen n-gram drives a sentence's probability to zero and leaves perplexity undefined.

Someone asks you to finish a sentence you have never heard before. You cannot recall the whole phrase, so you use less of it — just the last couple of words — and guess from there.

Backoff is software doing the same thing. Older language tools predicted the next word by counting word sequences across huge amounts of text, and no amount of text contains every sequence people might say. Rather than declaring an unfamiliar phrase impossible, the system steps back to a shorter, better-attested clue and makes a sensible guess. It is what keeps such a model from freezing the moment it meets something new.