arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.15983cs.SEcs.AIcs.LGmath.OC
收藏

ReLoop:结构建模与行为验证用于可靠的基于LLM的优化

ReLoop: Structured Modeling and Behavioral Verification for Reliable LLM-Based Optimization

McCormick School of Engineering, Northwestern University(西北大学工程学院);Wenzhou Buyi Pharmacy Chain Co., Ltd.(温州-buyi药链有限公司);College of Computer Science and Artificial Intelligence, Wenzhou University(温州大学计算机科学与人工智能学院);Department of Decision Analytics and Operations, City University of Hong Kong(香港城市大学决策分析与运营部门);Institute of Operations Research and Analytics, National University of Singapore(新加坡国立大学运筹学与分析研究所)

Junbo Jacob Lian, Yujun Sun, Huiling Chen, Chaoyu Zhang, Hanzhang Qin, Chung-Piaw Teo

AI总结:

ReLoop通过结构生成和行为验证机制,解决LLM生成优化代码的可行性与正确性差距问题,提升代码执行准确性和鲁棒性。

摘要:

大型语言模型(LLM)可以将自然语言转换为优化代码,但静默故障构成重大风险:执行并返回可行解的代码可能编码语义错误的公式化——在组合问题中,可行性正确性差距可达90个百分点。我们引入ReLoop,通过两种互补机制解决此差距。结构生成将代码生成分解为四阶段推理链(理解、形式化、合成、验证),在源头防止公式错误。行为验证检测生成中存活的错误,通过测试公式对求解器参数扰动的响应是否正确——外部语义信号绕过LLM自我审查,无需地面真实。两种机制互补:结构生成在组合问题上获得最大收益(在Claude Opus 4.6上提升8.5个百分点的准确性),而行为验证在局部缺陷上主导(在MAMO-ComplexLP上提升4.4个百分点)。结合诊断执行恢复,ReLoop在Claude Opus 4.6上达到100%可执行代码,并在三个基准上持续提高对话微调基础模型的准确性;我们进一步识别了狭窄微调SFT模型的已知限制,其学习的输出格式对推理链提示敏感——我们记录并分析了这种交互。我们发布了RetailOpt-190,190个组合零售优化场景,针对多约束交互,这是LLM最常失败的领域。

英文摘要:

Large language models (LLMs) can translate natural-language problem descriptions into optimization code, but the code is prone to silent failures: it executes and returns a solver-feasible solution while encoding a semantically incorrect formulation. On compositional problems, the resulting feasibility-correctness gap reaches 90 percentage points. We introduce ReLoop, which combines two mechanisms. Structured generation decomposes code production into a four-stage reasoning chain (understand, formalize, synthesize, verify) to reduce formulation errors during generation. Behavioral verification detects the errors that remain by testing whether the formulation responds correctly to solver-based parameter perturbation, a signal that comes from the solver rather than from LLM self-review and requires no ground truth. The two mechanisms address different error structures: structured generation gives the largest gain on compositional problems (+8.5pp accuracy on RetailOpt-190 with Claude Opus 4.6), and behavioral verification gives its largest gain on localized defects (+4.4pp on MAMO-ComplexLP). With diagnostic execution recovery, ReLoop reaches 100% executable code on Claude Opus 4.6, and relative to direct generation it raises or preserves every reported metric of the three chat-tuned foundation models on all three benchmarks. For the narrowly fine-tuned SFT model we test, the chain-of-thought prompt conflicts with its learned output format and lowers its accuracy on MAMO-ComplexLP; we document and analyze this interaction. We release RetailOpt-190, 190 compositional retail optimization scenarios in which several constraints interact.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑