MedCodER: A Generative AI Assistant for Medical Coding

Krishanu Das Baksi, Elijah Soba, John J. Higgins, Ravi Saini, Jaden Wood, Jane Cook, Jack Scott, Nirmala Pudota, Tim Weninger, Edward Bowen, Sanmitra Bhattacharya

Abstract

Medical coding—the assignment of standardized ICD-10 codes to patient records—is a critical yet labor-intensive task in healthcare administration. We present MedCodER, a novel generative AI framework that automates this process through a multi-stage pipeline involving extraction, retrieval, and re-ranking. By leveraging Large Language Models (LLMs) and semantic search, MedCodER achieves a micro-F1 score of 0.62 on a newly curated expert-annotated dataset, significantly outperforming previous state-of-the-art methods. Crucially, the system provides human-readable evidence for its code assignments, facilitating seamless human-in-the-loop verification.

Introduction

In the United States, medical coding involves navigating a massive label space of over 70,000 distinct ICD-10-CM codes. Traditional automated systems often struggle with the unstructured nature of clinical notes and lack the transparency required for clinical trust. MedCodER addresses these challenges by mimicking the workflow of professional coders, transforming unstructured physician notes into verifiable, standardized codes.

The MedCodER Framework

The MedCodER architecture follows a three-step pipeline designed to maximize both accuracy and interpretability:

  1. Extraction: Utilizing a "Chain-of-Thought" (CoT) approach, an LLM (e.g., GPT-4o) identifies potential diagnoses and extracts specific "supporting evidence" sentences directly from the medical record.
  2. Retrieval: To ensure comprehensive coverage of the 70,000+ code library, the system performs a semantic search against a vector database containing official ICD-10 descriptions and synonyms from the UMLS Metathesaurus. This captures relevant codes that might be overlooked during initial extraction.
  3. Re-ranking: A final LLM pass evaluates the combined candidates from the extraction and retrieval stages, re-ranking them based on the full clinical context to produce a prioritized list of suggestions.
The MedCodER pipeline: Extraction, Retrieval, and Re-ranking stages leading to final ICD-10 suggestions with supporting evidence.

Data and Evaluation

The researchers introduced the Extended ACI-BENCH dataset to evaluate the framework. This dataset consists of 207 clinical notes based on the Ambient Clinical Intelligence Benchmark. Unlike previous datasets, it includes high-quality annotations from a professional coder with over 20 years of experience, providing ground-truth ICD-10 codes alongside the specific text spans used as evidence.

Results and Key Insights

MedCodER demonstrates significant improvements over traditional methods. It achieved a micro-F1 score of 0.62, a substantial leap from the 0.40 achieved by the previous state-of-the-art model, PLM-ICD.

Ablation studies highlight the importance of the hybrid approach. As shown in the performance metrics, the combination of prompting and retrieval (MedCodER) consistently outperforms individual components in both recall and precision across various values of $k$.

Recall and Precision metrics for MedCodER and its variants, demonstrating the performance gains from the full hybrid pipeline.

Key findings include:

  • Evidence-First Prompting: Forcing the model to identify evidence before selecting a code significantly reduces hallucinations.
  • Backbone Performance: GPT-4o was identified as the most effective backbone, surpassing other leading models like Claude 3.5 Sonnet in this domain.
  • Interpretability: By highlighting evidence, the system reduces the time required for human verification from minutes to seconds.

Conclusion and Future Directions

MedCodER represents a major step toward practical AI-assisted medical coding. While highly effective, challenges remain regarding extremely long records and the processing of non-digital document formats (e.g., scanned PDFs). Future work will explore chunk-based processing and the integration of medical-specific LLMs to further refine retrieval accuracy.

Summary updated

BibTeX
@inproceedings{baksi2025medcoder,
  author = {Krishanu Das Baksi and Elijah Soba and John J. Higgins and Ravi Saini and Jaden Wood and Jane Cook and Jack Scott and Nirmala Pudota and Tim Weninger and Edward Bowen and Sanmitra Bhattacharya},
  title = {{MedCodER: A Generative AI Assistant for Medical Coding}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.naacl-industry.37},
}
Figure