Calibrating Reasoning in Language Models with Internal Consistency

Zhihui Xie, Jizhou Guo, Tong Yu, Shuai Li
5/1/2024

No official code found. Best implementation: zhxieml/internal-consistency (6 stars, MIT, last commit 2025-02-07).

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.

View on arXivView PDF

Code Implementations(1)

MIT

https://arxiv.org/abs/2405.18711

60Shell, PythonDec 6, 20241 years agoMIT

Similar Papers

Cite this paper

@article{xie2024calibrating,
  title  = {Calibrating Reasoning in Language Models with Internal Consistency},
  author = {Zhihui Xie and Jizhou Guo and Tong Yu and Shuai Li},
  year   = {2024},
  eprint = {2405.18711},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2405.18711},
  url    = {https://arxiv.org/abs/2405.18711},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2405.18711.svg)](https://codeofpaper.com/paper/2405.18711)

Discussion