Holy Grail 2.0: From Natural Language to Constraint Models

Dimos Tsouros,Hélène Verhaeghe,Serdar Kadıoğlu,Tias Guns
2023-08-03
Abstract:Twenty-seven years ago, E. Freuder highlighted that "Constraint programming represents one of the closest approaches computer science has yet made to the Holy Grail of programming: the user states the problem, the computer solves it". Nowadays, CP users have great modeling tools available (like Minizinc and CPMpy), allowing them to formulate the problem and then let a solver do the rest of the job, getting closer to the stated goal. However, this still requires the CP user to know the formalism and respect it. Another significant challenge lies in the expertise required to effectively model combinatorial problems. All this limits the wider adoption of CP. In this position paper, we investigate a possible approach to leverage pre-trained Large Language Models to extract models from textual problem descriptions. More specifically, we take inspiration from the Natural Language Processing for Optimization (NL4OPT) challenge and present early results with a decomposition-based prompting approach to GPT Models.
Artificial Intelligence,Computation and Language,Human-Computer Interaction
What problem does this paper attempt to address?
The paper aims to address the challenge of automatically converting natural language descriptions of problems into constraint programming models. Specifically, the goals of the paper are as follows: 1. **Narrowing the gap between natural language descriptions and formal models**: Current technologies allow users to describe problems using modeling languages (such as Minizinc) and have solvers solve them, but users still need a certain level of expertise to convert problems into optimization models. This limits the widespread application of constraint programming. 2. **Leveraging large language models (LLMs)**: With the development of large language models, researchers are exploring how to use these models to extract formal optimization models from natural language descriptions. The paper proposes a modular approach that breaks down the modeling task into multiple subtasks, thereby enhancing the ability of LLMs to handle complex multi-step tasks. 3. **Automating the modeling process**: By dividing the problem modeling process into steps such as entity recognition, relationship recognition, problem formalization, and code generation, the paper demonstrates how LLMs can be used to automatically convert problem descriptions into executable code, and finally interact with users to refine the model. In summary, the main goal of this paper is to develop a framework that can take natural language descriptions of problems, automatically construct corresponding constraint programming models, and ultimately generate executable code. This work is expected to lower the barrier to constraint programming, allowing more non-experts to easily use constraint programming to solve problems.