arXiv:2502.11771cs.CLcs.AI2025-02EMNLP被引 11

分析大模型算术验证失效的内在机制,发现其依赖表面数值一致性。

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

  • 通过电路分析定位错误检测子图,发现依赖表面数值对齐的注意力头。
  • 算术计算在高层进行,验证在中层完成,导致结果未完全编码即被验证。
  • 揭示小模型难以纠错的根本原因,适合关注模型可解释性的研究者。

大型语言模型(LLMs)自我验证与识别错误的能力对其鲁棒性至关重要。然而,现有研究表明,这些模型在自我修正方面存在显著困难。尽管已有研究尝试提升其自我纠正能力,但对模型内部错误检测机制的理解仍较薄弱。本文针对简单算术问题,对四个较小规模的LLM进行了机制分析。通过电路分析,我们识别出各模型中负责检测算术错误的计算子图。研究发现,所有模型均严重依赖“一致性头”——一种评估算术解中数值表面一致性的注意力头。此外,我们观察到模型的内部算术运算主要发生在高层,而验证则在中层进行,远在最终算术结果被充分编码之前。这种计算与验证之间的结构分离,可能是小型模型难以检测简单算术错误的根本原因。

原文摘要 · Abstract (English)

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.

大模型算术推理可解释性错误检测

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。