A training corpus has three sentences: " i like tea ", " i like coffee " and " you like tea ". The vocabulary of predicted words is i, you, like, tea, coffee, , so . Using add-one smoothing, what is the bigram probability of the sentence " you like coffee ", and what does the unsmoothed MLE give?
Sequence models and transformers, Language modelling
Level L2 Elementary. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can count bigrams and apply the add-one formula with the right denominator.
Key idea
Add-one smoothing: . The sentence probability is the product of four such terms.
Steps
- Count the contexts: , , , .
- Count the bigrams needed: , , , .
- MLE: .
- Add-one: , , , .
- Multiply: .
- Smoothing lowers the probability of this seen sentence from to , because mass is moved to the many unseen bigrams.
Common mistakes
- Using in the denominator instead of .
- Forgetting that (the number of sentences), not .
- Adding to even though it is never predicted.
How long your answer should be
Half a page; 3–4 minutes.
Last checked on 4 December 2026.
Read this
Previous in Sequence models and transformers: What are the two gates of a GRU and what does each control? How is a GRU different from an LSTM?
Next in Sequence models and transformers: Reference: "the cat is on the mat" (6 words). Candidate 1: "the the the the the the the". Candidate 2: "the cat mat". (a) What is the clipped unigram precision of Candidate 1? (b) For Candidate 2, what are the unigram precision and the brevity penalty, so what is its unigram-only BLEU?