NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

A Theoretical Understanding of Chain-of-Thought: Coherent Reasoning and Error-Aware Demonstration

Yingqian Cui, Pengfei He, Xianfeng Tang, Qi He, Chen Luo, Jiliang Tang, Yue Xing

Abstract

Few-shot Chain-of-Thought (CoT) prompting has demonstrated strong performance in improving the reasoning capabilities of large language models (LLMs). While theoretical investigations have been conducted to understand CoT, the underlying transformer used in these studies isolates the CoT reasoning process into separated in-context learning steps (Stepwise ICL). In this work, we theoretically show that, compared to Stepwise ICL, the transformer gains better error correction ability and more accurate predictions if the reasoning from earlier steps (Coherent CoT) is integrated. Given that this coherent reasoning changes the behavior of the transformer, we further investigate the sensitivity of the transformer with Coherent CoT when the demonstration examples are corrupted at the inference stage. Our theoretical results indicate that the transformer is more sensitive to errors in intermediate reasoning steps than the final outcome. Building upon this observation, we propose an improvement on CoT by incorporating both correct and incorrect reasoning paths in the demonstration. Our experiments validate the effectiveness of the proposed approach.

Introduction

Chain-of-Thought (CoT) prompting has revolutionized the use of Large Language Models (LLMs) for complex reasoning tasks. However, theoretical understanding has often lagged behind empirical success. Previous studies frequently simplified CoT into "Stepwise In-Context Learning" (ICL), treating each reasoning step as an isolated event. This paper addresses this gap by exploring "Coherent CoT," where models process the entire context window at once, allowing for a more integrated reasoning process.

Theoretical Insights: Coherence and Sensitivity

The authors utilize a two-layer noisy regression task ($x \to z \to y$) to model reasoning, where $x$ is the input, $z$ an intermediate step, and $y$ the final answer.

The Advantage of Coherence

The study theoretically demonstrates that Coherent CoT outperforms Stepwise ICL because the model can utilize the original input $x$ to "self-correct" errors made during the intermediate step $z$. In a stepwise model, any mistake in $z$ is propagated without the possibility of recovery from the original context.

Sensitivity to Intermediate Steps

Mathematical analysis reveals that LLMs are significantly more sensitive to errors in intermediate reasoning steps than to noise in final labels. A logical flaw in the chain is far more damaging to the final prediction than a simple mislabeling of a training example. This insight suggests that improving the quality and robustness of the reasoning chain itself is the most effective way to boost performance.

Error-Aware Demonstration (EAD)

Based on these findings, the authors propose Error-Aware Demonstration (EAD). This prompting strategy explicitly teaches the model to identify and avoid logical pitfalls by including both correct and incorrect reasoning paths in the prompt. A typical EAD prompt includes a question, an incorrect reasoning path, an Error Explanation (EE) detailing why that path is flawed, and finally, the correct reasoning path and answer.

Experimental Results

The proposed EAD approach was evaluated across several LLMs, including GPT-3.5-Turbo, GPT-4o-mini, Gemini Pro, and DeepSeek 67B, using benchmarks like BIG-bench Hard (BBH) and GSM8K.

Performance comparison of GPT models with and without Error-Aware Demonstration (IR) across reasoning benchmarks.

As shown in the results for GPT models, the inclusion of incorrect reasoning paths (w/ IR) consistently improves accuracy across diverse tasks, from mathematical reasoning to object tracking. For instance, GPT-3.5-Turbo improved from 81.03% to 83.38% on the GSM8K benchmark.

The Necessity of Error Explanations

A critical component of EAD is the Error Explanation (EE). The authors found that simply showing a model a wrong path without explaining the flaw can lead to confusion.

Ablation study demonstrating the impact of Error Explanation (EE) on model performance.

The ablation study highlights that the "w/ EE" configuration consistently yields the highest performance gains, confirming that teaching the model why a reasoning path is incorrect is essential for effective learning from mistakes.

Conclusion

This work provides a robust theoretical foundation for CoT, emphasizing the importance of coherence and identifying the reasoning chain as the model's primary point of sensitivity. By incorporating Error-Aware Demonstrations, practitioners can significantly enhance LLM performance on complex reasoning tasks. Future research will explore automated methods for generating these error explanations to scale the approach further.

Summary updated

BibTeX
@inproceedings{cui2025theoretical,
  author = {Yingqian Cui and Pengfei He and Xianfeng Tang and Qi He and Chen Luo and Jiliang Tang and Yue Xing},
  title = {{A Theoretical Understanding of Chain-of-Thought: Coherent Reasoning and Error-Aware Demonstration}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2025},
  url = {https://openreview.net/forum?id=2vtbbM2iqm},
}
Figure