Abstract
Modern Automatic Speech Recognition (ASR) systems often rely on a two-pass decoding strategy where a fast, lightweight n-gram model performs initial hypothesis generation, followed by a more computationally intensive neural reranking pass. However, n-gram models frequently suffer from data sparsity in low-resource or highly specialized domains. This paper investigates methods for distilling the linguistic knowledge of large-scale pre-trained language models (PLMs), specifically GPT-2, into efficient n-gram models. We introduce Vocabulary-Restricted Decoding (VRD), a novel synthetic data generation technique that anchors the PLM to the target domain's vocabulary. Our results demonstrate that this approach yields up to a 20% improvement in test perplexity over standard baselines, particularly in technical domains like air traffic control.
Introduction
In the field of Automatic Speech Recognition (ASR), the "first-pass" decoding phase is a critical bottleneck. To maintain real-time performance, this phase typically utilizes n-gram models due to their low latency and high throughput. While Large Language Models (LLMs) like GPT-2 exhibit superior linguistic modeling capabilities, their transformer-based architectures are too computationally expensive for the initial search through the vast hypothesis space of an ASR system.
The central challenge addressed in this research is the effective transfer of knowledge from a massive transformer model into a compact n-gram model without sacrificing the speed advantages of the latter. This is especially pertinent in low-resource scenarios where the available in-domain training data is insufficient to build a robust n-gram model.
Methodology
The study evaluates three distinct strategies for approximating GPT-2 as an n-gram model:
1. Sampling-Based Approximation (SBA)
In this approach, GPT-2 is first fine-tuned on a small target dataset. The model is then used to generate a large volume of synthetic text (e.g., 100 times the size of the original training set). Finally, a standard n-gram model is trained on this augmented synthetic corpus. This method treats the PLM as a sophisticated data generator.
2. Probability-Based Approximation (PBA)
This method attempts a more direct mathematical extraction. N-gram probabilities are calculated by querying the internal weights and output distributions of the PLM for specific word sequences.
3. Vocabulary-Restricted Decoding (VRD)
As the primary novel contribution of this work, VRD refines the SBA process. During synthetic text generation, the PLM's output is restricted to sub-word tokens (Byte Pair Encodings) that appear in the original training set. This constraint prevents the model from drifting into general-purpose English and forces it to adhere more closely to the specific grammatical structures and jargon of the target domain.
The final language model is constructed by interpolating the baseline n-gram model (trained on real data) with the model trained on the GPT-2 generated synthetic data.
Experimental Setup
The methods were rigorously tested across eight distinct domains to evaluate performance across varying levels of technical complexity:
- Taskmaster-2: Conversational data covering six domains (e.g., Food ordering, Flights, Movies).
- HUB4 1996: A standard broadcast news corpus representing general media language.
- ATCO2: A highly specialized and technical dataset of air traffic control communications, characterized by strict protocols and unique terminology.
Key Insights and Analysis
The Superiority of Sampling
The researchers found that Sampling-Based Approximation (SBA) significantly outperformed Probability-Based Approximation (PBA). Analysis suggests that PLMs tend to overestimate the probabilities of lower-order n-grams when queried directly, leading to "lossy" mathematical conversions. Generative sampling, conversely, allows the model to express its learned distribution more naturally.
The "Difficulty" Inverse Rule
A key finding was the relationship between domain specificity and data requirements. In highly technical domains like Air Traffic Control (ATCO2), standard random sampling often failed or even degraded performance. In these "difficult" domains, the VRD method was essential to anchor the model, and significantly larger volumes of synthetic data were required to surpass the baseline.
The Low-Resource Advantage
The utility of GPT-2 distillation is most pronounced when training data is extremely scarce (fewer than 100 samples). As the volume of real-world training data increases, the relative gain from PLM augmentation diminishes. Once the training set reaches a certain threshold (e.g., 20,000 sentences), the standard n-gram model becomes a formidable competitor, making the computational cost of PLM distillation less justifiable.
Results
- Perplexity Reduction: Interpolating baseline models with GPT-2 sampled data reduced test perplexity by an average of 15%.
- VRD Impact: The introduction of Vocabulary-Restricted Decoding increased the perplexity improvement to 20% in domain-specific tasks.
- Technical Domain Success: In the ATCO2 domain, VRD provided a 20% improvement over the baseline, whereas standard sampling methods were unable to beat the baseline.
- Out-of-Vocabulary (OOV) Mitigation: The synthetic data generation process effectively reduced OOV rates by providing the n-gram model with various inflections and suffixes that were absent in the small primary training set.
Conclusion
This research demonstrates that n-gram models—the workhorses of first-pass ASR—can be significantly enhanced by distilling knowledge from pre-trained transformers. By using Vocabulary-Restricted Decoding, researchers can effectively "anchor" a general-purpose LLM to a specific, technical domain. While the offline computational cost of generating synthetic data is high, the resulting n-gram models remain fast and efficient for real-time deployment, offering a practical path for improving ASR in low-resource and specialized environments.
Summary updated