LearnActCoder: Role-Aware Error Memory for Adaptive Clinical Coding Agents

Meysam Ghaffari and colleagues turn a small labeled batch of clinical coding errors into a structured mistake database and route each lesson to the agent role that can act on it.
Ask this paper
The errors repeat. Clinical coding agents hit the same failure modes over and over: unsupported codes, missed documented conditions, specificity errors and convention mismatches.
Role-aware routing is the mechanism. False-negative lessons go to a recall-oriented Coder and false-positive lessons go to a precision-oriented role, so each agent sees only the corrections relevant to its objective.
Adaptation happens at inference time. Learn-Then-Act needs a LEARN batch rather than a fine-tuning run, which fits regulated settings where model weights cannot be changed.
Memory is structured, not a transcript log. The MistakeKDB stores typed lessons, which is what makes selective routing possible.
Abstract
Clinical coding agents repeatedly encounter the same failure modes, including unsupported codes, missed documented conditions, specificity errors, and procedure-coding convention mismatches. We introduce Learn-Then-Act, an inference-time adaptation framework that converts errors from a small labeled LEARN batch into a structured Mistake Knowledge Database (MistakeKDB). False-negative lessons are routed to a recall-oriented Coder, while false-positive lessons are routed to a precision-oriented Judge. We instantiate the framework in LearnActCoder, a Coder-Judge clinical coding pipeline with lookup-table grounding where available. On 150 matched MIMIC-III notes, structured MistakeKDB improves CPT F1 by 5.9 percentage points, while raw-example and reflection-style memories remain near the no-memory baseline; the ICD-9 improvement is not significant. On a matched MIMIC-IV cohort, memory shifts ICD-10 coding toward higher precision at a recall cost, leaving F1 statistically unchanged. Applying the same memory to 1,000 held-out MIMIC-III notes maintains a stable ICD operating point, providing scale/stability evidence. Overall, the results are consistent with structured, feedback-derived error memory being useful for adapting clinical coding behavior across cases without weight updates or changes to the underlying workflow. Absolute CPT/HCPCS performance remains low, and the system is evaluated retrospectively rather than in clinical deployment.