Cumulative Reasoning with Large Language Models
August 2, 2025 ยท View on GitHub
This is the official implementation for the paper "Cumulative Reasoning with Large Language Models", published in Transactions on Machine Learning Research (TMLR).
Cumulative Reasoning (CR) is a structured framework that enhances LLM problem-solving by emulating human-like iterative and cumulative thought processes. CR orchestrates LLMs in three distinct rolesโProposer, Verifier(s), and Reporterโto systematically decompose tasks, validate intermediate steps, and compose them into a final solution.
๐ Key Achievements
CR demonstrates state-of-the-art performance across multiple complex reasoning benchmarks:
- Game of 24: Achieves 98% accuracy, a +24% absolute improvement over Tree-of-Thoughts (ToT).
- MATH Dataset (No Code Interpreter): Attains 58% accuracy with GPT-4, outperforming Progressive-Hint Prompting (PHP) by +4.2%.
- MATH Dataset (Hardest Problems): Shows a 43% relative improvement on Level 5 problems (from 22.4% to 32.1%).
- MATH Dataset (with Code Interpreter): The CR Agent reaches 72.2% accuracy, surpassing PAL (PoT) by +20.2%. On Level 5 problems, this represents a 66.8% relative improvement over PAL.
๐ง Installation
To get started, clone the repository and set up the environment:
# Clone the repository
git clone https://github.com/iiis-ai/cumulative-reasoning.git
cd cumulative-reasoning
# Create and activate a conda environment
conda create -n cr python=3.10
conda activate cr
# Install the required packages
pip install -r requirements.txt
For detailed instructions on specific experiments, please refer to the README.md files within each subdirectory.
๐ค CR Agent: Solving MATH with a Code Environment
The CR-Agent directory contains our implementation for solving the MATH dataset using a code interpreter. This agent demonstrates how CR can be integrated with external tools for robust, semi-symbolic reasoning.
Experimental Results
Our CR Agent, using GPT-4-1106-preview, significantly outperforms previous methods. The agent uses a minimalist setup, accumulating context as a simple string without complex frameworks.
Performance on MATH by Category
| Method | Algebra | Counting & Prob. | Geometry | Interm. Algebra | Num. Theory | Prealgebra | Precalculus | Overall |
|---|---|---|---|---|---|---|---|---|
| PAL (PoT) | 65.3 | 57.9 | 31.7 | 30.9 | 66.1 | 73.2 | 23.2 | 52.0 |
| ToRA | 71.8 | 68.4 | 48.8 | 49.5 | 66.1 | 67.1 | 44.6 | 60.8 |
| CR Agent | 86.3 | 71.1 | 53.7 | 51.5 | 88.7 | 86.6 | 51.8 | 72.2 |
Performance on MATH by Difficulty
| Method | Level 1 | Level 2 | Level 3 | Level 4 | Level 5 |
|---|---|---|---|---|---|
| PAL (PoT) | 88.4 | 65.6 | 60.0 | 45.3 | 31.3 |
| ToRA | 74.4 | 75.6 | 69.5 | 53.9 | 46.3 |
| CR Agent | 90.7 | 90.0 | 81.9 | 66.4 | 52.2 |
โจ CR Agent Assistant & Meta Prompting
We also explore a simplified implementation of the CR Agent using the OpenAI Assistants API, guided by the principles of Meta Prompting.
- Demo: Try the CR Agent v0.1 on the GPT Store.
- Implementation: See the minimalist prompt structure in
./CR-Agent-Assistant/cr-agent-assistant-v0.1.md.
Meta Prompting is a technique that emphasizes the structure and syntax of prompts, providing a scaffold for the LLM to generate complex, structured outputs. Learn more at the meta-prompting repository.
๐ฎ Revisiting Game of 24
Using Meta Prompting, we created an agent that writes a Python program to solve all Game of 24 puzzles in a single pass, achieving 100% accuracy at a speed of 0.08s per sample. See the meta-prompting repo for details.
๐ Acknowledgements
This work builds upon the excellent research and open-source contributions from the teams behind Guidance, Hugging Face, Tree of Thoughts, and ToRA. We thank them for their invaluable work.
๐ Citation
If you find Cumulative Reasoning useful in your research, please cite our paper and star this repository. Thank you!
For questions, please feel free to email yifanzhangresearch@gmail.com or open a GitHub issue.
@article{zhang2023cumulative,
ย title={Cumulative Reasoning With Large Language Models},
ย author={Zhang, Yifan and Yang, Jingqin and Yuan, Yang and Yao, Andrew Chi-Chih},
ย journal={Transactions on Machine Learning Research; arXiv preprint arXiv:2308.04371},
ย year={2023}
}