Teaching LLMs to Generate Challenging MILP Instances via Solver Feedback
Organizations: IIT Roorkee · IIT Bombay · IIT Delhi
Abstract
Generating optimization instances that are both feasible and computationally challenging is crucial for benchmarking solvers and training learning-based optimization algorithms. Existing non-LLM generators rely on seed instances or parameter tuning, resulting in high test-time computational cost, while existing LLM generators lack explicit hardness measures. Recent reinforcement learning methods with verifier feedback evaluate only binary correctness, which is misaligned with generating challenging problems. We note that an optimization solver reports the cost of solving at several stages of its pipeline, and leverage this to design a reward that scores both the solvability and the hardness of generated problems, measured by branch-and-bound nodes and post-cut relaxation gaps. Our key idea is a challenger-solver asymmetric self-play approach, where an LLM challenger generates progressively harder instances and the solver verifies feasibility and hardness, so no seed or training MILP instances are required. We fine-tune Gemma-4-12B and Qwen3.5-4B with GRPO and a size curriculum into OptiScribe-12B and OptiScribe-4B, which generate feasible yet challenging MILP problems from natural language instructions. On capacitated facility location and max-cut, OptiScribe-12B raises median SCIP search nodes by 1.7-5x and post-cut gaps by 1.1-1.7x over its base model and improves the feasibility rate on facility location by 9-19 points, while OptiScribe-4B raises median nodes by up to 15.6x. The problems cover a wider difficulty range than public benchmarks of the same size, follow instructions on density and difficulty, and can tune solver settings for families that public libraries lack. These results indicate that optimization-specific rewards, used in self-play mode, can teach LLMs to generate high-difficulty optimization benchmarks. We will release our code and models publicly on acceptance.
Figures & tables
| Method | Artifact | Difficulty Signal | Difficulty | Learns | Input at | Solver at | Text |
| Scale | Hardness | Generation | Inference | control | |||
| Verifier-in-the-loop RL | |||||||
| Absolute Zero | Code task | Solver success rate | Relative | ✓ | Past tasks | ✓ | ✗ |
| R-Zero | Question | Majority agreement | Relative | ✓ | None | ✗ | ✗ |
| STP | Conjecture | Prover pass rate | Relative | ✓ | Seed theorems | ✗ | ✗ |
| MILP instance generators | |||||||
| Capacitated Facility Location (CFL) | Max-Cut | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Bracket | Arm | Parse | Feas | Nodes | Gap | Parse | Feas | Nodes | Gap |
| B1 | Gemma-4-12B | 78.9 | 72.7 | 22 [1, 456] | 18 [1, 63] | 100.0 | 85.9 | 41 [15, 91] | 258 [182, 314] |
| OptiScribe -12B-D | 84.8 | 82.4 | 21 [1, 388] | 18 [1, 55] | 99.6 | 89.1 | 41 [15, 90] | 260 [190, 315] | |
| OptiScribe -12B | 94.1 | 91.8 | 109 [2, 755] | 30 [2, 74] | 100.0 | 89.1 | 142 [29, 297] | 338 [237, 392] | |
| B2 | Gemma-4-12B | 88.3 | 86.7 | 224 [1, 1873] | 22 [4, 63] | 99.6 | 91.8 | 81 [29, 182] | 298 [237, 354] |
| OptiScribe -12B-D | 85.5 | 85.2 | 170 [1, 1587] | 24 [2, 65] | 99.6 | 96.9 | 85 [31, 193] | 300 [238, 355] | |
| Max-Cut | Capacitated facility location | ||||||
|---|---|---|---|---|---|---|---|
| Bracket | Arm | Parsing (pp) | Nodes | Gap (pp) | Parsing (pp) | Nodes | Gap (pp) |
| 111–170 | OptiScribe -4B-D | ||||||
| OptiScribe -4B | |||||||
| OptiScribe -4B-xH | |||||||
| 171–225 | OptiScribe -4B-D | ||||||
| OptiScribe -4B | |||||||
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Family | Bracket | Geometry hint ( SIZE line) | |
| CFL | 76–110 | about 8 depots and 12 customers | 41 |
| CFL | 111–170 | about 10 depots and 15 customers | 41 |
| CFL | 171–225 | about 14 depots and 13 customers | 26 |
| CFL | 226–350 | about 16 depots and 17 customers | 29 |
| CFL | 351–500 | about 20 depots and 20 customers | 28 |
| Multiple knapsack | 76–110 | not trained at this bracket | |
| Statement | Meaning |
|---|---|
| MILP <family> <min|max> | Three-token header with problem class, family name and optimization sense. |
| set S <size> | Index set . |
| par p[S,T] | Parameter table , values given in the data block. |
| var v[S,T] [<lb> <ub>] <type> | Variable family , , with type continuous , integer or binary . A bound is a number or a parameter entry indexed by the running indices of the family, e.g. dem[d] . Bounds are omitted for binary , which fixes them to . |
| obj <min|max> <sum> + <sum> | Objective, a sum of terms such as sum i in S, j in T: c[i,j]*v[i,j] . |
| con <name>: for i in S{, j in T}: <lhs> op <rhs> | Constraint family with one row for every element of the product of the listed sets. |
| Family | Geometry | Compact | Expanded | Ratio | ||
|---|---|---|---|---|---|---|
| Facility location | 104 | 116 | 786 | 7,827 | 0.10 | |
| Facility location | 160 | 175 | 962 | 12,279 | 0.08 | |
| Max-cut | 90 | 162 | 438 | 6,401 | 0.07 | |
| Max-cut | 156 | 288 | 585 | 11,727 | 0.05 |
| Policy and optimization | Reward and solver | ||
|---|---|---|---|
| Base models | Gemma-4-12B-it, Qwen3.5-4B | ||
| Adaptation | LoRA, rank | Node cap | |
| Algorithm | GRPO, group | Wall-clock kill (training) | s |
| Learning rate | In-loop solver | SCIP 10.0 | |
| KL coefficient | Evaluation-only solvers | HiGHS, Gurobi 13.0.3 | |
| Decoding | , top- | ||
| Family | Geometry | Bracket | Nodes | 1 node (%) | Status | |||
| Facility location | 196 | 171–225 | 48.5 | 0.426 | 0.155 | 100.0 | A | |
| 96 | 76–110 | 11.0 | 0.165 | 0.205 | 75.0 | |||
| 100 | 76–110 | 9.0 | 0.251 | 0.203 | 75.0 | |||
| 104 | 76–110 | 10.5 | 0.221 | 0.176 | 58.3 | |||
| 104 | 76–110 | 7.0 | 0.173 | 0.124 | 100.0 | ✓ | ||
| 143 | 111–170 | 38.5 | 0.399 | 0.170 | 91.7 |