arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2409.15820cs.LGcs.CL
收藏

监督微调通过交替注意力头激活模式实现快速任务适应

Supervised Fine-Tuning Achieve Rapid Task Adaption Via Alternating Attention Head Activation Patterns

Beijing Academy of Artificial Intelligence(北京人工智能研究院)

Yang Zhao, Li Du, Xiao Ding, Kai Xiong, Ting Liu, Bing Qin

AI总结:

本文通过基于梯度的注意力模式分析揭示SFT中LLMs选择性激活任务特定注意力头、复杂任务模式由基础模式组合而成且少量参数变化即可显著影响激活模式,并据此实验提升SFT效率与效果。

摘要:

大语言模型(LLMs)在复杂任务上的表现仍不尽如人意。一个关键问题在于,当前LLMs以数据驱动的方式学习,而关于这些复杂任务的指令既稀缺又难以收集或构建。相反,一个显著现象是,LLMs在预训练阶段已获得充分先验知识的较简单任务上能够相当快速地学习。因此,若能阐明这种快速泛化的前提条件与机制,就能提升LLMs学习复杂任务的效率和效果。为此,本文采用一种基于梯度的方法,从注意力模式的角度剖析监督微调(SFT)过程如何使LLMs适应下游任务。我们发现:(1)LLMs在SFT过程中选择性地激活任务特定的注意力头;(2)复杂任务的激活模式是基础任务模式的组合;(3)在少量样本上进行SFT后,少数参数的变化就能显著影响激活模式。基于这些见解,我们开展了实验,以切实提升SFT的效率和效果。

英文摘要:

LLMs' performance on complex tasks is still unsatisfactory. A key issue is that presently LLMs learn in a data-driven schema, while the instructions about these complex tasks are both scarce and hard to collect or construct. On the contrary, a prominent phenomenon is that LLMs can learn rather fast on simpler tasks with adequate prior knowledge captured during pretraining stage. Thus, if the prerequisite and mechanism of such rapid generalization could be elucidated, it could enhance the efficiency and effectiveness of the LLM's ability to learn complex tasks. Thus, in this paper, we employ a gradient-based method, to dissect the process that the SFT process adapts LLMs to downstream tasks via the perspective of attention patterns. We find that: (1) LLMs selectively activate task-specific attention heads during SFT; (2) activation patterns for complex tasks are combinations of basic task patterns; and (3) changes in a few parameters can significantly impact activation patterns after SFT on a small number of samples.Based on these insights, experiments are conducted to actually enhance the efficiency and effectiveness of SFT.

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

↑