Why Can Large Language Models Generate Correct Chain-of-Thoughts?

Rasul Tutunov, Antoine Grosnit, Juliusz Ziomek, Jun Wang, Haitham Bou-AmmararXiv 2023 · DOI

Introduction

Chain-of-Thought (CoT) prompting—the practice of asking a model to "think step-by-step"—has become a cornerstone of modern Large Language Model (LLM) interaction, significantly boosting performance on complex reasoning tasks. However, despite its empirical success, the underlying mechanism of why next-token predictors can perform multi-step reasoning has remained elusive. This paper introduces a theoretical framework based on Bayesian inference to explain how CoT examples allow LLMs to "triangulate" the hidden reasoning context of a problem, leading to a geometric convergence toward the correct reasoning path.

A Hierarchical Model of Language

The researchers propose that language generation is not just a sequence of tokens but a hierarchical process driven by latent variables. They introduce a two-level Probabilistic Graphical Model (PGM) to formalize this:

  1. Latent Context ($c$): The overarching domain or task (e.g., "arithmetic").
  2. Latent Intentions ($\theta_i$): The specific reasoning steps or goals (e.g., "add these two numbers").
  3. Observed Messages ($x_i$): The actual text generated (e.g., "5 + 6 = 11").
The hierarchical graphical model where latent context $c$ and intentions $\theta$ drive the observed messages $x$.

In this framework, LLMs are viewed as marginal approximators that have learned the "true" distribution of natural language from massive datasets. CoT prompting works by providing the model with enough observed messages ($x$) to infer the correct latent context ($c$) and the sequence of intentions ($\theta$) required to solve the problem.

Relevance, Coherence, and Ambiguity

To quantify the effectiveness of CoT, the authors define two critical properties of reasoning steps:

  • Relevance: A message is relevant if it refers to essential elements from previous steps or the initial prompt.
  • Coherence: A sequence is coherent if each step can be logically derived from previous ones within the given context.
Examples of how individual messages in a chain-of-thought exhibit relevance and coherence.

The paper also introduces a measure of Natural Language Ambiguity ($\epsilon$), representing the probability that a sequence of messages fails to uniquely identify the underlying context. A key finding is the 0.5 Ambiguity Threshold: if the ambiguity of CoT examples is less than 0.5, the model's error rate vanishes at a geometric rate as more examples are added.

Geometric Convergence of Reasoning

The central theoretical contribution is a proof of the Geometric Convergence Bound:

$$|p_{LLM}(CoT | Inp, Examples) - q_{True}(CoT | Inp, Context)| \leq \eta \rho^N$$

Where:

  • $N$ is the number of CoT examples.
  • $\rho$ is a factor determined by the language's ambiguity (if ambiguity < 0.5, then $\rho < 1$).
  • $\eta$ depends on the ambiguity of the initial task description.

This formula demonstrates that as more (and clearer) examples are provided, the LLM's probability of generating the "true" reasoning chain increases exponentially toward 1. Essentially, CoT examples act as "clues" that filter out incorrect latent contexts.

Conclusion and Future Directions

This work moves the conversation from "can a transformer do math?" to "how does a prompt trigger the right reasoning?". While the theory assumes the LLM is a perfect approximator of the training data—a simplification given real-world model biases—it provides a rigorous foundation for understanding prompting. Future work aims to extend this to non-linear structures like Tree-of-Thoughts and conduct empirical validations of the proposed ambiguity measures.

Summary updated

BibTeX
@misc{tutunov2023why,
  author = {Rasul Tutunov and Antoine Grosnit and Juliusz Ziomek and Jun Wang and Haitham Bou-Ammar},
  title = {{Why Can Large Language Models Generate Correct Chain-of-Thoughts?}},
  year = {2023},
  eprint = {2310.13571},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.13571},
}
Figure