arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.04156cs.LG
收藏

GPT-2 如何预测缩写?通过机制可解释性提取并理解一个回路

How does GPT-2 Predict Acronyms? Extracting and Understanding a Circuit via Mechanistic Interpretability

Lucentia Research, Department of Software and Computing Systems, University of Alicante(阿利坎特大学软件与计算系统系卢森蒂亚研究所)

Jorge García-Carrasco, Alejandro Maté, Juan Trujillo

AI总结:

本文利用机制可解释性分析 GPT-2 Small 的三字母缩写预测,首次识别并解释由 8 个注意力头组成、负责连续多 token 预测的回路。

摘要:

基于 Transformer 的语言模型因其参数量庞大且内部交互复杂而被视为黑箱,这是一个严重的安全隐患。机制可解释性(Mechanistic Interpretability,MI)旨在依据人类可理解的组件对神经网络行为进行逆向工程。在本工作中,我们聚焦于理解 GPT-2 Small 如何执行预测三字母缩写的任务。迄今为止,MI 领域的以往工作都集中于预测单个 token 的任务。据我们所知,这是首个尝试从机制层面理解涉及预测多个连续 token 的行为的工作。我们发现,该预测由一个包含 8 个注意力头(约占总注意力头数的 5%)的回路执行,并根据其作用将这些注意力头分为三组。我们还证明,这些注意力头集中了缩写预测功能。此外,我们从机制上解释了该回路中最相关的注意力头,并发现它们使用通过因果掩码机制传播的位置信息。我们期望本工作能为理解涉及多 token 预测的更复杂行为奠定基础。

英文摘要:

Transformer-based language models are treated as black-boxes because of their large number of parameters and complex internal interactions, which is a serious safety concern. Mechanistic Interpretability (MI) intends to reverse-engineer neural network behaviors in terms of human-understandable components. In this work, we focus on understanding how GPT-2 Small performs the task of predicting three-letter acronyms. Previous works in the MI field have focused so far on tasks that predict a single token. To the best of our knowledge, this is the first work that tries to mechanistically understand a behavior involving the prediction of multiple consecutive tokens. We discover that the prediction is performed by a circuit composed of 8 attention heads (~5% of the total heads) which we classified in three groups according to their role. We also demonstrate that these heads concentrate the acronym prediction functionality. In addition, we mechanistically interpret the most relevant heads of the circuit and find out that they use positional information which is propagated via the causal mask mechanism. We expect this work to lay the foundation for understanding more complex behaviors involving multiple-token predictions.

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

↑