Enhancing LLM Medical Coding with Structured External Knowledge

Yidong Gan, David D. Nguyen, Yang Lin, Xu Zhong, Thanh Vu, Long Duong, Yuan-Fang LiML4H 2026 Poster 2026

Abstract

Accurate medical coding requires consulting authoritative resources such as the ICD tabular list and coding guidelines. Existing LLM-based automated methods largely rely on internal model knowledge, which is prone to hallucination and cannot keep pace with guideline updates. We introduce RAG-Coding, an agentic, training-free method that augments LLMs with structured external knowledge. Specifically, we encode the tabular list as a knowledge graph capturing hierarchical and instructional code relationships, and distil the guidelines into concise, code-specific summaries rather than retrieving raw text. On the MDACE dataset, RAG-Coding outperforms the strongest LLM-based baseline by 3--13\% in micro-F1 and 1--8\% in macro-F1 across five LLM backbones; compared to the supervised state-of-the-art, PLM-ICD, RAG-Coding achieves 11\% higher recall at the cost of 6\% lower precision. We also release MDACE-2025, an expert re-annotation of the MDACE test set under the contemporary 2025 ICD-10-CM/PCS guidelines. On MDACE-2025, RAG-Coding also outperforms all baselines notably in micro- and macro-F1, demonstrating effective generalisation to guideline updates. Ablation studies show stepwise gains, confirming the value of structured external knowledge for LLM-based medical coding.
BibTeX
@inproceedings{gan2026enhancing,
  author = {Yidong Gan and David D. Nguyen and Yang Lin and Xu Zhong and Thanh Vu and Long Duong and Yuan-Fang Li},
  title = {{Enhancing LLM Medical Coding with Structured External Knowledge}},
  booktitle = {ML4H 2026 Poster},
  year = {2026},
  url = {https://openreview.net/forum?id=ehmmpbC1rI},
}

Loading related content...

Figure