ICML 2025

Autoformulation of Mathematical Optimization Models Using LLMs
Nicol´as Astorga * 1 Tennison Liu * 1 Yuanzhang Xiao 2 Mihaela van der Schaar 1
Abstract
Mathematical optimization is fundamental to
decision-making across diverse domains, from
operations research to healthcare. Yet, translat-
ing real-world problems into optimization models
remains a difficult task, often demanding special-
ized expertise. This paper approaches the prob-
lem of autoformulation: the automated creation
of solver-ready optimization models from natu-
ral language problem descriptions. We identify
three core challenges of autoformulation: (1) the
vast, problem-dependent hypothesis space, (2) ef-
ficient and diverse exploration of this space un-
der uncertainty, and (3) evaluation of formulation
correctness against problem description. To ad-
dress these challenges, we present a novel method
leveraging Large Language Models (LLMs) with
Monte-Carlo Tree Search, exploiting the hierar-
chical nature of optimization modeling to gener-
ate and systematically explore possible formula-
tions. To enhance search efficiency, we introduce
symbolic pruning to eliminate trivially equiva-
lent search paths (branches), and employ LLM-
based evaluation of partial formulations to guide
search. Empirical analysis on linear and mixed-
integer programming benchmarks demonstrates
our method’s effectiveness, with significant per-
formance gains from both LLM-based value esti-
mation and symbolic pruning techniques.
1. Introduction
Mathematical optimization has long been a cornerstone of
decision-making processes across various domains, from
supply chain management (Bramel & Simchi-Levi, 1997)
and healthcare resource allocation (Delgado et al., 2022) to
portfolio optimization (Mokhtar et al., 2014). These prob-
*Equal contribution
1DAMTP, University of Cambridge,
Cambridge, UK 2ECE, University of Hawaii at Manoa, Hon-
olulu, USA. Correspondence to: Nicol´as Astorga, Tennison Liu
<{nja46,tl522}@cam.ac.uk>.
Proceedi...