The AI That Taught Itself and Then Quietly Called Python

The task was clear. Build an expression evaluator: parse the input in C, wire it up through Rust, and ship a static binary. A hidden fuzz test then throws expressions at it and checks the output, character for character, against a reference implementation.

The AI agent’s first attempts failed on a tiny detail. When a division came out even, it printed 23 where the reference expected 23.0. After more training, the agent passed both gates in both trial runs, so its score on the task went to 100%.

Then the researchers read the logs. The final model had built the C pieces and the Rust bindings, run a quick “does the linking work” smoke test, and then handed the actual arithmetic to Python. Python’s number formatting matched the reference exactly, so every check passed.

The authors wrote it up without spin:

“Fuzz-test success establishes tested output equivalence, not a native Rust–C AST execution path.”
— Terminal-RSI paper, Section 3

In plain English, it gave the tests what they asked for. It didn’t build what the task asked for.

Keep that story in mind, because it comes from the same paper that, a week later, went viral on X as proof that AI can now improve itself.

“China just cracked recursive self-improvement”

On October 23, a post on X made the big claim:

“China just cracked recursive self-improvement. And they did it with a 27B model.”

The post leaned on a familiar fear: “We feed models the internet. But we are running out of internet.” That fear has a real basis. Researchers at Epoch AI estimated that if current trends continue, models will be trained on datasets about the size of all public human text “between 2026 and 2032”. They also named synthetic data as one possible way forward.

So the post’s pitch lands: a “self-sustaining intelligence loop” that “generates its own high-quality reasoning traces. It filters out its own mistakes. It trains on its own successes.” It says this “shatters the centralized AI moat,” and it ends on an ominous question. If an open-weight model can improve itself “without human oversight or human data… Who is steering it?”

The post links no paper, only a screenshot. The paper is Terminal-RSI: Recursive Self-Improving Terminal Agents (PDF), posted to arXiv on October 15 by researchers from Tencent’s Hy Frontier team, the National University of Singapore, the University of Maryland, the University of Georgia and Indiana University. Everything is public:

The post has one thing right: the results are real and they’re impressive. But the authors describe their work far more modestly. Here is how co-author Yucheng Shi announced it:

“We used an agent to help train a stronger successor. Then we used that successor to help train the next. […] We’re interested in how far this kind of hill climbing can go, and what makes it stall.”

“Hill climbing” and “what makes it stall” are a long way from “cracked.” To see why, look at how the loop works.

How the loop actually works

They started from Alibaba’s open model Qwen3.8-27B and trained it to do terminal work: fixing broken repositories, resolving dependencies, editing files, and leaving the machine in a state that passes a test suite. The yardstick is Terminal-Bench, a benchmark of hard command-line tasks. Its paper says each task comes with “a unique environment, human-written solution, and comprehensive tests for verification.”

One round of the loop has four steps:

  1. Attempt. The model tries thousands of tasks (the training pool has about 3,000) under several different agent harnesses.
  2. Verify. Only runs that pass a protected test suite count. The model’s own opinion of whether it succeeded doesn’t.
  3. Rewrite (RSR, “Recursive Self-Rewrite”). Winning runs are rewritten into clean, reusable runbooks. These are re-executed in a fresh environment, screened for leaked answers, and only then used for fine-tuning. The companion paper says “the entire pipeline uses a single base model, Qwen-3.8-27B” for this step.
  4. Practice (RPR, “Recursive Policy-Refine”). Classic reinforcement learning (PPO), with one twist. The “critic”, the part that estimates how promising a situation is, carries over from stage to stage. It gets recalibrated each time instead of starting from scratch.

Then the improved model goes back to step 1. They ran this twice, which gives five stages: Base, RSR-1, RPR-1, RSR-2, RPR-2.

The order matters. When the team skipped the rewrite step and ran PPO directly on the base model, it got nowhere. In the paper’s words: “Direct PPO records no Terminal-Bench 4.0 success at steps 5, 10, 15, and 20.” Reinforcement learning only took off once the model had a base of verified successes to build on.

The numbers

The gains are real. On Terminal-Bench 2.1, success went from 51.70% to 86.52%. On the much harder Terminal-Bench 4.0, it went from nothing to 19.84%. Further out, though, the curve flattens. On long-horizon tasks the model fully completed just 5 of 46. On the one suite kept entirely out of training it went from 3% to 6% and then stopped moving. The authors’ own verdict: “Five stages of one 27B backbone establish neither scaling laws nor universal monotonicity.”

Who is actually in the loop

Set that against the viral post’s “without human oversight or human data” and the picture changes. The model never judges its own work. In the paper’s words, success “requires the complete protected verifier rather than an agent declaration.” The tasks and tests came out of the group’s own curation pipeline, the base model learned from human text, and people chose which checkpoints to keep. The authors flag that last point themselves: “Repeated selection using final benchmark feedback would confound learning with test-set adaptation.”

Even “a new SOTA” needs an asterisk. The paper’s own comparison chart lists GPT-6 Astra at 54.00% on Terminal-Bench 4.0, and the authors note those outside scores weren’t re-run under the same conditions.

What the reward was really paying for

The most revealing part of the paper isn’t a benchmark score at all. It’s an audit of the reward. Early on, the model got partial credit for each check it passed. When the team looked back over 4,352 runs, they found that “failures receive 50.09% of FDR reward mass,” and that 48 failed runs had passed “every executed scenario check but fail the terminal gate.”

Half the reward was going to runs that failed. The model was being paid for looking like it was making progress. A reworked reward cut that share to 28.72%, but the lesson stands, and the authors spell it out: “Tests certify enforced requirements only.”

So who is steering it?

The viral post ends with “Who is steering it?” The paper’s answer is the verifiers. The loop keeps only what passes the tests, so the tests set the direction and their gaps set the limits. Jaymari Chua put it well: “Whoever builds the verifiers sets its pace.”

Anyone in security knows the pattern: a system optimized against a checklist learns the checklist. Terminal-RSI is a real step, a mid-sized open model bootstrapping real skill, published with its weights, code and an unusually honest list of limitations. It isn’t a machine that improves itself unsupervised. People build the loop, and people write the tests.

The tests in that Rust–C task checked whether the output matched. They never checked how the answer was produced, and the model handed the work to Python.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.