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 6 reasoning tasks, ranging from grade school math, air travel planning, ..., 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 and explicitly outlines the reasoning structure, and (ii) for computationally hard reasoning tasks, the more sophisticated tree structure of ToT outperforms the linear structure of CoT. These findings provide useful guidelines for the use of LLM in solving reasoning tasks in practice.

Introduction

While empirical "prompt engineering" has shown that asking an LLM to "think step-by-step" (CoT) or explore multiple reasoning paths (ToT) significantly improves performance, a rigorous theoretical understanding of why these methods work has been lacking. This paper bridges the gap by analyzing these techniques through the lens of machine learning theory, specifically focusing on how prompt structure affects sample complexity (the data needed to learn a task) and computational complexity (the difficulty of finding a solution).

Comparison of Direct, Chain-of-Thought, and Tree-of-Thought prompting strategies for the Game of 24.

Theoretical Framework: Decomposition and Complexity

The authors use Description Length (DL)—the number of bits required to describe a predictor—as a proxy for sample complexity. According to the Minimum Description Length (MDL) principle, a method with a shorter DL requires less training data to achieve low generalization error.

The core insight is that task decomposition reduces sample complexity. By breaking a high-complexity mapping (Input → Final Answer) into a series of low-complexity intermediate steps (Step $n$ → Step $n+1$), the "description length" of what the model needs to learn is significantly reduced.

Furthermore, the choice between linear (CoT) and search-based (ToT) structures depends on the task's computational complexity. For "easy" tasks solvable with a greedy policy (like GSM8K), linear CoT suffices. However, for NP-hard tasks like the Game of 24 or Blocksworld, a tree structure is necessary to manage the search space effectively.

Experimental Setup

The researchers evaluated four primary reasoning approaches across six diverse tasks:

  1. Direct: Immediate answer generation.
  2. Chain-of-Thought (CoT): A linear sequence of intermediate steps.
  3. CoT with Self-Consistency (CoT-SC): Majority voting over multiple CoT chains.
  4. Tree-of-Thought (ToT): A search-based approach exploring multiple reasoning branches.

Tasks included grade school math (GSM8K), multi-hop QA (MusiQue), dynamic programming (MWIS), graph search (Air Travel Planning), and NP-complete planning (Blocksworld).

Key Results and Analysis

The experiments confirmed that making intermediate reasoning states explicit simplifies the learning problem. In Dynamic Programming (MWIS) tasks, explicit CoT demonstrations provided a >20% improvement over implicit ones.

Performance comparison across models (left) and sample efficiency of CoT vs. Direct prompting (right).

Key findings include:

  • Sample Efficiency: In GSM8K, CoT outperformed Direct prompting even when the Direct model was trained on 7x more data, proving that decomposition is more efficient than brute-force memorization.
  • Search vs. Variance Reduction: For simpler reasoning like GSM8K, ToT was only marginally better than CoT and actually performed worse than CoT-SC. This suggests that for polynomial-time tasks, variance reduction (majority voting) is more valuable than complex search.
  • Hard Reasoning Tasks: In NP-hard style tasks like the Game of 24, Direct and CoT methods failed during fine-tuning, while ToT achieved high success rates.

Conclusion

This study provides a theoretical foundation for why structured prompting works. By reducing sample complexity through decomposition and addressing computational complexity through search, CoT and ToT enable LLMs to solve tasks that are otherwise intractable. Future work should focus on automatically determining the optimal level of decomposition to balance token costs with reasoning accuracy.

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