Skip to content
Preprint

IR2Solve: Structured Intermediate Representations for Cost-Efficient Optimization Autoformulation

Jul 2026 · 0 citations · 22 references
Computer Science

Abstract

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 workflows increase inference cost. We present IR2Solve, an intermediate-representation-first autoformulation pipeline that uses a single semantic LLM call to produce a schema-constrained ModelIR, followed by two deterministic stages: verification and IR-to-solver compilation. ModelIR explicitly represents sets, parameters, variables, objectives, and constraints using restricted Python-like expression strings. A concrete scalar-constraint convention represents finite per-index constraint families as individual entries, reducing free-index and implicit-quantification errors while simplifying downstream verification and compilation. Across six cleaned optimization benchmarks, IR2Solve achieves strong objective correctness and remains competitive with recent optimization-modeling systems. A controlled ablation on 153 IndustryOR and ComplexLP instances shows sequential gains from the structured IR interface, the scalar-constraint instruction, and deterministic verification. On a matched ten-instance cost panel, IR2Solve uses one semantic call per instance, whereas Chain-of-Experts and SAC-Opt use 8 and 39 calls per instance and consume 3.3 and 22.9 times the token volume of IR2Solve, respectively. These results show that structured intermediate representations, combined with deterministic post-generation processing, provide a practical accuracy-cost trade-off for LLM-based optimization autoformulation.

View source

Similar papers

Preprint 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 language, but even a correct model can be expensive to solve because performance remains sensitive to modelling choices. In this work, we investigate whether LLMs can automate performance-oriented model reformulation. Inspired by Automatic Heuristic Design (AHD), we use an evolutionary framework in which an LLM proposes candidate reformulations that are verified and benchmarked against the user-defined baseline model. We compare AHD-adapted search strategies that control which prior attempts, instructions, and measured feedback enter each prompt. Existing retention strategies prioritize recency or performance, but do not explicitly diversify the context. To cover this gap, we introduce Profile-Diverse Retention (PDR), which applies Maximal Marginal Relevance (MMR) to instance-level runtime vectors to retain behaviourally diverse attempts. We systematically evaluate the strategies on eight CSPLib problems using validation-based final model selection. The results show that: (i) iterative reformulation can produce substantial held-out speedups; (ii) strategies that keep the retained context diverse outperform those that retain only recent or the fastest attempts; and (iii) validation-based selection improves the held-out speedup of every strategy.

Kostis Michailidis, Dimos Tsouros, Dang Nguyen et al. · 0 citations
Preprint Jul 2026

MetaInfer: A Knowledge Only LLM Inference Engine Generator SKILL Toolbox

The results show that metainfer organizes generation constraints, validation feedback, and knowledge consolidation into a continuous closed loop, enabling runnable customized inference solutions to be generated from explicit knowledge.

Zhenwen Miao, Honglin Wang, Mingheng Mi et al. · 0 citations
Preprint Jun 2026

Optimization and Constraint Modeling using LLMs with a Retrieval Augmented Generation Process

The combination of synthetic dataset generation with retrieval augmentation provides an effective alternative to fine-tuning, suggesting that domain-specific synthetic corpora paired with retrieval augmentation can serve as a practical pathway for deploying LLM-based optimization tools in real-world decision-support contexts without costly model retraining.

P.S. Roy, Akash Singirikonda · 0 citations

BRIDGE: Building Representations in Domain-Guided Program Synthesis

BRIDGE is presented, a structured prompting framework that decomposes verification into three interconnected domains: Code (implementations), Specifications (formal intent), and Theorem State-ments (constructive correctness claims), and elicits domain-specific intermediate reasoning to connect them.

Robert Joseph George, Carson Eisenach, Udaya Ghai et al. · 0 citations
Conference Open access 2026

Uncertainty-Aware Test-Time Search for Optimization Problem Solving

UMCTS is an Uncertainty-aware Monte Carlo Tree Search framework that combines the language understanding capability of large language models with the reliability of well-established solvers and achieves state-of-the-art solution accuracy and improves efficiency by reducing token usage.

Linlin Yu, Xujiang Zhao, Dong Li et al. · 0 citations
Preprint Jul 2026

OptGraph: Large Language Models Enhanced Evolutionary Optimization Via Graph Retrieval-Augmented Generation

OptGraph is the first optimization agentic workflow that introduces graph retrieval-augmented generation (GraphRAG) and first constructs reusable experience as a typed graph, capturing the relationships among modeling patterns, problem formalization, implementation details, and error corrections.

Xianchao Xiu, Jianhao Li, Huangyue Chen et al. · 1 citation