Karpathy Loop Engineering is 📝Andrej Karpathy's formulation of 📝loop engineering: instead of prompting an AI step by step, the operator defines a goal and lets the agent loop — discovering tasks, planning, acting, checking against a verifier, and feeding failures back — until it arrives.
The formulation rests on three parts: a verifier such as automated tests, metrics, or a build so the agent cannot grade its own work; persistent state files that track attempts and next steps across sessions; and clear stop conditions. Karpathy demonstrated it with AutoResearch in March 2026, an agent that edited GPT training code, evaluated changes against an objective metric, and ran roughly seven hundred experiments over two days, surfacing about twenty improvements humans had missed. Bilevel autoresearch extends the idea with a meta-loop that rewrites how the inner loop searches at runtime, reported to yield a fivefold gain on the same benchmark with identical models — evidence that the leverage comes from loop design rather than raw model strength. Karpathy frames the discipline as agentic engineering: write a verifier, bound the retries, and raise the agent's autonomy as the verifier proves out.
