Brain-Inspired Two-Stage Approach: Enhancing Mathematical Reasoning by Imitating Human Thought Processes

Yezeng Chen, Zui Chen, Yi ZhouarXiv 2024 · DOI

Abstract

The "Brain" framework addresses the limitations of Large Language Models (LLMs) in solving complex multi-step mathematical word problems by mimicking human cognitive specialization. By decoupling high-level strategic planning (Frontal Lobe) from low-level code execution (Parietal Lobe), the system reduces logical hallucinations and calculation errors. Evaluated on the GSM8K benchmark, the Brain framework achieved a state-of-the-art 74% accuracy for 7B-parameter models, demonstrating the efficacy of specialized reasoning stages and Direct Preference Optimization (DPO) in mathematical problem-solving.

Introduction

While Large Language Models (LLMs) have demonstrated impressive emergent abilities in basic mathematics, they frequently struggle with complex, multi-step word problems. Current fine-tuning methods, such as Supervised Fine-Tuning (SFT), often treat the model as a general-purpose memory unit—akin to the hippocampus—without effectively activating the specialized reasoning centers required for rigorous logic.

A primary challenge is the "cognitive load" of managing high-level strategy (planning) and low-level syntax (calculation) simultaneously. When a model attempts both at once, it is prone to logical hallucinations or execution errors. The "Brain" framework seeks to overcome this by decomposing the problem-solving process into a logical roadmap before attempting a solution.

Methodology: The Brain Framework

The researchers propose a two-stage approach that simulates distinct cognitive functions through specialized models:

  1. The Frontal Lobe Model (FLM): Serving as the "decision-maker," this model generates a step-by-step natural language plan for a given math problem. To ensure high-quality output, the authors employed Direct Preference Optimization (DPO), allowing the model to learn optimal planning strategies without the computational overhead of traditional Reinforcement Learning from Human Feedback (RLHF).
  2. The Parietal Lobe Model (PLM): Acting as the "executor," this model translates the FLM's plan into Python code.
  3. The Executor: A standard Python interpreter runs the generated code to produce a final numerical answer.
The two-stage reasoning process: a Frontal Lobe Model generates a plan, which the Parietal Lobe Model translates into executable code.

The system was built using Code LLaMA 7B as the base model. Training involved a massive synthetic dataset of plans and reasoning paths generated by GPT-3.5-turbo, including 55,000 samples for Frontal Lobe SFT and 90,000 for Parietal Lobe SFT.

Key Results and Insights

The core insight of this research is that LLMs perform significantly better when strategy is separated from syntax. The researchers found that planning is a latent capability within LLMs that can be explicitly extracted to improve performance. There is a strong positive correlation between plan alignment—how well a plan matches the question—and the accuracy of the resulting code.

In empirical evaluations on the GSM8K (Grade School Math 8K) benchmark, the Brain framework achieved 74% accuracy. This represents a state-of-the-art (SOTA) result for 7B-scale models, outperforming other specialized models like ToRA-Code and MAmmoTH-Coder.

Comparison of the Brain framework against other closed-source and open-source models on the GSM8K benchmark.

Key performance highlights include:

  • Two-Stage Superiority: The framework provided a 2.9% absolute improvement over a standard one-stage SFT approach using the same base model.
  • DPO Efficiency: Refining the planning stage with DPO resulted in a 7.5% improvement in plan quality compared to standard fine-tuning.
  • Scaling Potential: When paired with a more powerful Frontal Lobe (e.g., GPT-4), the system's accuracy on GSM8K rose to 81.8%.

Conclusion and Future Work

The Brain framework demonstrates that mimicking human cognitive division is a viable path toward more reliable mathematical reasoning in LLMs. However, the current iteration lacks a self-verification step to check if code outputs are contextually sensible. Future research will focus on expanding the framework to broader scientific tasks and implementing error-correction mechanisms to allow models to self-correct during the reasoning process.

Summary updated

Abstract

Although large language models demonstrate emergent abilities in solving math word problems, there is a challenging task in complex multi-step mathematical reasoning tasks. To improve model performance on mathematical reasoning tasks, previous work has conducted supervised fine-tuning on open-source models by improving the quality and quantity of data. In this paper, we propose a novel approach, named Brain, to imitate human thought processes to enhance mathematical reasoning abilities, using the Frontal Lobe Model to generate plans, and then employing the Parietal Lobe Model to generate code and execute to obtain answers. First, we achieve SOTA performance in comparison with Code LLaMA 7B based models through this method. Secondly, we find that plans can be explicitly extracted from natural language, code, or formal language. Our code and data are publicly available at https://github.com/cyzhh/Brain.
BibTeX
@misc{chen2024brain,
  author = {Yezeng Chen and Zui Chen and Yi Zhou},
  title = {{Brain-Inspired Two-Stage Approach: Enhancing Mathematical Reasoning by Imitating Human Thought Processes}},
  year = {2024},
  eprint = {2403.00800},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.00800},
}
Figure