Greedy Is a Strong Default: Agents as Iterative Optimizers
Abstract
Classical optimization algorithms--hill climbing, simulated annealing, population-based methods--generate candidate solutions via random perturbations. We replace the random proposal generator with an LLM agent that reasons about evaluation diagnostics to propose informed candidates, and ask: does the classical optimization machinery still help when the proposer is no longer random? We evaluate on four tasks spanning discrete, mixed, and continuous search spaces (all replicated across 3 independent runs): rule-based classification on Breast Cancer (test accuracy 86.0% to 96.5%), mixed hyperparameter optimization for MobileNetV3-Small on STL-10 (84.5% to 85.8%, zero catastrophic failures vs. 60% for random search), LoRA fine-tuning of Qwen2.5-0.5B on SST-2 (89.5% to 92.7%, matching Optuna TPE with 2x efficiency), and XGBoost on Adult Census (AUC 0.9297 to 0.9317, tying CMA-ES with 3x fewer evaluations). Empirically, on these tasks: a cross-task ablation shows that simulated annealing, parallel investigators, and even a second LLM model (OpenAI Codex) provide no benefit over greedy hill climbing while requiring 2-3x more evaluations. In our setting, the LLM's learned prior appears strong enough that acceptance-rule sophistication has limited impact--round 1 alone delivers the majority of improvement, and variants converge to similar configurations across strategies. The practical implication is surprising simplicity: greedy hill climbing with early stopping is a strong default. Beyond accuracy, the framework produces human-interpretable artifacts--the discovered cancer classification rules independently recapitulate established cytopathology principles.
Figures & tables
| Task | Artifact Type | Method | Metric | Seed | Best |
|---|---|---|---|---|---|
| Cancer rules | Discrete (YAML) | Greedy ( ) | Test accuracy | 0.860 | 0.965 |
| STL-10 pipeline | Mixed (16 params) | Greedy ( ) | Test accuracy | 0.845 | 0.858 |
| LoRA SST-2 | Mixed (8 params) | Greedy ( ) | Test accuracy | 0.895 | 0.927 |
| XGBoost Adult | Continuous (12 params) | Full ablation | Test AUC | 0.9297 | 0.9317 |
| Method | Runs | Mean Test | Std | Best Test | Mean Rounds |
|---|---|---|---|---|---|
| Seed | — | 0.860 | — | — | 0 |
| Greedy | 3 | 0.959 | 0.005 | 0.965 | 3.3 |
| SA ( ) | 3 | 0.941 | 0.018 | 0.956 | 6.7 |
| sklearn DT (reference) | — | 0.960 | — | — | — |
| sklearn RF (reference) | — | 0.960 | — | — | — |
| Method | Test Acc. | Trials | Failure Rate |
|---|---|---|---|
| Default (seed) | 0.845 | 1 | 0% |
| SMAC | 0.840 | 30 | 33% |
| Random Search | 0.855 | 30 | 60% |
| Agentic (mean, ) | 0.852 | 8 | 0% |
| Agentic (best) | 0.858 | 4 | 0% |
| Run | Rounds | Accepted | Val Acc. | Test Acc. |
|---|---|---|---|---|
| Run 1 | 5 | 3 | 0.862 | 0.858 |
| Run 2 | 3 | 1 | 0.853 | 0.841 |
| Run 3 | 3 | 1 | 0.862 | 0.858 |
| Mean | — | — | 0.859 | 0.852 |
| Method | Val Accuracy | Test Accuracy | Trials |
|---|---|---|---|
| Seed config | 0.866 | 0.895 | 1 |
| Random Search | 0.905 | 0.921 | 20 |
| Optuna TPE | 0.911 | 0.922 | 20 |
| Agentic (mean, ) | 0.910 | 0.924 | 9 |
| Agentic (best) | 0.910 | 0.927 | 12 |
| Run | Accepted | Best Val | Test | Training Runs |
|---|---|---|---|---|
| Run 1 | 2 | 0.910 | 0.927 | 12 |
| Run 2 | 2 | 0.911 | 0.922 | 8 |
| Run 3 | 2 | 0.909 | 0.923 | 8 |
| Mean | 2.0 | 0.910 | 0.924 | 9 |
| Parameter | Seed | Phase 1 | Phase 2 (Final) | Optuna TPE |
|---|---|---|---|---|
| LoRA rank | 8 | 16 | 8 | 8 |
| LoRA alpha | 16 | 32 | 64 | 64 |
| Alpha/rank | 2 | 2 | 8 | 8 |
| Learning rate | 2 | 2–3 | 3.3 | |
| Dropout | 0.05 | 0.05 | 0.20–0.25 | 0.28 |
| Weight decay | 0.01 | 0.01 | 0.10–0.15 | 0.18 |
| Method | Test AUC-ROC | Evals |
|---|---|---|
| Default | 0.9292 | 1 |
| Random Search | 0.9299 | 50 |
| Optuna TPE | 0.9301 | 50 |
| OPRO-lite ( ) | 0.9303 | 11 |
| Grid Search | 0.9307 | 50 |
| Optuna CMA-ES | 0.9317 | 50 |
| Variant | Mean Test | Best Test | CV Evals | vs. CMA-ES |
|---|---|---|---|---|
| Single-model (Opus 4.6) | ||||
| Greedy ( ) | 0.9314 | 0.9317 | 13 | |
| SA ( ) | 0.9313 | 0.9316 | 28 | |
| Parallel ( , ) | 0.9313 | 0.9314 | 33 | |
| Multi-model (Opus 4.6 + Codex) | ||||
| Codex Advisory ( ) | 0.9312 | 0.9313 | 15 | |
| Task | Greedy Test | SA Test | SA Helps? |
|---|---|---|---|
| Cancer (mean, ) | 0.959 | 0.941 | No ( 0.018) |
| XGBoost (mean, ) | 0.9314 | 0.9313 | No ( 0.0001) |
| Task | Agentic Evals | Baseline Evals | Agentic Result | Best Baseline |
|---|---|---|---|---|
| Cancer | 3 | N/A | 0.965 | 0.960 (DT/RF) |
| STL-10 | 4–12 | 30 | 0.858 | 0.855 (random) |
| LoRA SST-2 | 9 | 20 | 0.927 | 0.922 (TPE) |
| XGBoost (greedy) | 13 | 50 | 0.9317 | 0.9317 (CMA-ES) |
| XGBoost (OPRO-lite ablation) | 11 | — | 0.9303 | 0.9317 (agentic greedy) |
Large Language Model-Guided Optimization
Large Language Model-Guided Optimization uses language models to propose, steer, and refine solutions to hard search and design problems.
See all 608 papers