Papers › LLMOPT: Learning to Define and Solve General Optimization Problems from Scratch

LLMOPT: Learning to Define and Solve General Optimization Problems from Scratch

17 Oct 2024arXiv:2410.13213archive 2025-07-28

Caigao Jiang, Xiang Shu, Hong Qian, Xingyu Lu, Jun Zhou, Aimin Zhou, Yang Yu

Optimization problems are prevalent across various scenarios. Formulating and then solving optimization problems described by natural language often requires highly specialized human expertise, which could block the widespread application of optimization-based decision making. To make problem formulating and solving automated, leveraging large language models (LLMs) has emerged as a potential way. However, this kind of way suffers from the issue of optimization generalization. Namely, the accuracy of most current LLM-based methods and the generality of optimization problem types that they can model are still limited. In this paper, we propose a unified learning-based framework called LLMOPT to boost optimization generalization. Starting from the natural language descriptions of optimization problems and a pre-trained LLM, LLMOPT constructs the introduced five-element formulation as a universal model for learning to define diverse optimization problem types. Then, LLMOPT employs the multi-instruction tuning to enhance both problem formalization and solver code generation accuracy and generality. After that, to prevent hallucinations in LLMs, such as sacrificing solving accuracy to avoid execution errors, model alignment and self-correction mechanism are adopted in LLMOPT. We evaluate the optimization generalization ability of LLMOPT and compared methods across six real-world datasets covering roughly 20 fields such as health, environment, energy and manufacturing, etc. Extensive experiment results show that LLMOPT is able to model various optimization problem types such as linear/nonlinear programming, mixed integer programming and combinatorial optimization, and achieves a notable 11.08% average solving accuracy improvement compared with the state-of-the-art methods. The code is available at https://github.com/caigaojiang/LLMOPT.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2410.13213")

Code

Syntology Ran 10 of 10 code samples harvested from 1 repository linked to this paper; 0 have no recorded run. Of those that ran: 10 ran with no contract checked.

By repository: official repository: 10 samples from 1 repository, 10 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

caigaojiang/llmopt officialmentioned in papermentioned on GitHub report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

10 samples harvested; 10 ran; 0 honoured the contract we drafted; 0 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

10ran

Licence: 10 of the 10 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from caigaojiang/llmopt. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

Q2C caigaojiang/llmopt/prompts/generate_prompt.py official repository ran fingerprinted no licence file found · pointer only · 11a20109d1d4cded · report
Q2F caigaojiang/llmopt/prompts/generate_prompt.py official repository ran fingerprinted no licence file found · pointer only · 424573ce442f730f · report
QF2C caigaojiang/llmopt/prompts/generate_prompt.py official repository ran fingerprinted no licence file found · pointer only · c29fef2fb87e9fca · report
aug_0 caigaojiang/llmopt/prompts/augment_prompt.py official repository ran fingerprinted no licence file found · pointer only · 41f9c49df2146d47 · report
aug_1 caigaojiang/llmopt/prompts/augment_prompt.py official repository ran fingerprinted no licence file found · pointer only · ed125bc4a9ffd75d · report
aug_2 caigaojiang/llmopt/prompts/augment_prompt.py official repository ran fingerprinted no licence file found · pointer only · d74190a8561fcb4d · report
classification_background caigaojiang/llmopt/prompts/classification_prompt.py official repository ran fingerprinted no licence file found · pointer only · 6897470becf3bcf2 · report
classification_type caigaojiang/llmopt/prompts/classification_prompt.py official repository ran fingerprinted no licence file found · pointer only · 1b8cb3d807bbac67 · report
preprocess caigaojiang/llmopt/sft/sft.py official repository ran no licence file found · pointer only · d1b60aa8fe0416e6 · report
self_correction caigaojiang/llmopt/prompts/self_correction_prompt.py official repository ran no licence file found · pointer only · 763114f4e6850981 · report

Tasks

Code GenerationCombinatorial Optimization

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections