Skip to content

AlphaEvolve: A Coding Agent for Scientific and Algorithmic Discovery

optionalcorefrontierpaperrubric 11/122025 · Google DeepMind white paper (arXiv) · ~35 min

Alexander Novikov, Ngân Vũ, Marvin Eisenberger, …, Matej Balog

Status

TL;DR. AlphaEvolve is an evolutionary coding agent. A user marks parts of a program for evolution and writes an evaluate function that returns scores. In a loop, a prompt sampler shows Gemini models some good programs from a database together with their scores. The models propose code diffs, evaluators score the new programs, and the best go back into the database. With this loop, the authors report a 48-multiplication algorithm for 4×4 complex matrices (which the paper calls the first improvement over Strassen’s algorithm in this setting in 56 years) and better results on about 20% of over 50 open math problems. They also report production gains at Google, such as recovering about 0.7% of fleet compute through a scheduling heuristic.

Why it matters now. AlphaEvolve is the clearest example of an agent whose progress is measured by a machine, not by a judge: rank, runtime or a bound. This is why it can run for many generations without drifting the way a language-only “AI scientist” can. It is also where its limits come from. The same pattern underlies automated research loops such as Agent4Sci and the autoresearch work in Aligning Autoresearch, and it is a form of test-time compute.

Let PP be the space of programs and let h:P→Rmh: P \to \mathbb{R}^m be the user’s evaluator (several scores to maximise). AlphaEvolve keeps a database DtD_t of scored programs and repeats:

p′=apply(LLM(prompt(Dt)), p),Dt+1=update(Dt, (p′,h(p′))),p' = \mathrm{apply}\big(\mathrm{LLM}(\mathrm{prompt}(D_t)),\ p\big), \qquad D_{t+1} = \mathrm{update}\big(D_t,\ (p', h(p'))\big),

where pp is a parent sampled from DtD_t and the LLM output is a set of search-and-replace diffs on the marked code. The update step is inspired by MAP-Elites and island models: it keeps the best programs in different regions or islands, not only the global best, so the search keeps exploring.

The pieces that make this work at scale (§2):

  • Evaluation cascade. Cheap tests first; only promising programs reach expensive tests.
  • Rich prompts. Parent programs, their outputs and scores, problem context, and optionally prompts that are themselves evolved (“meta-prompt evolution”).
  • Model ensemble. Gemini 2.0 Flash for volume, Gemini 2.0 Pro for occasional stronger proposals.
  • Choice of abstraction. Evolve the solution directly, a function that constructs it, or a search heuristic that improves the current best within a time budget.

Compared with its predecessor FunSearch (Table 1), AlphaEvolve evolves whole files in any language instead of one Python function, supports multiple objectives, and uses frontier LLMs with long context.

AlphaEvolve: an evolutionary loop in which LLMs propose code changes and an automated evaluator scores them The user supplies an initial program with blocks marked for evolution and an evaluate function. A program database, organised like MAP-Elites with islands, stores scored programs. A prompt sampler builds prompts from parent programs, context and past scores. An ensemble of Gemini Flash and Pro writes code diffs. The evaluator runs a cascade of tests and returns scores, and promising programs go back to the database. A note below says the evaluator only scores what can be computed, such as rank, speed or a bound, and not elegance, generality or scientific insight. user supplies initial program with EVOLVE-BLOCKs, and evaluate() program database MAP-Elites grid and islands prompt sampler parents, context and past scores LLM ensemble Gemini Flash + Pro writes code diffs evaluator h cascade of tests returns scores promising programs and their scores go back into the database h scores only what can be computed: rank, speed, a bound. It does not score elegance, generality or scientific insight.
Original sketch. The user supplies a starting program and an evaluator; LLMs propose diffs, the evaluator scores them, and the database keeps diverse good programs. The evaluator defines what counts as progress.
  • Matrix multiplication (§3.1, Table 2). Starting from a simple gradient-based decomposition program, AlphaEvolve improved the best known rank for 14 matrix multiplication targets, including rank 48 for 4×4 complex matrices.
  • Open math problems (§3.2, Appendix B). On over 50 problems in analysis, combinatorics, number theory and geometry, it matched the best known construction in about 75% of cases and improved it in about 20%. Examples: kissing number in 11 dimensions 592 to 593, and small improvements to Erdős’s minimum overlap bound. Constructions are in the accompanying Colab.
  • Google infrastructure (§3.3). A Borg scheduling heuristic recovers on average about 0.7% of fleet-wide compute, confirmed after deployment. A kernel tiling heuristic gives an average 23% kernel speedup and about 1% shorter Gemini training. A FlashAttention kernel, edited at the compiler’s intermediate representation level, ran 32% faster. A Verilog simplification of a TPU arithmetic circuit was validated by TPU designers. All of these are reported by Google about its own systems.
  • Ablations (§4, Figure 8). On matrix multiplication and kissing numbers, removing evolution, prompt context, meta-prompts, full-file evolution or the larger model each lowers the curve. Results are shown only as figures averaged over three seeds; I did not find a numeric table.
  • Needs an automated evaluator. The paper says so directly: natural sciences, where only some experiments can be simulated, are outside the main setting. LLM-based grading is supported but not optimised.
  • Metric ≠ value. Many math gains are small improvements to bounds. They are real, but whether they bring new understanding is a separate question the evaluator cannot answer.
  • Goodhart risk. Any gap in hh can be exploited by strong search; the paper limits this with correct-by-construction setups and expert checks, which do not exist for every problem.
  • Compute and access. The system depends on Gemini models and large evaluation clusters; the paper does not report full compute budgets per result.
  • Weak ablation reporting. Two problem families, figures only, and no matched-compute best-of-N baseline.
  • Same pattern, different artifact: GEPA evolves prompts with reflective feedback and a Pareto set; DSPy optimises LM programs against a metric.
  • Code as action: CodeAct shows why code is an effective action space for LLMs.
  • Evaluator gaps: when the score is a proxy, strong optimisers find its holes; see reward hacking in agents and noisy verifiers.
  • Automated research: Agent4Sci tests open-ended agents on scientific ML tasks, where the evaluator is a benchmark metric and misconduct becomes possible.

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Derive / compute

    AlphaEvolve uses an evaluation cascade: a new program runs a cheap first stage, and only promising programs run the expensive later stages. Suppose stage 1 costs 1 unit and passes 20% of programs, stage 2 costs 10 units and passes 25% of those, and stage 3 costs 100 units. Compute the expected cost per candidate with and without the cascade, and explain the risk the cascade introduces.

    What a strong answer covers
    • Without the cascade every candidate runs all stages: 1 + 10 + 100 = 111 units.
    • With the cascade: 1 + 0.2 × 10 + 0.2 × 0.25 × 100 = 1 + 2 + 5 = 8 units, about 14 times cheaper.
    • The savings let the system evaluate many more candidates for the same budget, which matters because evolution depends on throughput.
    • The risk is false negatives: a program that is weak on easy early tests but strong on the hard final tests is pruned and never seen again.
    • Early stages therefore need to correlate with the final metric, and the thresholds act as hidden hyperparameters of the search.
  2. Mechanism

    For many math problems, AlphaEvolve does not evolve the construction itself (for example a sphere configuration) but evolves a search heuristic that is given a fixed time budget, starts from the best construction found so far and tries to improve it. Explain why this indirection can work better, and why the paper mixes a fast model (Gemini 2.0 Flash) with a stronger one (Gemini 2.0 Pro).

    What a strong answer covers
    • A search heuristic can do millions of cheap local moves inside its time budget, so each LLM proposal buys a large amount of computation, not one candidate.
    • Starting from the previous best construction makes generations build on each other, so selection favours heuristics that improve already good solutions.
    • Code is a compact description: a short program can generate a large, structured object that would be hard for an LLM to write out directly.
    • The final constructions often come from a sequence of different specialised heuristics, which a single direct proposal could not reach.
    • Flash gives many cheap, diverse proposals per unit time; Pro gives occasional higher-quality changes that can move the search to a better region.
  3. What if…

    AlphaEvolve's ablations (Figure 8) remove evolution, problem context, meta-prompt evolution, full-file evolution, or the large model, on matrix-multiplication and kissing-number tasks, and report curves over compute averaged over three seeds. The paper states every component helps significantly but gives no table. What can you conclude, what can you not, and what would a stronger ablation report?

    What a strong answer covers
    • You can conclude that on two problem families each removed component made the curve worse under the paper's settings.
    • You cannot read effect sizes precisely from a figure, and three seeds give limited power, especially for comparing similar curves.
    • You cannot tell whether the components matter on the infrastructure tasks or the other 50 or so math problems, because only two families were ablated.
    • "No evolution" repeatedly feeds the initial program; a fairer baseline is best-of-N sampling with the same number of LLM calls and evaluations.
    • A stronger report gives a table of final scores with confidence intervals, compute used per arm, and results on more problem families.
  4. Critique

    AlphaEvolve's own discussion names its main limitation: it needs an automated evaluator. Critique the claim that AlphaEvolve does "scientific discovery", separating what its evaluators measure from what scientists value, and give one example from the paper where the evaluator does capture what matters and one setting where it would not.

    What a strong answer covers
    • The evaluator h returns scalar scores such as rank, runtime or a bound; the loop maximises h, so anything h does not measure (simplicity, generality, explanation) is optimised only by accident or by optional LLM grading.
    • The 4×4 complex matrix result is a case where h captures the goal: fewer multiplications in a provably correct decomposition is exactly the scientific question.
    • The scheduling heuristic is checked in a simulator and then confirmed by fleet measurements (about 0.7% compute recovered), so the evaluator was validated against reality.
    • In natural science, many experiments cannot be simulated, so h would be a proxy; optimising a proxy hard invites Goodhart effects similar to reward hacking.
    • Many results also improve bounds slightly (for example kissing number 592 to 593 in 11 dimensions); progress on a metric is real but does not by itself say whether it gives new understanding.
  5. Connect

    The paper calls AlphaEvolve a test-time compute agent. Compare it with GEPA, which evolves prompts using reflective feedback and a Pareto set of candidates. What do they share, how do they differ, and what does each need from its evaluator?

    What a strong answer covers
    • Both are search loops in which an LLM proposes changes to an artifact, a fitness signal scores them, and a population keeps diverse good candidates (MAP-Elites and islands vs a Pareto frontier).
    • AlphaEvolve evolves code and scores it by execution; GEPA evolves natural-language prompts and scores them on task metrics, also reading execution traces for reflection.
    • Both trade compute at search time for a better artifact, without changing model weights.
    • Both are only as good as the evaluator: GEPA can overfit a small dev set, and AlphaEvolve can exploit gaps in h.
    • Both keep diversity on purpose, because pure greedy selection collapses the population onto one local optimum.
  6. Research idea

    Design an AlphaEvolve-style study for IR: evolving a first-stage ranking function (for example a BM25 variant or a learned-sparse scoring rule written in code) on a set of test collections. Specify the evaluator, the safeguards against overfitting the evaluator, and how you would decide whether a found ranking function is a scientific contribution.

    What a strong answer covers
    • Evaluator: nDCG@10 and recall@1000 on training collections, with an efficiency term such as query latency or index size, as multiple scores.
    • Safeguards: hold out whole collections (as in BEIR-style zero-shot evaluation), use a cascade from small samples to full runs, and keep a final untouched test set.
    • Check for label artifacts: the function should not exploit document IDs, qrels structure or collection-specific quirks; inspect the code for such features.
    • Scientific value: the evolved code should be simple enough to explain, transfer to unseen collections and languages, and suggest a principle (for example a new term-weighting idea).
    • Compare against strong baselines tuned with the same compute, such as grid-searched BM25 parameters, to show the gain is not just tuning.

Done with this page?

Status