TRANSMISSION // 2605.27377v3
Giving Medical-Coding AI a Rulebook to Check
Source published
RAG-Coding pairs language models with a structured ICD knowledge graph and concise coding rules. Tests show higher F1 scores on two versions of MDACE, but errors and study limits remain.

Medical codes must match both what a clinical note says and the rules of the coding system. Researchers tested whether language models do better when those rules are organized for them to consult—not left to memory.
Medical coding turns clinical notes into standardized codes used in billing, research and health policy. The task is more than matching a diagnosis to a label: codes have hierarchies, may require companion codes, and must follow detailed rules. Because those rules change, a model relying mainly on learned patterns may produce an outdated or unsupported answer.
A study by Yidong Gan and colleagues presents RAG-Coding, a training-free system that gives language models external coding references in a structured form. The work appears in the Proceedings of Machine Learning Research for Machine Learning for Health 2026; the supplied source is an arXiv preprint. Its central question is whether organizing coding knowledge as relationships and short, targeted rules can improve automated coding.
From candidate codes to audited codes
RAG-Coding processes a medical note in four stages. First, a language model proposes candidate ICD-10-CM codes and supporting evidence. Next, another stage checks those candidates against a knowledge graph built from the official ICD tabular list. The graph records relationships such as parent and child codes, exclusions, and instructions to use an additional code. Invalid codes are also removed by a deterministic check.
The system then finds relevant sections of the coding guidelines and condenses them into code-specific summaries. A final model-based audit uses those summaries and the note to keep, remove or replace codes. In short, the system does not simply retrieve a large block of reference text: it tries to present the model with the particular relationships and rules relevant to each candidate.
The researchers evaluated the method on MDACE, a dataset of medical notes with coding annotations, and compared it with several automated approaches, including the supervised PLM-ICD model. They also created MDACE-2025: expert revisions of the MDACE test set using the April 2025 coding guidance, with code sequencing and justifications for complex decisions. The new version offers a test against updated rules, though it is a re-annotation of the test set rather than a new, broad clinical evaluation.
Stronger benchmark scores, with trade-offs
On the original MDACE test set, RAG-Coding exceeded the strongest LLM-based baseline in micro- and macro-F1 across five language-model backbones. F1 combines precision—the share of predicted codes that are correct—and recall—the share of target codes found. With GPT-5, the paper reports micro-F1 of 0.54 and macro-F1 of 0.32, each 8% above the strongest LLM baseline in that comparison.
Against PLM-ICD, the authors narrowed the comparison by filtering language-model outputs to the code space available to the supervised model. In that setting, RAG-Coding had higher recall, while PLM-ICD had higher precision. This is a meaningful trade-off: finding more relevant codes can also mean proposing more codes that do not belong. The comparison is not perfectly like-for-like, the paper notes, because the language models initially reason over a larger code space.
On MDACE-2025, RAG-Coding also scored higher than the tested baselines in micro- and macro-F1. The updated annotations differ from the original: they include additional diagnosis codes and fewer procedure codes, among other changes. The authors report that the updated test set was annotated by one credentialed coder using a review-and-revise process. That expertise supports the work, but a single annotator cannot establish how consistently other experts would make the same revisions.
Ablation tests—where parts of the system are removed or replaced—suggest that the format of the reference material matters. Replacing the knowledge graph with plain text or replacing concise guideline summaries with narrative snippets lowered micro-F1 in the reported tests. These results support the value of the structured approach in this setup; they do not prove that the same design will help in every coding environment.
What the results do not establish
The evaluation is limited to English-language ICD-10-CM coding on MDACE and its revised test set. It does not show that the system improves patient outcomes, billing accuracy in routine practice, or coder productivity in a live workflow. The paper’s own analysis found errors in which the system removed briefly documented comorbidities or added codes more specific than the note supported. Because the method has several stages, an early missed code can also be difficult for later stages to recover.
The authors describe RAG-Coding as an assistive tool, not a replacement for professional coders. The source code is not released, citing intellectual-property constraints, which limits independent reproduction. The study also identifies future needs: broader annotation with multiple coders and checks on whether the generated guideline summaries faithfully represent the official rules.
The findings therefore offer evidence that structured, current coding references can improve benchmark performance, including under updated guidance. They are not evidence that automated coding is ready to operate without human review.
- medical coding
- large language models
- ICD-10-CM
- retrieval-augmented generation
- knowledge graphs
- clinical NLP
Related reading
Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.
Can synthetic notes help AI predict rare diagnosis codes?
Source published
Shared keywords: clinical nlp, medical coding
DotRAG narrows graph searches by reasoning along likely paths
Source published
Shared keywords: knowledge graphs, large language models, retrieval augmented generation
Teaching Knowledge Bases to Learn from Answer Errors
Source published
Shared keywords: knowledge graphs, large language models, retrieval augmented generation
When graphs help AI agents—and why better retrieval is not enough
Source published
Shared keywords: knowledge graphs, large language models, retrieval augmented generation
Fine-tuning helps language models identify relations in text
Source published
Shared keywords: large language models, retrieval augmented generation