Autoresearch: Karpathy Lets AI Agents Run ML Experiments While You Sleep

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.py handles data prep and evaluation and is never touched. train.py holds the GPT model, optimizer, and training loop, and the agent edits it. program.md is 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.tsv file as keep, discard, or crash.
Sign up for Proton VPN

This is a referral link. I may earn a commission if you sign up through it.

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

program.md | nanochat


You’re invited to Grok Bot
Scott invited you to try Grok Bot, free for 2 weeks. Hand off real work and everyday tasks, and come back to them done.