arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.00492cs.CLcs.AIcs.LG

从语言建模到指令跟随:理解指令微调后大语言模型的行为转变

From Language Modeling to Instruction Following: Understanding the Behavior Shift in LLMs after Instruction Tuning

University of Georgia(佐治亚大学);Tencent AI Lab(腾讯人工智能实验室)

Xuansheng Wu, Wenlin Yao, Jianshu Chen, Xiaoman Pan, Xiaoyang Wang, Ninghao Liu, Dong Yu

AI总结:

本文通过局部与全局解释方法对比预训练和指令微调后的大语言模型,揭示指令微调使模型识别指令、增强指令动词注意力并旋转前馈知识以面向用户任务,为理解和优化LLMs提供基础。

摘要:

大语言模型(LLMs)已取得显著成功,其中指令微调是使LLMs与用户意图对齐的关键步骤。本文研究指令微调如何调整预训练模型,重点关注其内在变化。具体而言,我们首先开发了多种局部和全局解释方法,包括一种基于梯度的输入-输出归因方法,以及用于解释自注意力和前馈层中模式与概念的技术。然后,通过比较从预训练模型和指令微调模型中得到的解释来研究指令微调的影响。该方法在人类可理解的层面上提供了模型转变的内部视角。我们的发现揭示了指令微调的三个重要影响:1)它使LLMs能够识别用户提示中的指令部分,并促进响应生成持续以指令为条件。2)它促使自注意力头捕获更多关于指令动词的词-词关系。3)它促使前馈网络将其预训练知识转向面向用户的任务。这些见解有助于更全面地理解指令微调,并为未来旨在解释和优化LLMs以适应各种应用的工作奠定基础。我们的代码和数据已在 https://github.com/JacksonWuxs/Interpret_Instruction_Tuning_LLMs 公开。

英文摘要:

Large Language Models (LLMs) have achieved remarkable success, where instruction tuning is the critical step in aligning LLMs with user intentions. In this work, we investigate how the instruction tuning adjusts pre-trained models with a focus on intrinsic changes. Specifically, we first develop several local and global explanation methods, including a gradient-based method for input-output attribution, and techniques for interpreting patterns and concepts in self-attention and feed-forward layers. The impact of instruction tuning is then studied by comparing the explanations derived from the pre-trained and instruction-tuned models. This approach provides an internal perspective of the model shifts on a human-comprehensible level. Our findings reveal three significant impacts of instruction tuning: 1) It empowers LLMs to recognize the instruction parts of user prompts, and promotes the response generation constantly conditioned on the instructions. 2) It encourages the self-attention heads to capture more word-word relationships about instruction verbs. 3) It encourages the feed-forward networks to rotate their pre-trained knowledge toward user-oriented tasks. These insights contribute to a more comprehensive understanding of instruction tuning and lay the groundwork for future work that aims at explaining and optimizing LLMs for various applications. Our code and data are publicly available at https://github.com/JacksonWuxs/Interpret_Instruction_Tuning_LLMs.

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

↑