Why medical coding is hard to benchmark
Medical coding is not a single-label classification task. Coders are often selecting the maximum valid set of billable codes, frequently up to 25 per case, while staying compliant.
In practice, coding is simultaneously:
- An evidence extraction problem: what diseases and procedures are actually documented?
- An optimization problem: what can be billed compliantly, given coding rules and institutional SOPs?
Coders must reason over clinical documentation, disease severity, co-morbidities, and procedural context. This institutional nuance is exactly why strong benchmarks are necessary. This is also why generic public datasets tend to fail.
The two core failures of most public coding benchmarks
Most public coding benchmarks run into the same structural limitations:
Contamination risk: Public datasets are often scraped or replicated into training corpora. This can inflate apparent model performance through memorization, rather than testing genuine medical and billing reasoning.
Billing is not ground truth: Many EMR datasets include submitted bills, but submission does not equal approval. The real signal is which bills passed payer review, and which bills avoided denial.
This is also why simply hiring expert coders to annotate an EMR dataset is often insufficient without connection to real-world validation signals and outcomes.
What “gold-standard” coding data requires
To benchmark coding systems credibly, you need data that is tightly connected to real billing workflows and outcomes:
- EMR linked to billing outcomes.
- Visibility into submitted codes, approved codes, and denial patterns.
- A way to identify high-performing coders (for example, those associated with low denial rates).
- Coverage across diverse diagnoses, complex co-morbid cases, and multi-day inpatient stays.
This is what makes coding benchmarks reflect real financial and compliance stakes, rather than toy tasks.
What Protege built: the data engine behind MedCode
Protege’s role in the MedCode benchmark was to curate de-identified medical EMR datasets linked to bills that successfully passed submission, and to prepare them so they could be used as evaluation-ready benchmark data, not training data.
For each case, we provided raw clinical notes, submitted billing codes, and ancillary codes present in the chart but not billed. This creates visibility into both the evidence available in the record and the coding decisions made in practice.
That distinction is crucial for understanding where a model fails: did it miss evidence in the notes, or did it fail to apply billing logic and coding rules? Models were evaluated on their ability to assign the correct primary ICD, capture appropriate secondary ICDs, and maximize compliant code sets.
A core design constraint for the Protege-provided data was preventing leakage. These datasets were intentionally held out of training datasets, with holdout occurring at the patient level (not just record level). This ensures the benchmark tests true generalization, not recall from near-duplicate encounters.