Language Modelling
Your phone offers three words before you have typed a letter of the next one. Behind that sits the oldest and most load-bearing idea in natural language processing: a model that assigns a probability to a sequence of words.
What the model is
Language modelling means estimating how likely a given string of words is as a piece of the language — which the chain rule turns into a product of next-word predictions, each word conditioned on what came before. Much of the field's history is different answers to how much of that history to keep and how to represent it:
- Count-based n-gram models keep the previous one or two words and read probabilities off corpus counts, with smoothing covering the sequences never observed.
- Neural models learn a continuous representation of the context, which lets them generalise to word combinations absent from training.
- Masked models such as BERT reshape the objective: predict a hidden word from both sides rather than only from the left.
How it is judged
Perplexity is the standard intrinsic measure — the exponentiated average negative log-probability the model assigns to held-out text, read loosely as how many words it is effectively choosing between at each step. Lower is better, and it is comparable only between models sharing a vocabulary and tokenizer, which is why reported numbers on WikiText or the Penn Treebank always name both.
Why it matters
A probability over sequences is a general-purpose instrument: it ranks a speech recogniser's candidate transcriptions, scores a translation's fluency, repairs OCR noise, and supplies the pretraining objective behind nearly every modern encoder. It also needs no labels — the text is its own supervision, which is why this objective scaled before anything else in NLP did.
Language modelling is the task of assigning a probability to a sequence of words, usually factored into predicting each word from the words before it. Estimates come from corpus counts with smoothing in n-gram models, or from a trained network in neural ones, and are compared by perplexity on held-out text. It requires no labelled data, which makes it the pretraining objective behind modern NLP models and the fluency component in speech recognition and translation.
When your phone suggests the next word before you type it, something has worked out which words usually follow the ones you just wrote. Language modelling is exactly that skill: software learning, from enormous amounts of ordinary text, what people are likely to say next.
It is useful well beyond keyboards. It helps a voice assistant decide whether you said "ice cream" or "I scream", and it helps a translation come out sounding natural rather than merely correct. Best of all, nobody has to label anything for it to learn — the text teaches it, one word at a time.