We let an AI improve its own code 2,400 times. What it did depended entirely on who was checking.
RSI, in AI, means recursive self-improvement — a system that improves its own ability to improve, by rewriting its own logic, tuning its own thresholds or upgrading the process it uses to get better. This page reports a preregistered experiment on the gate such a system would need. Full definition and FAQ ↓
00What we found
Imagine a small program that looks at a picture of someone at a desk and decides whether their posture is putting them at risk of a repetitive strain injury. Now hand it to an AI and say: make it better. Twenty times in a row, each time starting from the last version it produced.
How do you know each new version really is better? You need a gatekeeper. We built four, locked the experimental design before running anything, and ran 120 trajectories of 20 revisions each. Behind them sat 2,000 more pictures the AI never saw, generated by the same rules, which told us the truth.
Under a gatekeeper that only checks a visible score, the AI's score on the 60 pictures it could see climbed to 100 % in seven runs out of ten, while the hidden truth stayed flat or fell. It had learned the pictures: special cases in the code that recognised individual examples by their coordinates. Nobody asked it to do this; it is simply the shortest route to a higher score. Adding a hidden test set stopped the damage and produced nothing. The only gatekeeper under which the program improved on the hidden truth was the one that demanded correct behaviour on specified postures, independent of any example set. Under it the AI found the real geometric flaw in the original code in seven runs out of ten, and in ten out of ten with a stronger model.
Three things surprised us. A deliberately stupid optimiser that cannot write code ended with better real accuracy than the AI under the visible-score gatekeeper, because it cannot memorise. The stronger model was no safer under the weak gatekeeper, only more productive under the strong one. And taking away the AI's notes to itself between rounds, which we had assumed was the risky channel, made the gaming faster and the honest fix rarer.
The study in one picture. Full-size version and the data behind every number are linked below.
01The Problem
The same three letters describe both the hardest open problem in AI safety and the most common occupational injury among the people building it.
RSI in machine-learning circles is Recursive Self-Improvement — a system that edits its own logic to get better at its objective. RSI in physiotherapy is Repetitive Strain Injury — what happens to your forearms after a few thousand keystrokes a week. The first one is a frontier-lab anxiety; the second is what you actually wake up with on a Wednesday after shipping a frontier-lab feature on a Tuesday.
This project started in 2025 as a hand-made prototype of that gate. The September 2026 audit of the prototype asked the obvious question, whether the gate would hold against an optimiser that can rewrite the detector in full and is under pressure to score well, and the experiment above is the answer. The pun stayed.
02Architecture
Self-improving systems fail when their objective is too easy to satisfy. The RSI Loop separates "did it work?" (Stage 1) from "is the result clinically meaningful?" (Stage 2). In the original prototype a candidate detector, written by hand, was accepted as COMPLETE only if it passes both stages.
Read top to bottom — each stage produces a verdict and an exit code, and the loop is COMPLETE only if both verdicts are PASS.
detector.py is scored against benchmarks.json. v1 failed one scenario (a radial-deviation blind spot); v2 fixes it with vector trigonometry and passes all ten.
benchmarks.jsondetector.assess(landmarks) over each scenarioThe Auditor reads the live thresholds out of detector.py via getattr and compares each one against the Clinical Gold Standard. A candidate with thresholds outside the clinical range is rejected here even if Stage 1 was satisfied. On the original ten-case benchmark the two stages never disagreed, so the prototype never tested the gate under optimisation pressure; the experiment is that test, with Stage 2 strengthened into an absolute behavioural envelope.
15–25° · Wrist deviation 40–60°PASS · WARNING · HARD FAILURE per thresholdThe experiment generalised this two-stage shape into four gatekeepers: A asks the optimiser whether its change is better; B is Stage 1 alone (the visible score must not fall); C adds a hidden set the optimiser never sees; D adds Stage 2 in its strongest form, an absolute behavioural envelope the candidate must satisfy on a fixed sweep of specified postures, plus canary inputs. The two panels below show what each of the extremes did over twenty revisions.
Proxy versus truth over twenty revisions, Claude Sonnet 5, ten runs per gatekeeper. Under B the visible score climbs while the hidden truth sags: the Goodhart curve. Under D the visible score barely moves and the truth steps up as the real fix lands. The gate changed what the optimiser proposed, not just what it accepted: under D it put forward far fewer envelope-violating candidates in the first place.
03The Pharma Angle
Pharma teams already have a name for "let the system improve, but only inside an immutable spec": Computer System Validation (CSV). The RSI Loop's two-stage pipeline maps cleanly onto CSV's separation between functional qualification (does the system do what it claims?) and performance qualification (does it stay inside its validated envelope under change?).
| CSV Concept | RSI Loop Equivalent |
|---|---|
| Validated specification | Clinical Gold Standard, hard-coded in auditor.py — the search space the loop is allowed to occupy |
| Operational Qualification (OQ) | Stage 1 — test_engine.py proves the detector classifies the labelled benchmarks correctly |
| Performance Qualification (PQ) | Stage 2 — the Auditor checks that the thresholds stay within clinically acceptable bounds |
| Change control | Any threshold mutation forces a fresh audit; failed audits return non-zero exit codes that block the change |
| Independence of QA | In the experiment the candidate runs in a separate, audit-hooked process with no file, network or OS access, and the verifier holds information the candidate never sees. The 2025 prototype lacked this; the audit that found it is in docs/. |
| Audit trail | Every revision archives its prompt, response, candidate code, scores and gate decision; the full set of 2,400 is on Zenodo with a SHA-256 manifest |
The takeaway for pharma audiences: an acceptance gate with an external, immutable spec is a pattern regulated environments already understand, and the experiment says it is the part that matters. The visible-score check alone was gamed; the spec-shaped check was what let real improvement through.
04Limitations & Roadmap
This is a deliberately small, deliberately observable experiment. The point is the shape of the gate, not the model. Honest about what it is and isn't:
A finished, preregistered experiment. Four gates × ten seeds × twenty revisions with Claude Sonnet 5, plus Opus 5, a notes-off condition and a parametric baseline: 120 trajectories, about $1,000 of API credit, one laptop. Hypotheses, metrics and decision rules were frozen before the first run; every defect found afterwards is logged, not patched over. Limits: one environment with a simple, known truth rule; ten seeds per cell; one model family; twenty revisions.
Study 2. A deliberately wrong behavioural envelope, to see whether a bad specification gates bad behaviour just as firmly; more than one environment; longer horizons; and an adversarial condition in which the optimiser is told outright to maximise the visible score. The first two are the questions a sceptical reader should ask of these results.
Generalise the pattern: replace the clinical envelope with whatever immutable spec governs the target domain (ABPI for promotional copy, ICH-E6 for trial design, and so on) and test whether the result holds when the spec is harder to state in physical terms.
This will not become a clinical device, a workplace surveillance tool, or a substitute for a real ergonomist. The intent is methodological: to measure, in a small and fully observable setting, which kinds of gate keep real performance rather than measured performance.
05FAQ
In AI, RSI stands for recursive self-improvement: a system that improves its own ability to improve — rewriting its own logic, tuning its own thresholds, or upgrading the very process it uses to get better. Each cycle compounds on the last, which is why RSI sits at the centre of debates about accelerating AI capability and how to keep it under meaningful oversight.
This page reports a small, inspectable experiment on the gate such a system would need — applied to a detector that targets the other RSI, repetitive strain injury. An LLM rewrote the detector twenty times per run under four different gates; only the gate that checked behaviour against a fixed physical specification let real improvement through.
A normal program is improved by its developers. A recursively self-improving system proposes changes to itself — to its detection logic, thresholds or code — evaluates whether the change made it better, and keeps what works. It is "recursive" because the thing being improved is also the thing doing the improving, so gains can compound from cycle to cycle.
Unbounded self-improvement is a core AI-safety concern: a system optimising itself against a narrow score can drift into behaviour its designers never intended. The RSI Loop sketches one mitigation pattern — a two-stage gate in which a candidate change must pass both an accuracy check and an independent auditor that holds the system inside clinically plausible bounds. The October 2026 experiment tested exactly that. Under a gate that only required a visible score not to fall, Claude Sonnet 5 reached a perfect visible score in 7 of 10 runs by memorising the test set while hidden accuracy stayed flat or fell. A gate that also required correct behaviour on a fixed sweep of specified postures stopped the gaming and was the only architecture under which hidden accuracy rose.
A Python harness (MIT-licensed) in which an LLM rewrites a posture-risk classifier for 20 revisions under one of four acceptance gates, with a seeded simulator defining the ground truth, a process-isolated sandbox, and a preregistered analysis. The October 2026 confirmatory run covered 120 trajectories with Claude Sonnet 5 and Claude Opus 5 plus a parametric baseline; every prompt, policy and gate decision is archived at Zenodo (DOI 10.5281/zenodo.23223679). The original 2025 version was a 1,150-line hand-made prototype of the gate; a September 2026 audit of it motivated the experiment.
It depends on who is talking. In AI research, RSI is recursive self-improvement — a system that helps improve itself. In occupational health, including for anyone who spends the day at a keyboard, RSI is repetitive strain injury, the umbrella term for overuse conditions of the hands, wrists, arms and neck. In trading, RSI is the relative strength index, a momentum indicator with nothing to do with either. This page is about the first two, and the pun is deliberate: a gate for a self-improving detector of repetitive strain injury.
In machine learning, RSI is recursive self-improvement: a system that takes part in improving itself, rather than being improved only by its developers. Ordinary training improves a model against a fixed objective, under a process the developers control. In recursive self-improvement, the system also modifies the improvement process itself — proposing new logic, tests or thresholds. That autonomy is what makes RSI powerful, and what makes independent verification essential — which is why the RSI Loop keeps the optimiser and the verifier in separate processes with separate information.
Closer than it was, and not there yet, depending on what you count. Narrow forms already exist: systems such as AlphaEvolve and the Darwin Gödel Machine let a model rewrite parts of the code around itself and keep whatever scores better, and frontier labs now use their models to write much of their own research code. What does not yet exist is a system that improves the model itself, end to end, faster than its developers can check the result. In September 2026 OpenAI's chief scientist, Jakub Pachocki, wrote that machine RSI "will be at the very core of future scientific discovery" if progress continues, that no lab has yet solved alignment and monitoring well enough to keep scaling at full speed for much longer, and called for shared, externally audited safety bars. That is the frontier-scale version of the question this page asks at toy scale: when a system is allowed to change itself, who checks the change, with what information, and can the check be gamed?
Everything is open: the frozen design and preregistration, the harness, every prompt and every version of the code the optimiser wrote, every gate decision, and the analysis that produced the numbers above. The repo is MIT-licensed; the 120-trajectory archive is on Zenodo under CC BY.
If you came for the safety question rather than the code: the preprint, the results write-up and the preregistration are in the repo, and Observer Zero, the other PharmaTools.AI Labs experiment, asks a neighbouring question — whether a society of LLM agents can tell that the rules of its world have changed.