IDP-MCTS Empowering Small Language Models for Automated MILP Modeling and Code Generation in Flexible Job Shop Scheduling
Abstract
Automating mathematical modeling for industrial scheduling is critical for intelligent manufacturing, yet presents technical complexities. A core challenge lies in translating natural language specifications into executable Mixed-Integer Linear Programming (MILP) models, particularly for the Flexible Job Shop Scheduling Problem (FJSP) with its intricate logical constraints. While Large Language Models (LLMs) show significant potential, their industrial deployment is hindered by stringent privacy and cost requirements. This necessitates localized Small Language Models (SLMs) to safeguard proprietary data and reduce costs. Nevertheless, SLMs typically lack the reasoning depth required for formal modeling, leading to low accuracy. To address these challenges, we propose an incremental dual-phase Monte Carlo Tree Search framework IDP-MCTS that decomposes the task into sequential stages: mathematical modeling via MCTS and code generation via MCTS. By prioritizing incremental ``Delta-modifications'' to base templates and a multi-dimensional reward mechanism, IDP-MCTS effectively enhances the consistency of the generated MILP models and code with the input constraints. Evaluated on a benchmark of 210 industrial scheduling problems, IDP-MCTS achieves 84.29\% accuracy, suggesting that search-guided model elicitation with symbolic, semantic, and execution-level verification provides a practical pathway toward reliable LM-assisted planning systems.