N-gram model
Also: n-gram models
It predicts the next word from patterns in the previous few words.
The fuller definition
A language model that estimates the next word from counts of short word sequences. Smoothing and backoff can assign probabilities to unseen sequences.
- Count
Observe short sequences
- Estimate
Calculate probabilities
- Back off
Handle sparse or unseen sequences
A simplified relationship, not a screenshot or a complete design.
A concrete example
A three-word model predicts a word using the preceding two words.
The distinction that matters
It uses a limited word history rather than a learned neural representation of a long context.
Related terms
Large language model (LLM)
A program trained on enormous amounts of text so it can read and write language. ChatGPT and Claude are built on large language models.
FoundationsToken
A piece of text, often part of a word, that the model actually works with. Models read and write tokens, not whole words.
Training & generationTraining
Adjusting a model with examples and a learning rule. The aim is to improve how it handles tasks.
Where it is taught
What actually happens when you ask AI a question?Source and further reading
Jurafsky & Martin · Speech and Language Processing, ch. 3: N-gram Language ModelsThe definition and example are written for this library. The link gives background, official documentation or legal authority as labelled. Legal scope depends on the jurisdiction and current text; product features depend on release and settings.