Alphaevolve and Autoresearch in the Context of Optimisation Algorithms
In March of 2026, something changed. Karpathy made his autoresearch repository public. For those of you who do not know what autoresearch does: it is a very simple program that uses coding agents (like Claude or Codex) to improve a Large Language Model (LLM). It is an agent powered by an LLM that runs experiments to improve an LLM.
This gave the public a first hint of the dreaded Recursive Self-Improvement (RSI). Under RSI, the speed of Large Language Model innovation would increase exponentially. Each generation of LLMs could be used to build the next one. If you have ever read Goethe’s The Sorcerer’s Apprentice, or watched Disney’s rendition of it in Fantasia, this could feel a bit scary.
Autoresearch is a fantastic example of Karpathy’s taste for simplicity. A simple markdown file defines an entire experimentation process. Yet, the idea of using LLMs for optimisation is not new. Let’s take a step back and put it in perspective.
Optimisation
Optimisation is one of my favourite topics. If you are not familiar with it, I would recommend reading my introductory article on Coffee Machines and Optimisation, or my series on Optimisation.
Too busy to click on these links? Fine. Optimisation is concerned with minimising or maximising an objective function \(f(x)\) given a set of constraints. Formally, we express an optimisation problem as:
\[\min_x f(x) \quad \text{subject to} \quad g(x) \le C\]
I am writing this article on a train from Paris to Berlin. This morning, I had to pack my bag, a typical optimisation problem. Here, \(x\) is a combination of items (e.g., what I pack in my bag), and \(\mathcal{X}\) is the set of all possible combinations. I want to maximise the satisfaction brought by the items I pack (objective function \(f(x)\)), while making sure that my bag still closes (constraint \(g(x) \le C\)).
There are more serious optimisation problems, particularly in the field of Machine Learning (topic introduction here). One of the principled ways to build Machine Learning pipelines is to find the models and hyperparameters that achieve the highest predictive accuracy.
Training a Large Language Model is another optimisation problem. The goal is to find the model weights \(W\) that maximise the model’s ability to predict the next word. The world around us is full of optimisation problems. Our time on earth is limited, what do we want to do with it?
Common Optimisation Algorithms
But concretely, how can we optimise a function? Let’s say I am making some crêpes, one of my favourite desserts. I want to find the best recipe. Formulating this as an optimisation problem, I want to find the set of ingredients and their quantity that maximise crêpe goodness.
To do so, I can start with the recipe I find online. If the crêpes fall apart, I will add an egg or remove some milk next time. If they are too sweet, I will put less sugar. This is a trial-and-error based approach.
You could do the same to build a Machine Learning pipeline. You can start training a simple Linear Regression. If the model has a high error, you may want to try testing other algorithms like XGBoost or Nearest Neighbours.
In optimisation, this is very similar to a method called Hill-Climbing. You start with a given configuration (recipe) and explore neighbouring configurations (more sugar, less milk). With this process, you can incrementally improve crêpe goodness and search the space of all possible recipes. You can follow the same process to improve a Machine Learning pipeline.
Neighbourhood Operators
Like many optimisation algorithms, Hill-Climbing is a neighbourhood-based search. You start from a given configuration and explore neighbouring configurations. This works in well-defined search spaces like a crêpe recipe, but has some limitations.
The crêpe search algorithm explained above cannot find theoretical novelties like adding rum, trying a vegan recipe or using a different type of flour. It is constrained by the search space I had previously defined; i.e., changing the quantities of the different ingredients already present in the original recipe. I could also include the possibility of adding a new ingredient in the search space (like rum or vanilla).
But here again, the optimisation will not be able to surprise me. It is constrained by the search space defined. It can only come up with better configurations from a known (large) set of configurations.
LLMs as Neighbourhood Operators
Something changed with the publication of Alphaevolve by Google DeepMind. For the first time, the creativity of LLMs was used to come up with new crêpes recipes. Or in more general terms, Large Language Models were used to find neighbouring configurations.
Given a crêpe recipe, the LLM was prompted to suggest improvements. It was not constrained by any search space. For instance, it could suggest that I form a well with the flour to gradually incorporate the eggs without creating flour lumps. This would not have been possible with the Hill-Climbing process described above, in which only the quantities of the different ingredients could change.

Moving away from cooking into the field of building Machine Learning pipelines; instead of searching through a pre-defined grid of hyperparameters, the LLM could propose code changes to the pipeline definition. The LLM could surprise the builder of the optimisation system, and come up with new innovative solutions.
For example, here is an open-ended change suggested by an LLM optimising a scikit-learn pipeline, modifying both the dimensionality reduction and classifier hyperparameters:
--- trial_1
+++ trial_6
@@ -6,10 +6,10 @@
from sklearn.linear_model import LogisticRegression
def make_model(random_state: int = 0):
- # Add PCA for dimensionality reduction before logistic regression.
+ # Increase PCA components, use stronger regularization (C=0.5), and L2 penalty.
pipe = Pipeline([
("scaler", StandardScaler()),
- ("pca", PCA(n_components=30, random_state=random_state)),
- ("clf", LogisticRegression(max_iter=1000, C=1.0, random_state=random_state))
+ ("pca", PCA(n_components=38, random_state=random_state)),
+ ("clf", LogisticRegression(max_iter=1000, C=0.5, penalty="l2", solver="lbfgs", random_state=random_state))
])
return pipeThis is an actual example of a change suggested by my own implementation of Alphaevolve.
Alphaevolve was used to find novel solutions to a range of mathematical and engineering problems. As a Machine Learning practitioner, I was amazed. We could now improve systems beyond simple parameter changes (quantities of the different ingredients).
Back to the topic of Recursive Self-Improvement, Alphaevolve was used to optimise the matrix multiplication kernel used in the training of the Google Gemini LLM (DeepMind Blog). This is one of the first hints of LLMs improving LLMs.
Alphaevolve was a big step. But there was no open-source implementation of it. I generated my own that worked relatively well. Still, I doubt that people would bother building the harness for this tool to work. The implementation involved repeatedly calling a range of different LLMs, building an iteration loop, and maintaining a database of trials.
The Zen of Autoresearch
Having to build such an elaborate system felt wrong. At this time, I was already using Claude Code, an existing coding agent. Why couldn’t we use this existing agentic loop to generate new configurations and run the experiments?
This is exactly what Karpathy shared with the world. Beyond the hype of Recursive Self-Improvement, everyone with Claude Code access could write a text file and let Claude run LLM-based optimisation experiments.
Do we even need a separate markdown file?
Karpathy proved that we did not need to code our own agentic loop to do auto-research. A simple markdown file would be enough.
Anthropic and OpenAI have now fully productionised these types of features. Users of Claude Code can now use the /goal command to specify the metric they want to optimise.
Now, if there is anything you would like to optimise for, like the accuracy of a Machine Learning model or the latency of a function, you just need a single prompt to Claude Code. It would be as simple as:
/goal "Maximise val_accuracy in model.py while keeping execution under 5 mins"Is it the end of Hyperparameter Optimisation as we know it?
Not really. Automated Hyperparameter Optimisation (HPO) is still much faster and more efficient than using LLMs. When you are looking to optimise a function within a well-defined search space, it would be a waste of compute to use an LLM. HPO methods are fast, cheap and mathematically grounded.
On the other hand, Alphaevolve and Autoresearch can shine in any problem that requires building something with code with an objective evaluation metric.
For instance:
- Building a function with a goal to reduce its latency
- Designing a Machine Learning pipeline to maximise predictive accuracy
This paper by Zhang et al. (2026) shows that combining Autoresearch to write code and HPO to search grids is the best method to design Machine Learning prediction pipelines.

Autoresearch in a single prompt
The first version of Autoresearch was a markdown file. If you want to optimise a given metric by building a system with code, you do not need a specific markdown file anymore. You can just ask Claude Code or Codex to do it.
This is a major change in the way we build things. When working on a prediction problem in which I want to maximise a model’s accuracy, I simply give the dataset, target and some context to the agent. It will do the rest.
What this means for human-led research
Should we now leave LLMs to optimise whatever they want to optimise and hope for the best? I would not want that. As humans, we are still (for now) defining research goals. We use our own sense of agency to determine what should be built.
In delegating research to LLMs, we have to be careful not to let our own research skills atrophy. Scientific investigation, literature review, experimentation, results analysis… All of these are critical skills that have an impact on the quality of our life. Practising these skills will take more and more discipline.
In this new LLM-driven world, the human-in-the-loop is becoming a lot more powerful. We can now throw an LLM at any problem we want to solve. What problem do you now want to solve next?