Autoresearch: Karpathy Lets AI Agents Run ML Experiments While You Sleep
What if your AI coding agent did machine learning research overnight while you slept? That's the idea behind autoresearch, a small experiment from Andrej Karpathy released in March 2026. The Python project has about 100,000 stars and 13,800 forks on GitHub, and its README lists the MIT license.
What it is
Autoresearch hands an AI agent a small but real LLM training setup and lets it experiment on its own. The agent edits the code, trains for five minutes, checks whether the result improved, keeps or discards the change, and repeats. The training code is a simplified single-GPU version of Karpathy's nanochat. The twist is that you don't edit the Python yourself. You write program.md, a plain Markdown file of instructions that sets up your "research org."
Key features
- Three files that matter.
prepare.pyhandles data prep and evaluation and is never touched.train.pyholds the GPT model, optimizer, and training loop, and the agent edits it.program.mdis the file you edit. - Fixed five-minute budget. Every run trains for the same wall-clock time, so results are directly comparable. That works out to about 12 experiments an hour, or roughly 100 overnight.
- One clear metric. Runs are scored on validation bits per byte (val_bpb), where lower is better.
- Everything is logged. The agent works on its own git branch, commits each idea, and records results in a
results.tsvfile as keep, discard, or crash.
Why it matters
Autoresearch is a hands-on look at agents doing real research instead of just writing app code. It's for ML tinkerers, students, and anyone curious about where agentic AI is headed. Fair warning: it needs a single NVIDIA GPU (tested on an H100). Community forks listed in the README cover macOS, Windows RTX cards, and AMD.
Getting started
You need Python 3.10+ and uv. Run uv sync, then uv run prepare.py to download data and train the tokenizer, then uv run train.py for one test run. If that works, open Claude, Codex, or another coding agent in the repo and point it at program.md to kick off a new experiment.
View the repo on GitHub: github.com/karpathy/autoresearch

