Improving CTC-based speech recognition via knowledge transferring from pre-trained language models

Keqi Deng, Songjun Cao, Yike Zhang, Long Ma, Gaofeng Cheng, Ji Xu, Pengyuan Zhang · DOI

Abstract

Connectionist Temporal Classification (CTC) models offer significant advantages in inference speed for Automatic Speech Recognition (ASR) due to their non-autoregressive nature. However, they often lag behind Attention-based Encoder-Decoder (AED) models in accuracy because of the conditional independence assumption. This paper explores a novel approach to bridge this gap by distilling linguistic knowledge from pre-trained language models (PLMs) like BERT and GPT-2 into a CTC-based framework during training. By employing Knowledge Transfer via Representation Learning (KT-RL) and Classification Learning (KT-CL), the researchers achieved a 16.1% relative reduction in Character Error Rate (CER) on the AISHELL-1 dataset, reaching a competitive 4.2% CER without any additional computational overhead during inference.

1. Introduction

The landscape of Automatic Speech Recognition (ASR) is primarily divided into two architectures: Attention-based Encoder-Decoder (AED) models and Connectionist Temporal Classification (CTC) models. AED models are known for their high accuracy, attributed to their ability to capture global context through autoregressive decoding. However, this token-by-token generation makes them computationally expensive and slow. Conversely, CTC models predict all output tokens in parallel, offering superior inference speed. The primary drawback of CTC is its "conditional independence assumption," which assumes that output tokens are independent of one another given the input, leading to a lack of linguistic context.

Traditionally, this is mitigated by using an external Language Model (LM) during a second-pass decoding phase. While effective, this adds complexity and latency. This research proposes a "teacher-student" paradigm where the CTC model (the student) inherits the contextual intelligence of a pre-trained language model (the teacher) during the training phase, allowing the final model to remain lightweight and fast.

2. Methodology

The researchers utilized a wav2vec 2.0 backbone and introduced two distinct strategies for knowledge transfer from PLMs.

2.1 Knowledge Transfer via Representation Learning (KT-RL)

In this approach, BERT serves as the teacher. Because BERT is a bidirectional model, it provides a rich, context-aware representation of the entire sentence. A significant challenge in this distillation is the length mismatch: speech frames are significantly more numerous than text tokens. To resolve this, the authors implemented a Continuous Integrate-and-Fire (CIF) mechanism. CIF acts as a bridge, aggregating speech frame features into a sequence that matches the length of the text tokens. The ASR model is then trained to minimize the Cosine Similarity loss between its internal representations and BERT’s high-level embeddings.

2.2 Knowledge Transfer via Classification Learning (KT-CL)

This strategy employs GPT-2 as the teacher within a hybrid CTC/attention architecture. During training, the system uses GPT-2 to extract features from previous text tokens, which are then integrated with speech features via a cross-attention mechanism. This forces the speech encoder to learn representations that are compatible with the linguistic space of a generative language model.

In both scenarios, the PLM "teacher" is discarded after training. The resulting inference model is a pure CTC system, maintaining the speed benefits of parallel prediction.

3. Experimental Results

The models were evaluated using the AISHELL-1 Mandarin speech corpus, with the base wav2vec 2.0 model pre-trained on the larger AISHELL-2 dataset.

3.1 Performance Gains

The proposed method achieved a 4.2% Character Error Rate (CER) on the AISHELL-1 test set. This represents a 16.1% relative improvement over the vanilla wav2vec 2.0 CTC baseline. Notably, this performance was achieved without the use of an external language model during decoding, making it highly efficient for real-time applications.

3.2 Comparative Analysis

  • BERT vs. GPT-2: KT-RL (BERT) consistently outperformed KT-CL (GPT-2). The researchers suggest that BERT’s bidirectional context is more beneficial for speech representation learning than the unidirectional, "look-back" nature of GPT-2.
  • Alignment Mechanisms: For KT-RL, the CIF mechanism proved superior to standard attention. CIF’s monotonic nature—matching the chronological order of speech—provides a more stable alignment than the more flexible, but sometimes erratic, global attention.
  • Loss Functions: Using Cosine Similarity as a loss function yielded better results than Mean Squared Error (MSE). This indicates that the "direction" or semantic orientation of the feature vectors in the PLM space is more critical for knowledge transfer than their absolute magnitude.

4. Discussion and Conclusion

This research demonstrates that the linguistic limitations of CTC models can be effectively addressed during training rather than inference. By distilling knowledge from BERT, the model learns to internalize contextual relationships that it would otherwise ignore.

While the training process is more complex—particularly with the serial nature of the CIF mechanism—the payoff is a model that is both highly accurate and exceptionally fast. The system outperformed several state-of-the-art AED models while requiring significantly fewer training epochs (20 epochs compared to 50+ for Conformer-based models). Future work may involve fine-tuning the PLM teachers during the distillation process or extending the methodology to lower-resource languages.

Summary updated

BibTeX
@inproceedings{deng2022improving,
  author = {Keqi Deng and Songjun Cao and Yike Zhang and Long Ma and Gaofeng Cheng and Ji Xu and Pengyuan Zhang},
  title = {{Improving CTC-based speech recognition via knowledge transferring from pre-trained language models}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2022},
  url = {https://openreview.net/forum?id=pQ9TjdjQix},
}
Figure