Internal Language Model Adaptation with Text-Only Data for End-to-End Speech Recognition

Zhong Meng, Yashesh Gaur, Naoyuki Kanda, Jinyu Li, Xie Chen, Yu Wu, Yifan Gong

Abstract

End-to-end (E2E) Automatic Speech Recognition (ASR) models, particularly those based on the RNN-Transducer architecture, have become the standard for high-performance speech systems. However, these models often struggle with domain shifts, such as recognizing specialized "Command & Control" phrases when trained on general conversational data. Traditional adaptation methods require paired audio-text data, which is scarce, or external language models (Shallow Fusion), which increase inference latency and memory usage. This paper presents Internal Language Model Adaptation (ILMA), a novel technique to adapt E2E models using only text data. By employing a dual-mode training objective and a targeted adaptation of the joint network's final layer, ILMA achieves significant Word Error Rate (WER) reductions—up to 34.9% relatively—without any additional computational overhead during inference.

Introduction

The deployment of E2E ASR models in real-world applications faces a significant challenge: the domain gap. A model optimized for general voice search might fail on specific domains like medical dictation or device control. While text-only data for these domains is often abundant, integrating it into E2E models typically involves Shallow Fusion, where an external language model (LM) is combined with the ASR model at decoding time. This approach is computationally expensive and increases the system's footprint. This paper explores a more efficient alternative: adapting the model's internal language model (ILM) directly.

Methodology

The proposed method consists of two main phases: Internal Language Model Training (ILMT) and Internal Language Model Adaptation (ILMA).

Internal Language Model Training (ILMT)

Standard E2E models implicitly learn a language model within their prediction and joint networks. To make this ILM explicit and robust, the authors introduce a dual-objective loss during base training. In addition to the standard ASR loss, an ILM loss is calculated by "zeroing out" the audio encoder's contribution. This forces the prediction and joint networks to function as a standalone language model, creating a "dual-mode" model capable of both ASR and text-only probability estimation.

Internal Language Model Adaptation (ILMA)

Once the base model is trained, it is fine-tuned on target-domain text. The authors identify two critical components for successful text-only adaptation:

  • The "Joiner" Optimization: Transducer models rely on a "blank" token for temporal alignment. Since text-only data lacks these tokens, updating the entire network can degrade the model's ability to predict blanks. The authors found that updating only the final linear layer of the joint network (the "Joiner") effectively adapts the vocabulary distribution while preserving alignment logic.
  • KL-Divergence Regularization: To prevent catastrophic forgetting of the general domain knowledge, a Kullback-Leibler (KL) divergence penalty is applied between the original and adapted ILM distributions.

Experimental Results

The method was evaluated using a 30,000-hour base dataset and specialized "Command & Control" and "Voice Search" test sets.

Comparison of ILMA with baseline and Shallow Fusion methods across different tasks and parameter counts.

As shown in Figure 3, ILMT + ILMA significantly outperforms the baseline Transducer (T-T) and even surpasses Shallow Fusion (SF). Notably, ILMA achieves a WER of 8.34 on Command & Control tasks compared to 12.81 for the baseline—a 34.9% relative improvement. Furthermore, ILMA maintains a much smaller parameter footprint (67M vs. 125M for SF) and offers 20.7% faster inference speeds because no external LM is required.

Ablation study showing the impact of adapting different components and varying the KLD regularization weight on the Command & Control task.

Figure 4 highlights the importance of the "Joiner" trick. Adapting only the Joiner parameters consistently yielded better results than adapting the full ILM or the Predictor network. The optimal KLD regularization weight (ρ) was found to be around 0.2, balancing domain-specific adaptation with general knowledge retention.

Conclusion

ILMA provides a highly efficient and effective framework for adapting E2E speech recognition models to new domains using text-only data. By leveraging the internal components of the Transducer architecture and a surgical adaptation strategy, the method eliminates the need for external language models during inference. This makes it an ideal solution for resource-constrained environments where both high accuracy and low latency are paramount.

Summary updated

BibTeX
@inproceedings{meng2022internal,
  author = {Zhong Meng and Yashesh Gaur and Naoyuki Kanda and Jinyu Li and Xie Chen and Yu Wu and Yifan Gong},
  title = {{Internal Language Model Adaptation with Text-Only Data for End-to-End Speech Recognition}},
  booktitle = {Interspeech},
  year = {2022},
  doi = {10.21437/interspeech.2022-13},
}
Figure