Evolving better clinical coding agents with GEPA

Research • October 15, 2026 • Miniml Labs

Our GEPA-evolved workflow improved clinical-coding micro-F1 by 13.4% over an expert-designed baseline, without retraining the language model.

Our GEPA-evolved clinical-coding workflow improved micro-F1 by 13.4% over an expert-designed multi-agent baseline, using the same language model without retraining its weights.

On 115 held-out MDACE hospital notes, it recovered 16.1% more correct code assignments while making fewer false-positive assignments. The gains came from evolving the coding program.

Better coding through workflow evolution

We used GEPA to evolve executable coding workflows from a simple one-call starting point. Search could introduce intermediate reasoning stages, reorganise the agents, and add code-selection logic. The underlying Qwen3.6-35B-A3B model stayed fixed and ran locally.

Without being given the expert-designed architecture, the evolved workflows developed evidence extraction, candidate narrowing, assignment, and auditing steps. All three workflows evolved from code-description inputs exceeded our Code Like Humans baseline on the test split.

Results

The GEPA-evolved workflow improved both precision and recall over Code Like Humans. Its micro-F1 reached 0.4606, a gain of 5.44 percentage points over the expert-designed baseline and a 47.4% relative improvement over direct one-call coding.

Coding approach Micro-F1 Precision Recall
Direct one-call coding 0.3125 0.2468 0.4259
Expert-designed Code Like Humans 0.4061 0.3770 0.4401
GEPA-evolved workflow 0.4606 0.4191 0.5110

These results support automatic workflow design as a research direction for clinical coding. The next question is whether the same approach can recover clinically relevant information missing from routine GP coding, with evaluation inside the organisation that holds the records.

Evaluation notes

These are preliminary hospital-note results, with one search trajectory per configuration; the strongest observed workflow is shown. All comparisons use the same 115 test notes. The evolved workflows make multiple model calls and use a catalogue of 898 codes derived across the dataset, including test-label vocabulary; individual test notes and their assignments were withheld from optimisation. Scores include execution failures. GP transfer, full-ontology performance, and clinical safety require separate validation.

Aggregate results and benchmark protocol are available without clinical text or individual predictions.

More from Insights

Explainer

Compressing a photo with PCA

October 24, 2026

An interactive demo that treats each row of a grayscale photo as a vector, keeps the first k principal components, and rebuilds the picture from them.

Reliable Inference

Evaluator aware decoding

July 5, 2026

Evaluator aware decoding: let the model write the expression, let the engine write the answer