Improving N-gram Language Models with Pre-trained Deep Transformer

Yiren Wang, Hongzhao Huang, Zhe Liu, Yutong Pang, Yongqiang Wang, ChengXiang Zhai, Fuchun PengarXiv 2019

Abstract

Traditional n-gram language models remain the standard for first-pass decoding in Automatic Speech Recognition (ASR) due to their efficiency. However, they suffer from data sparsity and an inability to capture long-range dependencies. This paper proposes a method to enhance n-gram models by using a pre-trained deep Transformer as a synthetic data generator. By pre-training on a massive general corpus and fine-tuning on domain-specific data, the model generates high-quality synthetic text that, when interpolated into n-gram models, achieves significant Word Error Rate (WER) reductions, particularly in low-resource domains.

Introduction

In the field of Automatic Speech Recognition (ASR), the trade-off between latency and accuracy is a primary concern. While neural language models (LMs) offer superior accuracy, their computational cost often precludes them from "first-pass" decoding. Consequently, production systems still rely on n-gram models for initial audio-to-text translation.

The performance of n-gram models is limited by the availability of in-domain training data. When specific word sequences are absent from the training set, the model fails to generalize. This paper explores a novel approach: using a powerful, albeit slow, neural model to "teach" a fast n-gram model by generating synthetic training data, thereby bridging the gap between state-of-the-art accuracy and real-time efficiency.

Methodology

The proposed pipeline leverages the generative capabilities of deep Transformers through a multi-stage process.

The proposed pipeline for data augmentation and the underlying Transformer architecture.
  1. General-Domain Pre-training: A deep Transformer decoder is trained on a massive dataset of 110 million public Facebook posts. This stage allows the model to learn general linguistic structures.
  2. In-Domain Fine-tuning: The pre-trained model is adapted to specific target domains (e.g., smart assistant commands) using smaller, specialized datasets.
  3. Prefix-based Text Generation: Synthetic data is generated by feeding the model prefixes from real data and sampling subsequent words. A temperature parameter ($\tau$) is used to balance the diversity and quality of the output.
  4. Data Filtration and Interpolation: Generated text is filtered for quality (length, OOV rate, repetition). Finally, a new n-gram model is trained on this synthetic corpus and interpolated with the baseline n-gram model.

Experimental Setup

The study evaluates the method across three primary datasets:

  • General Domain: 110 million Facebook posts and comments.
  • Assistant: 730,000 utterances for the Facebook Portal, categorized into sub-domains like Weather, Music, and Device Control.
  • Conversation: A crowd-sourced dataset of 240,000 utterances covering 20 daily life topics, representing higher linguistic complexity.

Results and Discussion

The integration of synthetic data from pre-trained Transformers led to consistent improvements in ASR performance. On the Assistant dataset, the approach achieved a 2.25% relative Word Error Rate Reduction (WERR) over the baseline.

The most significant gains were observed in data-sparse sub-domains. As shown in the table below, the pre-trained Transformer approach significantly outperformed both LSTM and in-domain Transformer baselines in specific categories.

Word Error Rate Reduction (WERR) across different sub-domains of the Assistant dataset.

Specifically, for the Weather domain, the model achieved a 6.01% WERR, and for Music, a 4.91% WERR. These results suggest that the Transformer effectively "hallucinates" variations in sentence structure and entities (like city or artist names) that were missing from the original training data. Furthermore, scaling the synthetic data on the Conversation dataset from 4 million to 18 million sentences improved the WERR from 2.62% to 3.08%, demonstrating the scalability of the method.

Conclusion

This research demonstrates that pre-trained deep Transformers can be effectively used to distill complex linguistic knowledge into efficient n-gram models. This approach allows ASR systems to maintain the speed required for first-pass decoding while benefiting from the accuracy of modern neural architectures. Future work will focus on automating the data filtration process and exploring the limits of general-domain pre-training for highly divergent target domains.

Summary updated

BibTeX
@misc{wang2019improving,
  author = {Yiren Wang and Hongzhao Huang and Zhe Liu and Yutong Pang and Yongqiang Wang and ChengXiang Zhai and Fuchun Peng},
  title = {{Improving N-gram Language Models with Pre-trained Deep Transformer}},
  year = {2019},
  eprint = {1911.10235},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1911.10235},
}
Figure