Medical agents that keep improving

MedicalRSI

Medical Recursive Self-Improving Agents via Clinical Model-Harness Co-Evolution

One model carries out clinical workflows and writes its own medical harness from its failures. The agent improves not only itself but also its improving strategy.

Tasks solved on MedAgentBench (%)

Qwen3.5-9B, 320 test tasks. The dashed line marks the Base Agent.

MedicalRSI85.1
GRPO Solver62.8
GRPO Improver61.2
GPT-6.1-Sol writes the harness51.6
GRASP50.3
Base Agent36.9

+48.2 points over the Base Agent

Model and harness co-evolve Improve the harness only Train the model only No self-improvement

One model, two roles

The Solver is the medical agent itself. The Improver is its learnable improving strategy, which writes the medical harness from the agent's failures.

Rewarded by gain

Each harness is rewarded by how much it improves the agent over acting without it, so no reference harness is needed.

Trained together

Both roles learn from the same attempts, so the Improver keeps adapting to the problems the Solver has not yet solved.

The problem

Medical agents repeat the same mistakes

On an electronic health record system, an agent retrieves laboratory results, records patient information and places orders. The same clinical workflow comes back for patient after patient.

1

One workflow, many patients

Each patient has different records and needs, but the tasks share many checks, decisions and steps. Experience from one attempt can guide the next.

2

Fixed after deployment

Most medical agents stay fixed once deployed and do not keep using this experience. The same kind of error recurs across patients.

3

A fixed improving strategy

Self-improving agents train the model or update the medical harness, but the strategy that decides these changes stays fixed. It never learns which changes actually help.

Recursive self-improvement

An agent improves not only itself but also its improving strategy.

Why this is hard in medicine

No reference harness

Clinical workflows rarely come with a reference harness that tells the agent how to organize its steps, and the details differ across hospitals. The improving strategy can only learn from the outcomes of the agent's own attempts.

Errors change as the agent learns

A change that fixes early errors may not fix the problems the agent meets later.

Early Uses a magnesium result from 3 days ago Time-filter skill Fixed
Later Right result, wrong dose Same time-filter skill No longer helps
The central question

How can a medical agent continually improve its improving strategy from its own outcomes?

Process demo

Watch one round of co-evolution

Each round turns the agent's failures into a better harness and a better model. The first eight steps follow an illustrative magnesium workflow. The last step is a real unseen workflow from MedAgentBench.

One round of MedicalRSI Illustrative example
Clinical workflow

Check the patient's latest magnesium level in the past 24 hours. If it is low, order IV magnesium replacement.

Patient 1
Patient 2
Patient 3
Patient 4
Patient 5
Patient 6
Solver

Acts with H0, the plain harness with no skill or tool for this workflow.

Patient 1check_circle
Patient 2cancel
Patient 3cancel
Patient 4check_circle
Patient 5cancel
Patient 6cancel
Patient 2 failedRead 2.1 mg/dL from 3 days ago, so no order was placed. The value from the past 24 hours was 1.5 mg/dL.
Patient 2Not solved
  1. get magnesium
  2. read 2.1 from 3 days ago
  3. no order
Patient 5Not solved
  1. get magnesium
  2. read an old value
  3. no order
Patient 1Solved
  1. get magnesium
  2. 1.4 from 6 hours ago
  3. order IV magnesium
Workflow evidence

Each attempt with its trajectory and its outcome feedback.

No reference answer
Skill · time filter
When to useA magnesium task with a 24-hour window
StepsGet the magnesium results, keep only the last 24 hours, and order IV magnesium if the newest value is low
PitfallsA value older than 24 hours does not count
Candidates from the Improver
H1Skill · time filter
H2Tool · recent_labs()
H3Skill · check units
H4Skill · order first
Harness P1P2P3P4P5P6 Solved H0plain check_circlecancelcancelcheck_circlecancelcancel 2/6 H1time filter check_circlecheck_circlecheck_circlecheck_circlecheck_circlecancel 5/6 H2recent_labs() check_circlecancelcheck_circlecheck_circlecancelcancel 3/6 H3check units check_circlecancelcancelcheck_circlecancelcancel 2/6 H4order first cancelcancelcancelcheck_circlecancelcancel 1/6
H1+50
H2+17
H30
H4−17
Improver reward

Patients solved with the harness minus patients solved without it.

Solver reward

One point for each task it solves, with or without a harness.

Solver

Learns from task outcomes

θtθt+1 L(θ) = ½ [ Limp + Lsol ]
Improver

Learns from harness gains

Workflow memory keeps the better harnessSkill · time filter, +50
Earlier round Read an old magnesium result Fixed by the time-filter skill
Later round Found the low value but ordered the wrong dose The time filter no longer helps
The Improver revises the stored skill+ Steps · base the dose on the magnesium level
New workflowPotassium above 5.5 mmol/L → ECG now and repeat potassium in 2 hours
Solver alone2 / 11checks pass
Harness from these failuresFixes the window, the decision rule and both orders
Solver with the harness11 / 11checks pass
Weights stay fixed, no retraining
Step 1 of 9

A clinical workflow arrives

The same workflow serves many patients. Each patient has different records, but the steps are shared.

Arrow keys step through
    Method

    Clinical Model-Harness Co-Evolution

    One model plays two roles through two prompts. Because both roles share the same weights, every update of the agent also updates its improving strategy.

    Solver

    The medical agent itself.

    It carries out a clinical workflow on each patient's records by following the medical harness. It learns from the outcome of every task.

    Improver

    Its learnable improving strategy.

    It reads the agent's latest failures and writes the medical harness. It learns from how much each harness helps the Solver.

    Overview of MedicalRSI. The Solver attempts the tasks of a workflow with the plain harness, a few attempts form the workflow evidence, the Improver writes candidate harnesses, the Solver attempts the tasks with each, both roles are rewarded, and one update trains the shared weights. Workflow memory keeps the better harness.
    Overview of MedicalRSI. In each round the Solver attempts a workflow, a few attempts become evidence, the Improver writes candidate harnesses, the Solver tries each of them, and one update trains both roles on their rewards.

    What makes it work

    Workflow evidence

    A few failed and successful attempts with their outcome feedback. It never shows the reference answer or the grader's checks.

    Skills and tools

    Each candidate harness adds one skill, a short procedure in plain language, or one tool, reusable code for a repeated operation.

    Workflow memory

    Memory keeps the best skill or tool for each workflow and replaces it only when a new candidate gains more.

    Counterfactual gain reward

    A harness earns what it adds over acting without it. It is credited for the failures it fixes and charged for the successes it breaks.

    Joint dual-role optimization

    One loss trains both roles on the same attempts in every round, so the Improver keeps up with the Solver.

    Test-time adaptation

    On a new workflow the weights stay fixed. The same model writes a harness from a few of its own failures.

    Details of the failure-grounded medical harness: an example attempt that reads a three-day-old magnesium value, the skills and tools the Improver writes, workflow memory, and test-time adaptation to a new workflow.
    Details of the Failure-Grounded Medical Harness. The Improver turns failures into a skill or a tool. Memory keeps the better one for each workflow, and a new workflow gets skills or tools written from its first attempts.
    Results

    Better than both routes of self-improvement

    On MedAgentBench and MedAgentGym, MedicalRSI outperforms context-level and weight-level self-improvement, and what it learns carries over to unseen workflows, other models and a new database.

    85.1%MedAgentBenchQwen3.5-9B, up from 36.9%. That is 22.3 points above the strongest baseline.
    89.0%MedAgentGymQwen3.5-9B, 19.5 points above the strongest baseline.
    3.3×Unseen workflows66.1% of tasks solved, against 20.0% for the Base Agent.
    7 / 7Other solvers improve+16.8 to +32.3 points with harnesses from our Improver, frontier models included.
    Left: tasks solved on MedAgentBench with Qwen3.5-9B, grouped by what each method changes. MedicalRSI solves 85.1 percent. Right: test outcome over ten training rounds for MedicalRSI, the GRPO Improver and the GRPO Solver.
    MedicalRSI Outperforms Existing Methods and Keeps Improving. Methods are grouped by what they change. After two training rounds, MedicalRSI already passes the final scores of the two strongest trained baselines.
    MethodWhat it changesTraining workflowsUnseen workflowsOverall
    Base AgentNothing40.820.036.9
    GRASPHarness54.631.750.3
    GPT-6.1-Sol writes the harnessHarness53.643.151.6
    GRPO ImproverHarness63.152.761.2
    STaRModel61.230.055.3
    GRPO SolverModel68.538.362.8
    MedicalRSIModel and harness89.566.185.1

    Tasks solved (%) on MedAgentBench with Qwen3.5-9B. Unseen workflows are held out from training. The paper reports every baseline, three backbones and bootstrap deviations.

    Analysis of co-evolution: four fixed solvers with the harness of the GRPO Improver and with that of MedicalRSI, and the gain of a new harness, a new solver and both over training rounds on Qwen3.5-9B and Gemma-4-E4B.
    Analysis of Co-Evolution. With the same solver, MedicalRSI writes a better harness than the GRPO Improver. Both roles improve, and together they improve the most.
    Analysis of transfer: the Improver's harnesses help seven other solvers, before and after RL training, the Solver uses a harness from GPT-6.1-Sol, and MedicalRSI carries over from MIMIC-III to the eICU database.
    Analysis of Transfer Beyond Training. The Improver helps every solver, even frontier models, and RL training adds much of this gain. The Solver makes strong use of a harness from another model. On the eICU database, MedicalRSI reaches 37.2%, 11.0 points above the Base Agent.
    Case study

    A few failures fix an unseen workflow

    Task from a workflow never seen in trainingCheck the most recent potassium within the last 24 hours. If it is above 5.5 mmol/L, order a 12-lead ECG now and a repeat serum potassium 2 hours from now.
    Solver alone2 / 11checks pass. It misses the 24-hour window and places neither order.
    Harness written from these failuresFixes the window, the decision rule and both orders.
    Solver with the harness11 / 11checks pass, without any retraining.
    Case study on an unseen workflow: the Solver alone gets all potassium values without a 24-hour window and passes 2 of 11 checks; the harness written by MedicalRSI sets the window and the decision rule; with it the Solver orders the ECG and the repeat potassium and passes 11 of 11 checks.
    Case Study on an Unseen Workflow. From the Solver's failures, the same model writes a harness that fixes the window, the decision rule and both orders. A few failures are enough to fix a workflow the model never saw in training.
    Citation

    Cite MedicalRSI

    BibTeX
    @article{wang2026medicalrsi,
      title   = {MedicalRSI: Medical Recursive Self-Improving Agents
                 via Clinical Model-Harness Co-Evolution},
      author  = {Wang, Ziqing and Palangi, Hamid and Zhao, Lili and Ding, Kaize},
      journal = {arXiv preprint arXiv:2611.26806},
      year    = {2026}
    }