ReLoop: Structured Modeling and Behavioral Verification for Reliable LLM-Based Optimization
Junbo Jacob Lian, Yujun Sun, Huiling Chen, Chaoyu Zhang, Hanzhang Qin, Chung-Piaw Teo
NeurIPS page · Open on the map
Category: LLM Agents, Evals & Benchmarks › LLM-Driven Code Synthesis and Verification · Type: new method · Keywords: LLM code generation, optimization verification, structured generation, behavioral verification, silent failures
Areas: LLM Reasoning › Reasoning Strategies › Self-Evolution and Improvement; Code & Coding Agents › Code Verification › Verified code generation; Evaluation & Benchmarks › Language Model and Agent Benchmarks › Software Engineering Benchmarks
Summary
ReLoop introduces structured generation and behavioral verification to detect silent failures in LLM-generated optimization code, achieving 100% executable code and improving accuracy on multiple benchmarks.
Explained to a 5-year-old
Large computers can write math problems in code. Sometimes the code looks right but actually solves the wrong problem. We made a new way to check the code by breaking it into steps. We also test the code with small changes to see if it still works. This helps make sure the math problems are solved correctly.
Explained to a 5-year-old, longer
A big computer can write instructions to solve a math problem. These instructions are like a recipe that tells a machine what to do. Sometimes the recipe is written in a way that looks correct, but when you run it, it solves the wrong problem. To fix this, we split the recipe writing into several simple steps: first understand the problem, then write a formal description, then create the code, then check it. After the code is made, we also run a test where we change a few numbers and see if the answer changes in the right way. This extra test catches mistakes that the first check might miss. We also added a way to recover from errors if something goes wrong. All of these ideas work together to make sure the computer’s math solutions are reliable. The new method helps people trust computer-generated math more, which is useful for planning and decision-making in many fields.
For a technical reader
The paper presents a two-part solution for LLM-generated optimization code: a structured generation pipeline that follows a four-stage reasoning chain and a behavioral verification step that perturbs solver parameters to detect semantic errors. Combined with diagnostic execution recovery, the approach guarantees 100% executable code on a state-of-the-art model and consistently improves accuracy across three benchmarks. The authors also release a new benchmark, RetailOpt-190, to evaluate compositional optimization scenarios.
Problem
Large language models can generate optimization code, but silent failures can produce semantically incorrect formulations, leading to a large feasibility-correctness gap, especially on compositional problems.
Method
The approach decomposes code generation into a four-stage reasoning chain (understand, formalize, synthesize, verify) and adds a behavioral verification step that tests the generated formulation against solver-based parameter perturbations, together with diagnostic execution recovery.
Results
The approach achieves +8.5pp accuracy on RetailOpt-190, +4.4pp on MAMO-ComplexLP, reaches 100% executable code on Claude Opus 4.6, and improves accuracy across three benchmarks.
Contributions
The paper introduces a structured generation pipeline and a behavioral verification technique that detect silent failures in LLM-generated optimization code, and releases the RetailOpt-190 benchmark of compositional retail optimization scenarios.
Limitations and assumptions
The approach's effectiveness may be limited on narrowly-tuned SFT models with brittle output formats, and the evaluation is restricted to the reported benchmarks.
Practical relevance
Ensuring correct optimization code is crucial for real-world decision-making, and the method enables safer deployment of LLMs in optimization tasks.
This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction