arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2504.13752cs.LGcs.CL
收藏

基于注意力的归因学习

Learning to Attribute with Attention

MIT(麻省理工学院)

Benjamin Cohen-Wang, Yung-Sung Chuang, Aleksander Madry

AI总结:

针对语言模型生成序列的标记归因成本高问题,提出将不同注意力头权重作为特征学习有效利用的AT2方法,性能与大量消融方法相当且效率更高,在问答场景中修剪上下文次要部分提升回答质量。

摘要:

给定语言模型生成的标记序列,我们可能需要识别影响模型生成该序列的前置标记。执行此类标记归因成本高昂;常用方法是消融前置标记并直接测量其影响。为降低标记归因成本,我们重新将注意力权重视为语言模型如何使用先前标记的启发式指标。研究发现,用注意力归因模型行为的朴素方法(如跨注意力头平均注意力权重以估计标记的影响)不可靠。为获得忠实的归因,我们提出将不同注意力头的注意力权重视为特征。这样,我们就能学习如何有效利用注意力权重进行归因(使用消融信号)。我们提出的方法Attribution with Attention(AT2)性能与涉及大量消融的方法相当,同时效率显著提高。为展示AT2的实用性,我们在问答场景中用它修剪提供上下文的次要部分,提升了回答质量。我们在https://github.com/MadryLab/AT2提供AT2的代码。

英文摘要:

Given a sequence of tokens generated by a language model, we may want to identify the preceding tokens that influence the model to generate this sequence. Performing such token attribution is expensive; a common approach is to ablate preceding tokens and directly measure their effects. To reduce the cost of token attribution, we revisit attention weights as a heuristic for how a language model uses previous tokens. Naive approaches to attribute model behavior with attention (e.g., averaging attention weights across attention heads to estimate a token's influence) have been found to be unreliable. To attain faithful attributions, we propose treating the attention weights of different attention heads as features. This way, we can learn how to effectively leverage attention weights for attribution (using signal from ablations). Our resulting method, Attribution with Attention (AT2), reliably performs on par with approaches that involve many ablations, while being significantly more efficient. To showcase the utility of AT2, we use it to prune less important parts of a provided context in a question answering setting, improving answer quality. We provide code for AT2 at https://github.com/MadryLab/AT2 .

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

↑