Paper Reading AI Learner

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

2025-10-20 14:02:37
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 this https URL.

Abstract (translated)

大型语言模型(LLMs)常常会遇到语言混淆的问题,即在文本生成过程中意外地混杂使用不同语言。目前解决这个问题的方法要么需要重新训练模型,要么无法区分有害的混淆和可接受的语言转换(code-switching)。本文介绍了一种名为“语言混淆门”(Language Confusion Gate, LCG)的技术,这是一种轻量级、插件式的解决方案,在解码过程中过滤掉不需要的标记,而无需修改基础LLM。LCG通过调整范数的自我蒸馏训练方法来预测合适的语言家族,并仅在必要时应用屏蔽操作。 本文的方法基于以下发现:语言混淆是相对罕见的现象;正确语言中的词汇通常出现在模型输出的最前面位置;资源丰富的语言(如英语)的输出标记嵌入规范较大,这会偏向于采样这些语言。通过跨多个模型进行评估,包括Qwen3、GPT-OSS、Gemma3和Llama3.1等,LCG显著减少了语言混淆现象,有时甚至可以减少一个数量级,并且不会对任务性能产生负面影响。 代码可以在提供的链接地址获取。

URL

https://arxiv.org/abs/2510.17555

PDF

https://arxiv.org/pdf/2510.17555.pdf


Tags
3D Action Action_Localization Action_Recognition Activity Adversarial Agent Attention Autonomous Bert Boundary_Detection Caption Chat Classification CNN Compressive_Sensing Contour Contrastive_Learning Deep_Learning Denoising Detection Dialog Diffusion Drone Dynamic_Memory_Network Edge_Detection Embedding Embodied Emotion Enhancement Face Face_Detection Face_Recognition Facial_Landmark Few-Shot Gait_Recognition GAN Gaze_Estimation Gesture Gradient_Descent Handwriting Human_Parsing Image_Caption Image_Classification Image_Compression Image_Enhancement Image_Generation Image_Matting Image_Retrieval Inference Inpainting Intelligent_Chip Knowledge Knowledge_Graph Language_Model LLM Matching Medical Memory_Networks Multi_Modal Multi_Task NAS NMT Object_Detection Object_Tracking OCR Ontology Optical_Character Optical_Flow Optimization Person_Re-identification Point_Cloud Portrait_Generation Pose Pose_Estimation Prediction QA Quantitative Quantitative_Finance Quantization Re-identification Recognition Recommendation Reconstruction Regularization Reinforcement_Learning Relation Relation_Extraction Represenation Represenation_Learning Restoration Review RNN Robot Salient Scene_Classification Scene_Generation Scene_Parsing Scene_Text Segmentation Self-Supervised Semantic_Instance_Segmentation Semantic_Segmentation Semi_Global Semi_Supervised Sence_graph Sentiment Sentiment_Classification Sketch SLAM Sparse Speech Speech_Recognition Style_Transfer Summarization Super_Resolution Surveillance Survey Text_Classification Text_Generation Time_Series Tracking Transfer_Learning Transformer Unsupervised Video_Caption Video_Classification Video_Indexing Video_Prediction Video_Retrieval Visual_Relation VQA Weakly_Supervised Zero-Shot