Smoothing a Tera-word Language Model

Deniz YuretACL 2008

Abstract

Traditional language modeling smoothing techniques, such as Kneser-Ney (KN), rely heavily on low-frequency n-gram counts to estimate probability distributions. However, in massive "tera-word" datasets like the Web 1T corpus, these low-frequency events are often pruned to maintain manageable data sizes, causing standard smoothing methods to degrade. This paper introduces Dirichlet-Kneser-Ney (DKN), a novel algorithm that combines Bayesian Dirichlet priors with the structural advantages of Kneser-Ney back-off. By explicitly modeling missing counts in pruned data, DKN achieves a 31% perplexity reduction on the Brown corpus compared to standard KN implementations.

Introduction

Language models (LMs) are fundamental to natural language processing, providing the probability of a word sequence by calculating the likelihood of a word given its preceding context ($n$-grams). A persistent challenge in LM development is the sparsity of data: even with massive training sets, many valid word sequences never appear. Smoothing is the essential technique used to redistribute probability mass from observed sequences to unseen ones, ensuring the model can generalize to novel text.

While Kneser-Ney (KN) smoothing is widely regarded as the state-of-the-art for standard datasets, it struggles with the scale of modern "Big Data." In datasets like the Web 1T corpus—which contains approximately $10^{12}$ words—computational constraints necessitate the pruning of $n$-grams that appear fewer than 40 times. Because KN relies on the counts of unique contexts and low-frequency events to calibrate its back-off distributions, this pruning removes the very information the algorithm needs to function effectively.

Methodology: Dirichlet-Kneser-Ney (DKN)

To address the limitations of traditional smoothing on pruned data, this research proposes Dirichlet-Kneser-Ney (DKN). This hybrid approach merges two influential concepts in language modeling:

  1. Kneser-Ney Intuition: Rather than focusing solely on raw frequency, KN considers the number of unique contexts in which a word appears. For example, a word like "York" may be frequent, but because it almost exclusively follows "New," it should have a low probability in other contexts.
  2. Dirichlet Smoothing: Derived from Bayesian priors, this method treats smoothing as the addition of "pseudo-counts" to observed data, providing a more flexible framework for redistribution than the absolute discounting used in standard KN.

The Missing Count Correction

The primary innovation of DKN is its ability to "reconstruct" the statistical properties of pruned data. In the Web 1T dataset, any $n$-gram with a count below 40 is deleted. DKN introduces a parameter ($\delta$) to estimate these missing counts by calculating the difference between the total word count and the sum of the counts of the $n$-grams that were retained. This allows the model to estimate the type-token ratio of the "long tail" of the distribution that was lost during pruning.

Experimental Setup

The model was trained on the Web 1T 5-gram dataset, which includes counts for $n$-grams up to length five derived from one trillion words of web content. Evaluation was conducted on the Brown Corpus, a standard million-word collection of edited English. The primary metric for evaluation was cross-entropy (measured in bits per token), which directly relates to model perplexity.

Results and Discussion

The DKN method demonstrated significant improvements over both baseline absolute discounting and standard Kneser-Ney implementations. The results, measured in cross-entropy, are summarized below:

  • Baseline Absolute Discounting (3-gram): 8.53 bits
  • Standard Kneser-Ney (4-gram): 8.40 bits
  • KN with Missing Count Correction (4-gram): 8.23 bits
  • Dirichlet-Kneser-Ney (5-gram): 7.86 bits

The reduction from 8.40 bits to 7.86 bits represents a 31% reduction in perplexity. This improvement highlights two key findings: first, that interpolated models (which mix higher and lower-order distributions) are more robust than simple back-off models; and second, that the Dirichlet form is empirically superior to absolute discounting when dealing with massive, pruned datasets.

Limitations and Future Work

While DKN provides a substantial performance boost, certain constraints remain. Parameter optimization was limited to a 1,000-sentence sample of the Brown corpus due to the immense computational requirements of the Web 1T dataset. Additionally, the model utilized a fixed 13-million-word vocabulary, leaving the challenge of out-of-vocabulary (OOV) words in specialized domains for future study. Further research is also required to establish the precise mathematical conditions under which Dirichlet smoothing consistently outperforms absolute discounting in the Kneser-Ney framework.

Conclusion

As language models continue to scale, the ability to handle pruned, incomplete datasets becomes critical. Dirichlet-Kneser-Ney offers a powerful solution by integrating Bayesian priors into the Kneser-Ney structure, effectively modeling the "missing" data in tera-word corpora and setting a new benchmark for large-scale smoothing performance.

Summary updated

BibTeX
@inproceedings{yuret2008smoothing,
  author = {Deniz Yuret},
  title = {{Smoothing a Tera-word Language Model}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2008},
}
Figure