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

信息流路径:大规模自动解释语言模型

Information Flow Routes: Automatically Interpreting Language Models at Scale

Universitat Politècnica de Catalunya(加泰罗尼亚理工大学);FAIR at Meta AI(Meta AI FAIR研究院)

Javier Ferrando, Elena Voita

AI总结:

该研究提出一种基于归因的自顶向下方法,仅需一次前向传播即可自动构建语言模型的信息流路径图,无需人工设计模板,在Llama 2上验证了注意力头功能、词性处理规律及组件领域专用性。

摘要:

信息通过模型中实现的机制,沿网络内部的路径流动。这些路径可表示为图,其中节点对应词元表征,边对应网络内部的运算。我们以自顶向下的方式自动构建这些图,针对每个预测仅保留最重要的节点和边。与现有依赖激活修补的工作流程不同,我们通过归因方法实现这一点:这使得我们仅需一次前向传播,就能高效发现已有的电路。此外,我们方法的适用范围远超出修补范畴:我们不需要人工精心设计预测模板,并且可以为任意预测提取信息流路径(而不仅限于允许模板内的预测)。因此,我们可以从整体层面、针对特定预测类型或不同领域来探讨模型行为。我们在Llama 2上开展实验,结果表明部分注意力头的作用总体上很重要,例如前序词元头和子词合并头。其次,我们发现Llama 2在处理相同词性的词元时,行为存在相似性。最后,我们证明部分模型组件可以专门针对编码或多语言文本等领域发挥作用。

英文摘要:

Information flows by routes inside the network via mechanisms implemented in the model. These routes can be represented as graphs where nodes correspond to token representations and edges to operations inside the network. We automatically build these graphs in a top-down manner, for each prediction leaving only the most important nodes and edges. In contrast to the existing workflows relying on activation patching, we do this through attribution: this allows us to efficiently uncover existing circuits with just a single forward pass. Additionally, the applicability of our method is far beyond patching: we do not need a human to carefully design prediction templates, and we can extract information flow routes for any prediction (not just the ones among the allowed templates). As a result, we can talk about model behavior in general, for specific types of predictions, or different domains. We experiment with Llama 2 and show that the role of some attention heads is overall important, e.g. previous token heads and subword merging heads. Next, we find similarities in Llama 2 behavior when handling tokens of the same part of speech. Finally, we show that some model components can be specialized on domains such as coding or multilingual texts.

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

↑