GEC-RAG: Improving Generative Error Correction via Retrieval-Augmented Generation for Automatic Speech Recognition Systems

Amin Robatian, Mohammad Hajipour, Mohammad Reza Peyghan, Fatemeh Rajabi, Sajjad Amini, Shahrokh Ghaemmaghami, Iman GholampourarXiv 2025

Abstract

Automatic Speech Recognition (ASR) systems have demonstrated remarkable performance across various applications. However, limited data and the unique language features of specific domains, such as low-resource languages, significantly degrade their performance and lead to higher Word Error Rates (WER). In this study, we propose Generative Error Correction via Retrieval-Augmented Generation (GEC-RAG), a novel approach designed to improve ASR accuracy for low-resource domains, like Persian. Our approach treats the ASR system as a black-box and proposes a Retrieval-Augmented Generation (RAG) approach within the In-Context Learning (ICL) scheme to enhance the quality of ASR predictions. By constructing a knowledge base that pairs ASR predictions with their corresponding ground truths, GEC-RAG retrieves lexically similar examples using the Term Frequency-Inverse Document Frequency (TF-IDF) measure. This process provides relevant error patterns to the Generative Large Language Model (LLM), enabling targeted corrections. Our results demonstrate that this strategy significantly reduces WER in Persian, highlighting its potential for domain adaptation without requiring direct model modification.

Introduction

Despite the success of end-to-end ASR models like Whisper, performance often falters when encountering low-resource languages or specialized technical domains. These systems frequently struggle with homophones, phonetic similarities, and domain-specific jargon, resulting in elevated Word Error Rates (WER). Traditional methods for addressing these errors involve retraining the model or implementing complex decoding-time fusion techniques. However, many modern ASR services are provided as "black-box" APIs, making internal modifications impossible.

This paper introduces GEC-RAG, a post-processing framework that treats ASR output as noisy text requiring sophisticated correction. By leveraging Retrieval-Augmented Generation, the system provides a Large Language Model (LLM) with contextually relevant examples of past errors and their correct transcriptions, effectively creating a "spell-check" mechanism informed by the specific failure modes of the underlying ASR system.

Methodology

The GEC-RAG framework operates entirely outside the core ASR system, allowing it to be applied to any black-box model. The pipeline consists of four main stages: transcription, knowledge base construction, retrieval, and generation.

The GEC-RAG architecture, illustrating the flow from voice input to error-corrected text via retrieval-augmented generation.

Knowledge Base and Retrieval

A repository of error patterns is built by pairing ASR transcriptions from a training set with their known ground-truth labels. When a new transcription (the query) is generated, the system retrieves the top $k$ most lexically similar examples.

Crucially, the authors utilize TF-IDF and cosine similarity for retrieval rather than semantic dense vector embeddings. This choice is driven by the nature of ASR errors, which are typically phonetic or orthographic (words that sound or look similar) rather than semantic. TF-IDF excels at identifying these surface-level lexical overlaps, providing the LLM with examples of how the ASR system specifically misinterprets similar-sounding strings.

Generative Correction

The query and the retrieved examples are fed into GPT-4o using an In-Context Learning (ICL) prompt. These retrieved examples serve as "shots" that demonstrate the system's error patterns to the LLM (e.g., "When the ASR says X, it usually means Y"). The model then generates a final, corrected transcription based on these linguistic clues.

Experimental Results

The framework was evaluated using the CommonVoice-v19 dataset for Persian. A critical preliminary step involved language-specific normalization (using the Hazm library), which addressed unique Unicode characters and spacing issues. This normalization alone reduced the baseline test WER from 86.93% to 39.09%.

Comparison of Word Error Rates (WER) across baseline ASR, Vanilla LLM correction, and GEC-RAG for 1-best and 5-best hypotheses.

As shown in the performance metrics, GEC-RAG provides a substantial improvement over both the ASR baseline and standard "Vanilla" LLM correction. For the 1-best hypothesis, GEC-RAG reduced the test WER to 24.29%, outperforming the Vanilla LLM's 32.04%. The system's performance further improved when utilizing the 5-best hypotheses, reaching a WER of 21.47%. This suggests that providing the LLM with multiple candidates allows it to better navigate the ASR model's uncertainty.

Furthermore, the study explored the impact of knowledge base scale. By expanding the retrieval pool by a factor of ten, the authors achieved a transformative reduction in WER to 6.84% for the 1-best hypothesis—an 82% reduction compared to the normalized baseline. This indicates that for ASR correction, the volume of available error patterns in the retrieval bank is a primary driver of accuracy.

Conclusion

GEC-RAG offers a powerful, non-intrusive solution for enhancing ASR performance in low-resource and domain-specific contexts. By combining lexical retrieval with the reasoning capabilities of LLMs, the framework significantly reduces transcription errors without the need for expensive model retraining. Future research will investigate the framework's applicability to other low-resource languages and its performance in highly specialized domains such as medicine or law.

Summary updated

BibTeX
@misc{robatian2025gec,
  author = {Amin Robatian and Mohammad Hajipour and Mohammad Reza Peyghan and Fatemeh Rajabi and Sajjad Amini and Shahrokh Ghaemmaghami and Iman Gholampour},
  title = {{GEC-RAG: Improving Generative Error Correction via Retrieval-Augmented Generation for Automatic Speech Recognition Systems}},
  year = {2025},
  eprint = {2501.10734},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2501.10734},
}
Figure