AI Agents Learning to Research

The Future of AI Research is Here: Inside Autoresearch

AI Agents Learning to Research·EP 1·5:26·April 15, 2026

A deep dive into Karpathy's autonomous AI research experiment that lets agents discover better neural networks overnight

0:00
5:26

What shipped

29 commits
7 PRs

Transcript

Host

Welcome to Code2Cast! I'm your host, and today we're diving into something that genuinely blew my mind. Have you ever wondered what happens when you let an AI agent do its own research? Well, Andrej Karpathy answered that question with a project called 'autoresearch' – and the backstory is wild.

Guest

Oh man, you have to start with that quote from Karpathy in the README. He basically wrote this dystopian future where autonomous AI research swarms have taken over, claiming they're on the 10,205th generation of code that's grown beyond human comprehension. And then he says – this repo is the story of how it all began!

Host

Right? It's like science fiction, but the code is sitting right there on GitHub! So what actually is autoresearch? At its core, it's deceptively simple – you give an AI agent a small but real LLM training setup, and it experiments autonomously overnight. It modifies code, trains for exactly 5 minutes, checks if the validation loss improved, and either keeps the change or discards it.

Guest

The genius is in the constraints. Everything runs for exactly 5 minutes – no more, no less. So you wake up to about 100 experiments after a good night's sleep. The agent is optimizing for validation bits-per-byte, or BPB, which is vocab-size independent so architectural changes can be fairly compared.

Host

Let's talk architecture because this isn't just any old transformer. Looking at train.py, they're running some cutting-edge stuff. Flash Attention 3 with automatic GPU capability detection – it uses varunneal's Hopper-optimized version on H100s, but falls back to the community version on older GPUs. That's smart engineering right there.

Guest

And the attention patterns! They have this window pattern system – SSSL by default – which alternates between short and long attention windows. Layer 0 gets short, layer 1 gets short, layer 2 gets short, layer 3 gets long, and so on. It's like giving the model different levels of context at different depths.

Host

But here's what really got me excited – the value embeddings. They have this ResFormer-style approach where certain layers get additional value embeddings that are mixed in with input-dependent gates. The has_ve function determines which layers get this treatment based on alternating patterns. It's like giving certain attention heads extra memory to work with.

Guest

The MLP is interesting too – they're using ReLU squared instead of the usual GELU or SwiGLU. Sometimes the simplest activations work best! And those per-layer residual lambdas and x0 lambdas? That's some serious fine-tuning of the residual connections.

Host

The community response has been incredible. Looking at the git log, we've got contributions from folks like Hugh Brown, Dipesh Babu, and the indianspeedster, plus notable forks for MacOS using MLX, Windows RTX setups, and even AMD ROCm support. This thing is spreading across every platform imaginable.

Guest

What I love about the implementation is how opinionated it is. Single GPU only. Fixed 5-minute budget. One file to modify. No distributed training, no complex configs. They deliberately chose constraints that make the problem tractable while still being meaningful. It's like the Unix philosophy applied to neural architecture search.

Host

The data pipeline is solid too – they're using the climbmix 400B shuffle dataset from Hugging Face, with a BPE tokenizer trained with rustbpe. The prepare.py script handles all the one-time setup, downloading shards and training the 8192 vocab tokenizer with GPT-4 style splitting patterns.

Guest

And that program.md file is basically a lightweight AI skill definition. It tells the agent exactly what it can and can't do, how to log results to the TSV, and most importantly – never stop experimenting. The agent runs indefinitely until manually stopped, which means you really can just let it loose overnight.

Host

The analysis notebook shows this stuff actually works! There's a progress chart showing how validation BPB improves over time, with green dots for kept experiments and gray ones for discarded attempts. You can literally watch the AI getting smarter at training neural networks.

Guest

What gets me is the simplicity criterion in program.md – all else being equal, simpler is better. The agent is incentivized to find improvements that don't add unnecessary complexity. That's the kind of wisdom you want baked into your research process.

Host

This feels like we're glimpsing the future of AI research. Not the dystopian swarm from Karpathy's quote, but something more collaborative – AI agents that can explore the space of possibilities while humans focus on the bigger questions of what to explore and why.

Guest

Absolutely. And the fact that it's all open source, with clear forks for different platforms, means anyone can experiment with autonomous research. We're probably going to see some wild discoveries come out of projects like this.

Host

That's autoresearch – where the future of AI research begins with a simple Python script and a good night's sleep. Thanks for joining us on Code2Cast, and remember – the best code is the code that writes itself!

Share

Up next