Lune

ICLR2026Top-tier venue

Language Confusion Gate: Language-Aware Decoding Through Model Self-Distillation

Collin Zhang, Fei Huang, Chenhan Yuan, Junyang Lin

Abstract

Large language models (LLMs) often experience language confusion, which is the unintended mixing of languages during text generation. Current solutions to this problem either necessitate model retraining or cannot differentiate between harmful confusion and acceptable code-switching. This paper introduces the Language Confusion Gate (LCG), a lightweight, plug-in solution that filters tokens during decoding without altering the base LLM. The LCG is trained using norm-adjusted self-distillation to predict appropriate language families and apply masking only when needed. Our method is based on the findings that language confusion is infrequent, correct-language tokens are usually among the top predictions, and output token embedding norms are larger for high-resource languages, which biases sampling. When evaluated across various models, including Qwen3, GPT-OSS, Gemma3, Llama3.1, LCG decreases language confusion significantly, often by an order of magnitude, without negatively impacting task performance. Code is available at https://github.com/collinzrj/language_confusion_gate.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • The Impact of Language Mixing on Bilingual LLM Reasoning cites Understanding and Mitigating Language Confusion in LLMs
  • Understanding and Mitigating Language Confusion in LLMs cites A Survey of Code-switching: Linguistic and Social Perspectives for Language Technologies
  • Understanding and Mitigating Language Confusion in LLMs cites The Decades Progress on Code-Switching Research in NLP: A Systematic Survey on Trends and Challenges
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on7

  1. XL-Sum: Large-Scale Multilingual Abstractive Summarization for 44 LanguagesTahmid Hasan, Abhik Bhattacharjee, Md. Saiful Islam, Kazi Samin Mubasshir et al.ACL Findings 2021 · 228 citations
  2. The Decades Progress on Code-Switching Research in NLP: A Systematic Survey on Trends and ChallengesGenta Indra Winata, Alham Fikri Aji, Zheng Xin Yong, Thamar SolorioACL Findings 2023 · 46 citations
  3. Understanding and Mitigating Language Confusion in LLMsKelly Marchisio, Wei-Yin Ko, Alexandre Berard, Théo Dehaze et al.EMNLP 2024 · 10 citations
  4. The Impact of Language Mixing on Bilingual LLM ReasoningYihao Li, Jiayi Xin, Miranda Muqing Miao, Qi Long et al.EMNLP 2025 · 8 citations
  5. A Survey of Code-switching: Linguistic and Social Perspectives for Language TechnologiesA. Seza Dogruöz, Sunayana Sitaram, Barbara E. Bullock, Almeida Jacqueline ToribioACL 2021

Related papers

  1. SASFT: Sparse Autoencoder-guided Supervised Finetuning to Mitigate Unexpected Code-Switching in LLMsBoyi Deng, Yu Wan, Baosong Yang, Fei Huang et al.ICLR 2026 · 2 citations
  2. Self-Ensemble: Mitigating Confidence Distortion for Large Language ModelsZicheng Xu, Guanchu Wang, Guangyao Zheng, Yu-Neng Chuang et al.EMNLP Findings 2025
  3. Code-Switching Curriculum Learning for Multilingual Transfer in LLMsHaneul Yoo, Cheonbok Park, Sangdoo Yun, Alice Oh et al.ACL Findings 2025 · 4 citations
  4. TLPO: Token-Level Policy Optimization for Mitigating Language Confusion in Large Language ModelsJinho Choo, JunSeung Lee, Jimyeong Kim, Yeeho Song et al.ACL 2026
  5. CodeMixBench: Evaluating Code-Mixing Capabilities of LLMs Across 18 LanguagesYilun Yang, Yekun ChaiEMNLP 2025 · 1 citation
Dusk over the sea between two cliffs drawn in fine vertical lines