N-gram Language Models
Jurafsky & Martin, Speech and Language Processing, 3rd ed. draft, ch. 3
4 cards in “Introduction” · whole deck
Introduction
- What does a language model do, formally?It assigns a probability to each possible next word (a probability distribution over next words), and can also assign a probability to an entire sentence or word sequence.
- Jurafsky & Martin, Speech and Language Processing, 3rd ed. draft, ch. 3, Introduction, p. 68
- Why is predicting upcoming words so important?Large language models are built just by training them to predict words. Word probabilities also help directly: correcting grammar or spelling (There are beats Their are), speech recognition (back soonish beats bassoon dish), and word suggestions in augmentative and alternative communication (AAC).
- Jurafsky & Martin, Speech and Language Processing, 3rd ed. draft, ch. 3, Introduction, p. 68
- What is an n-gram, and what is an n-gram model?An n-gram is a sequence of n words (bigram: “water of”; trigram: “water of Walden”). An n-gram model is a probabilistic model that estimates the probability of a word given the previous n−1 words, and thereby of whole sequences.
- Jurafsky & Martin, Speech and Language Processing, 3rd ed. draft, ch. 3, Introduction, p. 69
- Which language-modeling concepts does the chapter introduce through n-grams?Training and test sets, perplexity, sampling, and smoothing/interpolation: all of which carry over to neural LLMs.
- Jurafsky & Martin, Speech and Language Processing, 3rd ed. draft, ch. 3, Introduction, p. 69
Source
- Daniel Jurafsky and James H. Martin. Speech and Language Processing. 3rd edition (draft). https://web.stanford.edu/~jurafsky/slp3/