FastCorrect: Fast Error Correction with Edit Alignment for Automatic Speech Recognition

Yichong Leng, Xu Tan, Linchen Zhu, Jin Xu, Renqian Luo, Linquan Liu, Tao Qin, Xiang-Yang Li, Ed Lin, Tie-Yan Liu

Introduction

Automatic Speech Recognition (ASR) has become a cornerstone of modern human-computer interaction. However, even state-of-the-art ASR systems frequently produce errors, such as homophone substitutions (e.g., mishearing "write" as "right"). While post-processing error correction models can mitigate these issues, traditional Autoregressive (AR) models introduce significant latency, often exceeding the processing time of the ASR system itself. FastCorrect addresses this by introducing a specialized Non-Autoregressive (NAR) architecture that leverages edit alignment to achieve high-speed, accurate corrections.

The Latency Bottleneck in ASR Correction

The standard approach to ASR error correction relies on AR Transformers, which generate corrected text token-by-token. In industrial applications, this sequential generation is too slow for real-time use. While general-purpose NAR models exist, they are typically designed for Machine Translation (MT) where word order changes significantly. ASR errors are different: they are monotonic (preserving sequence order) and sparse (mostly insertions, deletions, or substitutions). FastCorrect is designed specifically to exploit these characteristics, avoiding the accuracy degradation often seen when applying general NAR models to speech tasks.

Methodology: Edit Alignment and Source Adjustment

The core innovation of FastCorrect is the use of Edit Alignment to transform the error correction task into a length-matching problem.

Edit Alignment

During training, the model computes the edit distance between the noisy source and the ground truth target. This process assigns a target length to each source token:

  • Length 0: Indicates the token should be deleted.
  • Length 1: Indicates the token is correct or requires a one-to-one substitution.
  • Length ≥ 2: Indicates that one or more tokens must be inserted after the current token.

When multiple edit paths are possible, the system uses an n-gram frequency table to select the most linguistically plausible alignment, ensuring the model learns from the most natural correction patterns.

The process of deriving edit alignment from an edit distance matrix to guide token length prediction.

Model Architecture

FastCorrect utilizes an encoder-decoder framework optimized for parallel generation. The process involves four key stages:

  1. Transformer Encoder: Processes the noisy source sequence to generate hidden representations.
  2. Length Predictor: A 1D-CNN-based module that predicts the target length for each source token based on encoder outputs.
  3. Source Adjustment: The source hidden states are adjusted according to the predicted lengths. States corresponding to length 0 are removed, while states for length ≥ 2 are duplicated. This ensures the sequence length precisely matches the intended target length.
  4. Transformer Decoder: Processes these adjusted states in a single parallel pass to produce the final corrected sentence.
The FastCorrect architecture, featuring a Transformer Encoder, a CNN-based Length Predictor, and a Transformer Decoder.

Pre-training with Homophones

A significant challenge in ASR correction is the scarcity of paired (noisy/clean) training data. To overcome this, the authors utilized 400 million pseudo-sentences. They simulated realistic ASR errors by replacing words with homophones from a phonetic dictionary. This pre-training phase allows the model to learn common substitution patterns at scale before fine-tuning on real ASR data, which proved critical for achieving high accuracy.

Key Results and Performance

FastCorrect was evaluated on the AISHELL-1 benchmark and a massive 75,000-hour internal industrial dataset. The results demonstrate that the model effectively bridges the gap between speed and accuracy:

  • Massive Speedup: FastCorrect achieves a 6–9x speedup over standard AR Transformers. On a single-core CPU (simulating typical cloud deployment), latency dropped from over 530ms to just 82ms per sentence.
  • High Accuracy: The model achieved an 8–14% Word Error Rate Reduction (WERR). This performance is nearly identical to slow AR models and significantly better than other NAR competitors like LevT, which can sometimes increase error rates in ASR contexts.

Conclusion

FastCorrect demonstrates that by tailoring NAR architectures to the specific monotonic nature of ASR errors, it is possible to achieve the accuracy of autoregressive models with a fraction of the computational cost. By treating error correction as a length-prediction task guided by edit alignment, FastCorrect makes high-quality, real-time error correction viable for large-scale industrial ASR deployments.

Summary updated

BibTeX
@inproceedings{leng2021fastcorrect,
  author = {Yichong Leng and Xu Tan and Linchen Zhu and Jin Xu and Renqian Luo and Linquan Liu and Tao Qin and Xiang-Yang Li and Ed Lin and Tie-Yan Liu},
  title = {{FastCorrect: Fast Error Correction with Edit Alignment for Automatic Speech Recognition}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=DNhPrY6n-K},
}
Figure