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, Xiangyang Li, Edward Lin, Tie-Yan Liu

Introduction

While Automatic Speech Recognition (ASR) technology has advanced significantly, models still make mistakes—specifically insertions, deletions, and substitutions. To fix these, researchers often use "error correction" models as a post-processing step to refine the output sentences and achieve a lower word error rate (WER).

The gold standard has been autoregressive (AR) models (like the standard Transformer), which generate corrections one word at a time. However, these are painfully slow; in some cases, the correction process takes longer than the original speech recognition, making them unusable for real-time applications like voice assistants.

Existing non-autoregressive (NAR) models, which generate all words in parallel, are much faster but typically suffer from poor accuracy in ASR tasks. They struggle to handle the specific "monotonic" nature of ASR errors—where the source and target sentences are mostly aligned but differ by a few specific edits. To address this, researchers introduce FastCorrect, a novel NAR error correction model designed to refine ASR outputs at lightning speed. By leveraging a unique "edit alignment" strategy to guide parallel token generation, it achieves a 6-9x inference speedup over traditional models while maintaining high accuracy.

Methodology: Bridging Speed and Accuracy

FastCorrect bridges the gap between NAR speed and AR accuracy using three primary innovations:

1. Edit Alignment

ASR errors are local and monotonic. FastCorrect exploits this by using edit distance, which is a perfect mathematical fit for monotonic alignment. During training, the model calculates the edit distance between the noisy ASR output (source) and the ground truth (target). It extracts an "operation path" that identifies exactly which source tokens should be deleted (length 0), kept/substituted (length 1), or expanded via insertion (length $\ge$ 2).

To handle cases where multiple edit paths are possible, the authors use an n-gram frequency table to select the most "natural-sounding" alignment. This tie-breaking mechanism provides a much cleaner training signal for the model.

Illustration of the edit alignment process, showing how source tokens are mapped to target tokens using edit distance and n-gram frequencies.

2. Granular Length Prediction

Unlike standard NAR models that predict the total length of the target sentence, FastCorrect uses a CNN-based Length Predictor to predict the number of target tokens corresponding to each individual source token. By predicting length at the token level rather than the sentence level, the model effectively "re-aligns" the sequence before it even hits the decoder. This removes the need for the iterative refinement steps that slow down other NAR models and allows the model to precisely "reshape" the source sequence into the target sequence for parallel decoding.

The FastCorrect architecture, featuring a Transformer encoder, a per-token length predictor, and a decoder that processes adjusted tokens in parallel.

3. Homophone-based Pre-training

Because high-quality ASR error data is scarce, the authors created a massive pseudo-dataset (400M sentences). They injected noise by randomly deleting, inserting, or substituting words—specifically using a homophone dictionary for substitutions to mimic real-world ASR "sounds-like" errors.

Datasets and Evaluation

The model was evaluated on two major benchmarks:

  • AISHELL-1: A popular open-source Mandarin speech corpus (178 hours).
  • Internal Industrial Dataset: A massive, 75,000-hour Mandarin dataset used to test the model's scalability in real-world production environments.
  • Pseudo-Data: 400 million crawled sentences used for large-scale pre-training.

Key Results

  • Massive Speedup: FastCorrect is 6.5x to 8.9x faster than AR models on a CPU, reducing latency from ~531ms to ~82ms per sentence on the AISHELL-1 test set.
  • High Accuracy: On AISHELL-1, it achieved a 13.87% WER reduction, coming very close to the AR model's 15.53% reduction (an 8-14% WER reduction overall across datasets).
  • Outperforming Baselines: It significantly outperformed other popular NAR frameworks like Levenshtein Transformer (LevT) and FELIX, which actually increased the error rate in some ASR scenarios.

Limitations and Future Work

While FastCorrect is highly effective for single-sentence correction, the authors note a few areas for growth:

  • N-best Candidates: Currently, the model only looks at the top ASR output. Future versions could potentially leverage the "N-best" list of candidates from the ASR model to further improve accuracy.
  • Generalization: The paper focuses heavily on Mandarin. While the edit alignment principle is language-agnostic, the homophone-based pre-training strategy would need to be adapted for languages with different phonetic structures (like English).
  • Task Expansion: The authors suggest that the design principle of "detect then correct" using edit alignment could be beneficial for general text editing tasks beyond ASR.

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 Xiangyang Li and Edward 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