IR2Solve: Structured Intermediate Representations for Cost-Efficient Optimization Autoformulation
Penglin Zhu, Linhai Zhang, Jungang Xu, Xinchi Wei, Xiuqi Wu
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.
Create a lesson
Related papers
Understanding Efficient LLM Serving: An Empirical Study of Frameworks, Optimizations Algorithms, and Real-World Adoption
Shared title terminology · Forough Majidi, Mohammad Mehdi Morovati, Foutse Khomh et al.
Intent-Level Quantum Programming with Assertion-Guided Execution and Inspectable Intermediate Representation
Shared title terminology · Ilesh Vora, Srikanth Thudumu, John Carlson et al.
Measuring and Optimizing Energy Efficiency in ICT: A Multi-vocal Literature Review on Data Centers, Cloud Computing, and LLM-Driven Code Optimization
Shared title terminology · Tobias Böhm, Benjamin Weigell, Ezgi Sarikayak et al.
SkillBridge: Cost-Aware Diagnosis and Repair of Cross-OS Compatibility Defects in Agent Skills
Shared title terminology · Anjie Xu, Zixing Wang, Yifeng Cai et al.
Before the Choice: An Evidential Framework for Studying Prospective Representations in Language Models
Shared title terminology · Sion Israel Sion
Trace2ST: Recovering PLC Structured Text from I/O Traces with LLM Generation and Verification
Shared title terminology · Hsi Chang, Irfan Khan