arXivDaily arXiv每日学术速递 周一至周五更新
​通知:联邦节假日调休:哥伦布日 / 原住民日(Columbus Day / Indigenous Peoples' Day),今日(13日)无更新。
arXiv 2507.14894cs.CL

SASFT:基于稀疏自编码器的监督微调以缓解大语言模型中的意外语言混合

SASFT: Sparse Autoencoder-guided Supervised Finetuning to Mitigate Unexpected Code-Switching in LLMs

Tongyi Lab, Alibaba Group Inc(通义实验室,阿里巴巴集团)

Boyi Deng, Yu Wan, Baosong Yang, Fei Huang, Wenjie Wang, Fuli Feng

AI总结:

SASFT通过稀疏自编码器引导监督微调,有效减少大语言模型中的意外语言混合,同时保持多语言能力。

摘要:

大语言模型(LLMs)具有出色的多语言能力,但它们会遭受意外的语言混合,也称为语言混合,这涉及在模型响应中切换到意外的语言。这个问题导致阅读性差,降低了模型响应的可用性。然而,现有研究在这方面缺乏机制分析,并且效果有限。在本文中,我们首先使用稀疏自编码器对意外语言混合进行了深入分析,并发现当LLMs切换到一种语言时,该语言的特征表现出过高的预激活值。基于我们的发现,我们提出了$\textbf{S}$parse $\textbf{A}$utoencoder-guided $\textbf{S}$upervised $\textbf{F}$ine$\textbf{t}$uning(SASFT),它教导LLMs在训练期间保持特定语言特征的适当预激活值。在五个模型上跨三种语言的实验表明,与标准监督微调相比,SASFT一致地将意外语言混合减少了超过50%,在一种情况下完全消除。此外,SASFT在六个多语言基准测试中保持甚至提高了模型的性能,显示了其在解决语言混合的同时保持多语言能力的有效性。代码和数据可在https://github.com/Aatrox103/SASFT上获得。

英文摘要:

Large Language Models (LLMs) have impressive multilingual capabilities, but they suffer from unexpected code-switching, also known as language mixing, which involves switching to unexpected languages in the model response. This problem leads to poor readability and degrades the usability of model responses. However, existing work on this issue lacks a mechanistic analysis and shows limited effectiveness. In this paper, we first provide an in-depth analysis of unexpected code-switching using sparse autoencoders and find that when LLMs switch to a language, the features of that language exhibit excessive pre-activation values. Based on our findings, we propose $\textbf{S}$parse $\textbf{A}$utoencoder-guided $\textbf{S}$upervised $\textbf{F}$ine$\textbf{t}$uning (SASFT), which teaches LLMs to maintain appropriate pre-activation values of specific language features during training. Experiments on five models across three languages demonstrate that SASFT consistently reduces unexpected code-switching by more than 50\% compared to standard supervised fine-tuning, with complete elimination in one case. Moreover, SASFT maintains or even improves the models' performance on six multilingual benchmarks, showing its effectiveness in addressing code-switching while preserving multilingual capabilities. The code and data are available at https://github.com/Aatrox103/SASFT.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑