Skip to content
Resources
Article

Karpathy's autoresearch, tested on a news search engine

Karpathy's autoresearch applied to search over a media client's news dispatches: the evaluation locked before the loop, the before/after table, the ideas the loop threw away and what it still cannot see.

Stan GirardStan Girard, Co-founderMonday, November 30, 20269 min🇬🇧🇫🇷
The Vibe Company mascot at night, watching a wall of small experiment cards, some kept and some discarded

Yes, Karpathy's autoresearch works beyond model training, as long as you lock the evaluation before the loop starts. On a media client's search engine, 508 runs gained 8.5 points of nDCG@10 on topics never seen during tuning, with 31% less vector memory. That score rises when the right documents reach the top ten results.

The trap is the measurement. Tobi Lütke said it about his own run at Shopify: "This is probably somewhat overfit".

I ran the loop in late November on Quivr, The Vibe Company's open-source engine. This article covers the locks I set before the first run, the before/after table, and what the loop still can't see.

Updated on 30 November 2026. Figures come from the final campaign report dated 28 November 2026, anonymised.

Karpathy's autoresearch, and what changes outside training

Autoresearch is an experiment loop that an AI agent runs alone: it edits the code, launches a short run, checks whether the result improved, keeps or discards, then repeats. Andrej Karpathy published it in his GitHub repo, created on 6 March 2026. In his words: "give an AI agent a small but real LLM training setup and let it experiment autonomously overnight".

The repo is three files. prepare.py holds the fixed constants, the data prep and the evaluation, and the agent leaves it alone. train.py is the only file the agent edits. program.md carries the instructions, and the human edits it. Each training run lasts five minutes, hence "approx 100 experiments while you sleep". The metric, val_bpb (validation bits per byte), has to go down. So the agent has no hold on the evaluation.

Shopify took the loop out of training. In "Autoresearch isn't just for training models", published on 15 April 2026, David Cortés explains that the company generalised it to improve 40+ metrics. The recipe stays the same: one hypothesis per iteration, kept if the number improves.

The same article notes that the agent "also does ugly hacks sometimes, like removing a lot of files. Yeah, it's faster, but that's not acceptable." It also quotes Tobi Lütke, on 12 March 2026, after a run on Liquid: "53% faster combined parse+render time, 61% fewer object allocations. This is probably somewhat overfit". His word, overfit. Outside training, the real work is the evaluation.

The terrain: search over a media client's news dispatches

The terrain is search in Quivr, over a corpus of French news dispatches at a media client: a case of AI for media. Two parts were frozen, and the agents weren't allowed to touch them: Weaviate v1.39.14 and the embedding model google/embeddinggemma-2 (768 dimensions). Every shipped component also had to be 100% open source, under Apache-2.0 or MIT.

The evaluation dataset, version v0 dated 27 November 2026, holds 295,049 dispatches and 18 topics. It carries 3,659 "silver" judgments, produced by an LLM, and 185 "gold" judgments, made by human annotators.

Search is a good target. Each run returns one number, nDCG@10, and stays light: there's no model to train.

The starting point: default Quivr, with 512-token chunks. On the 7 topics set aside for confirmation, it scores 0.6694 nDCG@10 and answers in 646 ms at the 95th percentile (warm p95). That is the number to beat.

Lock the evaluation before the first iteration

I locked the evaluation before the first iteration, because the risk was known. On 26 November 2026, in a framing meeting, I proposed an automatic evaluation pipeline and, in parallel, an autonomous agent loop to optimise the retriever. The risk of overfitting a small dataset came up in that meeting.

The answer is five steps, the ones in Quivr's public guide:

  1. Split the evaluation set before any tuning: a working split, and a locked "heldout" split never inspected during development.
  2. Track a full Pareto tuple rather than one metric: nDCG@10, human Gold nDCG@10, Recall@50, MRR@10, false positives, warm p95, RAM for 10 million documents.
  3. Test one hypothesis per run, against a keep/discard gate.
  4. Run the public generalisation guardrails before shipping: miracl-fr (343 queries, French Wikipedia) and xpqa-fr (200 queries, product questions).
  5. Confirm once on the locked heldout, then validate the plugin contract.

At this client, the split gives 11 working topics, where the agents tune, and 7 heldout topics that no tuning has seen. The files are encrypted separately, split by split. An agent on the working split can't read the heldout. Only the confirmation runner reads it, at most 10 times per campaign, and only the coordinator launches it.

Quivr publishes this gate in its public harness (PR #4081): zero query failures, an nDCG@10 of at least 0.99 times the champion's, a p95 under 400 ms on the worst query set.

The conversation coordinating the campaign ran in Antigravity, on Gemini 4 Neon, Google's model. It relied on Captain, my agent-orchestration skill. On another campaign the same weekend, 8 of the 9 sub-agents launched in Armada, The Vibe Company's cloud-sandbox agent tool, also ran on Neon. My take, dictated on 30 November (translated from French): "Overall, I found Neon incredible. It's an extremely capable model that does very well on long-running tasks." With those locks, the loop can run all night without lying to me.

508 runs: what the loop kept, what it threw away

The campaign, in 3 phases, counted 508 live experiments on the working split, including 351 in phase 1 (retrieval and reranking) and 155 in phase 2 (ingestion and storage). The coordinator then confirmed on the heldout.

ConfigurationnDCG@10 (merged judgments)Gold nDCG@10 (humans)Recall@50Vector memory, 10M documentsWarm p95
Baseline: default Quivr, 512-token chunks0.66940.27060.759342.2 GB646 ms
Fast tier, no GPU at query time0.7540 (+0.0846)0.39810.847729.1 GB (-31.2%)77 ms
Deep tier, with the Qwen3-Reranker-4B reranker0.7987 (+0.1294)0.39820.892129.1 GB7.13 s

Longer chunks. On the working split, the score climbs with the chunk window: 0.8381 at 192 tokens, 0.8969 at 512, 0.9133 at 768. It drops back to 0.8856 at 1024. Small chunks, from 192 to 384 tokens, hurt both retrievers, because they tear passing mentions out of their context. They also multiply vector RAM by 1.24 to 2.44. The winning setup: a 768-token body, cleaned of wire boilerplate, with the headline in the first chunk. More than 62% of dispatches fit in one chunk. That's where the 31.2% drop in vector memory comes from.

A cleaned query. Stripping French stopwords and elisions (l', d', qu') before keyword search adds +0.0174 nDCG@10. No GPU involved.

The inverted-pyramid rule. The fusion that won weighs 65% dense and 35% keyword, plus three "aboutness" signals. A dispatch that covers the subject in its headline and lead beats one that mentions it in passing. On the working split, the fast tier goes from 0.8624 to 0.9026. None of the 11 topics regresses.

The loop also threw ideas away. Dense contextual prefixes à la Anthropic trailed the baseline by 0.0063 to 0.0200 on short dispatches. A GraphRAG-style "entity card" raised vector memory by 46%. Several rerankers, including bge-reranker-v2-m3 (-0.086), lost to the single Qwen3-Reranker-4B.

The result is in Quivr PR #4043, merged on 28 November 2026. It adds the newsroom-retrieve plugin: 101 files, zero edits to the core engine. The public guardrails follow: 0.7135 versus 0.6696 on miracl-fr, 0.6913 versus 0.6638 on xpqa-fr. The plugin passes all 35 tests of the plugin contract.

Latency, licence: what the loop does not see

The deep tier adds 4.5 points of merged nDCG@10 over the fast tier, for about 90 times the latency: 7.13 s versus 77 ms.

Now look at the human column. Gold nDCG@10, computed on the annotators' judgments, is 0.3981 for the fast tier and 0.3982 for the deep one. A tie. A loop that tracked only the merged score would crown the slowest tier.

So latency has to sit in the gate. Its 400 ms threshold rules out the deep tier. The same goes for licences: I dropped the zerank-2 reranker because of its CC-BY-NC-4.0, non-commercial licence.

That leaves the decision. The plugin ships both tiers on the same index. Choosing between 77 ms and 7.13 s depends on the use case. That choice belongs to a human.

On your own system, start with the locks: a split nobody opens, a gate that includes latency and licence, then a human to decide. Putting AI agents in production takes the same discipline. Autoresearch works beyond model training when the agent can neither read nor tune what judges it.

FAQ

What is autoresearch?

Autoresearch is a loop where an AI agent edits code, launches a run, measures, keeps or discards, then repeats. Andrej Karpathy published the original repo on 6 March 2026, for training a small LLM.

Do you need a GPU for autoresearch?

For Karpathy's repo, yes: it requires a single NVIDIA GPU (tested on H100) and Python 3.10+. In my case, the embeddings ran on a GPU, and the fast tier needs none at query time.

Autoresearch vs a self-improving agent: what is the difference?

The difference is the target. In autoresearch, the agent improves a system outside itself, against a metric. Skillpack, The Vibe Company's sister site, covers the agent side in an article on self-improving agents and frozen evals.

Does autoresearch apply to enterprise RAG?

Yes, for the retrieval part of an enterprise RAG system: that's what my case measures. You need queries with their reference documents, cut into two splits before the first run.

If your search engine, your RAG or another system has a number that says whether it is getting better, let's talk about your autoresearch loop.