NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Contextual Modeling for Document-level ASR Error Correction

Jin Jiang, Xunjian Yin, Xiaojun Wan, Wei Peng, Rongjun Li, Jingyuan Yang, Yanquan ZhouCOLING 2024

Abstract

Contextual information, including the sentences in the same document and in other documents of the dataset, plays a crucial role in improving the accuracy of document-level ASR Error Correction (AEC), while most previous works ignore this. In this paper, we propose a context-aware method that utilizes a k-Nearest Neighbors (kNN) approach to enhance the AEC model by retrieving a datastore containing contextual information. We conduct experiments on two English and two Chinese datasets, and the results demonstrate that our proposed model can effectively utilize contextual information to improve document-level AEC. Furthermore, the context information from the whole dataset provides even better results.

Introduction

Automatic Speech Recognition (ASR) systems frequently make mistakes, especially with proper nouns, technical jargon, or homophones. While ASR Error Correction (AEC) models exist to fix these "typos" in the transcript, most operate on a sentence-by-sentence basis. This is a problem because many errors are only obvious when looking at the surrounding context. For example, if an ASR system mishears a person's name in one sentence, a human (or a smart model) could correct it by looking at how that name was spelled correctly in a previous sentence. Previous attempts to include context often struggled with long-range dependencies or introduced too much "noise" into the model's attention mechanism. This paper aims to provide a more efficient and accurate way to leverage both local (document) and global (dataset) context.

Methodology

The proposed context-aware AEC model is based on the BART architecture (an encoder-decoder Transformer). The core innovation is the integration of a $k$NN-augmented attention layer.

$k$NN-Augmented Attention

The model utilizes a retrieval mechanism to augment its internal representations:

  1. The Datastore: A datastore of (key, value) pairs is constructed, where "keys" are vector representations of previous sentences and "values" are the corresponding corrected tokens.
  2. Retrieval Mechanism: During decoding, the model uses the current query to perform a $k$-nearest neighbor search in the datastore to find the most similar contextual information.
  3. Gated Integration: A "gate" hyperparameter ($g$) balances the output from the standard local attention and the retrieved $k$NN information, allowing the model to decide how much to trust the external context versus the current sentence.
Architecture of the context-aware AEC model featuring the kNN attention layer and datastore.

Context Scopes and Modes

The model can operate in different modes depending on the available context:

  • Online vs. Offline: "Online" models only look at preceding text (simulating real-time correction), while "Offline" models look at both preceding and following text.
  • Doc-context vs. Dataset-context: The model can retrieve information just from the current document or from every document in the entire dataset, which is particularly useful for domain-specific terms.
Visualization of Online vs. Offline modes and the different context scopes (current sentence, doc-context, dataset-context).

Experimental Setup

The researchers evaluated their model on four major ASR benchmarks, adapted for document-level tasks:

  • Mandarin: AISHELL-1 and HKUST.
  • English: LIBRISPEECH_CLEAN and LIBRISPEECH_OTHER.

Since no dedicated document-level AEC datasets existed, the authors used the document structures provided within these standard ASR corpora to create their own benchmarks.

Results and Discussion

The proposed model achieved state-of-the-art results across all four datasets. On AISHELL-1, the Character Error Rate (CER) was reduced from 3.528 (BART baseline) to 3.336 using the Offline dataset-context model. Similar improvements were observed in HKUST (CER from 21.36 to 20.66) and LIBRISPEECH (consistent Word Error Rate improvements).

Key Insights

  • Retrieval as a "Cheat Sheet": Instead of forcing a model to remember everything via a massive attention window, the $k$NN approach acts like a searchable index. If the model is unsure about a word, it "searches" the datastore for similar contexts to find the right answer.
  • Dataset Context Superiority: Searching the entire dataset often yielded better results than just searching the current document. This suggests that domain-specific consistency across different recordings is a powerful signal for error correction.
  • Comparison with LLMs: In a head-to-head comparison on AISHELL-1, the specialized model significantly outperformed ChatGPT, highlighting the value of specialized models with retrieval mechanisms for high-precision tasks.

Ablation Studies

Ablation studies revealed that the model performs best when the $k$NN layer is placed deeper in the decoder (specifically the 5th layer) and when retrieving approximately 16 neighbors.

Conclusion

This work demonstrates that contextual information is vital for document-level ASR error correction. By using a $k$NN-based retrieval mechanism, the model can effectively leverage both local and global context without the computational burden of extremely long attention windows. While the retrieval process adds some inference latency (5% to 55% depending on configuration), the gains in accuracy are significant. Future work will focus on optimizing retrieval speed and extending this architecture to other document-level tasks like machine translation.

Summary updated

BibTeX
@inproceedings{jiang2024contextual,
  author = {Jin Jiang and Xunjian Yin and Xiaojun Wan and Wei Peng and Rongjun Li and Jingyuan Yang and Yanquan Zhou},
  title = {{Contextual Modeling for Document-level ASR Error Correction}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2024},
  url = {https://openreview.net/forum?id=CPGsQn2YX3},
}
Figure