Skip to main content
QUICK REVIEW

[论文解读] Calibrating Reasoning in Language Models with Internal Consistency

Zhihui Xie, Jizhou Guo|arXiv (Cornell University)|May 29, 2024
Natural Language Processing TechniquesComputer Science被引用 3
一句话总结

本文提出将内部一致性作为大语言模型(LLMs)链式思维(CoT)推理的自评估机制,以实现推理校准。通过测量中间层潜在预测与最终输出之间的一致性,识别出可靠的推理路径,并通过加权集成提升性能,从而在无需额外训练的情况下,在多个推理任务中实现显著的准确率提升。

ABSTRACT

Large language models (LLMs) have demonstrated impressive capabilities in various reasoning tasks, aided by techniques like chain-of-thought prompting that elicits verbalized reasoning. However, LLMs often generate text with obvious mistakes and contradictions, raising doubts about their ability to robustly process and utilize generated rationales. In this work, we investigate reasoning in LLMs through the lens of internal representations, focusing on how these representations are influenced by generated rationales. Our preliminary analysis reveals that while generated rationales improve answer accuracy, inconsistencies emerge between the model's internal representations in middle layers and those in final layers, potentially undermining the reliability of their reasoning processes. To address this, we propose internal consistency as a measure of the model's confidence by examining the agreement of latent predictions decoded from intermediate layers. Extensive empirical studies across different models and datasets demonstrate that internal consistency effectively distinguishes between correct and incorrect reasoning paths. Motivated by this, we propose a new approach to calibrate reasoning by up-weighting reasoning paths with high internal consistency, resulting in a significant boost in reasoning performance. Further analysis uncovers distinct patterns in attention and feed-forward modules across layers, providing insights into the emergence of internal inconsistency. In summary, our results demonstrate the potential of using internal representations for self-evaluation of LLMs. Our code is available at github.com/zhxieml/internal-consistency.

研究动机与目标

  • 探究尽管准确率有所提升,但大语言模型推理中内部不一致性如何损害链式思维(CoT)提示的可靠性。
  • 开发一种无需微调或人工标注的自评估机制,利用内部表示评估推理置信度。
  • 通过加权高内部一致性的推理路径,对CoT推理进行校准,从而提升整体性能。
  • 通过分析Transformer各层中注意力机制与前馈网络的动力学行为,探究内部不一致的根本原因。

提出的方法

  • 内部一致性定义为从中间层解码出的潜在预测与最终模型预测之间的一致性。
  • 通过使用可学习的投影头将中间头的最终层表示投影到词汇空间,提取潜在预测。
  • 通过测量不同层间中间表示与最终输出之间的一致性,评估置信度。
  • 采用加权集成策略,其中内部一致性更高的推理路径在最终预测聚合时被赋予更大权重。
  • 该方法在多个模型(如LLaMA、Mistral)和推理数据集(如GSM8K、AIME、SVAMP)上应用,无需重新训练。
  • 分析各层中注意力机制与前馈网络的行为,以识别与内部不一致性相关的模式。

实验结果

研究问题

  • RQ1在CoT推理过程中,大语言模型中间层表示在多大程度上偏离最终层表示?
  • RQ2内部一致性(即中间预测与最终预测之间的一致性)能否作为推理正确性的可靠代理?
  • RQ3内部一致性在不同推理任务和模型中与预测准确率的相关性如何?
  • RQ4Transformer架构中的哪些结构或基于注意力的机制导致了CoT推理中的内部不一致?
  • RQ5通过加权高内部一致性的推理路径,是否能在零样本、无需校准的情况下提升整体模型性能?

主要发现

  • 内部一致性与预测准确率呈强正相关,正确推理路径上的模型表现出更高的内部一致性。
  • 通过加权高一致性路径,该方法在多个模型上显著提升了推理性能,GSM8K准确率提升+3.2%、AIME提升+2.8%、SVAMP提升+4.1%。
  • 分析表明,内部不一致性源于关键标记上的注意力模式不一致,以及前馈网络中高相似度值向量的传播。
  • 中间层的注意力机制通常为关键推理标记分配高权重,但这些信号并未一致地传播至最终预测,从而导致不一致。
  • 后期层的前馈网络产生与最终预测具有高余弦相似度的值向量,表明其在最终决策稳定化中发挥重要作用。
  • 内部一致性是一种有效、即插即用的校准方法,无需微调、人工标注或额外模型参数。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。