TL;DR
Can modern reasoning LLMs act as out-of-the-box optimizers? This paper tests Anthropic’s frontier models (Sonnet 4.6, Opus 4.8, and Opus 5) on both continuous math functions and discrete drug-discovery tasks. The takeaway: while LLMs are surprisingly good—yet brittle—at optimizing numbers, they truly shine in semantically rich, discrete spaces like molecular design, often beating specialized algorithms with just a fraction of the data.
What Problem Does This Paper Address?
In many scientific and engineering problems—like designing a new drug or tuning a physical system—evaluating a single candidate is expensive and slow. This is the realm of black-box optimization (BBO): you have an objective function you can't see inside, and a strict budget for how many times you can query it.
Traditionally, scientists use methods like Bayesian Optimization (BO) with Gaussian Processes (GPs) for continuous spaces, or bespoke deep-learning models for discrete spaces like molecules. Recently, researchers have wondered if large language models (LLMs) could act as zero-shot optimizers simply by prompting them with past results and asking for the next batch of candidates. While earlier studies tested older LLMs on single-point proposals, it remained unclear how the latest generation of reasoning LLMs performs in batch optimization (proposing multiple candidates at once) across both continuous and discrete domains.
Methods
The authors evaluate three Anthropic models—Sonnet 4.6, Opus 4.8, and Opus 5—as zero-shot optimization policies. They test two prompting setups:
- Single-turn: Each prompt contains only the history of previously evaluated points and their scores.
- Multi-turn: The model maintains a continuous conversation, allowing it to reflect on its own previous reasoning.
To test continuous optimization, the authors compare the LLMs against a classic Bayesian Optimization baseline (GP-EI: Gaussian Process with Expected Improvement) and a random baseline. They fix a total budget of 120 evaluations (plus $2d$ initial points, where $d$ is dimensionality) and test batch sizes of $q = 1, 2, 4$. Crucially, to prevent the LLMs from simply recalling famous test functions from their training data, the authors create disguised versions of each function by permuting axes, flipping coordinates, warping inputs, and applying an affine transformation to the outputs.
To test discrete optimization, the models are tasked with proposing molecules as SMILES strings (a standard text representation of chemical structures) in a very low-budget regime: 10 random starting molecules followed by 20 batches of 10, for a total of just 210 oracle calls.
Datasets
- Continuous Synthetic Tasks: Five classic optimization functions of varying dimensionality: Branin (2D), Hartmann-3 (3D), Hartmann-6 (6D), Ackley (5D), and Rastrigin (5D), evaluated in both plain and disguised forms.
- Discrete Molecular Tasks: All 23 deterministic small-molecule oracles from the Practical Molecular Optimization (PMO) benchmark, initialized with molecules from the ZINC 250K dataset. (The original PMO benchmark uses 10,000 oracle calls; this paper's 210-call setup tests extreme sample efficiency.)
Key Insights and Ideas
- LLMs are brittle numerical optimizers: While Opus 5 (multi-turn) can beat GP-EI on continuous functions, its performance degrades as batch size increases, dimensionality grows, or the function is disguised.
- Memorization is hard to fully mask: On plain continuous functions, the LLM often recognizes the function's topology and jumps straight to the optimum. Even when disguised, the model can still partially reverse-engineer simpler, lower-dimensional landscapes (like Branin and Hartmann-3), though it loses this edge in higher dimensions.
- Discrete, semantic spaces are the LLM's home turf: Because autoregressive LLMs are trained on discrete tokens like text and SMILES strings, they navigate molecular spaces much more naturally than raw numerical coordinates.
- Stateful reasoning helps: Across the board, multi-turn conversations outperformed single-turn prompts, showing that letting the model reflect on its past reasoning improves optimization.
Key Results
- Continuous Optimization: Opus 5 (multi-turn) outperformed GP-EI on 10/10 tasks at batch size $q=1$, 8/10 at $q=2$, and 6/10 at $q=4$ (combining plain and disguised variants). Excluding the plain Ackley and Rastrigin tasks (where simply guessing the center of the cube hits the optimum), the LLM achieved a simple regret of $\le 10^{-2}$ in 31/40 runs, compared to 23/40 for GP-EI.
- Molecular Optimization (LLM vs. LLM): Across all 23 PMO oracles, Opus 5 (multi-turn) was the top-performing LLM, winning 17/23 tasks by Top-10 AUC and 20/23 by Top-10 mean.
- Molecular Optimization (LLM vs. Specialists): Within the 210-call budget, zero-shot Opus 5 (multi-turn) outperformed several bespoke deep-learning and BO methods (like REINVENT, SynNet, and GP BO) and matched GenMol (a specialized model trained on drug-like molecules) with an average Top-10 mean of 0.590 across all 23 oracles. Only heavily scaffolded LLM frameworks like ExLLM (0.738) scored higher on average. Many specialist methods required 3× to 40× more oracle calls—or failed entirely—to reach Opus 5's 210-call performance.
Limitations and Future Work
The authors note that disguising synthetic test functions is only a partial control against memorization, as frontier models can still infer familiar topologies from evaluated points. Similarly, even with task names hidden in PMO, reward signatures might still be recognizable (though Opus 5 also beat GenMol on three newly constructed, unfamiliar similarity tasks). Finally, while zero-shot LLMs are remarkably sample-efficient in discrete settings, they still trail carefully trained or heavily scaffolded specialist systems. Future work will explore new BBO formulations and investigate mid- and post-training protocols to boost the optimization capabilities of open-weight reasoning models.
Summary updated