All right, let's get started right on time. Welcome, everyone. My name is Venkat Guruswamy, and I'm the director here at the Simons Institute for the Theory of Computing, and it gives me great pleasure to welcome you all to today's talk on accelerating research and engineering with AI.
I want to say a few words about the Simons Institute and, in particular, this public lecture series. The institute was established in 2012 with a very generous grant from the Simons Foundation, who continue to support us, and it has since become a household name in theoretical computer science and a leading venue for collaborative research.
Every semester, the institute brings together the world's leading researchers in theoretical computer science and related fields, as well as the next generation of outstanding young scholars, for focused collaborative research on thematic programs.
These programs range in a variety of areas. They cover core aspects of theory, of course, but they also explore many other disciplines and technologies through a rigorous algorithmic lens, which is especially important these days as so much of decision making is algorithmic.
And the institute is also very nimble and adapts to game-changing advances in the broader computing landscape, which includes quantum or blockchains and, of course, AI.
Along with our research mission, we also seek to foster public understanding of algorithmic science, based in part on the huge impact that emerging technologies will have on human society.
So it's very much in this spirit that today's lecture is part of our Theoretically Speaking series, which highlights exciting advances in computing for a broad audience.
And before I introduce today's speaker, I would like to acknowledge the very generous support from Simons Foundation and Simons Foundation International, and as well as particularly today on our industry day, support from our industry partners as well as individual donors to the institute. So your support makes our research and events like this one possible.
So with that, it's my great pleasure to welcome our speaker today, Professor Matei Zaharia from UC Berkeley itself, for an industry day which celebrates between research and practice. I think you will all agree that it's hard to imagine a more fitting speaker.
Matei is on the faculty of EECS here at Berkeley, and he's the co-founder and CTO of Databricks.
He earned his PhD here, right here in Berkeley, and held faculty positions at MIT and Stanford before, fortunately for us, he returned to Berkeley.
Already as a Berkeley graduate student, he started Apache Spark, now one of the world's most widely used systems for large-scale data processing, deployed across tens of thousands of organizations.
And that's quite some impact for a PhD project, which was fittingly recognized with an ACM Doctoral Dissertation Award.
And of course, Spark was not a one-off; it was just a warm-up. His contributions to systems such as MLflow and Delta Lake have shaped how organizations manage data and machine learning.
More recently, his work on Dask, PyTorch, and JEPA is developing new ways to program and optimize AI systems.
He's, you know, naturally, he's received numerous honors, which include the ACM Doctoral Dissertation Award, as I mentioned, and also the Presidential Early Career Award for Scientists and Engineers (PECASE) award, the highest honor for junior faculty, and the Mark Weiser Award.
And earlier this year, he was awarded the 2025 ACM Prize in Computing, I think second in prestige to nothing else but the Turing Award, for his contributions to the infrastructure behind large-scale data analytics and AI.
And what I find particularly exciting about today's talk is that it takes the story in a new sort of reverse direction, from research that transforms computing to computing that can transform how we do research. So with that, please join me in welcoming Matei for his talk on accelerating research with AI.
All right, thanks a lot. Thanks for coming to my talk. So yes, and actually a lot of my recent research here, a lot of faculty in the EECS department are interested in using AI to accelerate research and engineering. So I want to talk about some of that work. And actually, a bunch of us are starting a new lab within EECS called StarLab that is going to be focused on that, starting next year.
And I want to talk about both, like, kind of what we've been doing with that, what are the findings. And since, you know, this series is called Theoretically Speaking, I want to have like very baby steps towards understanding, you know, what's possible and what isn't in this space, and how could we make AI even better, or what will it be bad at. So that's what I'm going to try to do. But a lot of it is hopefully trying to give you a picture of what AI is already doing when you hear that it's being used to do math and science and programming and stuff like that.
So I think everyone has probably heard some of these stories of AI getting breakthrough results.
So a recent one earlier, you know, just I guess a couple months ago, was OpenAI. They had been results of AI in math for a while, but they said that they solved one of these Millennium Prize problems, which are very hard problems that, you know, have been open for a long time, using AI, using a swarm of AI agents that basically explore different strategies to solve this problem. And it's now being validated by mathematicians, but, you know, they think they have a pretty solid case for it, including like a machine-checkable proof of their claim.
And then shortly after that, they released like 700 other papers of other results that they found, many of which were very surprising to people in those fields.
Often they're kind of inscrutable. If you know, if you ever use an LLM even for programming, you'll find, you know, it can be hard to understand like what exactly it's doing. But again, some of them come with machine-checkable proofs, which means they're likely to be accurate, at least if that proof is set up correctly. And people are again trying to figure out what's happening with these.
So definitely a lot happening in math. At the same time, of course, if you're involved in coding at all, you've probably seen language models are very good at coding.
Earlier this year, Anthropic also showed how they're very good at finding security attacks. But more generally, you know, people are doing large projects like rewriting a widely used piece of software from one programming language to another, which is something that, you know, you might never do before. And they're able to do this.
And even before that, I also want to give credit to earlier and smaller-scale results. So if you're paying a lot of attention to like AI for math and stuff like that, one of the earliest things with language models you might have seen is called FunSearch from Google. Basically, they found using AI that keeps trying solutions to some math problems, it improved the best known, you know, solution for certain problems. And people weren't maybe that excited back then, but it was kind of a step towards what's happening today. There's also AlphaEvolve as a more recent one. And then maybe you've also heard in biology and biophysics of AlphaFold, which is predicting the structure of a protein from its sequence, which is very widely used now and got the Nobel Prize for that.
Okay, so just so these are like some of the things happening in the industry.
At Berkeley, we're also figuring out how to use AI for many kinds of engineering and research. So I'll talk about some things that I'm collaborating on, but there are many others.
So one of them, so I also work in computer systems, which is things like operating systems, networks, databases, basically things that run the infrastructure that computer applications go on top of.
And we had this project last year where we took a bunch of recently published papers in computer systems that were all trying to improve performance of something. So it's easy to measure if you're doing well or not. And then we had AI try to get a better solution just from scratch, see if they can match the human solution that was published, or see if they can do even better. And actually, they did do a lot better in many of them. So that was a, you know, interesting finding.
It's not perfect. There are a lot of challenges, like it might make your network faster, but for example, it might, you know, drop data sometimes or something. But if you specify what you want, well, you can get it to keep searching and find pretty good solutions even in this area.
Another thing that I'm collaborating on with other folks here is controlling robots. So for controlling robots, there essentially were, you know, a couple of ways you could do it. One way is you try to train a model, like a neural network, basically, to control your robot. You need to give it a lot of examples to do that. But, you know, for applications where you're going to do something many, many times, it's worth it. But it's very costly. Another thing people have tried is having these powerful models we have today, these like language and vision models, and just asking them like every few seconds, you know, what should the robot do to do a task? And they look at the cameras and they decide, you know, to do something.
So we also used AI to try to create robot controllers, and we actually found you can get AI with the right setup to, you know, create a little program that controls the robot much better and faster than those two prior methods. So that's one project we're working on.
And then I've also been collaborating with folks in material science here who actually recently launched a startup on trying to automate many steps in material design and in synthesis, and actually finding a recipe that lets you produce a material at scale using AI and using again a lot of today's agents.
So because of things like this, and, you know, there's some work you have to do in each domain, but you're getting a lot from just the pre-trained AIs that are out there from OpenAI and Anthropic and so on. You know, people are really wondering what's going to happen to these technical fields. Like, it probably is the end of math as we know it. There's a different way to do math now when you're using these tools.
Software engineering is changing for sure. People are wondering, like, are there other areas of science that AI will cover? So that's what I want to talk about. So clearly, AI is doing a ton in research and engineering. So I want to talk a little bit about where does it work well, where does it not work, and some ideas to make it better, to, you know, to make it solve things even better. And we have some ongoing projects there too.
Okay, so first, let's start with like what does today's AI do, and that allows it to be so effective at things like this. So here, this actually ties back to very classical things in AI.
Historically, there were actually, I would say, well, at least two big waves of AI. So there was an early wave where people were writing lots of rules by hand and trying to model the world, and often working on what are called search algorithms, like for example planning the moves in chess, where you decide, okay, I'm going to look two moves ahead or three moves ahead or whatever, and how can I make that really efficient? So that's called search. A lot of classical AI was that.
And then there's a slightly newer approach which is called learning, where instead of trying to write rules by hand or creating a complicated algorithm, you actually try to fit a function to some data, and it's all about getting data that's representative and then trying to predict, make predictions based on it. It's a lot of statistics, basically. And that also works very well. So things like recommendation engines, you know, there aren't really people writing rules saying if you bought whatever, like, you know, dog collar on Amazon, you might want to buy dog food also.
Instead, they notice patterns of, you know, who's likely to click on it, and it can notice very subtle patterns like you bought the really, you know, the collar for a big dog, so you need to buy the food that is better for big dogs, or like whatever, stuff like that that maybe people would never bother to write.
So with large language models, which is what we're using today, when I talk about AI, this is primarily what I mean by modern AI, both of these are coming in a significant way. And I would say before these, people were kind of doing one or the other; they weren't combining them as much, at least in recent years.
So on the learning side, with large language models, you basically train them on like all the public data in the world, all the stuff on the internet, many books, and so on. So whatever associations you're learning can incorporate all of this information. So even when you apply the LLM in some new domain, it might know quite a bit about it because it's seen books and things like that where it's learned to predict patterns. So that was sort of one of the breakthroughs of LLMs that enabled ChatGPT, for example, to be able to kind of talk about anything.
And then the more recent wave of LLMs, I think the first one to popularize it was called o1 from OpenAI, which I think was around probably end of 2023 or beginning of 2024 it came out, so like a year after ChatGPT. These ones also do search, where like the LLM will say thinking, so it won't just give you an answer right away. It will basically explore a few ideas and backtrack and explore more, a little bit like what I said when you're playing chess and you're thinking, well, if I do this, they're going to do that. So, you know, what if I do something different? So that's in LLM land, that's called reasoning.
And then there are also attempts to run many agents in parallel and, you know, split up the problem or have them try different ideas and combine them and so on, which are usually called swarms.
So these are the things that make LLM-based AI effective today. I think without search, they wouldn't have done all the stuff on the previous slide, but the learning piece, and especially the idea of just putting in all the prior knowledge we have about the world somehow, is also helping a lot.
So these are kind of the things that help. So one thing I want to call out about both of these is there is actually some thing that determines when they're going to work well, which is they both work best when evaluating your answers, like verifying them or scoring them, is easy.
So what do I mean by that? So for example, when you're doing learning and trying to teach the agent to do something like, say, programming or something like that, there is a type of learning where it just looks at existing data and sort of copies it, but there's also a lot of what's called reinforcement learning or supervised learning where you know what the right answer is and you try to reward the model. There's a training algorithm that tries to teach it to get the right answer. So that's much easier to do when it's easy to score an answer.
For example, if I ask it, you know, fix this bug in a program, and I have a test I can run to see if the bug was fixed, then it's pretty easy to give it a score.
On the other hand, something like creative writing, you know, like write a very nice poem for my wife or whatever, it's very hard. And actually, LLMs are quite bad at that.
So, you know, because we don't know how to automatically evaluate that. Sometimes we have humans rate that, but it's much more expensive and difficult to get good quality. So that's for learning.
And then for search also, if you just let this LLM run for a long time, or you run like 100 copies of it and have them, you know, explore lots of solutions, they're going to have an easier time when they can get some kind of score for each solution, like knowing this one's a little bit better than the previous one. They're going to have a hard time if they can't evaluate it.
So this is one of the, this is an important thing, ease of evaluation. And by ease, it's a combination of, you know, does it cost money? Does it take time? You know, various ways. How good, how accurate is it? All these are things that affect it.
So with that in mind, now I think that helps explain a little bit the cases where AI has been so effective and, you know, doing better than humans, and also some cases where it's not as good yet.
So math is an example. Like the whole point of math is just through logic you can reason about, you know, whether something is true or not. So it's sort of the most verifiable field. And some of the results, I mean, some of the, you know, the results that like people are most excited about are ones where the LLM also produces a computerized proof.
So this is something called a machine-checkable proof. It's very annoying and detail-oriented to write, but then a machine can check that all the arguments it makes like actually stem from previous known facts. There's a software called Lean that's widely used to do this if you want to look into it. Yeah, go ahead.
Yeah, if you're looking for it, yeah, it's hard. And yeah, and then so for that point, that's one of the reasons I think they weren't that good at math for a long time. But I think people basically trained them to be good at evaluating these intermediate steps. So for the informal math, they do that. Yeah.
So I guess for saying which domains be good in, why it's possible to say, why is it possible to do steps in math, would it be possible to do that in physics or in chemistry or biology?
It's a great question. Yeah, I mean, I think in math, one of the reasons it's possible is they stem, like any step you have in an argument or a proof is usually referencing some prior things that are known to be true, and then there's some rules of like how you're applying those. So I think you can locally look at one of them and say, yeah, this one I'm using so-and-so theorem, and, you know, I'm plugging in this thing and that thing, so I think it's okay. I think each application is sort of small enough that you can check it.
There's still the question of how is the LLM learning to even generate the right moves in the first place. That, you know, I don't know, that's the magic of deep learning, and that's also actually where this comes in. I think a lot of the results, it's just seen so many math papers that if there's a trick someone used in a paper, it's, you know, it's going to use a similar trick. But I don't know, you do more math than me, so that's why whenever I have an issue with those, I ask theory faculty.
So yeah, but yes, but when they tell me I think I got it, I can actually, you know, try to verify the argument somehow if I work really hard. So that's the part that fits in there.
Okay, yeah, but I think math was a surprise because a lot of real math is informal. The only thing is eventually if we got it, we can get these verified proofs. That's why I put it first, because if you get good enough to do these, then your AI can probably do a lot more correct math in the future.
Okay, then programming is another one, right? Programming is one of the best things in terms of verification. You know, human programmers make mistakes all the time, so they write a lot of tests. So if you have an AI working on your software and it is making a change, you can run the tests and see, well, it didn't break anything else.
And you also have lots of examples of tests that you can put into its learning, into its prior knowledge, so it can become good at testing its own things. And also it's very fast. I mean, this is, you just need to think about the math, there's no dependence on the outside world to validate this. Here you have to run a program. It might be slow. It might be booting up, you know, like Windows or something. But, you know, it's still in the grand scheme of things, it's not that slow, at least compared to running an experiment in biology or something. So, you know, it's still pretty good. And that's why they're good at that.
And then protein folding was one that was really mostly about data. Essentially for AlphaFold, they had a lot of data that like people had created of here's a protein sequence and here's the structure of how it folded, plus they had general data about proteins. Like these proteins are related to each other. You know, they both do the same thing, or they like, you know, they evolve differently in like cats and dogs, but they're like still mostly similar. So it uses that kind of information too. And that was a big effort to get all this together, but eventually it became good enough to do it. Okay. Go ahead.
So you talked about like how AI kind of thrives if we have a deterministic unit test code or something like that for math programming. So what about, you know, in domains like cybersecurity where, you know, it's kind of mutating all the time? So what about the concepts of continual learning, and how would you like, how would you think of creating like a verifier that...
Yeah, so I would say, so yeah, the finding security vulnerabilities, it's a little bit, in a way it's a little bit like these informal arguments here, where if I show you, like if I show you the code that I think is bad, then it's fairly easy with just like small, you know, local reasoning for you to think about it and say, yeah, I think there's a problem there.
So it's again, it's not like automatic. Maybe in some cases you can automatically test it, but these models like Mythos, they don't necessarily need to run the code. They can just look at it and tell you, well, look, here you're receiving this input from the user and, you know, you assume it won't be a negative number, but like sometimes it is and then something else will break or whatever.
So it's like that. It's more there are many things to search for, but once you find it, it's pretty easy to check. And yeah, there's no, with today's models, there's like essentially no continual updating or learning at all. We just run them and hopefully in a few months they release a new model and it knows a little more about the world. I'm not going to talk about that at all, but there's quite a bit you can do even with these. Yeah.
Okay, so these are some of these domains. So in contrast, like let me show you some that are hard and what I think you'll need some, you know, big leaps to make a difference there. So one of them is biology. So, you know, things like a protein structure, we had ways of doing that and gathering data, but many things in biology are very slow and costly to evaluate. Like for example, if I'm trying to see, you know, what's the effect of like some change in, like say some DNA or like, you know, environment in the womb or whatever for like mouse development, right?
Well, it takes months for a mouse to develop, right? To be born and to grow, and for me to see if like, you know, if its mother like ate whatever thing, then the mouse is doing better or worse. And there's no way to speed that up. I mean, I could try a smaller animal, but then it's not a mouse. Even the mouse is not a human, which is maybe what I care about.
Or even worse, like let's say I want to make mice live longer. They already live a long time. So what can I do? I have to wait years to do an experiment, and there's really no good way to tell in the meantime. So that's where a lot of AI, like these are hard to do. LLMs can generate lots of ideas with their world knowledge, but validating the idea is hard. And I honestly, even humans generate way more ideas than we have time to check in the lab.
Okay. Another one is any kind of human behavior, you know, in as much as like the LLM can't figure out, you know, how humans will react to something.
So one that I like is AI is a good teaching tool, but like how can we make it even better at teaching? So unfortunately, and the same is true in like the School of Education and so on, it's really hard to evaluate whether some teaching idea actually works because you have to teach students with it for a while and then see maybe like years down the line how they're doing.
And this is something that's basically we're learning something about how humans behave. So there's not much maybe prior knowledge that the LLM can have. It can't like reason its way through it and think, you know, I believe if people did, you know, more homeworks, they would be better at this or whatever. It's hard to tell.
Or like running a company, right? Like we have a business school here, but like how many people have actually had practice running multiple companies and can then learn and do it better? It's just not that easy. And we certainly can't let AI during training run a company and see what's going to happen to teach it. Okay.
And then there are also some other things on the boundary. Robotics, depending what it's doing, it might be easy or it might be hard. This is one where you can also simulate it. So it's a little bit closer to programming maybe if you can simulate everything, but you know, maybe not, maybe it's not accurate enough for certain things. Okay.
Is there a hope to maybe somehow pack a lot of experiments together into one big experiment or like a framework?
Yeah, so that would be really cool. That's actually one of the things that, you know, I'm interested in in research, but not really doing. So yeah, can I run lots of experiments in parallel, right? Like with students, say I'm trying to teach students and see if they'll do better on the SAT. You know, there's like millions of students who take it. So I could give them like different setups and then see who does better.
Unfortunately, most machine learning methods actually don't scale well with the size of how many things you can test in parallel. That's called a batch size. So yeah, but maybe you could do it. I think there's room to do something there. Yeah.
So it depends a little bit on what aspect of the evaluation. As far as that one helps you if it's just slow to do, but not monetarily expensive. But some of them are also just expensive. So, you know, that's then you can even if you could do lots of them, it wouldn't help. Yeah.
Okay, so these are some examples. So yeah, so based on this, I mean, this is very informal, but it tells us like some areas we could try to work on to make it better.
So for learning, if we want to make learning better, we need to have AI learn from fewer examples. If getting each example is hard, we need to learn more essentially per example. So I'll talk about a project we're doing that does that. And in machine learning, that's called sample efficient.
So there are different types of learning. It could be you just see examples someone else did and find a pattern in them, or it could be what's called reinforcement learning where the AI tries to do a task and then gets a score. And, you know, both of them, it's called a sample. So we want fewer samples to learn more.
But all methods today are much less sample efficient than humans. Like humans can learn a task from, you know, just seeing a couple of examples. Even like animals and stuff can often do that, but the current machine learning methods can't. Okay.
And then there's also in search. So this one is less clear exactly how to model it. This is where I think some theory would be really great. But if you're doing these search methods where you're like sort of proposing moves or changes and evaluating them and proposing new ones, you need some combination of like diversity. You need to be creative and like actually propose, you know, a better solution.
You need quality. If like 99% of the ideas you have are bad, but like 1% are good, it's going to take longer to find a good solution. And also you need some way to score them maybe without fully doing the task.
Like this is I think what Umesh was saying for math, or like as you're developing your proof, you have some ideas and you have some intuition about this is a promising path or this one is not. So that's also hard to get.
But yeah, this is one I'd love to have a more precise model of like AI-based search and, you know, how improving these things can lead to a better result. Yeah.
Given the search, how much do you propose, you know, when you use LLMs especially in successful domains, how much of the thinking is done by LLMs and how much of it is calling the right tools, including search?
Yeah, yeah, no, I mean, yeah, I'm talking about the LLM searching like in its reasoning process here actually. So it's thinking like, oh, I did this, let me try this or that. But yes, you can use external tools and you can also like look for external information to get ideas and stuff like that. Yeah.
You know, just to get a sense, is that a minority or is it a significant percentage?
So I think in programming there's quite a bit, but for example the cybersecurity stuff I talked about, I think the models find them even without running any code.
So they might be better if they can run code, but they just reason about it. They just like think through like, okay, every place where there could be a security vulnerability, like let me just check what was going on. Yeah.
Yeah, it's a great question. Actually, it might be that running tools slows you down and confuses you, and you should just be thinking more instead. So I don't know what the right answer is. Yeah. Uh-huh.
Okay, so yeah, so I'll talk a little bit about some projects in both of these. So as I said, learning, we want to be more sample efficient. Search, how do we make the search better than whatever LLMs do on their own today when they're trying to solve a problem? We have some ideas in each, but it's very early on.
So for learning, I'll talk about this project we started called JEPA, which is a, we call it reflective optimization, but basically it's a way to get more sample efficient learning in many areas by having AI actually reason about like what it's trying to learn and what's happening when you do an experiment or when you run a sample. So and this is actually is now widely used in a bunch of places there.
This is also, it's a successor to FunSearch from Google that I mentioned, which is having an LLM guide a search. So there's other work in this area too.
And then I also want to talk about one application where we're trying to make, you know, both search and learning more effective in biology, where we're setting up, there's a problem that's like hard to evaluate, but we set up related problems and by training an agent on those, it becomes good at the target problem too.
So that's an example of a strategy where like if the main thing you're doing is hard, you do these other ones. It's kind of like if I'm trying to learn to play soccer, I can just play lots of games because they're two hours, but maybe I can practice shooting on the goal for a while and like I'll actually be better the next time I'm in a game. So that's the idea there.
And then finally, like a little bit of some baby steps sort of theory I call it that we built on how we can make search better or how it scales, and there's some surprising things there that are kind of fun. Okay, so let me talk about this one first.
So this is based on a paper we published last year, mostly with folks here at Berkeley, and it's about what we call evolution of prompts instead of training models the classic way.
So to explain it, I want to talk about first how does classic machine learning work? So in machine learning classically, you have this model which is basically a bunch of numbers, or like when you have an input, you run this formula over them and you get an output.
And there's a way, so these numbers in the model that you tune are called weights. There's like billions or trillions of them in language models today. Classically we used to have like, you know, a hundred or a thousand was considered a large model, but...
And there's these different ways to do it, but like one of them, most, they're all some form of gradient descent, which is if you took calculus, it's like following the derivative to try to make a score better for your task.
So there are a bunch of approaches. There's with language models, there's something called pre-training where it just predicts public data from the web, and then there's supervised tuning and reinforcement learning where you know how to score an answer and you sort of let it try to produce an answer and then score it and give it feedback. And these all require lots of examples.
So as I said before, progress in many capabilities is bottlenecked by sample efficiency, and in fact, as compute gets cheaper, even the...
compute cost of these training things will go down and it'll be all about getting the samples. So let's look at what's happening in these and why is there an opportunity to do better? So let's look at reinforcement learning for example, which is one of the learning approaches. You have your model give a task to do. These are called rollouts, and then it does something complicated. Like, let's say it's programming, you know, it tries to maybe it searches the web, it reads some code, it writes some code, whatever, it produces its final program, and then you run a test on it, and you get a score called a reward. And that's usually just a zero or one. Did it succeed or not? Maybe it's a number of like how many test cases it passed. And then you just pass that through these gradient descent algorithms to update the weights in the model. So if you think about it just from first principles, you know, this is what we designed because we viewed models as a bunch of like numbers and a function with numbers that we try to optimize. But there's actually a lot of information in these rollouts that is not used. Like if we read it as a human, we could tell you, well, you failed this one because, you know, you didn't run a specific test or like you didn't use certain tool to validate what you did or whatever. But we don't know how just reasoning about these traces can give us weight updates that we can use to update this thing. So how can we use this other information? And again, imagine these are very expensive. We would want to get more information on it than it ran for like 5 days and it failed or it ran and it succeeded.
So our idea is what we call reflective optimization. So we're going to have an LLM look at the traces of what you did to get an answer, and it will reason in natural language about what it did. It'll just read them and sort of think about it. And we call that reflection. So it can use all the intermediate results. It can even run new tools. Like it can test your thing and the program you wrote and say, oh, it fails this test that I came up with or whatever. No wonder it was wrong. And then there's a question of how we go from that natural language reasoning to making the agent better. And the way we're going to do that is we update a prompt for it instead. So we update the text instructions for a model instead of updating the model numeric weights. And the idea there is a small change like just noticing, hey, you make this kind of mistake all the time. I can just write a little instruction in the prompt and maybe it will never make the mistake. So actually I can also take bigger steps than I would with the classical approach of like weight updates with gradient descent.
So, you know, just stepping back, you know, if you haven't followed the gradient descent thing, the idea here is we're going to learn text instead of numbers. So we're going to learn instructions that make an LLM do a task very well. And if you do mathematical optimization, you probably have a queasy feeling because none of the classical stuff really applies to text, but we'll see what it looks like. So this is the algorithm we developed, GEPA, one algorithm to do this, stands for genetic Pareto, but it's basically an evolutionary algorithm where we have a few candidate solutions. We test them out and then like we combine them and produce new ones and over time this gives us very good instructions to get an agent to do a task. And as I said, FunSearch before and AlphaEvolve from Google are also in this space. There's a bunch of things in this space but this is one of the earliest ones and most effective ones to do this.
So how does it do so? I'm going to compare it here with one of the reinforcement learning algorithms called GRPO. So here we're trying to get an agent to answer questions about like some documents and it has to learn to do multi-hop search like it's a complicated question where maybe I, you know, I read one document and then based on the information there I do more searches and eventually answer it. And we looked at the number of rollouts like the number of samples you need, experiments you need to get a certain quality score and you can see GEPA, this blue one, very quickly like rises to good score compared to this GRPO which even if we ran it for 50,000 steps, I think it didn't get to this. Go ahead, yeah.
This is what the specific task?
Whereas GRPO is updating the weights and it could help future tasks.
Well, no, no, no, no, this is no, they're both doing a, you have a training set. It's the same training set and we measure the performance on, on addition on test new tasks that are similar, yeah. So it's the same setup and they're both, they both need the models that generalize like you do well on new questions. Yeah.
So yeah, a rollout is whenever I run my latest model or agent and I run it on a training example and I get back a score. And yes, with GEPA it will make one update after each of those.
Well, it's, we're not running all of them. We're running a few examples at a time and making changes based on those and then running more. But the total number of times you run is the same basically and yeah. It's kind of like imagine, I don't know, like for the thing with mice, like a rollout would be I'm going to grow one mouse and like, you know, look at it or whatever, or you know, so it's kind of the same. So GEPA does it, you know, it has its own way of deciding when to do a rollout and how many to do to update. Yeah.
What is costly here? Is it the number of runs or is it the number of human feedback that...
Yeah, here it's the each rollout. There's no human feedback here. We just have a training set where we have questions and we know the final answer and we're trying to teach the agents to search a bunch of documents to get that answer. So a human created those training sets once. It's the same effort to create it. So, but rollout just how many times it runs. So, this is a proxy like this is something that's actually fast to do rollouts in and cheap, but it's a proxy for like more expensive things because we didn't want to actually do something expensive. We have, you know, some other ones later where it's more like that. Yeah. Yeah, but the point is normally people don't, I mean they don't look so much at this metric of number of rollouts. They look more at compute cost or something. But here if you just look at number of times I have to do an experiment and improve my agent, this can learn very quickly. That's the idea here. Yeah.
Just a technical, you train only the prompt or you train the model itself to...
This is training. Yeah, GEPA only trains the prompt. I'll show some examples in... We have some later work where we also train the model. Yeah. Mhm.
Are you doing any regularization in the prompt space so it doesn't get too big or it doesn't go to emojis only?
Yeah, we are doing some things. Yeah, so I'll show how it works, but basically, yeah, the many of the updates, so we have an AI look at what the agent did and propose a change of the prompt. Many of those are bad ideas. So, we also have a validation set where like we try the proposed ideas and only keep the ones that make it better in some way. That's part of like what makes this work. Yeah. Uh-huh. Yeah.
Are some of the models better or more susceptible to the prompt tuning than the other...
Yeah, they are. So, I think today they're all pretty good, but historically like some models weren't that good at following instructions or if you had too many, they just wouldn't follow them. Yeah.
Do you think that in the perfect world no prompt tuning would be effective because models will be smart enough to prompt tune themselves?
Ah, it's a good... Maybe, but you, but then you need to tell it to do it. Yeah. I mean it needs to get information about your task, right? Like if there's something it doesn't know from training about, then it has to somehow learn it through doing experiments or rollouts. And the question is how quickly can I learn that? For sure, as models get better, I expect this to be faster. Yeah.
Yeah, yeah. These are all, yeah, I could, yeah, I could give it instructions at the beginning when I run GEPA. Like I could just tell it, you know, don't do these types of things and it will follow it every time it proposes a change or it might discover ones on its own. Yeah.
Yeah, it could be. Yeah, yeah. Yeah, it doesn't actually do that, but that's, it's worth a try. Yeah, we haven't looked too much into what's the best way to tell it to change things, but yeah, it's definitely, it's very easy to give it instructions. That's another cool thing. Yeah.
What kind of prompt changes are you seeing for this game?
So I'll, yeah, I'll show what it's doing. So they're pretty cool. And one of the things I worked on prompts before this too, ways to find prompts, and I think it's very unintuitive for people what prompts will have what effect on a model. So this is why actually automatically exploring them can help. But even with like a few hundred tests here, like you get very good results. That's sort of the point. So it's very fast. That's why people use this. So just as an example, like this was one of the prompts it created. This might be too small to see, but basically this is like it's doing this multi-hop search. So it's like, okay, you were given the question that the user is asking, and also you did the first search and you had some document and wrote a summary. So now you decide to do a second search to like, you know, look for more information to answer the question.
So this, the original prompt we had in the agent was just this. Like you're given question, summary one, whatever. It could be nicer than this too. It doesn't matter too much. But then this is the one that it wrote. So for example, it decided that, or at least the problem that performed well according to our testing tells it, okay, the original question is usually complex and requires info from multiple documents. You answer that with that. Now you want to generate a query to retrieve documents not found in the first hop that can answer the question completely. So, you know, you make sure you understand this. Blah blah blah. Make sure you look for the missing pieces. You must retrieve things not found in the first hop. Like don't just send the same question again. And it had all these things. So, let's see. Is this a good example?
Yeah, like this is a pretty random example, but I think it saw this in the training and keeping this instruction helped it. So, like if the first summary describes the population of a small civil parish, but the question is total population, you should ask for the total thing, like, you know, whatever that thing is part of or, you know, or whatever it is. If it covers a song and ask for the album, ask about the album now that you figured out what album the song is in or whatever. Yeah.
Some of the problems that solved these long-standing math problems were actually of this type. So, they were, they seemed like a second step. Like give me a problem that will solve the problem. So, I don't know if they were just...