Large Language Model-Driven Framework for Automated Constraint Model Generation in Configuration Problems

Roberto Penco, Damir Pintar, Mihaela Vranić, Marko Šoštarić · Applied Sciences · 2025

Constraint satisfaction problems (CSPs) are widely used in domains such as product configuration, scheduling, and resource allocation. However, formulating constraint models remains a significant challenge that often requires specialized expertise in constraint programming (CP). This study introduces the Automatic Constraint Model Generator (ACMG), a novel framework that leverages fine-tuned large language models (LLMs) to automate the translation of natural language problem descriptions into formal CSP models. The ACMG employs a multi-step process involving semantic entity extraction, constraint model generation, and iterative validation using the MiniZinc solver. Our approach achieves state-of-the-art (SOTA) or near-SOTA results, demonstrating the viability of LLMs in simplifying the adoption of CP. Its key contributions include a high-quality dataset for fine-tuning, a modular architecture with specialized LLM components, and empirical validation which shows its promising results for complex configuration tasks. By bridging the gap between natural language and formal constraint models, the ACMG significantly lowers the barrier to CP, making it more accessible to non-experts while maintaining a high level of robustness for industrial applications.

Read the paper · More papers on PaperTik