BPP-Search: Enhancing Tree of Thought Reasoning for Mathematical Modeling Problem Solving

Teng Wang, Wing-Yin Yu, Zhenqi He, Zehua Liu, Xiongwei Han, Hailei Gong, Han Wu, Wei Shi, Ruifeng She, Fangzhou Zhu, Tao Zhong

Abstract

Large Language Models (LLMs) have demonstrated significant potential in general reasoning tasks, yet they frequently struggle with the structured, multi-step translation of natural language problems into formal mathematical optimization models. This paper presents BPP-Search, a novel reasoning framework that integrates Beam Search, Process Reward Models (PRM), and Pairwise Preference ranking to navigate complex reasoning paths. To support this framework, we introduce StructuredOR, a dataset providing granular, step-by-step annotations of the modeling process. Our evaluation demonstrates that BPP-Search substantially improves accuracy and efficiency over state-of-the-art baselines in operations research tasks.

Introduction

Translating a natural language word problem into a formal mathematical model, such as a Linear Programming (LP) formulation, requires precise identification of sets, parameters, variables, objectives, and constraints. While Chain-of-Thought (CoT) prompting helps, LLMs often fail due to two primary bottlenecks:

  1. Data Scarcity: Most existing Operations Research (OR) benchmarks only provide final objective values, lacking the intermediate labels necessary to train effective verifiers or reward models.
  2. Search Inefficiency: Existing methods like Tree-of-Thought (ToT) often explore redundant or erroneous paths without a mechanism to prune "dead-end" logic early.

Methods: The BPP-Search Framework

BPP-Search addresses these challenges through a three-stage algorithmic approach:

  • Beam Search: Instead of a single reasoning path, the algorithm maintains the top-$k$ most promising candidates at each step, balancing exploration and exploitation.
  • Process Reward Model (PRM): A specialized model (Qwen2.5-Math-1.5B) is fine-tuned to score intermediate reasoning steps. This allows the system to prune incorrect logic before it propagates through the tree.
  • Pairwise Preference Model: At the final reasoning stage, where candidates are often highly similar, absolute scoring becomes unreliable. We employ a preference model to compare candidates in pairs, significantly refining the final selection.
BPP-Search utilizes a Process Reward Model (PRM) and a Pairwise Preference Model to navigate the reasoning tree and select the optimal solution.

The StructuredOR Dataset

A core contribution of this work is the StructuredOR dataset. Unlike traditional benchmarks, StructuredOR provides comprehensive labels for every stage of the modeling process: Sets $\rightarrow$ Parameters $\rightarrow$ Variables $\rightarrow$ Objectives $\rightarrow$ Constraints.

The StructuredOR dataset generation pipeline leverages GPT-4o for initial drafting and the Gurobi solver to verify mathematical validity.

The dataset was constructed using a rigorous pipeline where GPT-4o generated initial instances, which were then verified for mathematical validity using the Gurobi solver. This ensures that the intermediate steps are not only logically consistent but also lead to solvable mathematical models.

Experimental Results

BPP-Search was evaluated against standard baselines using GPT-4o as the base policy model across three datasets: StructuredOR, MAMO-ComplexLP, and NL4OPT.

Dataset CoT (Baseline) BPP-Search (Ours)
StructuredOR 0.633 0.933
Mamo-ComplexLP 0.486 0.722
NL4OPT 0.566 0.804

The results indicate a massive jump in reliability. Notably, BPP-Search is also more efficient, retrieving correct solutions in 15–21 reasoning steps, compared to over 40 steps for exhaustive Tree-of-Thought methods.

Conclusion

BPP-Search demonstrates that supervising the reasoning process is far more effective than outcome-based supervision for complex mathematical modeling. By combining process-level rewards with pairwise preferences, we can significantly enhance the reliability of LLMs in operations research. Future work will focus on improving numerical precision for large-scale industrial problems and expanding the diversity of problem domains in StructuredOR.

Summary updated

Abstract

LLMs exhibit advanced reasoning capabilities, offering the potential to transform natural language questions into mathematical models. However, existing open-source datasets in operations research domain lack detailed annotations of the modeling process, such as variable definitions, focusing solely on objective values, which hinders reinforcement learning applications. To address this, we release the StructuredOR dataset, annotated with comprehensive labels that capture the complete mathematical modeling process. We further propose BPP-Search, an algorithm that integrates reinforcement learning into a tree-of-thought structure using Beam search, a Process reward model, and a pairwise Preference algorithm. This approach enables efficient exploration of tree structures, avoiding exhaustive search while improving accuracy. Extensive experiments on StructuredOR, NL4OPT, and MAMO-ComplexLP datasets show that BPP-Search significantly outperforms state-of-the-art methods. In tree-based reasoning, BPP-Search excels in accuracy and efficiency, enabling faster retrieval of correct solutions. The StructuredOR dataset is available at https://github.com/tengwang0318/StructuredOR.
BibTeX
@inproceedings{wang2025bpp,
  author = {Teng Wang and Wing-Yin Yu and Zhenqi He and Zehua Liu and Xiongwei Han and Hailei Gong and Han Wu and Wei Shi and Ruifeng She and Fangzhou Zhu and Tao Zhong},
  title = {{BPP-Search: Enhancing Tree of Thought Reasoning for Mathematical Modeling Problem Solving}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
  url = {https://openreview.net/forum?id=OLxuViNlqC},
}
Figure