arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.17670cs.PLcs.AI
收藏

语法感知的 literate 生成式数学编程与编译器在环

Grammar-Aware Literate Generative Mathematical Programming with Compiler-in-the-Loop

Business School, University of Edinburgh(爱丁堡大学商学院);Insight Centre for Data Analytics, University College Cork(科克大学数据分析研究所)

Roberto Rossi, Steven D. Prestwich

AI总结:

提出 SyntAGM 系统,通过迭代生成-编译-评估-修正循环,利用编译器反馈和 LLM 对齐判断,生成可读的代数建模语言优化模型,实现成本与质量的更优权衡。

摘要:

数学规划广泛应用于物流、能源和劳动力规划等多个领域,用于建模和解决工业优化问题,但其使用需要大量的领域专业知识。大型语言模型提供了一种将自然语言问题描述转化为优化模型的有前景的方法,但现有方法成本高昂,且通常生成用通用计算机代码(如 Python)编写的模型,难以检查、验证和重用。在这项工作中,我们引入了 SyntAGM,一个通过迭代生成-编译-评估-修正循环生成可读代数建模语言优化模型的系统。SyntAGM 利用 PyOPL,一个类似 OPL 的建模语言编译器,旨在为迭代模型修复提供可操作的反馈。为了获得与问题描述匹配的有效 PyOPL 模型,SyntAGM 调动编译器反馈和基于 LLM 的对齐判断。此外,它结合了目标语言语法的上下文暴露和建模示例的少样本检索。在多个基准测试中,与既定的提示基线相比,SyntAGM 实现了更有利的成本-质量权衡。

英文摘要:

Mathematical programming is widely employed across various sectors - such as logistics, energy, and workforce planning - to model and solve industrial optimisation problems, but its use requires substantial domain expertise. Large language models offer a promising way to translate natural-language problem descriptions into optimisation models, yet existing approaches are costly and generally produce models written in general-purpose computer code (e.g. Python), which can be difficult to inspect, validate, and reuse. In this work, we introduce SyntAGM, a system that generates optimisation models in a readable algebraic modelling language through an iterative generate-compile-assess-revise loop. SyntAGM leverages PyOPL, an OPL-like modelling language compiler designed to provide actionable feedback for iterative model repair. To obtain a valid PyOPL model that matches the problem description, SyntAGM mobilises compiler feedback and an LLM-based alignment judge. In addition, it combines in-context exposure to the target language grammar, and few-shot retrieval of modelling exemplars. Across multiple benchmarks, SyntAGM achieves a more favourable cost-quality trade-off compared to established prompting baselines.

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

↑