On the Empirical Complexity of Reasoning and Planning in LLMs

Liwei Kang, Zirui Zhao, David Hsu, Wee Sun Lee

Abstract

Chain-of-thought (CoT), tree-of-thought (ToT), and related techniques work surprisingly well in practice for some complex reasoning tasks with Large Language Models (LLMs), but why? This work seeks the underlying reasons by conducting experimental case studies and linking the performance benefits to well-established sample and computational complexity principles in machine learning. We experimented with six reasoning tasks, ranging from grade school math to Blocksworld. The results suggest that (i) both CoT and ToT benefit significantly from task decomposition, which breaks a complex reasoning task into a sequence of steps with low sample complexity; (ii) for computationally hard reasoning tasks, the more sophisticated tree structure of ToT outperforms the linear structure of CoT; (iii) explicitly annotating important variables is critical for high performance.

Introduction

Large Language Models (LLMs) show remarkable reasoning abilities when asked to "think step-by-step" (CoT) or explore multiple reasoning paths (ToT). However, their performance is inconsistent across different types of problems. This paper moves beyond reporting that these methods work to understanding the underlying factors of when and why they work, using the lenses of sample and computational complexity.

Prompting Paradigms and Task Decomposition

The researchers analyzed four primary methods: Direct prompting, Chain-of-Thought (CoT), CoT with Self-Consistency (CoT-SC), and Tree-of-Thought (ToT). The core finding is that these methods succeed by decomposing a high-complexity "black box" task into a series of lower-complexity sub-tasks.

Comparison of Direct, Chain-of-Thought (CoT), and Tree-of-Thought (ToT) prompting strategies using the Game of 24 as an example.

By utilizing the concept of Description Length (DL), the authors argue that direct answering requires the model to learn a complex mapping (high DL), whereas CoT breaks this into a sequence of simpler functions with fewer variables. This reduction in DL translates to lower sample complexity, meaning the model can learn the reasoning pattern from significantly fewer examples.

Theoretical Framework: Sample vs. Computational Complexity

The study distinguishes between two types of difficulty:

  1. Sample Complexity: The amount of data required to learn a predictor. Decomposition reduces the search space for the model by providing intermediate milestones.
  2. Computational Complexity: The inherent hardness of the task (e.g., NP-hardness). For tasks like the "Game of 24," a linear reasoning path is often insufficient because the search space is too vast. In such cases, the branching structure of ToT provides the necessary search mechanism that a linear chain lacks.

Key Insights

  • Decomposition as a Shortcut: CoT breaks a massive "lookup table" problem into a sequence of functions with fewer variables, making the task easier to learn from a few examples.
  • The "Hidden Variable" Problem: Reasoning often involves intermediate variables. Explicitly naming these variables (Explicit CoT) makes the internal state observable, drastically improving performance (e.g., a >20% boost in the MWIS task).
  • Linear vs. Tree Trade-offs: For tasks with efficient solutions like grade-school math (GSM8K), a linear chain is sufficient. However, for computationally hard tasks like Blocksworld, the branching search of ToT is essential.

Empirical Results

The findings across six diverse datasets provide strong evidence for the complexity-based explanation.

Performance metrics showing accuracy across different models (left) and the relationship between dataset size and accuracy for Direct vs. CoT prompting (right).

As shown in the results, CoT consistently outperforms Direct prompting across models. Notably, on the GSM8K dataset, CoT achieved higher accuracy than Direct prompting even when the Direct model was given seven times more training data, empirically validating the sample complexity advantage of decomposition. In the Game of 24, both Direct and CoT methods failed during fine-tuning, whereas a decomposed ToT approach succeeded, highlighting the necessity of search for hard puzzles.

Limitations and Conclusion

While CoT and ToT offer significant advantages, models still struggle with Out-of-Domain (OOD) generalization, failing to scale to problems much larger than those seen during training. In conclusion, the success of step-by-step reasoning is a principled reduction in task complexity. By decomposing problems and making intermediate states explicit, these methods lower the barrier for models to execute complex logic.

Summary updated

BibTeX
@inproceedings{kang2024empirical,
  author = {Liwei Kang and Zirui Zhao and David Hsu and Wee Sun Lee},
  title = {{On the Empirical Complexity of Reasoning and Planning in LLMs}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  url = {https://openreview.net/forum?id=2ChFtjE6Q5},
}
Figure