Abstract
Code-switching automatic speech recognition (CS-ASR) presents unique challenges due to language confusion introduced by spontaneous intra-sentence switching and accent bias that blurs the phonetic boundaries. Although the constituent languages may be individually high-resource, the scarcity of annotated code-switching data further compounds these challenges. In this paper, we systematically analyze CS-ASR from both model-centric and data-centric perspectives. By comparing state-of-the-art algorithmic methods, including language-specific processing and auxiliary language-aware multi-task learning, we discuss their varying effectiveness across datasets with different linguistic characteristics. On the data side, we first investigate TTS as a data augmentation method. By varying the textual characteristics and speaker accents, we analyze the impact of language confusion and accent bias on CS-ASR. To further mitigate data scarcity and enhance textual diversity, we propose a prompting strategy by simplifying the equivalence constraint theory (SECT) to guide large language models (LLMs) in generating linguistically valid code-switching text. The proposed SECT outperforms existing methods in ASR performance and linguistic quality assessments, generating code-switching text that more closely resembles real-world code-switching text. When used to generate speech-text pairs via TTS, SECT proves effective in improving CS-ASR performance. Our analysis of both model- and data-centric methods underscores that effective CS-ASR requires strategies to be carefully aligned with the specific linguistic characteristics of the code-switching data.
Introduction
Code-switching (CS)—the practice of alternating between two or more languages within a single conversation or sentence—is a hallmark of multilingual communities worldwide. For Automatic Speech Recognition (ASR) systems, this phenomenon introduces significant complexity. CS-ASR systems must navigate language confusion, where unpredictable shifts in grammar and vocabulary disrupt standard language models, and accent bias, where non-native pronunciations blur phonetic boundaries. Furthermore, the scarcity of high-quality, annotated code-switching data remains a major bottleneck, as transcribing such audio requires specialized bilingual expertise.
This paper systematically investigates CS-ASR through two primary lenses: model-centric architectures and data-centric augmentation strategies. By evaluating state-of-the-art methods across diverse datasets, we provide a comprehensive analysis of what drives performance in these challenging multilingual environments.
Model-Centric Perspectives
Traditional ASR models often struggle to maintain accuracy when language boundaries are fluid. To address this, researchers have proposed several architectural modifications. We compare standard unified models against two main variants:
- Auxiliary Task Learning: These models incorporate additional objectives, such as frame-level Language Identification (LID) or Language Diarization (LD), to help the decoder distinguish between languages.
- Language-Specific Modules: This approach utilizes dedicated encoders or sub-modules for each language (e.g., a Mandarin-specific and an English-specific encoder) to capture language-unique phonetic and linguistic features more effectively.
Our findings indicate that while these architectural tweaks offer significant gains on datasets with simpler, more predictable switching patterns (like ASRU 2019), their effectiveness diminishes on highly fluid datasets like SEAME, where the base language changes frequently.
Data-Centric Perspectives and the SECT Strategy
Given the data scarcity in CS-ASR, Text-to-Speech (TTS) has emerged as a promising tool for data augmentation. However, the quality of synthetic data depends heavily on the realism of the underlying text. We propose SECT (Simplified Equivalence Constraint Theory), a novel prompting strategy for Large Language Models (LLMs) designed to generate linguistically valid code-switched text.
SECT guides LLMs by enforcing three core linguistic constraints: preserving the original meaning, limiting the number of intra-sentence switches to reflect natural human habits, and maintaining the grammatical integrity of both languages involved. To convert this high-quality text into training audio, we utilize an LLM-based TTS framework like CosyVoice2. This pipeline allows for the generation of diverse speech-text pairs that capture both linguistic variety and varied speaker accents.
Experimental Insights and Results
Our analysis reveals several critical insights into the nature of CS-ASR:
- Grammar vs. Accent: A key finding is that textual mismatch (training on simple grammar but testing on complex switching) is far more detrimental to ASR performance than accent mismatch. Modeling the logic of how languages are mixed is more important than perfect acoustic modeling of non-native accents.
- The Whisper Translation Quirk: We observed that models like Whisper-small exhibit a strong bias toward translating Mandarin into English. While this can inadvertently lower error rates on Mandarin-centric datasets, it leads to catastrophic failure (over 60% error) on datasets where English is the primary base language.
- The Value of Synthetic Diversity: Simply synthesizing audio from existing training transcripts can lead to overfitting. To see real gains, it is essential to generate novel text using strategies like SECT to introduce linguistic diversity.
The proposed SECT strategy significantly outperforms baseline prompting methods. When used for TTS augmentation, SECT-generated data helped Whisper-small achieve a Word Error Rate (WER) of 8.3% on the ASRU test set, surpassing the 8.8% achieved by fine-tuning on real data alone. Furthermore, linguistic evaluations by GPT-4o rated SECT-generated text higher in naturalness (7.0 vs 6.8) compared to standard prompts.
Conclusion
Effective code-switching ASR requires a nuanced approach that aligns model architecture and data strategies with the specific linguistic characteristics of the target data. While model-centric improvements provide a baseline, the future of robust CS-ASR lies in sophisticated data-centric methods like SECT that can bridge the gap between synthetic data and the rich complexity of human multilingual speech.
Summary updated