Manuscript Offprint

arXiv:2610.37932

Understanding Large Language Models as Numerical Optimizers

Lingyun Guo, Ali Bereyhi

Lingyun Guo and Ali Bereyhi, Senior Member, IEEE

Abstract—Large language models (LLMs) have emerged as potential tools for numerical optimization. Despite promising results, their intrinsic optimization capabilities and limitations remain poorly understood, particularly in high dimensions. This paper investigates the ability of LLMs to exploit mathematical problem structures and generate feasible, near-optimal solutions. We develop an evaluation framework that distinguishes solution quality from execution failures, including numerical inaccuracies, constraint violations, and output-format errors. Using representative problems from convex optimization, fractional programming, and constrained projection, we assess LLM performance against deterministic reference solvers across different dimensions. Our results reveal that LLMs can capture useful optimization structures and produce near-optimal solutions, even when their outputs fail to satisfy numerical or formatting requirements. However, reliability deteriorates with increasing problem dimension and depends strongly on the underlying optimization structure. To further investigate the limitations, we deploy an iterative refinement mechanism that provides targeted feedback on feasibility and solution quality. The results demonstrate that iterative refinement substantially improves reliability and extends the range of problem dimensions over which LLMs produce valid solutions. Nevertheless, persistent numerical and structural errors limit their applicability as standalone optimizers. These findings provide insights into the capacity and limits of LLM-based optimization and motivate hybrid approaches that combine LLM reasoning with deterministic numerical verification.

Impact Statement—Large language models (LLMs) are increasingly being considered for optimization and automated decision-making in engineering and other computational applications. Deploying these models without understanding their numerical limitations may lead to infeasible or unreliable decisions, particularly in systems governed by strict operational constraints. This work provides empirical insights into the capabilities and limitations of LLMs as numerical optimizers. It depicts that the ability of LLMs to identify useful structures does not necessarily translate into accurate numerical execution. By characterizing failure modes and investigating the impact of iterative feedback, this study highlights the importance of independent feasibility verification and numerical validation. The findings can inform the development of more reliable LLM-aided optimization systems, in which LLMs support problem interpretation and solution generation while deterministic algorithms enforce mathematical rigour. Such hybrid approaches may facilitate the responsible integration of LLMs into engineering optimization and automated decision-making workflows.

Index Terms—Artificial intelligence, large language models, constrained optimization, iterative refinement, numerical optimization, resource allocation.

Lingyun Guo and Ali Bereyhi are with the Edward S. Rogers Sr. Department of Electrical and Computer Engineering (ECE), University of Toronto, Toronto, ON, Canada; emails: lingyun.guo@mail.utoronto.ca and ali.bereyhi@utoronto.ca.

Ali Bereyhi is Faculty Affiliate at the Schwartz Reisman Institute (SRI) for Technology and Society.

I. INTRODUCTION

Recent advances in large language models (LLMs) have demonstrated their ability to interpret natural language context, take feedback, and generate solutions through reasoning [1]–[4]. These capabilities motivate the exploration of LLMs as numerical optimizers for different tasks, especially in applications such as resource allocation and scheduling [5]–[7].

Existing work has studied LLM-based optimization methods in various contexts. Yang et al. [8] consider optimization tasks described in natural language, including linear regression, the traveling salesman problem, and prompt optimization for task accuracy, and propose the optimization by prompting (OPRO) scheme, which iteratively generates candidate solutions using the guidance of an external evaluator. The LLM-driven evolutionary algorithm (LMEA) approach applies mutation and crossover operations on high-quality candidates to search for better solutions [9]. Closely related lines of work have further explored learning-based approaches instead of direct LLM prompting [10]–[13]. A recent example is the unified learning-based optimization (LLMOPT) framework in [13] that proposes fine-tuning LLMs to represent and solve optimization problems more reliably. LLMOPT also introduces mechanisms for self-correction and improved output validation.

References (36)