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

验证差距:语言模型如何计算算术却无法验证的机制分析

The Validation Gap: A Mechanistic Analysis of How Language Models Compute Arithmetic but Fail to Validate It

DISI, University of Trento(特伦托大学DISI中心);MaiNLP, Center for Information and Language Processing, LMU Munich(慕尼黑大学信息与语言处理中心);Munich Center for Machine Learning (MCML), Munich, Germany(慕尼黑机器学习中心);Free University of Bozen-Bolzano, Italy(博兹纳自由大学)

Leonardo Bertolazzi, Philipp Mondorf, Barbara Plank, Raffaella Bernardi

AI总结:

本文通过电路分析揭示小型语言模型在算术计算与验证之间存在结构分离,其依赖一致性头导致难以检测简单算术错误。

摘要:

大型语言模型(LLMs)验证其输出并识别潜在错误的能力对于确保鲁棒性和可靠性至关重要。然而,当前研究表明,LLMs在自我纠正方面存在困难,在检测错误时面临重大挑战。尽管已有研究探索了增强LLMs自我纠正的方法,但相对较少关注理解模型内部错误检测的机制。在本文中,我们对LLMs中的错误检测进行了机制分析,重点关注简单的算术问题。通过电路分析,我们识别出四个较小规模LLMs中负责检测算术错误的计算子图。我们的发现表明,所有模型都严重依赖一致性头(consistency heads)——即评估算术解中数值表面一致性的注意力头。此外,我们观察到模型的内部算术计算主要发生在较高层,而验证发生在中间层,在最终算术结果完全编码之前。这种算术计算与验证之间的结构分离似乎解释了为何较小规模的LLMs难以检测即使是简单的算术错误。

英文摘要:

The ability of large language models (LLMs) to validate their output and identify potential errors is crucial for ensuring robustness and reliability. However, current research indicates that LLMs struggle with self-correction, encountering significant challenges in detecting errors. While studies have explored methods to enhance self-correction in LLMs, relatively little attention has been given to understanding the models' internal mechanisms underlying error detection. In this paper, we present a mechanistic analysis of error detection in LLMs, focusing on simple arithmetic problems. Through circuit analysis, we identify the computational subgraphs responsible for detecting arithmetic errors across four smaller-sized LLMs. Our findings reveal that all models heavily rely on $\textit{consistency heads}$--attention heads that assess surface-level alignment of numerical values in arithmetic solutions. Moreover, we observe that the models' internal arithmetic computation primarily occurs in higher layers, whereas validation takes place in middle layers, before the final arithmetic results are fully encoded. This structural dissociation between arithmetic computation and validation seems to explain why smaller-sized LLMs struggle to detect even simple arithmetic errors.

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

↑