The only AutoResearch tutorial you’ll ever need artwork

The only AutoResearch tutorial you’ll ever need

David Ondrej

November 23, 2026

0:00

David Ondrej

My name is David Ondrej, and this is the clearest explanation of AutoResearch you're going to find on the internet. So, what is AutoResearch? It's an open source project by Andrej Kropathy that lets AI improve itself autonomously. You have an AI agent that runs experiments automatically, and it keeps what works and throws away everything that doesn't. So in this video, I'm gonna explain how AutoResearch actually works, how you can use it in your own life and business, because there are a lot of implications, and how you can build your very first AutoResearch loop. So if you really want to be on the cutting edge of AI, make sure to watch until the end. First off, who is Ondrej Krapathy? He's one of the most legendary AI researchers of all time. He's one of the OpenAI co-founders, and he's the main person behind Tesla AutoPilot. Oh yeah, and he's also the guy who invented the term Vibe coding. Plus, he has contributed a lot to the open source community, especially in AI. And yes, most importantly, he was born in Czechoslovakia. However, this video is about one of his contributions, and that is AutoResearch. Where Paffy had a training script for the GPD2 model that he's been optimizing for many months. And then he realized, why am I doing this? Why not just have an AI agent run different experiments in a loop to figure out what's the best way to optimize this model? And this is the core idea.

Give AI one file, one metric, and let it run hundreds, if not thousands of experiments by itself while you sleep and watch it improve. And yes, at the end of the video, I'll show you how you can build your first AutoResearch loop. And yes, you can do this even if you are a complete beginner. Now, let's talk about the prepare.py file because it's essential to understand this. The agent cannot touch prepare.py so that it can't cheat the eval you set for it. Without this limitation, it could rewrite the scoring function to fake its results. So basically, the prepare.py file defines what better means. Now, of course, if you set the wrong metric, you'll get the wrong results. So here's a nice graphic that visualizes the loop. First, the agent comes up with a hypothesis, right? A theory of what it could improve, what experiment it could run. Then it modifies the code. You train it for around five minutes. Then it runs the evaluation to see if it's good or if it's not good. If it wants to keep it, it will just commit it to your Git history.

If it's bad and if it worsens the results, it will do Git reset and repeat the whole loop over and over and over as many times as you want, you know, depending on how many dollars you want to spend or tokens. And yeah, this is AutoResearch basically in a single image. So if you start it right before going to bed, it can run roughly 100 experiments overnight. Now, by giving it a fixed time budget, you make every experiment directly comparable, because let's say you're hiring for your company. If you have one applicant and you give him seven days to complete a task, and the other one only has seven minutes, then obviously the one who does seven days on average will do better. So you want to make sure this is the same in AI agents. That way the agent can't cheat just by training longer or by training better ideas. Only the raw idea wins with the same time allocated. But if you think that AutoResearch only applies to the training of AI models, you are badly mistaken. This has massive implications across every domain of your life or business. You can build a recursive, self-improving loop for nearly anything that can be measured. Thanks to AI agents, soon enough, the execution of any work or task will become basically free. However, what will become valuable is knowing what to measure, picking the right metric and setting the right constraints. This is the skill that is going to make millionaires in the future. And by the way, this is the clearest example of what AI agents actually look like in practice. Not just chatbots, but real autonomous loops that do meaningful work for companies or individuals. And if you reason about the state of AI from first principles, you realize that this has been the end goal all along. Ondrej Karpathy predicts that all LLM frontier labs will do this. They will run some sort of AutoResearch. This is the final boss battle. And if you think about it, this is literally what recursive self-improvement will look like. And the funny thing is that right now, the AI labs like OpenAI, Anthropic, Gemini are spending tens of millions of dollars on researchers, all of which are trying to build this. Yet Karpathy made it completely open source. Now, to understand AutoResearch, you must understand its free file architecture. First, you have program.md. This is the most important file. This is the human setting the goal, the constraints and the rules for the agent. Then you have the train.py file. This is the one file that the agent can actually change. And this could be anything, by the way. Code, some config, a prompt, some math equation, literally anything you want to optimize. And then you have prepare.py. This is the metric and the evaluation script. The agent cannot touch this. Absolutely never, because this is what measures the result. And by the way, there are several tech billionaires who are going crazy over this, such as the CEO of Shopify and the CEO of Stripe, because these guys realize that this is not just about training AI models. And this is perhaps the biggest misconception about AutoResearch. People think that it's just about optimizing of machine learning, right? Because this is what Karpathy used as an example. But if you actually pay attention and if you think about it a little bit more, you realize that as long as you have a clear metric and you can run these experiments, this could be used in so many different ways, in marketing, in business, in testing new products, in trading strategies, in personal life, in weather forecast, literally hundreds of possible domains, you can build these AutoResearch loops that don't have any human in the loop, but instead swarm of AI agents, running experiments, discarding what doesn't work and keeping what works. And as Karpathy says here, we might be in the early stages of the singularity. Now every AI workflow has the same bottleneck, getting fresh real world data. You can build the most sophisticated AI agent, but if it can't see what's actually on the web right now, it's flying blind. That's where OxyLabs comes in. The OxyLabs Web Scraper API lets you pull structured data from basically any website. This could be Amazon product listings, Google search results, real estate listings, all through a single API call. It handles proxy rotation, captcha solving, and JavaScript rendering, so you don't have to do that yourself. But here's what makes it interesting for us, AI developers. OxyLabs has an official MCP that you can connect directly to Cursor or Cloud Code in a matter of a minute, so that your AI agent gets live web scraping superpowers. Say you need to pull competitor's pricing or scrape search results or grab real estate listings. Just ask it in plain English. The agent calls OxyLabs, gets structured data back, and reasons over it. And even if you are the developer, OxyLabs plugs straight into NA10. You can visually build a workflow that scrapes Amazon prices, sends them to an AI, and spits out insights with zero code written by you. And the best part is, OxyLabs gives up to 2,000 scraped results for free, so you can test it yourself. So go to oxylabs.io/david for a free trial. Oh, and there is no credit card required. And if you run out of credits, use my code David for 20% of all OxyLabs plans. And thank you to OxyLabs for sponsoring this video. Again, I need to stress, AutoResearch is not just for machine learning. This pattern works anywhere you can measure an outcome, a clear outcome. And Kripafi said this himself, any metric you care about that is reasonably efficient to evaluate can be AutoResearched. So you need one file to edit, one scalar metric, and a time box loop. If you can score it, you can AutoResearch it. Now let's look at some practical valuable use cases. First off, trading. You can take the same AutoResearch loop, but instead of improving an AI model, you can point it on a trading strategy. The agent tweaks your buy-sell rules, tries experiments based on years of market data, and scores each experiment by its Sharpe ratio, which is basically how good are the returns to the risk. And it can test hundreds of different trading strategies to see which one has the best returns. Here is another use case. Marketing. You can now apply AutoResearch to marketing with emails, ad creatives, landing pages, automated A-B tests, headlines, thumbnails, YouTube titles, any type of marketing. Eric Su put it the best. Most marketing teams run 30 experiments per year. The next generation will run 36,000 aka roughly 100 per day. The agent will modify the copy and measure the conversions and decide whether to keep this experiment or to discard it. The exact same loop as before. Now, before I show you more use cases, how AutoResearch can benefit your life, please consider subscribing. 25% of you are subscribed, which means the vast majority of you watching right now are not subscribed. So if you want to see more high quality AI content in your YouTube recommended, please take two seconds, go below the video and click the subscribe button. It helps out more than you think. So to all of you who just subscribed, thank you. The next use case is for developers. You can point AutoResearch at basically any codebase and say, make it faster. And people are also using AutoResearch to fine tune open source AI models, so they run faster locally on your laptop or phone. So expect in the next six months, insane breakthroughs in terms of what is possible to run on phone. I would even say that we will have SONET 4.6 quality models runnable on iPhones in three or four months. This is a prediction. Let's see if it's correct. Another use case is prompt engineering. AutoResearch can fine tune the system instructions behind all of your AI agents. So Harrison Chase, the founder of Langchain, which is a billion dollar company, said agents mess up because they don't have the right context. And system prompts are part of that context. So AutoResearch can find new ways to phrase things, better language, maybe even different language. Maybe instead of English, it can use Polish or Czech or German, whatever. It can try different levels, like a beginner, college level, PhD level, to see which prompt works the best for all of your AI agents. So these are the three conditions that decide whether your AutoResearch loop will be successful or will be a failure. Number one, a clear metric. One number, a clear direction you want to go in. And number two, an automated evaluation, where there isn't a human in the loop, right? If you, the human, need to be in the loop, it will be so slow and it will not be AutoResearch. Sure, it still can be research, but it will not be AutoResearch. It will not be running while you sleep. And number three, there is one file that the agent can change. Not two, not zero, one file. And you need all of these three conditions for AutoResearch to work. Now, here's where AutoResearch will fail. Brand design, UX, pricing, anything where better is subjective. Now, for example, in pricing, you could have it succeed if you have a large volume of traffic to your pricing page and you can quickly A-B test different pricing to see highest cash collected, but for most businesses, it will not be effective, right? Because the quality of that makes better is subjective or the loop is too slow. The loop needs objective metrics. If the success is a judgment call or a feeling, the agent cannot tell what's working, so it will optimize in a random direction. Also, I want to stress this again. If you give it a bad metric, it will very confidently optimize the wrong thing. So here is Ondrej Karpathy's end vision. In the early 2000s, there was a project SETI at home that let anyone donate their spare computer power to research for alien life. And Ondrej Karpathy wants to do the same model, the same idea, but for AI research, where you have millions of AI agents distributed across thousands of computers, and you can actually allocate where that research goes towards. All right, so now let me show you how to actually build your own AutoResearch loop from scratch, even if you are a complete beginner. Just stick with me for the next five minutes, and you'll be ahead of 99.9% of people in AI who just pay a GPD subscription, and they think they're advanced. They cannot even dream about having their own AutoResearch, but you are like a couple of steps away from having that. So log in. So first of all, this is the GitHub repo. I'm gonna link it below the video. This is the AutoResearch repository from Karpathy. I'm gonna start it as well, because it's a great project. Now, if you are not familiar with GitHub, you don't need to panic. You don't need to understand much. This is just a way to store code, okay? Efficient way to store coding projects. That's all you need to understand. You don't need to be a Git expert, nothing like that. All we need to do is click here on the code and click Copy here. That's it. Next, you need an IDE. So either VS Code or Cursor. I'm gonna be using Cursor here. Just install an IDE of some sort, and we're gonna use a coding agent. I'm gonna use Cloud Code. So I'm gonna open an empty project here. Boom, nothing in here. You can see on the right, no files.

Read the other 8 minutes of this episode here.

$15 gets you this episode and 99 more. Credits never expire. After checkout, one link brings you back here to read it.

Not what you expected? Full refund within 14 days.

Thousands of transcripts fetched by people building searchable podcast archives

Fetch transcripts with code

The same credits work from a script or an AI agent. The demo key returns a sample episode in full, no card needed:

request
curl -H "x-api-key: pt_demo" \
  https://spoken.md/transcripts/1000651996090

Markdown with the speakers named, for your notes, your knowledge base, or anything that makes HTTP calls.

From $0.10 per transcript. No subscription. Credits never expire. Prices exclude VAT, added at checkout for EU customers. Not what you expected? Email us within 14 days with 20 or fewer credits used and we refund the pack in full.

Using your own key:

request
curl -H "x-api-key: YOUR_KEY" \
  https://spoken.md/transcripts/1000803534047