Back to AI Research

AI Research

Large Language Model for Operations Research Formul... | AI Research

Key Takeaways

  • Large Language Model for Operations Research Formulation Selection in Multi-Warehouse Inventory Allocation addresses the challenge of selecting the most effe...
  • We study this issue as instance-wise operations research (OR) formulation selection, where each allocation instance is assigned to a solver-executable formulation from a candidate OR expert library.
  • We propose a solver-guided large language model (LLM) framework for OR formulation selection, in which each OR expert corresponds to a MIP formulation encoding a distinct allocation priority.
  • With GRPO, Hit Ratio@1 and Hit Ratio@2 increase from 21.45% to 50.42% and from 70.47% to 82.31%.
  • ## The Problem: Heterogeneous Inventory Needs
Paper AbstractExpand

Multi-warehouse inventory allocation is typically formulated as a mixed-integer programming (MIP) problem, yet no single formulation consistently matches heterogeneous instance-level regimes induced by demand concentration, inventory imbalance, replenishment scale, service constraints, and forecast volatility. We study this issue as instance-wise operations research (OR) formulation selection, where each allocation instance is assigned to a solver-executable formulation from a candidate OR expert library. We propose a solver-guided large language model (LLM) framework for OR formulation selection, in which each OR expert corresponds to a MIP formulation encoding a distinct allocation priority. To train the selector, the framework first constructs balanced expert-conditioned supervised fine-tuning (SFT) records for schema learning, and then uses MIP solver evaluation on historical instances to convert solver-evaluated allocation-quality gaps into margin-weighted identity preference optimization (IPO) preferences and per-instance expert-score metadata for reward lookup during group relative policy optimization (GRPO) to assign rewards to sampled responses. Experiments on multi-warehouse inventory allocation instances from JD$\mathord{.}$com, one of China's largest e-retailers, demonstrate that GRPO substantially improves expert-selection accuracy relative to the SFT+IPO selector and, more importantly, produces higher realized allocation quality than both the preference-trained selector and the best fixed formulation. With GRPO, Hit Ratio@1 and Hit Ratio@2 increase from 21.45% to 50.42% and from 70.47% to 82.31%. The resulting selector achieves an allocation accuracy gain of 12.57 percentage points over the incumbent baseline, outperforming both the SFT+IPO selector and the best fixed OR expert, and reduces the gap to the ex-post oracle to 4.85 percentage points.

Large Language Model for Operations Research Formulation Selection in Multi-Warehouse Inventory Allocation addresses the challenge of selecting the most effective mathematical optimization strategy for inventory management. Because different warehouse scenarios—such as varying demand levels or forecast volatility—require different optimization priorities, the authors propose an AI-driven framework that routes each specific inventory allocation instance to the most suitable mixed-integer programming (MIP) formulation.

The Problem: Heterogeneous Inventory Needs

Multi-warehouse inventory allocation is typically solved using mixed-integer programming (MIP). However, the authors, Jintao Xu, Yingzheng Ma, Jiong Dong, Yongzhi Qi, and Jianshen Zhang, note that no single formulation works for every situation. Factors like demand concentration, inventory imbalance, and service constraints mean that a strategy optimized for one warehouse might perform poorly for another. Currently, systems often rely on a fixed formulation, which the authors argue is frequently mismatched with the specific needs of individual stock-keeping units (SKUs).

The Approach: Solver-Guided LLM Routing

The researchers developed a framework that uses a Large Language Model (LLM) to act as a "selector." Instead of generating new code, the LLM analyzes the characteristics of an allocation instance and chooses one of four predefined "OR experts"—specialized MIP formulations—from a library.
The training process involves three progressive stages:

  • Supervised Fine-Tuning (SFT): The model is trained on balanced records to learn how to map instance characteristics to the correct formulation.

  • Identity Preference Optimization (IPO): The model is refined using pairwise comparisons, where it learns to prefer formulations that result in higher allocation quality based on historical solver data.

  • Group Relative Policy Optimization (GRPO): The model samples multiple potential choices for a single instance and receives rewards based on metadata derived from offline solver evaluations. This stage allows the model to learn from its own successful and unsuccessful selections.

Performance Results

The framework was tested on real-world data from JD.com. By using the full SFT+IPO+GRPO pipeline, the selector significantly outperformed simpler methods. According to the paper, the Hit Ratio@1 (the accuracy of selecting the single best expert) increased from 21.45% to 50.42%. Furthermore, the system achieved an allocation accuracy gain of 12.57 percentage points over the incumbent baseline used by the retailer. The authors report that this approach reduces the performance gap to an "ex-post oracle"—the theoretical best possible selection—to 4.85 percentage points.

Key Considerations

The effectiveness of this framework relies on the quality of the candidate library and the offline solver evaluations. The authors note that the library consists of four specific formulations: Lexicographic Band (LB), Scalarized Band-Deviation (SBD), Deviation Minimization (DM), and Reliability-Calibrated Band (RCB). The system is designed to combine the reasoning capabilities of an LLM with the reliability of explicit, solver-executable OR formulations. The authors emphasize that this division of labor allows the system to maintain the rigor of traditional optimization while gaining the adaptability of machine learning.

Comments (0)

No comments yet

Be the first to share your thoughts!