arXiv:2608.02641cs.SEcs.AI2026-08

用结构化中间表示提升大模型优化建模的准确率与效率

IR2Solve: Structured Intermediate Representations for Cost-Efficient Optimization Autoformulation

论文配图:IR2Solve: Structured Intermediate Representations for Cost-Efficient Optimization Autoformulation
图 1 · 摘自论文原文
  • 先生成受限语法的结构化中间表示,再确定性处理,避免错误传播
  • 在6个基准上保持高目标正确率,153个工业实例验证渐进增益
  • 仅需1次语义调用,比主流方法节省超90%推理成本,适合工业部署

大语言模型可将自然语言优化问题转化为求解器可用的形式,但直接生成代码易出错:模式、索引和语义错误会导致编译失败、不可行模型或目标错误。迭代修复、搜索和多代理流程还会增加推理成本。本文提出IR2Solve,一种以中间表示为核心的自动化建模流程:通过一次语义调用生成受约束的ModelIR,再经确定性验证与编译两阶段处理。ModelIR使用类似Python的表达式显式表示集合、参数、变量、目标和约束;采用具体标量约束规范,将有限索引的约束族表示为独立条目,减少自由索引和隐含量化错误,简化后续验证与编译。在6个清理后的优化基准上,IR2Solve实现强目标正确率,并保持与近期建模系统的竞争力。在153个IndustryOR与ComplexLP实例上的消融实验表明,结构化接口、标量约束指令与确定性验证带来逐级提升。在匹配的十实例成本面板中,IR2Solve每例仅需1次语义调用,而Chain-of-Experts与SAC-Opt分别需8次和39次,对应消耗的令牌量分别为IR2Solve的3.3倍与22.9倍。结果表明,结合结构化中间表示与确定性后处理,能为基于大模型的优化建模提供实用的精度-成本平衡。

原文摘要 · Abstract (English)

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.

优化建模中间表示大模型应用效率优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。