[NeurIPS 2024 Spotlight] Buffer of Thoughts: Thought-Augmented Reasoning with Large Language Models
We read every piece of feedback, and take your input very seriously. To see all available qualifiers, see our documentation.
Official Implementation of Buffer of Thoughts (BoT)
Affiliation: Peking University, UC Berkeley, Stanford University. Based on our BoT, we propose SuperCorrect, a novel two-stage fine-tuning method for improving both reasoning accuracy and self-correction ability for LLMs. The new SuperCorrect-7B model achieves new SOTA performance on MATH and GSM8K benchmarks among all 7B models.
We update our repository and release our implementation of Meta Buffer and Buffer Manager on math problems such as GSM8K based on the amazing work of light-RAG.
Introduction to Buffer of Thoughts (BoT)
BoT is a novel and versatile thought-augmented reasoning approach designed to enhance the accuracy, efficiency, and robustness of large language models (LLMs). We propose a meta-buffer to store a series of high-level thoughts known as thought-templates, distilled from problem-solving processes across various tasks. For each problem, we retrieve a relevant thought-template and adaptively instantiate it with specific reasoning structures to conduct efficient reasoning. Additionally, we propose a buffer-manager to dynamically update the meta-buffer, enhancing its capacity as more tasks are solved.
Experimental Results
We conducted extensive experiments on 10 challenging reasoning-intensive tasks, achieving significant performance improvements over previous SOTA methods. Notably, our Llama3-8B + BoT model shows the potential to surpass the Llama3-70B model.
Usage and Demo
For now, we have released a demo version of BoT based on three different benchmarks. You can use our framework to construct your own meta buffer. Simply set up the environment and run the inference code of BoT based on light-RAG on GSM8K problems. Thought templates about math problems are provided in math.txt. You can conduct tests with different math problems and validate the results using the provided commands.
Our BoT is easy to use. Specify the task_name and model_id parameters according to your requirements. The data for these tasks are located in the /benchmarks directory, and the results are stored in the /test_results directory.
Implementation of Meta Buffer and Buffer Manager
The implementation of our Meta Buffer and Buffer Manager is based on light-RAG. We are grateful for their amazing work and will continue to update and adapt more RAG frameworks.