M ed C od ER : A Generative AI Assistant for Medical Coding (2025)

Abstract: Medical coding standardizes clinical data but is both time-consuming and error-prone. Traditional Natural Language Processing (NLP) methods struggle with automating coding due to the large label space, lengthy text inputs, and the absence of supporting evidence annotations that justify code selection. Recent advancements in Generative Artificial Intelligence (AI) offer promising solutions to these challenges. In this work, we introduce MedCodER, an emerging Generative AI framework for automatic medical coding that leverages extraction, retrieval, and re-ranking techniques as core components. MedCodER achieves a micro-F1 score of 0.62 on International Classification of Diseases (ICD) code prediction, significantly outperforming state-of-the-art methods. Additionally, we present a new dataset containing medical records annotated with disease diagnoses, ICD codes, and supporting evidence texts (https://doi.org/10.5281/zenodo.13308316). Ablation tests confirm that MedCodER’s performance depends on the integration of each of its aforementioned components, as performance declines when these components are evaluated in isolation.

## introduction the international classification of diseases (icd) 1 , developed by the world health organization (who) 2 , is a globally recognized standard for recording, reporting, and monitoring diseases. in the united states, the use of icd codes is mandated by the u.s. department of health and human services (hhs) for entities covered by the health insurance portability and accountability act for insurance purposes. accurate icd coding is essential for medical billing, health resource allocation, and medical research @xcite . this task is performed by specialized professionals known as medical or clinical coders, who use a combination of manual techniques and semi-automated tools to process large volumes of medical records. their primary responsibility is to accurately assign icd-10 codes to medical records based on documented diagnoses and procedures. the coding process is often time-consuming and costly, and the difficulty depends on the complexity of the patient records and the level of detail in the documentation. errors in icd coding can have significant financial and legal implications for patients, healthcare providers, and insurers. despite the critical importance of accurate coding, few reliable solutions exist to supplement or automate this process. automation of icd coding is an active research area within the nlp community. while various approaches have been proposed, recent methods typically frame this task as a multi-label classification problem: given the raw text of a medical record, the goal is to predict each of the relevant icd codes @xcite . although the objective is straightforward, several challenges make automatic icd coding difficult. these include the ## medcoder framework here we introduce the medcoder framework, which is illustrated in fig. 1 . medcoder is an interpretable and explainable icd coding framework comprised three components: (1) extraction, (2) retrieval, and (3) re-ranking. in this section, we describe each component and its relevance to icd-10 coding. ## results in this section, we present the results of both the baselines and the medcoder framework. ## discussion unlike fully automated icd coding solutions, med-coder is an ai-assisted coding tool to enhance medical coding workflows. to illustrate this, we designed a preliminary but functional user interface (figure 3 ) which is current being beta-tested by our coders prior to production integration with an enterprise medical coding tool. for each predicted diagnosis, a button in the ui is available to highlight the corresponding text spans containing disease mentions and supporting evidence texts. additionally, a dropdown menu displays medcoder's top five most relevant icd-10 codes per diagnosis. coders can review and select a code from the dropdown or input a different code. in future work, we intend to investigate biomedical domain-specific llms, as medcoder depends on the llm's understanding of diseases, supporting evidence, and icd-10 codes. our framework's flexibility in replacing individual components allows us to integrate the latest sota models as the generative ai landscape evolves. for example, appendix c demonstrates the results of medcoder utilizing medcpt @xcite , a domainspecific embedding model trained on pubmed articles, as the backend embedder for retrieval, instead of the openai text-embedding-ada-002 model used in our current work. although the dataset discussed in this paper is in text format, real-world medical records often come in other formats, such as scanned or digital pdfs. these formats require additional preprocessing to handle any handwritten sections, tables, and other poorly-formatted data. furthermore, the fixed context length of llms may require ex-tra pre-processing steps for longer records. we hypothesize that performance should remain relatively consistent for larger records, provided they are divided into smaller consecutive chunks and processed sequentially. ## conclusions in conclusion, we present medcoder-an innovative, interpretable framework that surpasses current sota methods in automated icd coding. by integrating extraction, retrieval, and re-ranking techniques with llms, medcoder achieves a synergy that no single component can match alone. our analyses confirm that this holistic approach not only boosts coding accuracy but also maintains transparency in code selection. additionally, our error analysis has pinpointed key areas for future improvement, paving the way for more robust and efficient solutions. finally, our preliminary integration of medcoder as an ai-based assistant for medical coders demonstrates its potential to enhance both efficiency and accuracy in clinical settings, promising significant practical benefits.