Karpathy's Autoresearch Loop for Trading: What Moon Dev's Port Misses
By Matt Cullerton, founder of Mavric and Apso
Autoresearch is an open-source loop from Andrej Karpathy that lets an AI agent edit code, run an experiment, keep what improves a score and discard what does not, all without a human watching. A TikTok from @moondevonyt says "the co-founder of OpenAI" just released this loop and that he applied it to trading systems. The port is real, but the loop was published six months earlier for LLM training on a GPU, and the part that keeps it honest, a scoring step the agent cannot touch, is not visible in his setup.
Is Andrej Karpathy a co-founder of OpenAI?
Karpathy describes himself differently. His site, karpathy.ai, says "I was a research scientist and a founding member at OpenAI." Wikipedia also calls him "a founding member", and Fortune called him "one of the founding employees of OpenAI." TechCrunch has described him as having "co-founded" OpenAI, so the video repeats a label some press uses, but it is looser than his own.
He was also no longer at OpenAI when the video was posted. Wikipedia lists his OpenAI tenure as 2015 to 2017 and February 2023 to February 2024. On 2026-05-19, TechCrunch reported he had joined Anthropic's pre-training team, where an Anthropic spokesperson said he "will start a team focused on using Claude to accelerate pre-training research."
When was autoresearch released?
The repository karpathy/autoresearch was created on 2026-03-06, and its last push was 2026-03-26. The video went up on 2026-09-18, 195 days after the repo appeared. Fortune had already named it "The Karpathy Loop" on 2026-03-17, reporting that Karpathy let the agent run for two days, during which it ran 700 experiments and found 20 optimizations that improved training time. By 2026-10-19 the repo had 98,178 stars and 13,600 forks. The video's framing that he "just changed trading" does not fit those dates.
What does autoresearch do?
The README describes the goal: "give an AI agent a small but real LLM training setup and let it experiment autonomously overnight. It modifies the code, trains for 5 minutes, checks if the result improved, keeps or discards, and repeats."
The target metric is validation bits per byte. The instructions file, program.md, says "The goal is simple: get the lowest val_bpb." The README lists the hardware as "A single NVIDIA GPU (tested on H100), Python 3.10+, uv." Neither file mentions trading.
The loop in program.md runs under the heading "LOOP FOREVER": edit train.py, commit, run the training, read the result, log it in results.tsv, keep the commit if the score improved, and git reset if it did not. A section headed "NEVER STOP" tells the agent to keep working "indefinitely until you are manually stopped", with the example of a user who leaves it "running while they sleep" for about 100 experiments a night.
How Moon Dev adapted it for trading
The clip shows a coding agent reading results.tsv and baseline.json, which matches the log file program.md specifies. Moon Dev ported the structure.
The measurement changed completely. Karpathy's agent trains a model on a GPU for five minutes and reads one number. Moon Dev's agent runs Python scripts that load pandas and pandas_ta against saved price data, which is a backtest. The video's caption says Karpathy "handed me the exact loop", but he published a loop for LLM training, and the inner step was rewritten for a different job.
The clip covers about four minutes of agent activity, from 09:25:18 to 09:29:13, and shows one accepted change, where the agent notes that "The whole delay=2/3 row beats delay=1" and calls it "a plateau, not a fitted cell." No frame shows a results history, a profit and loss figure or an equity curve, so the claim that the systems keep getting "better and better and better" is not shown.
Can an AI agent overfit a trading backtest?
Yes, and this is the main risk in the port. Autoresearch is safe to run unattended because the agent cannot change how it is scored. program.md says the agent may not "Modify prepare.py. It is read-only." It also says the evaluate_bpb function "is the ground truth metric", and that metric is computed on held-out data the agent never trains on.
A trading version needs an equivalent: a held-out time period and a walk-forward test the agent cannot edit. An agent that tries hundreds of parameter variations on one price history will find settings that fit that history and nothing else. The video shows no read-only scoring code, no out-of-sample window and no comparison against held-out data. The agent's "plateau" check is a reasonable habit, but it is weaker than a scorer the agent is forbidden to touch.
Is autoresearch free?
Yes. The repo is public, and the README ends with "License MIT". There is no LICENSE file in the repo, and the GitHub API reports no license, so the MIT grant exists only as a line in the README.
Bottom line
Autoresearch is a real Karpathy project, released in March 2026 for LLM training rather than trading. Moon Dev's port copies its loop and log format. Anyone applying it to trading should rebuild the read-only, held-out scoring that makes the original safe to leave running.
Sources
- karpathy/autoresearch on GitHub - creation and push dates, stars and forks
- autoresearch README.md - loop description, hardware, license line
- autoresearch program.md - LOOP FOREVER steps, NEVER STOP, read-only evaluation rule
- Andrej Karpathy's site - "founding member" wording
- Andrej Karpathy, Wikipedia - OpenAI tenure
- The Karpathy Loop, Fortune (2026-03-17) - 700 experiments over two days
- Karpathy joins Anthropic, TechCrunch (2026-05-19) - move to Anthropic
- The TikTok from @moondevonyt - the original claim
Published September 18, 2026. Based on a TikTok by @moondevonyt. Full video notes (markdown)