# AlphaEvolve evolves code against a strict evaluator

Markdown copy of https://realalpha.app/s/alphaevolve-evolves-code-against-a-strict-evaluator/ on Real Alpha, the best minutes from long interviews with the people building AI. Cite and link the page, not this copy.

- Speaker: [Matej Balog](https://realalpha.app/builders/matej-balog/) · Research Scientist, Google DeepMind · Contributed to DeepCoder, AlphaTensor, FunSearch and AlphaEvolve, AI agents that discover algorithms for computational problems.
- Host: [Sarah Guo](https://realalpha.app/people/sarah-guo/) · Founder, Conviction · Ex-Greylock partner; early investor in Cognition, Harvey and Mistral.
- Show: No Priors
- Episode: [No Priors Ep. 120 | With Google DeepMind’s Pushmeet Kohli and Matej Balog](https://realalpha.app/v/2Fs6VZpsiMQ/), Jun 26, 2025
- Moment: 11:13 to 16:54 of the episode (6 min), playing on https://realalpha.app/s/alphaevolve-evolves-code-against-a-strict-evaluator/; the episode from there: https://realalpha.app/v/2Fs6VZpsiMQ/?t=673

## Quote

> “The strictness of the evaluation function provided by the user that is able to actually **filter out the things that work** from the ones that don't.”
> — [Matej Balog](https://realalpha.app/builders/matej-balog/) at [13:31](https://realalpha.app/v/2Fs6VZpsiMQ/?t=811) · No Priors

## Takeaways

1. Users define what makes a solution good with an evaluation function.
2. AlphaEvolve can start from scratch or improve an existing solution.
3. A diverse pool lets it combine ideas without committing too early.

## About this segment

Matej Balog explains how users define success, then AlphaEvolve uses language models and evolutionary search to improve code. A diverse pool helps it avoid locking into one approach too early.

From “No Priors Ep. 120 | With Google DeepMind’s Pushmeet Kohli and Matej Balog”, Jun 26, 2025. [Watch the full episode](https://realalpha.app/v/2Fs6VZpsiMQ/)

## Transcript

Transcribed by machine (Whisper) from the episode’s audio, so a word may be off here and there.

[11:18](https://realalpha.app/v/2Fs6VZpsiMQ/?t=678) I think this is a good moment to try to demystify what's happening under the hood for a broader set of people. Can you walk us through a concrete example of how AlphaEvolve actually evolves code? And say, let's take the example of trying to optimize data center scheduling, right? What does the step-by-step process look like from initial random code to final solution that saves millions of dollars of power?

[11:42](https://realalpha.app/v/2Fs6VZpsiMQ/?t=702) I can walk you through that. So the user of a system like Alpha Evolve, they basically specify what is the problem that they are trying to solve. So that's the most important thing. And you specify it by providing what is called an evaluation function. What this function does is whenever there is a proposed solution for solving the problem, you're able to tell how good this solution is. So you basically define what makes a good solution.

[12:07](https://realalpha.app/v/2Fs6VZpsiMQ/?t=727) For discovering an algorithm for scheduling jobs on a data center, this evaluation function could be something like a simulator of jobs in a data center. That given an algorithm for doing the scheduling, it simulates how good this algorithm is. So that's what the user provides. And this is a simulator you already had? Yes. So that's a simulator that we already had. And I would say it's something that- It is quite natural to have in many domains because, you know, whenever you want to innovate on something, you need to have a way of telling, okay, is the innovation actually good or not?

[12:39](https://realalpha.app/v/2Fs6VZpsiMQ/?t=759) So it's a very natural object to have, at least in principle. So you define the what by providing the evaluation function. And then AlphaEvolve fills in the how. So that's the job of our system. And you can do it in two fairly different ways. One is you tell AlphaEvolve, I have no idea how to solve this problem. let's start completely from scratch and let's try to be creative and come up with something completely new so that's one option you can take another option you can take is actually we have already worked on this problem for a really long time here is a very strong initial solution that we can provide to the system and you can start from here and that's what we did for the application to discovering new algorithms for for scheduling jobs in a data center so alpha evolve takes this initial solution. And then on a high level, it combines the creative power of large language

[13:32](https://realalpha.app/v/2Fs6VZpsiMQ/?t=812) models to propose creative new ways how to improve that solution. The strictness of the evaluation function provided by the user that is able to actually filter out the things that work from the ones that don't. And then this is wrapped inside an evolutionary algorithm that makes sure that we can discover the whole space of algorithms in that region so that we don't commit to a very specific type of solution early on. But instead, we maintain a diverse pool of potential solutions. Over time, maybe we combine ideas from different solutions that are already strong until we actually have an algorithm that's so strong that we are happy to deploy it to a critical part of Google's infrastructure, let's say. And intuitively, not in the machine learning sense, but in the evolution sense, you have different generations where you're getting

[14:19](https://realalpha.app/v/2Fs6VZpsiMQ/?t=859) closer to an optimal solution yeah that's right like you would expect that in each iteration of evolution what you're doing is you're looking at the previous iteration looking at the maybe the strongest solutions you have and then trying to be creative about how can i combine ideas from those solutions or maybe bring in completely new ideas to to come up with something even better and so yes each generation gets stronger and stronger how much scaling are we talking about Like, is there a way to predict how many generations it takes or how do you constrain the number of iterations that the model can use?

[14:53](https://realalpha.app/v/2Fs6VZpsiMQ/?t=893) So there are two parts to your question. One is about, OK, how does scaling work and then how can you predict it? So for the first. First part, this is actually a really nice feature of Alpha Evolve that it can adapt to the difficulty of the problem. If you ask Alpha Evolve to find a solution to a problem that's actually unexpectedly easy, then it will just do it very, very quickly. Like almost immediately, you will have the solution.

[15:17](https://realalpha.app/v/2Fs6VZpsiMQ/?t=917) But if you ask it a problem that's really, really difficult and by really, really difficult, I mean like really difficult, maybe an open question that has stood for decades in the sciences or you want the practical algorithm. for a really high value application in Google, then you would of course expect this is not an easy problem. You might need to spend longer time considering different solutions, exploring the space, combining ideas.

[15:43](https://realalpha.app/v/2Fs6VZpsiMQ/?t=943) But what's really nice about Alpha Evolve is that it is able to sustain this scaling in a way that it keeps improving over time. And it keeps improving for so long that you can make discoveries on this level of difficulty, like breaking decades old scientific challenges or discovering high value algorithms. Now, I know it maybe sounds trivial that if you wait longer, you'll get better results. But in practice, that's actually a really difficult thing to build automated agents that are able to sustain this continual improvement without plateauing quite early.

[16:17](https://realalpha.app/v/2Fs6VZpsiMQ/?t=977) This is, I think, a nice feature. There was a second part to the question about predicting how many iterations you will need. So that is something that is actually not so easy because it's like asking a priori, Do you know how difficult this question is going to be? And especially in the sciences, that's something that often has a very surprising answer. Very trivial questions can turn out to be extremely, extremely difficult and vice versa.

[16:40](https://realalpha.app/v/2Fs6VZpsiMQ/?t=1000) But the nice thing is that you have continual improvement if you run the system. And as long as you can run it, you can expect to get better and better results. And you just have to see where this gets you.
