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

Back Attention:理解并增强大型语言模型中的多跳推理

Back Attention: Understanding and Enhancing Multi-Hop Reasoning in Large Language Models

University of Manchester(曼彻斯特大学);Technion - IIT(以色列理工学院)

Zeping Yu, Yonatan Belinkov, Sophia Ananiadou

AI总结:

该研究提出 logit flow 分析 LLM 潜在多跳推理的阶段与失败原因,并设计 back attention 机制让低层利用高层隐藏状态,显著提升多个模型和数据集的推理准确率。

摘要:

我们研究大型语言模型如何在诸如“Wolfgang Amadeus Mozart's mother's spouse is”之类的提示中执行潜在多跳推理。为分析这一过程,我们提出 logit flow,这是一种可解释性方法,追踪 logits 如何跨层和跨位置传播至最终预测。利用 logit flow,我们识别出单跳知识预测中的四个不同阶段:(A)实体主体丰富,(B)实体属性提取,(C)关系主体丰富,以及(D)关系属性提取。将该分析扩展到多跳推理后,我们发现失败往往源于关系属性提取阶段,在该阶段相互冲突的 logits 会降低预测准确率。为解决此问题,我们提出 back attention,这是一种新颖机制,使较低层能够在注意力计算期间利用来自不同位置的较高层隐藏状态。借助 back attention,一个 1 层 transformer 达到了 2 层 transformer 的性能。将其应用于四个 LLM 时,back attention 提升了五个推理数据集上的准确率,证明了其在增强潜在多跳推理能力方面的有效性。

英文摘要:

We investigate how large language models perform latent multi-hop reasoning in prompts like "Wolfgang Amadeus Mozart's mother's spouse is". To analyze this process, we introduce logit flow, an interpretability method that traces how logits propagate across layers and positions toward the final prediction. Using logit flow, we identify four distinct stages in single-hop knowledge prediction: (A) entity subject enrichment, (B) entity attribute extraction, (C) relation subject enrichment, and (D) relation attribute extraction. Extending this analysis to multi-hop reasoning, we find that failures often stem from the relation attribute extraction stage, where conflicting logits reduce prediction accuracy. To address this, we propose back attention, a novel mechanism that enables lower layers to leverage higher-layer hidden states from different positions during attention computation. With back attention, a 1-layer transformer achieves the performance of a 2-layer transformer. Applied to four LLMs, back attention improves accuracy on five reasoning datasets, demonstrating its effectiveness in enhancing latent multi-hop reasoning ability.

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

↑