Skip to content

AlphaEvolve: how Gemini searches for better algorithms

AlphaEvolve suggests code changes, tests them, and keeps the improvements. How DeepMind used this loop to find better algorithms and speed up its systems.

Updated October 1, 20263 min read
AlphaEvolve: how Gemini searches for better algorithms
On this page

A model can suggest a faster algorithm. The harder question is whether the new code still works, and whether it is faster on the inputs that matter.

AlphaEvolve, Google DeepMind's evolutionary coding agent, turns that question into a repeated experiment. Gemini proposes code changes. Evaluators run them and return scores. Useful programs become starting points for the next round.

The approach has produced a new matrix-multiplication algorithm and optimizations used inside Google. Its advantage comes from running many checkable experiments, with a human-defined objective guiding the search.

TL;DR AlphaEvolve searches for better programs by generating, evaluating, and selecting code variants. DeepMind reports a 48-multiplication algorithm for 4x4 complex matrices, a scheduling improvement that recovers 0.7% of fleet-wide compute resources, and faster Gemini training kernels. The results depend on evaluators that check correctness and measure the intended improvement.

How AlphaEvolve searches over code

The starting point is a working program and evaluation code. A developer identifies which parts may change, supplies useful background, and defines the scores to optimize. For a scheduling heuristic, that might mean completing a simulated workload while wasting less capacity.

The developer supplies a problem and evaluator; generated programs return to the database with scores for the next search round.
(Source: Google DeepMind)

The technical report describes an ensemble of Gemini 2.0 Flash and Pro. Flash generates candidates quickly; Pro contributes more computationally expensive suggestions. The system sends them context from previous programs and their results, rather than asking for every change from scratch.

Proposals can arrive as diffs that modify selected code blocks. After applying a change, AlphaEvolve evaluates the resulting program. Cheap checks can reject an invalid candidate before a longer benchmark runs. This keeps the search from spending its entire budget on programs that cannot work.

Selection does more than keep the single highest score. The program database also preserves different approaches, so the next round can explore alternatives instead of repeatedly tweaking one promising solution. This is evolutionary search: create variations, measure them, and use the results to choose what to vary next.

What changes from ordinary coding assistance

A coding assistant usually returns a proposed patch for a person to inspect. AlphaEvolve repeatedly revises and evaluates candidates within the search task. A failed experiment can still be useful because it gives the next attempt information about what did not improve the score.

That resembles an evaluator-optimizer workflow, with a program database supplying more than one candidate history. The model generates possibilities; the evaluation decides which are useful under the chosen criteria.

DeepMind's earlier FunSearch used a related idea to evolve a single Python function. AlphaEvolve expands the scope to larger programs, multiple languages, and multiple objectives. Its evaluators can also spend hours on parallel hardware when the problem justifies that cost.

Those changes widen the problems it can attempt. They do not mean every stronger model automatically produces a better algorithm, or that better results arrive without extra compute.

The matrix-multiplication result

Multiplying matrices sounds like a settled operation, but the number of smaller multiplications needed to do it remains a research problem. For two 4x4 matrices, applying Strassen's method recursively uses 49 scalar multiplications.

DeepMind reports that AlphaEvolve developed a search program that found a 48-multiplication algorithm for 4x4 complex-valued matrices. The field matters: earlier results for other mathematical settings are not the same claim. The report describes this as the first improvement over Strassen's count in this setting in 56 years.

The result is an algebraic construction whose correctness can be checked. It does not establish that every practical 4x4 multiplication on a GPU will run faster. Operation count and real hardware runtime are different objectives, which require different evaluations.

Two infrastructure optimizations

Google's Borg scheduler assigns jobs to machines. A placement can leave capacity unused when the remaining CPU and memory do not fit the next jobs. AlphaEvolve searched for a better scoring rule to guide those placements.

The discovered Borg scoring function and its score surface across CPU and memory residuals.
(Source: Google DeepMind)

According to the report, Google first tested the heuristic in simulation and then deployed it across its fleet. Post-deployment measurements showed an average 0.7% of fleet-wide compute resources recovered from otherwise stranded capacity. That number describes Google's workloads and deployment, not a general saving for any scheduler.

The Gemini training result concerns a different problem: choosing tile sizes for matrix-multiplication kernels. A tile is a smaller block of a matrix processed together. A useful tiling strategy must fit the hardware's compute units and memory while accounting for the surrounding operations.

The tiling problem for matrix multiplication: choosing the M, N, and P block dimensions. This figure explains the optimization target, not its measured speedup.
(Source: Google DeepMind)

DeepMind reports an average 23% kernel speedup over its existing expert-designed heuristic, corresponding to about 1% less overall Gemini training time. Keeping those two numbers together prevents a local optimization from looking like a 23% improvement to the entire training run.

The evaluator determines what the result means

A score gives the search a direction. If the benchmark misses an important input or rewards a shortcut, the search can improve the number without improving the program in the way its developer intended.

For a runtime optimization, the evaluator needs to check correctness as well as speed. For scheduling, a simulation needs enough resemblance to the real workload that its improvements survive deployment. A mathematically checkable construction supports a stronger correctness claim than passing a finite set of ordinary software tests.

The useful starting point is therefore a narrow optimization problem with a repeatable measurement: an expensive kernel, a scheduling rule, or a search routine with a known objective. Define the valid outputs and the comparison baseline before asking a model to improve them. AlphaEvolve's results show what becomes possible when that evaluation is strong enough to guide many successive experiments.

Sources

Common questions

What is AlphaEvolve?

AlphaEvolve is Google DeepMind's coding agent for improving programs through repeated tests. Gemini proposes changes, automated checks score them, and useful versions become starting points for the next round.

What did AlphaEvolve discover?

DeepMind reports a method for multiplying two 4x4 complex-valued matrices with 48 scalar multiplications, improving on the previous 49. Its infrastructure results include recovering an average 0.7% of fleet-wide compute resources and a kernel optimization that reduced overall Gemini training time by about 1%.

How does AlphaEvolve check its code?

Developers provide evaluation code that checks candidates and returns scores. Evaluations can reject invalid programs before spending time on expensive performance measurements, but their reliability still depends on what the checks cover.

How is AlphaEvolve different from FunSearch?

FunSearch focused on evolving a single Python function. AlphaEvolve can change larger programs, work across programming languages, and evaluate multiple objectives with more expensive tests.

Can AlphaEvolve improve any program automatically?

It needs a program to start from and an automated way to distinguish useful changes from bad ones. Tasks with slow experiments, incomplete tests, or poorly defined goals make that search harder and its conclusions less dependable.