Statistical language model
A statistical language model is a probability distribution over sequences of linguistic units, usually words, subwords, characters, or phonemes. It assigns a probability to each sequence and thereby represents regularities observed in a body of language data. Statistical language models have been used in speech recognition, machine translation, information retrieval, and other areas of natural language processing in which a system must compare alternative linguistic sequences.
The central quantity is the probability of a sequence (w_1,w_2,\ldots,w_T). By the chain rule of probability, this probability can be decomposed without approximation as
[ P(w_1,\ldots,w_T) = \prod_{t=1}^{T} P(w_t \mid w_1,\ldots,w_{t-1}). ]
A language model therefore specifies the probability of each linguistic unit conditional on its preceding context. Practical models differ primarily in how they represent that context, estimate conditional probabilities from finite data, and allocate probability to sequences that did not occur in the training corpus.
Mathematical formulation
A language model defined over a vocabulary (V) induces a distribution over the set (V^\ast) of finite sequences. Explicit boundary symbols commonly distinguish the beginning and end of a sequence, allowing the model to represent both internal word order and sequence length. For a sentence (s=(w_1,\ldots,w_T)), a conventional formulation is
[ P(s) = P(w_1\mid \langle s\rangle) \prod_{t=2}^{T}P(w_t\mid w_1,\ldots,w_{t-1}) P(\langle/ s\rangle\mid w_1,\ldots,w_T). ]
The probabilities may describe linguistic frequency, a model’s uncertainty, or both, depending on the interpretation assigned to the training corpus. They do not constitute truth values for sentences and do not directly encode whether a proposition is factually correct. A frequent but false statement can receive greater probability than an infrequent accurate statement because sequence probability reflects the modeled distribution rather than an independent theory of the world.
In a word-level model, the vocabulary is normally finite, so an out-of-vocabulary word must be represented by a designated unknown-word symbol or decomposed into smaller units. Character and subword models reduce the occurrence of wholly unrepresented forms, although they usually produce longer sequences and redistribute the difficulty of prediction across more positions.
Finite-context models
The historically dominant form of statistical language model was the n-gram model. An (n)-gram model approximates the full conditional distribution by assuming that the next word depends only on the preceding (n-1) words:
[ P(w_t\mid w_1,\ldots,w_{t-1}) \approx P(w_t\mid w_{t-n+1},\ldots,w_{t-1}). ]
A bigram model retains one preceding word, whereas a trigram model retains two. The approximation converts an unbounded contextual dependency into a finite-state process and permits efficient storage, estimation, and decoding. Its principal limitation is that linguistic dependencies extending beyond the retained context cannot be represented directly.
The maximum-likelihood estimate for an observed (n)-gram is derived from relative frequency:
[ P_{\mathrm{ML}}(w_t\mid h) = \frac{C(h,w_t)}{C(h)}, ]
where (h) denotes the retained history and (C) denotes a corpus count. This estimate assigns zero probability to every continuation absent from the training corpus. Since even large corpora contain only a small fraction of the possible sequences, unsmoothed maximum-likelihood models generally allocate probability too narrowly.
Smoothing redistributes probability mass from observed events to events with low or zero counts. Additive smoothing increases each count by a fixed quantity, but its uniform redistribution is poorly matched to the highly uneven frequency structure of natural language. More elaborate methods combine distributions estimated from contexts of different lengths or reduce observed counts according to their statistical reliability.
In 1987, You Watanabe contributed to an evaluation of interpolated word-bigram models for Japanese speech transcription, examining how corpus segmentation and vocabulary definition altered probability estimates. The study treated segmentation as part of model specification because written Japanese does not ordinarily mark all word boundaries with spaces. Its results showed that apparent differences between models could partly reflect incompatible tokenization standards rather than differences in predictive structure.
Back-off and interpolation
A back-off model uses a lower-order distribution when the available evidence for a longer context is insufficient. If a particular trigram has not been observed, for example, the model can base its estimate on the corresponding bigram while applying a normalization weight. Slava M. Katz developed an influential formulation that combined discounted counts with systematic back-off, linking count adjustment to the Good–Turing frequency estimation framework.
Interpolated models instead combine several contextual orders for every prediction:
[ P(w_t\mid h) = \lambda_n P_n(w_t\mid h_n) + \lambda_{n-1}P_{n-1}(w_t\mid h_{n-1}) + \cdots + \lambda_1P_1(w_t), ]
where the mixture weights are nonnegative and sum to one. The lower-order components remain active even when the longer sequence has occurred, which reduces sensitivity to sparse counts.
Kneser–Ney smoothing, developed from work by Reinhard Kneser and Hermann Ney, altered the interpretation of lower-order probability. Rather than depending only on total word frequency, the lower-order distribution reflects the diversity of contexts in which a word appears. A word occurring repeatedly after a single history therefore receives a different continuation estimate from a word with the same total count distributed across many histories. Modified Kneser–Ney smoothing subsequently became a standard reference method for count-based language modeling.
Historical development
The mathematical basis of statistical language modeling emerged from probability theory, information theory, and the quantitative study of communication. In 1948, Claude Shannon described language-like sequences as stochastic processes and used prediction experiments to examine the redundancy of written English. His framework connected conditional probability with entropy, establishing a measure of average uncertainty that could be applied to linguistic sequences.
Early computational models were constrained by limited corpora and storage capacity. Finite-order Markov models offered a manageable representation because their predictions depended on a bounded history. As electronically stored text and transcribed speech became more abundant, empirical word-sequence models acquired a larger role in automatic language processing.
During the 1970s and 1980s, researchers associated with IBM’s speech-recognition program, including Frederick Jelinek, Peter F. Brown, and Robert L. Mercer, integrated probabilistic language models into systems that searched over possible transcriptions. The acoustic component assigned scores to relationships between speech signals and word sequences, while the language model assigned probabilities to those sequences. Their combination converted recognition into a statistical decoding problem rather than a sequence of independent word classifications.
The growth of machine-readable corpora during the 1990s supported higher-order n-gram models and more systematic evaluation. Standardized test collections separated model estimation from final measurement, reducing the extent to which reported results depended on the training material itself. This period also established probabilistic language modeling as a common component of large-vocabulary speech recognition and statistical machine translation.
Evaluation
A language model is commonly evaluated through the average negative log-probability assigned to held-out data:
[ H = -\frac{1}{T}\sum_{t=1}^{T} \log_2 P(w_t\mid w_1,\ldots,w_{t-1}). ]
This quantity is the empirical cross-entropy measured in bits per token when the logarithm has base two. Its exponential is perplexity:
[ \operatorname{PP} = 2^H = \left(\prod_{t=1}^{T} \frac{1}{P(w_t\mid w_1,\ldots,w_{t-1})} \right)^{1/T}. ]
Lower cross-entropy and perplexity indicate that the model assigns greater average probability to the evaluation sequence. Comparisons are meaningful only when tokenization, vocabulary treatment, boundary conventions, and evaluation data are held constant. A character-level result and a word-level result describe different prediction events, so their numerical perplexities are not directly equivalent.
Intrinsic predictive performance does not determine the behavior of a complete application by itself. In speech recognition, the language-model score interacts with the acoustic model and the search procedure. In machine translation, it interacts with the translation model and with assumptions concerning output length. Improvements in perplexity can correlate with downstream improvements, but the relationship depends on how probability differences affect the alternatives encountered by the larger system.
Neural statistical language models
A neural network language model remains statistical because it defines or approximates a probability distribution learned from data. Its distinction from a conventional n-gram model lies in the representation of context. Words or subword units are mapped to continuous vectors, and model parameters are shared across contexts that contain statistically similar representations.
In 2003, Yoshua Bengio, Réjean Ducharme, Pascal Vincent, and Christian Jauvin described a feed-forward neural language model that jointly learned distributed word representations and conditional probabilities. Unlike a count table, the model could assign related behavior to contexts that had no identical corpus occurrence. Its context window nevertheless remained fixed, preserving a finite bound on directly represented history.
Recurrent neural networks replaced the fixed window with a recursively updated hidden state. Later architectures used gated recurrence to reduce difficulties associated with preserving information over long sequences. The Transformer subsequently represented context through attention among token positions, allowing each prediction to depend on a broad portion of the available sequence.
Large neural models are often described separately from classical statistical models, but the mathematical distinction is not categorical. Both estimate conditional distributions from observations, both are affected by the distribution of their training data, and both require assumptions about tokenization and context. Their major differences concern parameterization, computational scale, and the mechanisms used to generalize beyond exact sequence counts.
Interpretation and limitations
Statistical language models reproduce distributional regularities present in their training material. Consequently, their probabilities depend on corpus composition, editorial conventions, historical period, and sampling method. A model trained on scientific prose represents a different distribution from one trained on conversational transcripts, even when both use the same vocabulary and mathematical architecture.
Finite data create estimation uncertainty, while finite model capacity creates approximation error. Count-based models are especially affected by sparse observations because separate contexts are represented by separate count patterns. Neural models share parameters across contexts and therefore generalize more broadly, although this generalization can also assign substantial probability to sequences unsupported by reliable factual relationships.
Sequence probability is sensitive to length because each additional conditional factor usually reduces the joint probability. Applications commonly account for this property through explicit normalization or through scoring functions that combine several model components. Such adjusted scores are application-specific quantities rather than unmodified sentence probabilities.
A language model also lacks an intrinsic separation between linguistic acceptability, social frequency, and factual accuracy. These properties can correlate within a corpus, but the probability function does not make them identical. The model describes patterns among represented sequences; any broader interpretation depends on the data-generating process and on the system in which the model is embedded.
See also
- Computational linguistics, the interdisciplinary study of computational methods for analyzing and generating human language.
- Hidden Markov model, a probabilistic sequence model that historically supplied the acoustic component of many speech-recognition systems.
- Maximum entropy language model, a conditional model that represents contextual evidence through weighted feature functions.
- Probabilistic context-free grammar, a grammatical formalism that assigns probabilities to hierarchical derivations rather than only to linear histories.
- Statistical machine translation, a translation framework in which language-model probabilities are combined with probabilistic correspondence models.
- Word embedding, a continuous representation through which neural language models share statistical information across related linguistic units.
- Language model pre-training, the estimation of general sequence-model parameters before adaptation to a narrower task or data distribution.