MedRSI: Recursive Self-Improvement for Medical Agents via Clinically Aligned Self-Evolution
Organizations: University of Oxford · Stanford University
Abstract
Medical agents increasingly combine general reasoning models with specialized clinical tools, yet their capabilities remain largely fixed by what clinicians and engineers design before deployment. Recursive self-improvement (RSI) offers a different paradigm in which agents learn from their own failures and autonomously expand their capabilities, but directly applying RSI to medicine introduces fundamental safety challenges. We introduce MedRSI, the first recursive self-improvement framework for medicine, which continuously transforms diagnostic failures into new clinical capabilities through tool composition and task-specific model training. Inspired by clinical practice, MedRSI introduces two mechanisms for clinically aligned self-evolution. Clinical-cost-aware failure prioritization directs improvement toward errors according to their potential clinical consequences rather than frequency alone. Fast discovery with slow registration separates rapid capability invention from conservative adoption, allowing new tools to enter the persistent agent only after demonstrating sustained benefit across subsequent patient cohorts. Across public glaucoma and heart disease benchmarks and two private clinical tasks, MedRSI progressively develops segmentation, measurement, prediction, multimodal reasoning, and generative capabilities, surpasses manually engineered medical agents, and autonomously discovers solutions to clinical problems not anticipated by its original designers. Our results show that medical agents need not remain constrained by capabilities specified before deployment: with clinically grounded mechanisms governing what to improve and what to retain, they can continuously construct, validate, and accumulate new capabilities from diagnostic experience. Code is available at https://github.com/ImprintLab/MedRSI.
Figures & tables
| Glaucoma (REFUGE2) | Heart disease (MITEA) | ||||||
| Family | Method | bAcc | F1 | AUC | bAcc | F1 | AUC |
| General multimodal | GPT-4o OpenAI (2024) | 56.4 | 21.1 | — | 56.8 | 28.1 | — |
| Janus-Pro-7B Chen et al. (2025) | 53.4 | 13.3 | — | 52.3 | 10.7 | — | |
| LLaVA-Med Li et al. (2023) | 50.0 | 0.0 | — | 50.0 | 0.0 | — | |
| BioMedCLIP Zhang et al. (2023) | 58.1 | 21.3 | — | 47.0 | 37.8 | — | |
| Qwen2.5-VL-7B Bai et al. (2025) | 54.3 | 16.3 | — | 50.0 | 0.0 | — | |
| Task | Round | bAcc (95% CI) | Sens. | Spec. | PPV | NPV | MCC | ECE | Cost | Severe |
|---|---|---|---|---|---|---|---|---|---|---|
| Glaucoma | 0 | 56.2 (53.6–58.8) | 28.4 | 84.0 | 18.7 | 90.0 | 0.10 | 0.29 | 12.4 | 9.8 |
| 5 | 80.9 (78.2–83.6) | 71.6 | 90.2 | 48.7 | 96.1 | 0.53 | 0.17 | 5.9 | 4.4 | |
| 10 | 91.2 (89.6–92.8) | 87.3 | 95.1 | 69.8 | 98.3 | 0.75 | 0.09 | 3.0 | 2.1 | |
| 20 | 94.1 (92.8–95.4) | 92.0 | 96.2 | 75.9 | 98.9 | 0.81 | 0.05 | 2.5 | 1.5 | |
| Heart disease | 0 | 56.5 (53.1–59.9) | 22.8 | 90.2 | 56.7 | 67.5 | 0.18 | 0.31 | 14.1 | 10.6 |
| 5 | 64.1 (60.5–67.7) | 49.2 | 79.0 | 56.9 | 73.4 | 0.29 | 0.24 | 10.2 | 7.5 |
| Tool | Task | Category | Route | Rd. | Resource | Quality | Gain |
|---|---|---|---|---|---|---|---|
| Fundus quality and disc crop | G | Image prep. | C | 2 | rule based | 0.98 | +0.9 |
| Optic disc localization | G | Segmentation | M | 3 | 600 images | 0.94 | +2.4 |
| Optic cup and disc segment. | G | Segmentation | M | 4 | 600 masks | 0.87 | +7.6 |
| Vertical cup-to-disc ratio | G | Measurement | T | 5 | composition | 0.91 | +6.1 |
| Rim width by ISNT sector | G | Measurement | T | 7 | composition | 0.84 | +2.2 |
| Peripapillary atrophy grading | G | Prediction | M | 9 | 600 images | 0.81 | +1.7 |
| Family | Method | bAcc (95% CI) | F1 | AUC | Sens. | Spec. |
|---|---|---|---|---|---|---|
| General | GPT-4o | 68.4 (65.1–71.7) | 60.9 | 72.6 | 61.3 | 75.5 |
| Single modality | Fundus only | 78.1 (75.2–81.0) | 72.9 | 84.9 | 73.2 | 83.0 |
| OCT only | 80.6 (77.8–83.4) | 75.9 | 87.2 | 76.9 | 84.3 | |
| Visual field only | 75.3 (72.1–78.5) | 69.4 | 81.7 | 70.1 | 80.5 | |
| Multimodal | Late fusion | 83.9 (81.2–86.6) | 80.0 | 90.4 | 80.6 | 87.2 |
| MedAgent-Pro | 79.2 (76.4–82.0) | 74.2 | 85.8 | 74.5 | 83.9 |
| Method | nMAE (95% CI) | MAE | Bias | ICC | Within 5 pts | |
| GPT-4o | 1.00 (0.92–1.08) | 9.3 | 0.34 | 0.29 | 31.2 | |
| MedAgent-Pro | 0.85 (0.78–0.92) | 7.9 | 0.52 | 0.48 | 42.7 | |
| Noncontrast predictor applied directly | 0.92 (0.84–1.00) | 8.6 | 0.44 | 0.40 | 37.5 | |
| Contrast-only predictor | 0.74 (0.67–0.81) | 6.9 | 0.66 | 0.63 | 51.0 | |
| Synthetic-only predictor | 0.79 (0.72–0.86) | 7.3 | 0.61 | 0.58 | 47.9 | |
| Task-specific regressor | 0.66 (0.60–0.72) | 6.1 | 0.74 | 0.71 | 58.3 |
| Configuration | bAcc | F1 | AUC | Cost | Severe | Tools | Discard | Round 30 |
| Generic RSI | 77.4 | 61.8 | 83.1 | 9.2 | 6.4 | 45 | 0 | 72.7 |
| Uniform failure priority | 88.7 | 74.6 | 92.8 | 6.0 | 4.0 | 15 | 61 | 88.3 |
| Immediate registration | 82.4 | 67.2 | 87.4 | 7.6 | 5.1 | 42 | 0 | 76.9 |
| Single trial cohort | 90.6 | 77.9 | 94.1 | 4.7 | 3.2 | 31 | 24 | 84.7 |
| Without failure clustering | 90.2 | 77.1 | 93.6 | 3.9 | 2.6 | 14 | 66 | 90.1 |
| Code generation only | 79.8 | 63.4 | 85.2 | 7.1 | 5.3 | 9 | 58 | 79.4 |
| Task | Rd. | Cand. | Pool | Reg. | GPU h | Tok. (B) | Days | h/tool |
|---|---|---|---|---|---|---|---|---|
| Glaucoma (REFUGE2) | 20 | 64 | 22 | 8 | 96 | 0.9 | 2.1 | 12.0 |
| Heart disease (MITEA) | 20 | 54 | 19 | 8 | 116 | 1.0 | 2.4 | 14.5 |
| Multimodal glaucoma | 12 | 41 | 14 | 6 | 174 | 0.7 | 3.2 | 29.0 |
| Contrast echo | 12 | 38 | 13 | 5 | 265 | 0.6 | 4.6 | 53.0 |
| Total | — | 197 | 68 | 27 | 651 | 3.2 | 12.3 | 24.1 |
Self-Improving Agents
Self-improving agents use experience and feedback to update their models, memories, skills, or workflows for better future task performance.
See all 160 papers