Abstract
Code-switching (CS) refers to the switching of languages within a speech signal and results in language confusion for automatic speech recognition (ASR). To address language confusion, we propose a language alignment loss (LAL) that aligns acoustic features to pseudo-language labels learned from the ASR decoder during ASR training. This approach enables frame-level language identification without the need for frame-level language annotations. To further tackle the complex token alternatives for language modeling in bilingual scenarios, we propose to employ large language models via a generative error correction method. A linguistic hint, derived from LAL outputs and decoded hypotheses, is introduced to guide the prompting and enhance the LLM-based generative error correction for CS-ASR. The proposed methods are evaluated on the SEAME dataset and data from the ASRU 2019 Mandarin-English code-switching speech recognition challenge. The incorporation of the proposed language alignment loss improves CS-ASR performance for both hybrid CTC/attention and Whisper models on both datasets, with only a negligible increase in the number of parameters. This work also highlights the efficacy of language alignment loss in balancing primary-language-dominant bilingual data during training, with an 8.6% relative improvement on the ASRU dataset compared to the baseline model. Performance evaluation using large language models reveals the advantage of the linguistic hint by achieving 14.1% and 5.5% relative improvement on test sets of the ASRU and SEAME datasets, respectively.
Introduction
Automatic Speech Recognition (ASR) systems often struggle with code-switching (CS), where speakers alternate between multiple languages in a single utterance. This phenomenon leads to "language confusion," where the model misidentifies phonetically similar words from different languages. A significant hurdle in developing robust CS-ASR is the lack of frame-level language annotations, which are expensive and time-consuming to produce manually. Furthermore, many bilingual datasets are imbalanced, dominated by a "matrix language," causing models to underperform on the secondary "embedded" language.
This paper introduces a novel framework to address these challenges through two primary innovations: a Language Alignment Loss (LAL) for acoustic-level language identification and a linguistic hint mechanism to guide Large Language Model (LLM) based error correction.
Language Alignment Loss (LAL)
The core of the proposed acoustic enhancement is the Language Alignment Loss (LAL). Instead of relying on manual timestamps, the method utilizes the cross-attention mechanism inherent in Transformer-based decoders. By analyzing which acoustic frames the decoder attends to when generating a specific token (whose language is known from the transcript), the system generates "pseudo-language labels" for every frame.
These pseudo-labels are used to train a lightweight language classifier jointly with the ASR task. This creates a mutual optimization loop: as the ASR model improves, its cross-attention becomes more precise, leading to better pseudo-labels and a more accurate language identification (LID) branch. To combat the matrix language bias, the authors also introduced a Weighted LAL, which assigns higher importance to the minority language during training.
LLM Generative Error Correction with Linguistic Hints
Beyond acoustic improvements, the researchers leverage the reasoning capabilities of Large Language Models (LLMs) for post-processing. While LLMs can correct ASR errors, they are often prone to hallucinations or choosing the wrong language path when presented with noisy N-best hypotheses.
To mitigate this, the authors introduce a "linguistic hint" derived from the LAL output. This hint (e.g., identifying the sentence as "code-switched" or "English-only") is incorporated into the prompt to guide the LLM's generative process.
Experimental Evaluation
The methods were tested on two prominent Mandarin-English benchmarks:
- ASRU 2019: A Mandarin-heavy dataset (89% tokens) with Mainland Chinese accents.
- SEAME: A more balanced dataset featuring South-East Asian accents (Singapore/Malaysia) with frequent switching.
Key Results
- Acoustic Performance: Adding LAL to a standard hybrid CTC/Attention model reduced the Mixed Error Rate (MER) on the ASRU dataset from 12.8% to 11.9% (a 7.03% relative gain).
- LLM Impact: The use of linguistic hints provided a substantial 14.1% relative improvement on the ASRU test set and a 5.5% improvement on the more challenging SEAME dataset.
- Model Versatility: The LAL method proved effective not only on custom architectures but also when fine-tuning OpenAI’s Whisper models, demonstrating its broad applicability.
Discussion and Conclusion
The research highlights that LAL is a computationally "cheap" yet effective way to add language awareness to ASR models, adding only a single linear layer. However, challenges remain, particularly regarding accents and colloquialisms. In the SEAME dataset, the auditory similarity between English and Mandarin in specific accents makes frame-level identification difficult. Additionally, LLMs trained on formal text sometimes struggle with spontaneous colloquial interjections like "lah" or "lor."
Future work suggests integrating LAL directly into the pre-training phase of multi-modal Speech LLMs to establish a foundation of language awareness. By aligning speech features to languages without manual labels, this approach paves the way for more scalable and accurate multilingual speech recognition systems.
Summary updated