
Karpathy launched an autonomous AI researcher that tunes neural networks while you sleep 🤯
Andrej Karpathy released
autoresearch — a repository that literally turns the ML research process into a while True loop for LLM agents. The mechanics are simple and built around three files:
1️⃣
prepare.py — the rock-solid foundation. Downloads data, trains a BPE tokenizer, and defines an evaluation function (metric val_bpb — bits per byte). This file is off-limits to the agent. This isolates the metric from the subject so the AI cannot "hack" the test itself.2️⃣
train.py — the sandbox. Training a GPT-like model with a fancy custom optimizer (here Muon + AdamW). The agent can modify this file however it wants: change layers, hyperparameters, batch size, logic.3️⃣
program.md — an instruction prompt that sets the rules for the agent (e.g., local Claude).⚙️ How the loop works:
You feed the AI a task and go to sleep. The agent reads the code, comes up with a hypothesis (e.g., "I'll change the learning rate and adjust value embeddings"), rewrites
train.py, and starts training.The agent has a hard limit — exactly 300 seconds per run. The agent comes up with a hypothesis ➡️ rewrites
train.py ➡️ runs the script. If after 5 minutes
val_bpb has dropped, the change is committed (git commit). If it runs out of memory (OOM) or the metric degrades — git reset and next hypothesis. One experiment — 5 minutes. That's 12 experiments per hour. About 100 while you sleep. In the morning, you just open
results.tsv (there's a script in the repo for plotting graphs) and pick up the ready-optimized architecture for your hardware.You no longer need to debug tensor dimensions by hand. Your value as an engineer is now measured not by your knowledge of PyTorch parameters, but by how well you can write
program.md 😏#good_opensource
Comments
0No comments yet.
Sign in to join the discussion.