A Generalized Language Model as the Combination of Skipped n-grams and Modified Kneser Ney Smoothing

Rene Pickhardt, Thomas Gottron, Martin Körner, Paul Georg Wagner, Till Speicher, Steffen Staab

Abstract

Traditional n-gram language models often struggle with data sparsity, where many word combinations are absent from training sets. While Modified Kneser-Ney (MKN) smoothing is the standard solution, it is limited by a rigid back-off strategy that only drops the oldest word in a sequence. This paper introduces the Generalized Language Model (GLM), which systematically incorporates "skip n-grams" into the smoothing process. By considering all possible word omissions in a context, the GLM achieves up to a 12.7% reduction in perplexity on large datasets and over 25% on sparse data across multiple languages.

Introduction

Language models (LMs) are foundational to natural language processing tasks such as speech recognition and machine translation. Most LMs utilize n-grams to predict the next word based on a local window of $n-1$ preceding words. However, data sparsity remains a persistent challenge: the vast majority of potential word combinations never appear in training corpora, leading to unreliable probability estimates.

Smoothing techniques, specifically Modified Kneser-Ney (MKN) smoothing, address this by "backing off" to lower-order models. For instance, if a 3-gram is rare, MKN looks at the corresponding 2-gram by dropping the first word. The authors argue this is insufficient; if a word later in the context is the source of rarity, dropping the oldest word does not resolve the sparsity.

Methods: The Generalized Language Model

The GLM treats the back-off process as a recursive exploration of all possible "skip n-grams," where any word in the context can be treated as a wildcard.

  1. Skip n-grams as Wildcards: For a context $w_1 w_2 w_3$, the GLM evaluates not just $w_2 w_3$, but also $w_1 \_ w_3$ and $w_1 w_2 \_$.
  2. Generalized Interpolation: The standard MKN formula is extended to interpolate a higher-order model with an average of all possible lower-order models formed by skipping one word.
  3. Continuation Counts: The model adapts Kneser-Ney’s "continuation counts"—which measure how many unique words precede a sequence—to the skip n-gram framework.
Recursive structure of the GLM showing the interpolation of skip n-grams across different orders (n) and skip patterns (k).

This recursive structure allows the model to find the most statistically reliable sub-patterns within a context, effectively "skipping" over noisy or rare words that would otherwise cause a back-off to a much less informative lower-order model.

Experimental Setup

The model was evaluated on Wikipedia (general domain) and JRC-Acquis (legislative domain) corpora in English, German, French, and Italian. To specifically test performance under varying degrees of sparsity, the authors created shrunk subsets of the English Wikipedia corpus, ranging from 80% down to 0.008% of the original data.

Results and Discussion

The GLM consistently outperformed the MKN baseline across all languages and dataset sizes. On the full English Wikipedia dataset, a 5-gram GLM reduced perplexity by 12.7%.

The advantage of the GLM is most pronounced in sparse data environments. As shown in the figure below, the relative improvement over MKN increases as the dataset size decreases and the n-gram order increases. On the smallest test set (approx. 736 KB), the GLM achieved a 25.7% reduction in perplexity.

Relative change of perplexity for GLM over MKN across different dataset sizes and n-gram orders.

Key Insights

  • Efficiency: A 5-gram GLM trained on only 1% of the data can outperform a standard 3-gram MKN model trained on 100% of the data, suggesting that intelligent context utilization is more impactful than raw data volume.
  • Generalization: For word sequences entirely absent from the training set, the GLM outperformed MKN by 15.6%, demonstrating superior generalization capabilities.

Conclusion

The Generalized Language Model provides a robust framework for overcoming data sparsity in n-gram modeling. While it introduces higher computational overhead in terms of memory and CPU usage, its significant gains in perplexity—especially for higher-order models and small datasets—make it a powerful alternative to traditional smoothing techniques. Future work may focus on optimizing skip-pattern weights and improving computational efficiency through advanced indexing.

Summary updated

BibTeX
@inproceedings{pickhardt2014generalized,
  author = {Rene Pickhardt and Thomas Gottron and Martin Körner and Paul Georg Wagner and Till Speicher and Steffen Staab},
  title = {{A Generalized Language Model as the Combination of Skipped n-grams and Modified Kneser Ney Smoothing}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2014},
  doi = {10.3115/v1/p14-1108},
}
Figure