The AGI Protoplast
What if the Secret to AGI
Is the World's Dumbest Loop?
A simple while(true) loop shipped a programming language, 6 repositories overnight, and a $50K contract for $297.
In 2025, Geoffrey Huntley discovered something that sounds too stupid to be real. Take an AI coding agent. Put it in an infinite loop. Add a verification function.
while :; do
cat PROMPT.md | \
npx --yes @sourcegraph/amp
doneThat's it. 3 lines of Bash.
while (!taskComplete) {
state = agent.observe(codebase)
plan = agent.orient(state, goal)
actions = agent.decide(plan)
result = agent.act(actions)
taskComplete = verify(result)
}The oldest pattern in intelligence.
They call it the "Ralph Wiggum technique" — after the Simpsons character who succeeds through sheer persistence rather than intelligence.
But here's the Veritasium-worthy twist:
Every form of intelligence we know operates on exactly this structure.
The Universal Pattern of Intelligence
In 1948, Norbert Wiener published Cybernetics and identified the fundamental structure of intelligent behavior: the feedback loop.
His insight: neurons process signals, initiate actions, then monitor and adjust. Communication and control through feedback is how organisms maintain stability.
Let's see this in action with the simplest possible example.
The feedback loop in action: Watch how the system responds to disturbances and maintains homeostasis. The hysteresis band (green zone) prevents rapid on/off cycling. This is identical to how the Ralph Loop handles errors in code - sense, compare, act, repeat.
The thermostat follows a simple loop: sense temperature → compare to setpoint → activate heating/cooling → sense again.
This is mathematically identical to what Ralph does with code. Same structure, different domain.
The OODA Loop
John Boyd was a fighter pilot with an unbroken record. He earned the nickname "Forty-Second Boyd" — his standing bet that he could defeat any opponent in aerial combat within 40 seconds.
His secret wasn't better reflexes. It was a faster decision loop: Observe → Orient → Decide → Act. Whoever completes this cycle faster, wins.
Read codebase, parse error messages, scan tests
The Ralph loop is OODA applied to code generation. The agent observes the codebase, orients using its training, decides what actions to take, acts via tool calls, and loops until verification passes.
Emergence from Simple Rules
Here's where it gets philosophically interesting. Stephen Wolfram's A New Kind of Sciencedemonstrated something profound about computation:
"Computationally unpredictable results from a computationally simple rule."
The most famous example is Rule 30 — a cellular automaton that produces apparent randomness from a single cell and a trivial rule.
From one cell + one rule = apparent randomness. Proven to be computationally universal.
The rule is absurdly simple: each cell looks at itself and its two neighbors, then applies a lookup table with 8 entries. That's it.
Yet the pattern is proven to be computationally universal — capable of computing anything computable. NIST even uses it for random number generation.
The Ralph connection: The loop itself is trivial. But what emerges from running it on a powerful LLM with tools is complex behavior — building compilers, shipping repos overnight, creating programming languages.
"Just as birds in a flock follow simple local rules that lead to complex collective behavior, neural networks develop organized patterns without explicit programming."
Watch the Loop Work
Let's visualize what happens inside the Ralph loop. The agent receives a task, makes observations, takes actions, and loops until verification passes.
Analyzing task requirements...
Notice the key insight: the first attempt often fails. The verification function is what makes it work — by providing feedback that drives the next iteration.
Geoffrey Huntley's metaphor: "Ralph is very good at making playgrounds, but he comes home bruised because he fell off the slide. So you tune Ralph by adding a sign: 'SLIDE DOWN, DON'T JUMP.'"
77 Years of the Same Pattern
The Ralph Loop isn't new. It's the rediscovery of a pattern that appears across every domain that produces intelligent behavior.
The Results Speak for Themselves
Theory is nice. But the Ralph Loop has shipped real code.
A functional compiler with LLVM compilation, standard library, and partial editor support. Built by one Ralph loop.
"The skill shifts from 'directing Claude step by step' to 'writing prompts that converge toward correct solutions.'"
The AGI Implication
All intelligence is iterative feedback
From Wiener's cybernetics to Boyd's OODA loop to robotic SPA architectures — the fundamental unit is the same.
Ralph reduces this to minimal form
"At its core, it's elegantly simple: keep feeding an AI agent a task until the job is done."
The "dumb persistence" is profound
This mirrors how evolution works — dumb iteration + selection = intelligence.
The verification function is key
The agent works, an evaluator checks, and if not done, tries again with context. This is artificial selection.
The Paradox
The halting problem proves we can't know if a program will terminate. Ralph deliberately embraces this uncertainty and harnesses it — which might be exactly how biological intelligence works too.
If the fundamental unit of intelligence is just "loop + feedback + selection," then we might already be looking at the basic architecture of AGI.
The sophistication isn't in the loop — it's in what gets looped.
Want More Deep Dives?
We build interactive, intuition-first explanations of complex AI and computation concepts.
Inspired by Geoffrey Huntley's Ralph Wiggum technique