Skip to content
Preprint

Improving Constraint Models with LLM Agents

Aug 2026 · 0 citations · 28 references
Computer Science

TL;DR

This work introduces an agentic framework that reformulates a constraint model from an open-ended space and establishes correctness empirically rather than by construction, and demonstrates that autonomous agentic methods can support the improvement of constraint models.

Abstract

The runtime of Constraint Programming (CP) solvers is highly sensitive to modeling choices, such as symmetry breaking, implied constraints, global constraints, constraint reformulation, and variable representation. Improving these constraint models has traditionally required human expertise, and existing automated reformulation systems are restricted to a predefined library of hand-crafted transformation rules. We introduce an agentic framework that instead reformulates a constraint model from an open-ended space and establishes correctness empirically rather than by construction: a Large Language Model (LLM) agent, given a model and three training instances, proposes alternative formulations, validates each by injecting its solution back into the original model, and diagnoses and repairs failures, returning the best variant it finds in a median of about fifteen minutes. The models are expressed in the CPMpy modeling library, and each proposed model is evaluated on three larger test instances. Across nine combinatorial optimization problems, the generated models outperform the originals on 21 of 27 test instances, and on some problems solve more than two orders of magnitude faster. A comparison against non-agentic baselines that reuse the same validation and selection tools indicates that the gains stem from the agent's iterative diagnosis and repair, not merely from sampling several candidates. These results demonstrate that autonomous agentic methods can support the improvement of constraint models.

View source

Similar papers

Jul 2026

LLM-Guided Evolutionary Search for Constraint Model Reformulation to Improve Solver Efficiency

Combinatorial problems appear in numerous industrial applications. A common approach is to formulate these problems as declarative constraint models that can subsequently be compiled to and solved by a range of back-end solvers. Recent work shows that Large Language Models (LLMs) can produce correct models from natural...

Kostis Michailidis, Dimos Tsouros, Dang Nguyen et al. · 0 citations
Open access Aug 2026

Efficient Reformulations of Half-reified Global Constraints using Auxiliary Variables

A set of reformulation rules are proposed that allow the use of half-reification of a global constraint with any CP solver that supports the “normal” global constraint propagator, and expand the range of available solvers and constraint models that can be used in XCP techniques or for solving CSPs with compound constra...

Ignace Bleukx, Hélène Verhaeghe, Dimos Tsouros et al. · 1 citation
Conference 2026

From LLM Suggestions to Lean Proofs: Verified Redundant Constraints for MiniZinc

This work presents a pipeline that combines LLM-based constraint generation with empirical evaluation and formal verification, and handles MiniZinc’s partial semantics by requiring the base model to be safe and separately proving that the proposed constraint is well-defined for all instances and solutions of the base m...

Philipp Danzinger, Nysret Musliu · 0 citations
Preprint Aug 2026

Not All Problems Are Best Modeled as MILP: A DSL-Centric Framework for Flexible and Accurate Optimization Modeling

OptiDSL is proposed, a framework that shifts the focus from rigid MILP formulations to domain-specific language (DSL) representations, and enables seamless integration with a diverse library of specialized solvers, ranging from traditional heuristics to modern learning-based methods.

Shao-Feng Zhang, Hongyuan Su, Qing Peng et al. · 0 citations
Preprint Jul 2026

IR2Solve: Structured Intermediate Representations for Cost-Efficient Optimization Autoformulation

Large language models (LLMs) can translate natural-language optimization problems into solver-ready formulations, but direct code generation is brittle: schema, indexing, and semantic errors can cause compilation failures, infeasible models, or incorrect objectives, while iterative repair, search, and multi-agent workf...

Penglin Zhu, Linhai Zhang, Jungang Xu et al. · 0 citations
Preprint Jul 2026

G-RRM: Guiding Symbolic Solvers with Recurrent Reasoning Models

A neuro-symbolic approach, ``Guiding with Recurrent Reasoning Models''(G-RRM), which integrates SE-RRMs with symbolic solvers for constraint satisfaction problems and delineate the regimes in which neural guidance translates into practical speedups.

Timo Bertram, Sidhant Bhavnani, Richard Freinschlag et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.