mini-rsi: A Minimal Testbed
for Recursive Self-Improvement

A hackable, single-codebase environment for testing whether an AI agent that edits its own scaffolding can compound capability over generations — and a metric to measure if it's working.

Bingchen Zhao University of Edinburgh Sep. 11, 2026

Introduction

An agent that can edit its own harness can, in principle, improve the process that produces the next improvement. That is recursive self-improvement: not one better model, but a search whose objects are themselves searches.

Recursive self-improvement as nested search
The inner loop stacks ideas on a seed solution. The outer loop searches over those search processes. Zooming out, that outer tree is itself one node.

The idea dates to Good’s ultraintelligent machine and Yudkowsky’s feedback loop: an AI uses its current intelligence to improve the machinery that produces its intelligence (Bostrom, 2014; Good, 1965; Yudkowsky, 2008). In today’s systems the near-term path is unlikely to start as a model rewriting its weights. It is harness engineering — improving the runtime around a frozen model (tools, context, workflow, evaluation) so the same weights do better work (Weng, 2026).

Weng organizes recent auto-research and self-improving agents around that claim. The object being optimized has moved from instruction prompts, to structured context, to workflow graphs, to the harness code itself.

Search over solutions is now routine. AIDE treats machine-learning engineering as tree search in the space of code (Jiang et al., 2025). Evolutionary coding agents such as AlphaEvolve keep a pool of programs and keep the ones that score (Novikov et al., 2025). These systems improve answers. They do not ask whether the improver improved.

Search over workflows enlarges the object. ADAS has a meta-agent write new agentic systems in code (Hu et al., 2025). The AI Scientist hand-designs a full research pipeline — ideas, experiments, manuscript, review (Lu et al., 2024). The search space is a graph of LLM calls, not a single prompt.

Search over the harness is the RSI-shaped setting. STOP asked whether an improver can improve itself, and found that recursive structure is not enough: GPT-4 compounded, weaker models did not (Zelikman et al., 2024). The Darwin Gödel Machine lets a coding agent edit its own repository and keeps an archive of agents (Zhang et al., 2025). Meta-Harness, Self-Harness, and Agentic Harness Engineering close a propose–evaluate–keep loop over harness code (Lee et al., 2026; Lin et al., 2026; H. Zhang et al., 2026). What they report, almost always, is that harness edits raise task scores.

That is not the question. A better solver is not automatically a better improver. Lin et al. separate the two: harness-updating (can the model write a useful edit?) is roughly flat across model sizes; harness-benefit (can it use the edit?) is not (M. Lin et al., 2026). mini-rsi is a minimal testbed for the missing measurement: after promotion, at matched compute, on held-out tasks, does the improved agent become a better improver?

Inspired by nanochat’s approach of making one thing simple and hackable (Karpathy, 2025), the setup is one codebase, one command, one metric.

Design

The core insight: everything is a tree search, and both levels use the same code.

Outer loop
Meta agent
  • Read harness + past trajectory
  • Edit via str_replace
  • Score = benchmark on all tasks
runs on
all tasks
Inner loop
Task agent
  • Read task workspace
  • Plan and apply edits
  • Score = real eval
Same code: AIDE tree search · run_task()
Promote best harness → next generation

The task agent (inner loop) uses AIDE-style tree search to solve coding tasks: draft solutions, improve the best one, debug buggy ones. It has four tools: bash, file_read, file_write, file_edit.

The meta agent (outer loop) uses the exact same run_task() function, but its task is editing the harness code itself — the prompts, tools, search strategy, and Docker agent that the task agent uses. Its score is the aggregate benchmark performance of the modified harness.

Promotion is one CLI flag: --harness-dir ./runs/gen0/v3/. The best harness from generation NN becomes the meta agent for generation N+1N+1. That is the recursion.

Why this design

Benchmarks

BenchmarkTrainTestWhat it measures
KernelBench5 tasks5 tasksGPU kernel optimization (Modal A10G, real speedup)
DeepSWE5 tasks5 tasksSWE bug fixing (pier + Docker, test pass rate)
Terminal-Bench5 tasks5 tasksTerminal debugging (harbor + Docker, reward)
DS-100020 samples20 samplesData science code generation (local execution)
Polyglot169 ex. (py / js / go / java)56 ex. (rust / cpp)Exercism exercises across 6 languages

Every benchmark uses the same AIDE tree search. What differs is what one search node looks like: for KernelBench the agent writes solution.py locally; for DeepSWE each node is a full Docker run via pier; for Polyglot it is 225 parallel LLM calls evaluated against real test suites.

The RSI metric

The metric that matters is not “does the agent improve?” (it does). It is does the improved agent become a better improver?

RSI Efficiency=best test score−baseline test scoremeta steps\text{RSI Efficiency} = \frac{\text{best test score} - \text{baseline test score}}{\text{meta steps}}

Each generation gets the same compute budget (the same number of meta steps) and starts from the same baseline harness. If efficiency rises across generations, the promoted improver finds better edits faster — that is the RSI signal.

Initial results

First RSI experiment: claude-sonnet-5, 3 meta steps per generation, 2 generations.

BaselineGen 0Gen 1
Improver—base harnessgen0’s best
Train score—0.4850.487
Test score0.4050.4910.442
RSI Efficiency—0.0290.012
Finding

Gen 0 improved held-out test score from 0.405 to 0.491 by editing prompts, tools, and the Docker agent. When this improved harness was promoted to be the improver for Gen 1, efficiency dropped from 0.029 to 0.012. The improved agent was a better task solver but not a better improver.

Per-benchmark test scores

BenchmarkBaselineGen 0Gen 1
KernelBench0.0000.2000.200
DeepSWE0.9260.9260.926
Terminal-Bench0.0000.2000.000
DS-10000.6500.7000.600
Polyglot (rust / cpp)0.4460.4290.482

What the meta agent edited

GenVersionFiles changedTrain score
0v1pier_agent.py0.360
0v2pier_agent.py0.373
0v3prompts.py, tools.py, pier_agent.py0.485
1v1tools.py, infra.py0.378
1v2tools.py0.487
1v3—0.398

Gen 0’s biggest jump (v2 → v3) came from editing three files at once: better search prompts, a new grep tool, and improved Docker agent behavior. Gen 1 focused narrowly on tools.py.

Future work

  1. Bostrom, N. (2014). Superintelligence: Paths, Dangers, Strategies. Oxford University Press.
  2. Good, I. J. (1965). Speculations Concerning the First Ultraintelligent Machine. In Advances in Computers (Vol. 6, pp. 31–88). Academic Press.
  3. Hu, S., Lu, C., & Clune, J. (2025). Automated Design of Agentic Systems. International Conference on Learning Representations.
  4. Jiang, Z., Schmidt, D., Srikanth, D., Xu, D., Kaplan, I., Jacenko, D., & Wu, Y. (2025). AIDE: AI-Driven Exploration in the Space of Code. arXiv Preprint arXiv:2502.13138. https://arxiv.org/abs/2502.13138
  5. Karpathy, A. (2025). nanochat. https://github.com/karpathy/nanochat
  6. Lee, Y., Nair, R., Zhang, Q., Lee, K., Khattab, O., & Finn, C. (2026). Meta-Harness: End-to-End Optimization of Model Harnesses. arXiv Preprint arXiv:2603.28052. https://arxiv.org/abs/2603.28052
  7. Lin, J., Liu, S., Pan, C., Lin, L., Dou, S., Xi, Z., Huang, X., Yan, H., Han, Z., Gui, T., & Jiang, Y.-G. (2026). Agentic Harness Engineering: Observability-Driven Automatic Evolution of Coding-Agent Harnesses. arXiv Preprint arXiv:2604.25850. https://arxiv.org/abs/2604.25850
  8. Lin, M., Wu, J., Wang, Z., Shi, Z., Sang, Y., He, B., Liu, Z., Wei, T., Wu, Z., Zhang, Z., Wang, D., Zhang, X., Dumoulin, B., Xie, C., Zhou, Y., Wang, S., & Lu, H. (2026). Harness Updating Is Not Harness Benefit: Disentangling Evolution Capabilities in Self-Evolving LLM Agents. arXiv Preprint arXiv:2605.30621. https://arxiv.org/abs/2605.30621
  9. Lu, C., Lu, C., Lange, R. T., Foerster, J., Clune, J., & Ha, D. (2024). The AI Scientist: Towards Fully Automated Open-Ended Scientific Discovery. arXiv Preprint arXiv:2408.06292. https://arxiv.org/abs/2408.06292
  10. Novikov, A., Vũ, N., Eisenberger, M., Dupont, E., Huang, P.-S., Wagner, A. Z., Shirobokov, S., Kozlovskii, B., Ruiz, F. J. R., Mehrabian, A., & others. (2025). AlphaEvolve: A Coding Agent for Scientific and Algorithmic Discovery. arXiv Preprint arXiv:2506.13131. https://arxiv.org/abs/2506.13131
  11. Weng, L. (2026). Harness Engineering for Self-Improvement. Lil’Log. https://lilianweng.github.io/posts/2026-07-04-harness/
  12. Yudkowsky, E. (2008). Artificial Intelligence as a Positive and Negative Factor in Global Risk. In N. Bostrom & M. M. Ćirković (Eds.), Global Catastrophic Risks (pp. 308–345). Oxford University Press.
  13. Zelikman, E., Lorch, E., Mackey, L., & Kalai, A. T. (2024). Self-Taught Optimizer (STOP): Recursively Self-Improving Code Generation. arXiv Preprint arXiv:2310.02304. https://arxiv.org/abs/2310.02304
  14. Zhang, H., Zhang, S., Li, K., Zhang, C., Chen, Y., Zhang, Y., Bai, L., & Hu, S. (2026). Self-Harness: Harnesses That Improve Themselves. arXiv Preprint arXiv:2606.09498. https://arxiv.org/abs/2606.09498
  15. Zhang, J., Hu, S., Lu, C., Lange, R., & Clune, J. (2025). Darwin Gödel Machine: Open-Ended Evolution of Self-Improving Agents. arXiv Preprint arXiv:2505.22954. https://arxiv.org/abs/2505.22954