Text2Model: Modeling Copilots for Text-to-Model Translation
Organizations: AI Center of Excellence, Fidelity Investments · Department of Computer Science, Brown University
Abstract
There is growing interest in leveraging large language models (LLMs) for text-to-model translation and optimization tasks. This paper aims to advance this line of research by introducing Text2Model and Text2Zinc. Text2Model is a suite of copilots based on several LLM strategies with varying complexity, along with an online leaderboard. Text2Zinc is a cross-domain dataset for capturing optimization and satisfaction problems specified in natural language, along with an interactive editor with built-in AI assistant. While there is an emerging literature on using LLMs for translating combinatorial problems into formal models, our work is the first attempt to integrate both satisfaction and optimization problems within a unified architecture and dataset. Moreover, our approach is solver-agnostic unlike existing work that focuses on translation to a solver-specific model. To achieve this, we leverage MiniZinc's solver-and-paradigm-agnostic modeling capabilities to formulate combinatorial problems. We conduct comprehensive experiments to compare execution and solution accuracy across several single- and multi-call strategies, including; zero-shot prompting, chain-of-thought reasoning, intermediate representations via knowledge-graphs, grammar-based syntax encoding, and agentic approaches that decompose the model into sequential sub-tasks. Our copilot strategies are competitive, and in parts improve, recent research in this domain. Our findings indicate that while LLMs are promising they are not yet a push-button technology for combinatorial modeling. We contribute Text2Model copilots and leaderboard, and Text2Zinc and interactive editor to open-source to support closing this performance gap.
Figures & tables
| IndustryOr | Mamo-Easy | Mamo-Complex | Nl4Opt | |
| Orlm Pass@1 | 38.0% | 82.3% | 37.4% | 85.7% |
| Our CoT Pass@1 (from Table 2 ) | 49.0% | 83.90% | 39.34% | 78.37% |
| Orlm Pass@2 | 40.0% | 83.7% | 49.8% | 88.6% |
| Orlm Pass@4 | 44.0% | 85.9% | 56.9% | 91.4% |
| Orlm Pass@8 | 49.0% | 88.4% | 72.1% | 93.0% |
| Our Best Pass@5 (from Table 2 ) | 57.0% | 84.97% | 55.92% | 78.37% |
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
| # LP | # MIP | # CP | |
| NLP4LP | 54 | 13 | 0 |
| ComplexOR | 25 | 12 | 0 |
| LPWP | 1101 | 0 | 0 |
| Text2Zinc | 64 | 31 | 15 |
| copilot Strategy | LLM | Execution Accuracy (%) | Solution Accuracy (%) | #LLM Query |
| Single-Call Strategies | ||||
| Baseline | GPT-4 | 32.73 | 17.27 | 1 |
| Chain-of-Thought (CoT) | GPT-4o | 60.91 | 34.55 | 1 |
| GPT-4 | 57.27 | 28.18 | 1 | |
| Multi-Call Strategies | ||||
| Knowledge Graph | GPT-4 | 48.18 | 25.45 | 2 |
| Error Type | Commentary |
| Syntax Errors | These errors indicate issues with the MiniZinc code syntax. They may include unexpected tokens, missing semicolons, or incorrect use of language constructs. For example: Error: syntax error, unexpected where, expecting ’)’ . |
| Undefined Identifiers | These errors are due to the use of variables or identifiers that have not been declared or are out of scope. Example: Error: type error: undefined identifier ‘i’, did you mean ‘X’? . |
| Array and Indexing Issues | Errors related to improper use of arrays or indexing problems. This can include out-of-bounds errors or incorrect array dimensions. Example: Error: type error: initialisation value for ‘Downtime’ has invalid type-inst: expected ‘array[int] of int’, actual ‘array[int,int] of int’ . |
| Function Not Found Errors | These errors occur when attempting to use functions or predicates that do not exist in the current MiniZinc environment or have incorrect signatures. This can happen with missing imports or incorrect function names. Example: Error: type error: no function or predicate with this signature found: ‘..o(float)’ . |
| Variable Redefinition Errors | These errors happen when the same variable is assigned or defined multiple times inappropriately, violating MiniZinc ’s variable declaration rules. Example: Error: type error: multiple assignment to the same variable . |
| Flattening Errors | These errors occur during the model flattening phase when MiniZinc attempts to convert the high-level model into a lower-level representation. Often related to unbounded variables or overly complex expressions that cannot be properly linearized. Example: Error: flattening error: unbounded coefficient in linear expression . |
Natural Language to Optimization Modeling
Natural language to optimization modeling translates human requirements into formal mathematical models and solver-ready code.
See all 76 papers