arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2511.07498cs.CLcs.AI
收藏

聚焦语言:揭示并利用多语言大语言模型中的语言注意力头

Focusing on Language: Revealing and Exploiting Language Attention Heads in Multilingual Large Language Models

Xin Liu, Qiyang Song, Qihang Zhou, Haichao Du, Shaowen Xu, Wenbo Jiang, Weijuan Zhang, Xiaoqi Jia

AI总结:

本文提出LAHIS方法,通过分析多语言大语言模型中的注意力头,揭示语言特定与通用头的作用,并通过轻量级适应提升多语言性能。

摘要:

大型语言模型(LLMs)越来越多地支持多语言理解和生成。与此同时,对内部机制的解释性研究也逐渐兴起,为提升多语言性能提供了洞察。尽管多头自注意力(MHA)在许多领域已被证明至关重要,但其在多语言能力中的作用仍被低估。在本工作中,我们研究了MHA在支持LLMs多语言处理中的贡献。我们提出了语言注意力头重要性评分(LAHIS),一种有效且高效的 方法,通过单次前向和反向传递通过LLM来识别与多语言能力相关的注意力头重要性。将LAHIS应用于Aya-23-8B、Llama-3.2-3B和Mistral-7B-v0.1,我们揭示了既存在语言特定又存在语言通用的注意力头。语言特定的注意力头能够实现跨语言注意力转移,引导模型朝着目标语言上下文发展,并缓解非目标语言生成问题,从而解决多语言LLM中的挑战。我们还介绍了一种轻量级的适应方法,该方法学习一个软头掩码来调节语言头的注意力输出,仅需20个可调参数即可提高XQuAD的准确性。总体而言,我们的工作从MHA的角度增强了LLM的可解释性和多语言能力。

英文摘要:

Large language models (LLMs) increasingly support multilingual understanding and generation. Meanwhile, efforts to interpret their internal mechanisms have emerged, offering insights to enhance multilingual performance. While multi-head self-attention (MHA) has proven critical in many areas, its role in multilingual capabilities remains underexplored. In this work, we study the contribution of MHA in supporting multilingual processing in LLMs. We propose Language Attention Head Importance Scores (LAHIS), an effective and efficient method that identifies attention head importance for multilingual capabilities via a single forward and backward pass through the LLM. Applying LAHIS to Aya-23-8B, Llama-3.2-3B, and Mistral-7B-v0.1, we reveal the existence of both language-specific and language-general heads. Language-specific heads enable cross-lingual attention transfer to guide the model toward target language contexts and mitigate off-target language generation issue, contributing to addressing challenges in multilingual LLMs. We also introduce a lightweight adaptation that learns a soft head mask to modulate attention outputs over language heads, requiring only 20 tunable parameters to improve XQuAD accuracy. Overall, our work enhances both the interpretability and multilingual capabilities of LLMs from the perspective of MHA.

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

↑