SwitchLingua: The First Large-Scale Multilingual and Multi-Ethnic Code-Switching Dataset

Peng Xie, Xingyuan Liu, Yequan Bie, Tsz Wai Chan, Yangqiu Song, Yang Wang, Hao Chen, Kani Chen · DOI

TL;DR

This paper introduces SwitchLingua, the first large-scale, multilingual, and multi-ethnic code-switching dataset, addressing the critical need for diverse data in speech technology. They also propose LinguaMaster, a novel multi-agent framework for synthesizing such data, and SAER, a new evaluation metric to better assess code-switching ASR performance.

What Problem Does This Paper Address?

Code-switching (CS), the practice of alternating between languages within a conversation, is common in multilingual societies but poses significant challenges for Automatic Speech Recognition (ASR) systems. Existing ASR models are typically trained on monolingual data and struggle with CS. While some CS datasets exist, they are often limited to bilingual pairs within homogeneous ethnic groups, lacking the diversity needed to reflect real-world linguistic and cultural richness. This gap hinders the development of robust CSASR, Text-to-Speech (TTS), and Cross-Lingual Information Retrieval (CLIR) applications. The authors aim to bridge this gap by creating a comprehensive, large-scale dataset and a framework for its generation, along with a more suitable evaluation metric.

Methods

The core of the paper's contribution lies in two main areas: data synthesis and evaluation.

LinguaMaster Framework: To address the data scarcity and diversity issues, the authors developed LinguaMaster, a multi-agent collaboration framework. This framework uses a "generate-evaluate-refine" cycle. A GenerationAgent creates initial code-switched candidates, guided by linguistic principles (syntactic constraints, semantic/conversational aspects, sociolinguistic factors) and optionally enriched by external tools (like news APIs or social media data) via a Model Context Protocol (MCP). Multiple "evaluator" agents then assess the generated text for fluency, naturalness, code-switching ratio, and socio-cultural appropriateness. A SummarizeAgent aggregates these scores, and an AcceptanceAgent either approves high-quality samples or sends suboptimal ones back to a RefinerAgent for iterative improvement. This approach ensures linguistic accuracy, diversity, and naturalness.

Semantic-Aware Error Rate (SAER): Traditional ASR metrics like Word Error Rate (WER) and Character Error Rate (CER) are insufficient for code-switching as they penalize valid semantic variations. To overcome this, the authors propose SAER. SAER combines a semantic error component (using LaBSE for sentence embeddings) with a form error component (WER/CER), weighted by a tunable parameter. This metric provides a more nuanced evaluation by considering semantic equivalence alongside surface-level accuracy.

Datasets

The paper introduces SwitchLingua, a novel, large-scale dataset for code-switching research.

  • Textual Data: 420,000 code-switching text samples across 12 languages.
  • Audio Data: Over 80 hours of audio recordings from 174 speakers representing 18 countries/regions and 63 racial/ethnic backgrounds.

SwitchLingua is designed to be significantly more diverse in terms of languages, ethnic groups, and topics compared to existing datasets like ARZEN, ASCEND, CSLR, MCE, MEDIAPARL, and SEAME. The paper also uses these existing datasets for comparison in their evaluation.

Key Insights and Ideas

  • The "ImageNet" for Code-Switching: The authors explicitly position SwitchLingua as a foundational benchmark akin to ImageNet for computer vision, highlighting the critical need for a large, diverse dataset to drive progress in CSASR.
  • Multi-Agent Synthesis is Key: The LinguaMaster framework demonstrates that a collaborative, multi-agent approach, guided by linguistic principles and external knowledge, is highly effective for generating realistic and diverse code-switching data at scale.
  • Beyond Word/Character Errors: The SAER metric is a crucial insight, recognizing that for code-switching, semantic understanding is as important, if not more so, than perfect transcription. This moves evaluation beyond simple string matching.
  • Sociolinguistic Nuance Matters: The framework's incorporation of sociolinguistic factors (gender, age, ethnicity, etc.) is vital for capturing the authentic drivers of code-switching, moving beyond purely grammatical or lexical considerations.

Key Results

  • SwitchLingua's Superiority: Human and LLM evaluations show SwitchLingua significantly outperforms existing datasets across various metrics like Linguistic Richness, Language & Racial Diversity, and Realism, with improvements of up to 28.1% over the second-best dataset.
  • ASR Model Performance Gaps: Benchmark experiments on SwitchLingua with state-of-the-art ASR models reveal substantial performance gaps, underscoring the dataset's utility in identifying areas for improvement in CSASR. For instance, Whisper-Large-v3 performed best on SAER across 8 languages.
  • SAER Effectiveness: The SAER metric provides a more sensitive evaluation, showing significant reductions in error rates compared to traditional metrics when applied to ASR outputs.
  • LinguaMaster Efficiency: The multi-agent framework is scalable, with an average cost of $0.10 per text entry and $0.26 per audio entry.

Limitations and Future Work

  • Potential for Misuse: The authors acknowledge that large-scale datasets like SwitchLingua could be misused for voice synthesis in fraudulent schemes. They propose licensing agreements to mitigate this risk.
  • ASR Model Challenges: Current ASR models still struggle with code-switching, with some exhibiting a tendency to overproduce text in a dominant language (e.g., Chinese) even when the target is different.
  • Future Directions: The paper suggests that LinguaMaster can serve as a reference for future data synthesis methodologies, and SwitchLingua will act as a benchmark to accelerate research in CSASR and natural language processing, promoting cultural inclusivity and linguistic diversity. The proposed SAER metric also opens avenues for developing more sophisticated evaluation tools.

Summary updated

BibTeX
@misc{xie2025switchlingua,
  author = {Peng Xie and Xingyuan Liu and Yequan Bie and Tsz Wai Chan and Yangqiu Song and Yang Wang and Hao Chen and Kani Chen},
  title = {{SwitchLingua: The First Large-Scale Multilingual and Multi-Ethnic Code-Switching Dataset}},
  year = {2025},
  eprint = {2506.00087},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.00087},
}
Figure