TL;DR
When using LLMs to write and optimize code for tough algorithmic problems, fancy evolutionary archives can quietly eat up your token budget before finding great solutions. By accounting for every single token spent on one strict ledger, this study reveals that simple, iterative refinement—writing lean code, testing it, and fixing it based on feedback—handily beats both complex evolutionary search and brute-force random sampling.
What Problem Does This Paper Address?
Suppose you want an LLM to tackle an optimization problem with no known exact solution, like routing a patrol car across 50 city maps. Today’s systems generally fall into two camps: Best-of-N (generate dozens of independent programs from scratch and pray one works) or Archive-based Evolution (like FunSearch or AlphaEvolve, which stuff prompts full of past "parent" and "inspiration" programs to breed better ones).
Here is the catch: published papers usually measure costs in wall-clock hours, "generations," or rough dollar caps, ignoring hidden overhead. Stuffing prompts with archived code makes every tested program expensive in tokens, and auxiliary calls (like checking if an idea is novel) burn budget without writing a single line of testable code. Nobody knew how to fairly split a fixed token budget between writing fresh code and revising existing code—because nobody was counting all tokens on a single, unified tab.
Methods
First, the authors introduce a strict per-problem token ledger. Every prompt, completion, reasoning token, summary note, and novelty check gets billed to the same budget (e.g., 600k tokens, or ~$4 for Claude Sonnet 4.6). This lets them calculate the exact "token price" per tested program.
To test lean allocation, they built FlashEvolve, a lightweight probe designed to refine programs cheaply:
- Lean Prompts: Instead of carrying a massive archive, prompts hold at most two programs (the best so far and the latest failure) alongside public test feedback (scores, runtimes, and error messages).
- Zero-Token Control Rules: Two parallel branches run short refinement attempts (up to 6 turns). If an attempt stalls for 2–3 turns, simple deterministic rules—requiring zero LLM calls—stop it early and trigger a restart asking for a substantially different algorithm.
- Compact Notes: Every second finished attempt, one tiny call summarizes what worked and failed into ≤200 words for future restarts.
Crucially, the authors pre-registered their experimental predictions before running batches to prevent cherry-picking.
Datasets
No training datasets were used (pure test-time search). Evaluations span three benchmarks where agents iterate on public test cases and are graded on hidden ones:
- ALE-Bench: 40 grueling AtCoder Heuristic Contest problems (plus its 10-problem "Lite" subset for comparing against published literature).
- CO-Bench: 36 classic combinatorial optimization problems.
- 10 Held-Out Contests: Newly introduced benchmark of 10 AtCoder Heuristic Contests held between April and September 2026—after Claude Sonnet 4.6’s knowledge cutoff—to rule out data memorization.
Key Insights and Ideas
- Archives inflate program prices and underdeliver: In a 600k-token budget, Best-of-N tests ~96 unrefined programs, FlashEvolve tests ~41 refined ones, and evolutionary ports (ShinkaEvolve/OpenEvolve) test only 26–27 because half their prompt tokens are spent carrying "inspiration" code. Worse, even when given double the tokens (1.2M) to test more programs (47), the ShinkaEvolve port still trails 600k-token FlashEvolve by 108 points.
- Refinement itself is the hero, not the fancy rules: Surprisingly, "Independent Refinement"—a stripped-down baseline that just runs 6-turn refinement loops from the problem statement without reusing the best program, notes, or restarts—performs just as well as FlashEvolve! The victory over evolution and Best-of-N comes almost entirely from cheap, iterative feedback loops.
- Error messages supercharge immediate bug fixes: Stripping per-case statuses and error messages out of feedback drops the model's one-turn repair rate on partly failing programs from ~52–57% down to ~35–36% (though over 600k tokens, final scores don't statistically separate).
Key Results
At 600k tokens per problem with Claude Sonnet 4.6 on ALE-Bench (40 problems, official 5 public cases and scoring rules):
- FlashEvolve scores 1542, beating the ShinkaEvolve port (1402, +140 pts) and Best-of-N (1426, +116 pts).
- Independent Refinement scores 1560, beating ShinkaEvolve by +158 pts and Best-of-N by +133 pts.
- Under the 50-case setup, both refinement methods beat OpenEvolve by ~200 points (+194 and +207).
- Cross-Benchmark Generalization: Pooled across ALE-Bench, CO-Bench, and the 10 post-cutoff contests (84 problems total), FlashEvolve leads the evolutionary port by 0.75 within-problem standard deviations and Best-of-N by 0.65.
Limitations and Future Work
- Narrower gaps elsewhere: FlashEvolve's lead over Best-of-N is statistically separated on ALE-Bench and in pooled readings, but not on CO-Bench, the held-out contests, GPT-5.2, or Gemini 3 Flash individually.
- Garbage-in, garbage-out traps: On one notoriously hard problem (
toyota2023summer-final), FlashEvolve scored zero in 9 of 18 runs because it kept trying to "build on the best program" when that program passed zero public test cases. Requiring a program to pass at least one case before reusing it fixed this in 2 of 3 test runs. - Future Directions: Because simple refinement worked so well here, FlashEvolve's extra rules (reusing the best code, patience, restarts) didn't show a statistically separated gain. The authors suggest testing regimes where those rules might truly pay off—such as ultra-hard problems where fresh starts almost never produce a valid working program.
Summary updated