TL;DR
Large Language Models (LLMs) frequently struggle with code-switching—the common linguistic practice of mixing multiple languages within a single conversation or sentence. This paper introduces CodeMixQA, a new 64,000-sample benchmark spanning 16 language pairs, revealing an average 11% drop in LLM performance and a fundamental trade-off between a model's ability to understand code-switched text versus its ability to generate it naturally.
What Problem Does This Paper Address?
In multilingual communities around the world, communication rarely happens in a single, isolated language. Instead, people naturally blend languages—a phenomenon known as code-switching (e.g., Spanglish, Hinglish, or Korean-English).
Despite the ubiquity of this behavior in real-world digital communication, modern LLMs are predominantly trained on clean, monolingual datasets. This creates a massive gap: models are highly English-centric and often experience "alignment slips" or logical failures when confronted with mixed-language inputs. This paper systematically investigates how well current LLMs understand, reason through, and generate code-switched text.
Methods
The authors evaluate LLMs across three core capabilities: understanding, reasoning, and generation. To test these capabilities under controlled conditions, they use four distinct prompting strategies to synthetically generate code-switched text from English sources:
- Random Switching: Randomly replacing words or phrases with target language equivalents up to a 50% cap.
- Selective Switching: Prompting the model to blend languages naturally while preserving the original meaning.
- Grammar Forcing (Source/Target): A linguistically grounded approach based on Matrix Language Frame theory. It forces the output to strictly follow either the source (English) or target (non-English) grammatical structure.
To evaluate the outputs, they utilize automated linguistic metrics like the Code-Mixing Index (CMI) and Switch-Point Fraction (SPF), alongside rigorous human evaluations from native speakers scoring naturalness and semantic accuracy on a 5-point Likert scale.
Datasets
The authors introduce CodeMixQA, a novel benchmark built on top of the challenging SimpleQA Verified dataset.
- Size: 64,000 total samples.
- Diversity: Covers 16 distinct language pairs spanning multiple geographic regions (e.g., French, Spanish, Japanese, Toba Batak).
- Transliteration Support: For Indian languages (Bengali, Hindi, Marathi, Urdu), the dataset includes both native scripts and romanized transliterations (writing native words using the Latin alphabet), which closely mirrors how people actually type online.
Key Insights and Ideas
- The Generation-Understanding Trade-off: There is a stark divergence in how models process language versus how humans speak it. LLMs achieve the highest task accuracy when code-switched text is forced into an English grammatical structure (Grammar Forcing (Src)). However, human annotators rate this exact strategy as highly unnatural, heavily preferring text that preserves the native language's grammar (Grammar Forcing (Tgt)).
- English-Centric "Thinking": Even when models are fed questions written predominantly in non-English scripts, their internal reasoning traces (the "chain of thought") remain almost entirely in English. This highlights a deep-seated English bias in thinking-oriented models.
- Transliteration is More Natural, But Not Easier for LLMs: For languages like Urdu and Marathi, human annotators find transliterated text significantly more natural for informal communication. However, LLMs show no clear performance preference or advantage when understanding native scripts versus transliterated text.
Key Results
- Performance Degradation: Across nine open-weight models (including Gemma3, Llama3.3, and Qwen3) and GPT-4, introducing code-switching caused an average 11% drop in F1 score compared to clean English inputs.
- Reasoning Breakdown: Code-switching directly disrupts the logical capabilities of LLMs. Using an LLM-as-a-judge to analyze reasoning traces, the authors found a massive spike in errors, led by Unsupported Claims, Illogical Leaps, and Ambiguous Facts.
- Scale Helps, But Doesn't Cure: Larger models like GPT-4 and GPT-OSS 120B handle code-switching significantly better than smaller models, but they still suffer from the same performance degradation patterns.
Limitations and Future Work
- Model Constraints: Due to API and compute budgets, the evaluation was restricted to a specific subset of open-weight models and one proprietary model variant.
- The "Polished" Language Problem: Human annotators noted that LLM-generated code-switched text often sounds too formal, rigid, or "stylistically refined" compared to the casual, organic way humans code-switch in daily text chats.
- Future Work: The authors call for the development of truly linguistically aware multilingual models. Future architectures need training paradigms that allow them to reason natively in mixed-language environments without constantly defaulting back to English-centric pathways.
Summary updated