arXiv · 2601.17670
Grammar-Aware Literate Generative Mathematical Programming with Compiler-in-the-Loop
Abstract
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.
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Roberto Rossi, Steven D. Prestwich. 2026-01-25. Grammar-Aware Literate Generative Mathematical Programming with Compiler-in-the-Loop. https://arxiv.org/abs/2601.17670
Cite the original work for its findings. Save a collection to share your selection of sources.