ORLM: A Customizable Framework in Training Large Models for Automated Optimization Modeling

Chenyu Huang, Zhengyang Tang, Shixi Hu, Ruoqing Jiang, Xin Zheng, Dongdong Ge, Benyou Wang, Zizhuo Wang

TL;DR

This paper introduces ORLM, a novel framework for training open-source large language models (LLMs) specifically for optimization modeling. By developing a semi-automated data synthesis framework (OR-INSTRUCT) and a new industrial benchmark (IndustryOR), ORLM significantly enhances LLMs' ability to translate natural language problems into mathematical models and solver code, achieving competitive performance with proprietary models.

What Problem Does This Paper Address?

Optimization modeling is a powerful tool for decision-making, but it requires significant expertise and is often hindered by the complexity of translating real-world problems into mathematical formulations. Existing approaches often rely on closed-source LLMs like GPT-4, which raise privacy concerns and lack customization. Furthermore, there's a scarcity of high-quality, diverse training data for optimization modeling, and current benchmarks are often too homogeneous. This paper aims to bridge this gap by enabling the training of open-source LLMs for automated optimization modeling, making it more accessible, private, and adaptable.

Methods

The core of this work is the OR-INSTRUCT framework, a semi-automated process for generating synthetic optimization modeling data. It employs an iterative bootstrapping approach:

  • Initial Dataset: Starts with a seed set of real-world industry cases.
  • Expansion Strategy: Uses GPT-4 to generate diverse scenarios and question types, drawing from the initial dataset and real-world examples.
  • Augmentation Strategy: Enhances data diversity and robustness by:
  • Altering Objectives and Constraints: Modifying problem statements to reflect real-world changes, improving environmental adaptability.
  • Rephrasing Questions: Rewriting problem descriptions to improve LLM robustness to prompt variations, enhancing linguistic diversity.
  • Incorporating Multiple Modeling Techniques: Introducing techniques like auxiliary variables and the Big M method to cover a wider range of solution approaches, improving solution variability.
  • Postprocessing and Filtering: Corrects minor errors, discards unexecutable programs, and removes duplicates to ensure data quality.

The paper also introduces IndustryOR, a new industrial benchmark for evaluating LLMs on optimization modeling tasks, sourced from 13 industries and covering various difficulty levels and question types.

Datasets

  • Training Data: Synthesized using the OR-INSTRUCT framework. The initial seed dataset comprised 686 real-world industry cases. After two iterations of OR-INSTRUCT, a total of 32,481 training examples were generated.
  • Evaluation Benchmarks:
    • NL4OPT: A benchmark for mathematical modeling, including 289 linear programming problems.
  • MAMO: Evaluates LLMs' mathematical modeling capabilities with 652 easy and 211 complex linear programming problems.
  • IndustryOR: A newly introduced industrial benchmark with 100 real-world OR problems from 8 industries, covering 5 question types and 3 difficulty levels.

Key Insights and Ideas

  • Open-Source LLMs for Optimization: Training open-source LLMs specifically for optimization modeling is a viable and promising path, offering advantages in privacy, cost, and customization over proprietary models.
  • Data Synthesis is Crucial: The scarcity of high-quality, diverse optimization modeling data is a major bottleneck. OR-INSTRUCT demonstrates that semi-automated data synthesis can effectively address this, leading to significant performance improvements.
  • Augmentation Strategies Enhance Robustness: The specific augmentation techniques (altering objectives/constraints, rephrasing, multiple modeling techniques) are critical for improving LLMs' adaptability, linguistic robustness, and ability to handle diverse problem-solving approaches.
  • Industry Benchmark is Needed: IndustryOR provides a more realistic and comprehensive evaluation of LLMs' capabilities in solving practical OR problems compared to existing, more homogeneous benchmarks.
  • Scaling Laws Matter: Both increasing data size and model size lead to performance improvements in ORLMs, following power-law trends, highlighting the importance of continued scaling.

Key Results

  • Competitive Performance: The trained ORLMs (7B parameters) achieve competitive performance on NL4OPT, MAMO, and IndustryOR benchmarks, often surpassing proprietary models like GPT-4 on certain tasks. For example, ORLM-LLaMA-3-8B achieved 57.5% accuracy on "Easy" problems and 35.0% on "Hard" problems on IndustryOR, significantly outperforming Standard-GPT-4.
  • Human-AI Collaboration: ORLMs significantly improve solution time and accuracy for both students and experts. For instance, ORLM usage led to an accuracy improvement of 10%-25% and saved 1.8-2.2 hours on average for problem-solving.
  • Customization Impact: Targeted training data for specific areas like Mixed Integer Linear Programming (MILP) demonstrably enhances ORLM's proficiency, correcting misinterpretations of logical relationships that plague general models.
  • Efficiency: ORLMs can generate solutions in seconds, accelerating project iterations and facilitating communication between business experts and algorithm engineers.

Limitations and Future Work

  • Limitations:
    • Simplistic Output for Complex Problems: ORLMs can produce overly simplistic outputs for complex scenarios, especially with smaller models (8B scale).
  • Ranking Capability: While ORLMs can generate correct answers, their ability to reliably rank the optimal solution is weak (gap between Pass@1 and Pass@8).
  • Learning from Data: The learning capability from data can be improved.
  • Performance on Rare Types: Both ORLM and GPT-4 perform poorly on non-linear programming and other rare question types, likely due to insufficient representation in the training data.
  • Future Work:
    • Reinforcement Learning: Incorporating RL techniques (e.g., RLHF, DPO) to improve ranking accuracy and bridge the gap between Pass@1 and Pass@8.
  • Dataset Construction for RL: Developing datasets with ranked preferences for RLHF.
  • Data Mining and Exploration: Investigating efficient data synthesis strategies to balance performance and training costs, potentially using smaller, optimized datasets.
  • Leveraging RAG: Integrating Retrieval-Augmented Generation to create domain-specific optimization experts.
  • Further Scaling: Continuing to explore scaling laws for both model size and data volume.

Summary updated

BibTeX
@article{huang2025orlm,
  author = {Chenyu Huang and Zhengyang Tang and Shixi Hu and Ruoqing Jiang and Xin Zheng and Dongdong Ge and Benyou Wang and Zizhuo Wang},
  title = {{ORLM: A Customizable Framework in Training Large Models for Automated Optimization Modeling}},
  journal = {Oper. Res.},
  year = {2025},
  doi = {10.1287/opre.2024.1233},
}
Figure