Improving cross-domain n-gram language modelling with skipgrams

Louis Onrust, Antal van den Bosch, Hugo Van hammeACL 2016

Abstract

Traditional n-gram language models are often limited by their reliance on contiguous word sequences, which hinders their performance in cross-domain scenarios. This paper investigates the integration of skipgrams into the Hierarchical Pitman-Yor Process Language Model (HPYLM) framework. By allowing the model to capture non-contiguous dependencies, we demonstrate a significant reduction in perplexity, particularly when adapting to out-of-domain text. Our results show a 30-40% reduction in perplexity for cross-domain tasks in both English and Flemish-Dutch, suggesting that skipgrams provide the necessary flexibility for robust language modeling.

Introduction

Language models typically rely on n-grams—sequences of $n$ contiguous words—to predict the next token in a sequence. While effective for within-domain tasks, this rigidity makes them brittle when applied to new domains where specific word-to-word sequences differ, even if underlying structural patterns remain similar. For instance, a model trained on general web text may struggle with the specialized vocabulary and syntax of medical or legal documents. To address this, we propose incorporating skipgrams—patterns that allow for "skips" between words—into a Bayesian HPYLM framework to capture more generalized linguistic structures.

Methodology

We build upon the Hierarchical Pitman-Yor Process Language Model (HPYLM), a Bayesian approach that effectively handles the power-law distribution of natural language. Our approach extends this model to include skipgrams, which are patterns of $n$ tokens where some tokens represent a skip of one or more words.

We evaluated three distinct backoff strategies to handle unseen word sequences:

  1. ngram: The standard contiguous backoff method.
  2. limited: A strategy that stops recursion if a specific pattern has been observed in the training data, thereby reducing unnecessary smoothing.
  3. full: A recursive strategy that incorporates skipgram features at every level of the hierarchy, providing maximum generalization.

Experimental Results

The models were tested on two large-scale datasets: the Google 1 Billion Word Benchmark for English and the Mediargus corpus for Flemish-Dutch.

English Cross-Domain Performance

For the English datasets, we trained on general web text and tested on Wikipedia (wp), JRC-Acquis (jrc - legal), and EMEA (emea - medical). The results indicate that the choice of backoff strategy is critical depending on the domain shift.

Table 1: Perplexity results for English test sets across different backoff strategies.

As illustrated in Table 1, the full backoff strategy achieved a massive 41% reduction in perplexity for the JRC dataset and a 39% reduction for EMEA. In contrast, for the within-domain 1bw test, the limited strategy was superior, providing a 6% improvement over the baseline.

Flemish-Dutch Performance

Similar trends were observed in the Flemish-Dutch experiments, where the model was trained on newspaper text and tested on the diverse Spoken Dutch Corpus (CGN).

Table 2: Perplexity results for various components of the Spoken Dutch Corpus (CGN).

Table 2 shows that the full strategy consistently outperformed the standard ngram model across nearly all components of the CGN, with relative perplexity reductions frequently exceeding 30%. This confirms that the flexibility provided by skipgrams is language-agnostic and highly effective for diverse text types.

Discussion and Conclusion

The integration of skipgrams into the HPYLM framework significantly improves language model robustness. While skipgram models are more memory-intensive due to a fivefold increase in parameters, the computational overhead during run-time remains negligible. The most striking finding is the 30-40% perplexity reduction in cross-domain tasks, achieved by leveraging the broader patterns captured by skipgrams. Future research will focus on evaluating these models in extrinsic applications such as Automatic Speech Recognition (ASR) and Machine Translation to determine if these perplexity gains translate into improved real-world performance metrics like Word Error Rate.

Summary updated

BibTeX
@inproceedings{onrust2016improving,
  author = {Louis Onrust and Antal van den Bosch and Hugo Van hamme},
  title = {{Improving cross-domain n-gram language modelling with skipgrams}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2016},
  doi = {10.18653/v1/p16-2023},
}
Figure