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

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

TL;DR

Translating natural language problems into mathematical models is a major challenge for LLMs, largely due to a lack of step-by-step datasets and the difficulty of selecting the best solution from a reasoning tree. This paper introduces StructuredOR, a new operations research dataset with full intermediate modeling annotations, and BPP-Search, an advanced tree-search algorithm. By combining Beam search, a Process Reward Model (PRM), and a Pairwise Preference Model, BPP-Search significantly boosts optimization modeling accuracy while drastically reducing computational overhead.

What Problem Does This Paper Address?

Large Language Models (LLMs) show immense promise in automating Operations Research (OR) tasks, such as translating a word problem into a Linear Programming (LP) or Mixed Integer Programming (MIP) model. However, current open-source OR datasets suffer from a major limitation: they only provide the final objective values as ground truth, completely omitting the intermediate modeling steps (like defining sets, parameters, and variables).

This lack of step-by-step data prevents researchers from training Process Reward Models (PRMs), which grade intermediate reasoning steps rather than just the final answer. Furthermore, while advanced reasoning frameworks like Tree of Thought (ToT) can generate multiple potential solutions, they lack a reliable verifier to pick the single best answer from a crowd of highly similar leaf nodes.

Methods

To solve these challenges, the authors propose BPP-Search, a search framework designed to navigate a structured reasoning tree efficiently without resorting to an exhaustive search.

The framework breaks the mathematical modeling process down into a 4-layer tree structure:

  1. Question (Q)
  2. Sets & Parameters (SP)
  3. Variables (V)
  4. Objectives & Constraints (OC)
Figure 2: The structure of the Tree of Thought. Here, Q represents the question, SP represents set and parameter, V represents variable, and OC represents objective and constraint.

BPP-Search operates using three core components:

  • Beam Search: Instead of exploring every single path (which is computationally expensive) or just picking the single best path at each step (Greedy), it maintains a fixed number ($k$) of the most promising candidate paths at each layer.
  • Process Reward Model (PRM): A Qwen2.5-Math-1.5B model is fine-tuned as a binary classifier to score the intermediate nodes, guiding the beam search through the first few layers.
  • Pairwise Preference Model: The authors discovered that PRMs struggle to differentiate between highly similar final candidate solutions in the last layer. To fix this, they fine-tuned another Qwen2.5-Math-1.5B model to perform pairwise comparisons between final candidates. The scores are aggregated to rank and select the absolute best mathematical model.
Figure 4: A real demonstration of the BPP-Search pro- cess with a beam search width of 2. Yellow nodes rep- resent pruned nodes that are not explored, while light blue nodes indicate nodes that have been visited.

Datasets

The authors evaluated their approach across three datasets, including a newly introduced benchmark:

  • StructuredOR (New): Explicitly designed to support process-supervised learning. It contains 124 concrete optimization problems across domains like logistics, scheduling, and networks, complete with full annotations for every step of the modeling process.
  • NL4OPT: A standard optimization modeling dataset used for cross-dataset evaluation.
  • MAMO-ComplexLP: An existing benchmark used to test the generalizability of the PRM and search algorithms.

The pipeline for creating the new StructuredOR dataset leverages GPT-4o to instantiate abstract models into concrete problems, which are then rigorously verified for correctness using the commercial Gurobi solver.

Figure 3: Pipeline of the construction process of our proposed StructuredOR dataset.

Key Insights and Ideas

  • The PRM Resolution Problem: A standard PRM is excellent at filtering out outright blunders early in the tree, but it struggles with "high-resolution" choices at the final leaf nodes. When two complex mathematical models differ by only a single index or inequality sign, their PRM scores are often identical.
  • Pairwise Ranking as a Fix: Forcing the model to directly compare two final candidate paths against each other (rather than scoring them in isolation) successfully mitigates PRM scoring imprecision.
  • Structure Beats Randomness: Grouping the reasoning steps into logical layers (Sets/Parameters $\rightarrow$ Variables $\rightarrow$ Constraints) makes the search space highly predictable and manageable compared to free-form Chain-of-Thought reasoning.

Key Results

Using GPT-4o as the underlying policy model, BPP-Search achieved substantial improvements in both accuracy and efficiency:

  • Superior Accuracy: On the StructuredOR dataset, BPP-Search achieved a 93.3% accuracy rate, outperforming standard Chain-of-Thought (63.3%) and Self-Consistency (70.0%).
  • Massive Efficiency Gains: Traditional Tree-of-Thought methods often require fully traversing the tree, taking up to 40 reasoning steps to find a solution. BPP-Search achieved higher accuracy in just 15 steps, cutting computational costs by more than half.
  • Robust Generalization: The performance gains held true across external datasets; on MAMO-ComplexLP, BPP-Search reached an accuracy of 72.2% (vs. 48.6% for CoT), and on NL4OPT, it reached 80.4% (vs. 56.6% for CoT).

Limitations and Future Work

Despite its success, the authors note two primary limitations:

  1. The Width/Depth Trade-off: As problems grow more complex, the tree must become wider and deeper. Even with beam search, the number of required LLM queries scales up quickly, making it expensive for massive industrial problems.
  2. The High-Dimensional Data Dilemma: Current LLMs struggle to accurately memorize and process large blocks of numerical data. If an optimization problem includes a 3D cost matrix with dozens of elements, the LLM frequently hallucinates or misplaces values during the translation process.

Future work will likely focus on improving how LLMs handle large-scale numerical inputs and finding ways to compress the search tree further.

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 on Huggingface https://huggingface.co/datasets/LLM4OR/StructuredOR and GitHub https://github.com/LLM4OR/StructuredOR.
BibTeX
@inproceedings{wang2025bpp,
  author = {Teng Wang and Wing-Yin Yu and Zhenqi He and Zehua Liu and Hailei Gong and Han Wu and Xiongwei Han 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