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

理解并修复大语言模型中的组合推理

Understanding and Patching Compositional Reasoning in LLMs

School of Computer Science and Technology, University of Science and Technology of China(中国科学技术大学计算机科学与技术学院);Department of Computer Science, City University of Hong Kong(香港城市大学计算机科学系);City University of Hong Kong Shenzhen Research Institute(香港城市大学深圳研究院);School of Computer Science and Engineering, Nanyang Technological University(南洋理工大学计算机科学与工程学院)

Zhaoyi Li, Gangwei Jiang, Hong Xie, Linqi Song, Defu Lian, Ying Wei

AI总结:

本文揭示大语言模型组合推理失败主要源于隐式推理结果生成或利用不当,定位中间层多头自注意力模块为关键,并提出轻量级方法CREME通过编辑这些模块修复推理错误。

摘要:

大语言模型(LLMs)标志着一次革命性转变,但它们在面对组合推理任务时仍然表现不佳。我们的研究致力于揭示大语言模型组合推理失败的根本原因,发现其中大多数源于隐式推理结果的生成或利用不当。受实证发现的启发,我们借助 Logit Lens 和干预实验来剖析大语言模型的内部隐藏状态。这一深入分析揭示,隐式推理结果确实出现在中间层,并在塑造最终显式推理结果中发挥因果作用。我们的探索进一步定位了这些层中的多头自注意力(MHSA)模块,它们是准确生成和利用隐式推理结果的关键所在。基于上述发现,我们开发了 CREME,一种通过编辑所定位的 MHSA 模块来修复组合推理错误的轻量级方法。我们的实证证据证明了 CREME 的有效性,为自主且持续地增强语言模型的组合推理能力铺平了道路。

英文摘要:

LLMs have marked a revolutonary shift, yet they falter when faced with compositional reasoning tasks. Our research embarks on a quest to uncover the root causes of compositional reasoning failures of LLMs, uncovering that most of them stem from the improperly generated or leveraged implicit reasoning results. Inspired by our empirical findings, we resort to Logit Lens and an intervention experiment to dissect the inner hidden states of LLMs. This deep dive reveals that implicit reasoning results indeed surface within middle layers and play a causative role in shaping the final explicit reasoning results. Our exploration further locates multi-head self-attention (MHSA) modules within these layers, which emerge as the linchpins in accurate generation and leveraing of implicit reasoning results. Grounded on the above findings, we develop CREME, a lightweight method to patch errors in compositional reasoning via editing the located MHSA modules. Our empirical evidence stands testament to CREME's effectiveness, paving the way for autonomously and continuously enhancing compositional reasoning capabilities in language models.

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

↑