arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.00469cs.SE
收藏

DSL 或代码?评估 LLM 生成的代数规范质量:在 Kinaxis 优化中的案例研究

DSL or Code? Evaluating the Quality of LLM-Generated Algebraic Specifications: A Case Study in Optimization at Kinaxis

University of Ottawa(渥太华大学);Kinaxis

Negin Ayoughi, David Dewar, Shiva Nejati, Mehrdad Sabetzadeh

AI总结:

本文研究了在数学优化中使用 LLM 生成 AMPL 模型与 Python 代码的准确性,通过案例研究发现 AMPL 在某些情况下表现更优,EXEOS 方法提升了生成规范的质量。

摘要:

模型驱动工程(MDE)提供了抽象和分析的严谨性,但在许多领域中,工业应用受到开发和维护模型成本的限制。大型语言模型(LLMs)可以通过支持从自然语言(NL)描述直接生成模型来改变这种成本平衡。然而,对于领域特定语言(DSLs)来说,LLM 生成的模型可能不如在主流语言如 Python 中生成的代码准确,因为后者在 LLM 训练语料库中占主导地位。我们在此研究数学优化领域,使用 AMPL,一种具有已建立工业应用的 DSL。我们介绍了 EXEOS,一种基于 LLM 的方法,从 NL 问题描述中推导 AMPL 模型和 Python 代码,并通过求解器反馈迭代改进它们。使用公开的优化数据集和来自我们工业合作伙伴 Kinaxis 的真实世界供应链案例,我们评估生成的 AMPL 模型与 Python 代码在可执行性和正确性方面的表现。使用两个 LLM 家族的消融研究显示,AMPL 与 Python 相当,有时甚至更好,并且 EXEOS 的设计选择提高了生成规范的质量。

英文摘要:

Model-driven engineering (MDE) provides abstraction and analytical rigour, but industrial adoption in many domains has been limited by the cost of developing and maintaining models. Large language models (LLMs) can help shift this cost balance by supporting direct generation of models from natural-language (NL) descriptions. For domain-specific languages (DSLs), however, LLM-generated models may be less accurate than LLM-generated code in mainstream languages such as Python, due to the latter's dominance in LLM training corpora. We investigate this issue in mathematical optimization, with AMPL, a DSL with established industrial use. We introduce EXEOS, an LLM-based approach that derives AMPL models and Python code from NL problem descriptions and iteratively refines them with solver feedback. Using a public optimization dataset and real-world supply-chain cases from our industrial partner Kinaxis, we evaluate generated AMPL models against Python code in terms of executability and correctness. An ablation study with two LLM families shows that AMPL is competitive with, and sometimes better than, Python, and that our design choices in EXEOS improve the quality of generated specifications.

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

↑