LLM4OR: The Generative AI That Translates Problems into Solutions
A Deix project exploring the potential of language models in optimization
Imagine having to solve a complex problem, such as organizing the optimal employee shift schedule in a company while minimizing costs and complying with all legal and productivity constraints. For an operations research expert, this means transforming the request into a mathematical model, with precise equations and constraints, and then delegating the solution to specialized software.
But what if artificial intelligence could perform this translation automatically?
This is where LLM4OR comes into play—a Deix research project exploring the use of Large Language Models (LLMs) to interpret problems described in natural language and convert them into ready-to-use mathematical models.
The idea is as simple as it is ambitious: Can we teach AI to perform our analysis and formalization work?
Not to replace human intelligence, but to make it more efficient and faster.
How Does an LLM Work?
A Large Language Model (LLM) like ChatGPT does not "think" or "understand" in the human sense of the terms. It does not reason like an optimization expert who analyzes a problem, reflects on its implications, and consciously formulates a mathematical model.
Instead, an LLM functions as a highly advanced sentence completer. It works by associating word sequences with other statistically probable sequences based on all the training data it has seen.
A useful analogy?
Imagine a tourist in a foreign country who doesn’t speak the local language. They have a phrasebook with pre-translated sentences: they don’t truly understand the meanings but know that to ask for the check at a restaurant, they must say, "The check, please." If the situation changes slightly (e.g., a waiter asks if they want to pay by card or cash), they might be confused.
An LLM works in a similar way: it doesn’t truly "understand" the problem, but it knows which type of response is most probable based on its training data.
LLMs for Operations Research
Despite this statistical approach, LLMs can be surprisingly effective. To test whether an LLM can simulate the ability to translate an optimization problem into a mathematical model, we:
- selected an open-source model (Llama3-8B-Instruct) to evaluate its effectiveness compared to proprietary models like ChatGPT,
- used a public dataset containing optimization problems already translated into mathematical models, providing the model with clear examples,
- created a custom dataset with more realistic and complex problems to further improve the model's capabilities,
- fine-tuned the model, allowing it to "study" the new data to enhance its translation accuracy.
It's important to clarify: we did not "teach" the model to think like an expert but trained it to recognize and replicate effective translation patterns.
A system capable of converting problems described in natural language into mathematical models.

We compared our model with ChatGPT-3.5 and ChatGPT-4o on a set of problems, evaluating:
- correct identification of variables and the objective function
- precise translation of mathematical constraints
- ability to generate executable code for solving the problem.
Our model outperformed ChatGPT-3.5 and, thanks to fine-tuning on custom data, even surpassed ChatGPT-4o's capabilities.
But what does this mean in practice?
It means that a user could describe a problem in plain language and automatically receive a model ready to be solved by optimization software.
Today, the project is still in an experimental phase, but its applications are vast:
- Supporting our experts: At Deix, this technology could **accelerate our work **by reducing the time required for the initial modeling phase.
- Integration into JINN: Deix's AI platform for creating multi-purpose AI agents now includes features for training and fine-tuning a dedicated model based on an open-source one, not just for optimization problems.
The LLM4OR experiment has demonstrated that LLMs can support optimization by translating problems into mathematical models with increasing accuracy.
🚀 This isn’t about replacing human intelligence but enhancing it, providing a tool that speeds up and simplifies the work of experts.
💡 For Deix, this reaffirms our mission: exploring AI's potential to create innovative and practical solutions.
Interested in This Technology?
If you want to learn more or collaborate with us on this project, contact us at info@deix.ai.