NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

A Two-Stage Decoder for Efficient ICD Coding

Thanh-Tung Nguyen, Viktor Schlegel, Abhinav Ramesh Kashyap, Stefan Winkler

Abstract

Automated International Classification of Diseases (ICD) coding is a critical task in healthcare, yet it remains challenging due to the massive, long-tailed label space and the complexity of clinical narratives. This paper presents a two-stage decoding framework that mimics the hierarchical workflow of human medical coders. By decomposing the prediction process into parent category identification followed by specific child code selection, the model achieves state-of-the-art performance among single-model architectures. Notably, the framework demonstrates a significant 25% relative improvement in identifying rare medical conditions while maintaining high computational efficiency.

1. Introduction

International Classification of Diseases (ICD) coding involves assigning standardized alphanumeric codes to patient diagnoses and procedures based on clinical documentation. These codes are essential for hospital billing, insurance claims, and large-scale epidemiological research. However, the task is inherently difficult: the label space is vast (exceeding 140,000 codes in ICD-10) and follows a "long-tailed" distribution where a small number of codes appear frequently while the vast majority are rarely seen.

Existing automated solutions often rely on massive pre-trained language models or complex external knowledge graphs. While effective, these approaches frequently overlook the inherent hierarchical structure of medical ontologies and the intuitive process used by human experts. This paper proposes a computationally efficient, two-stage decoding framework designed to address these limitations by incorporating hierarchical logic directly into the model architecture.

2. Methodology

The proposed framework utilizes a structured approach to simplify the multi-label classification problem into manageable steps.

2.1 Document Encoding

The model employs a Bidirectional Long Short-Term Memory (Bi-LSTM) network to process clinical notes. This encoder transforms raw text into dense vector representations, capturing the contextual nuances of medical jargon and long-form clinical narratives.

2.2 Two-Stage Decoding

The core innovation lies in the factorization of the prediction probability. Instead of predicting specific codes in a single pass, the model follows a two-step hierarchy:

  1. Stage 1: Parent Prediction: The model first identifies "parent" categories (e.g., the characters preceding the decimal point in an ICD code). It utilizes a label-attention mechanism, where the model learns specific embeddings for each parent category to focus on the most relevant sections of the clinical note.
  2. Stage 2: Child Prediction: To determine the final "child" codes, the model attends to both the original document representation and a "soft embedding" of the parent labels predicted in the first stage.

This process is mathematically represented as: $$P(\text{child} | \text{note}) = P(\text{child} | \text{parent}, \text{note}) \times P(\text{parent} | \text{note})$$

By breaking the problem down, the model reduces the output space at each stage, allowing for more focused and accurate classification.

3. Experimental Setup

The model was evaluated using the MIMIC-III (Medical Information Mart for Intensive Care) database, the gold-standard benchmark for clinical NLP. Two specific subsets were used:

  • MIMIC-III-Full: The complete set of 8,929 codes, representing the full complexity of the coding task.
  • MIMIC-III-50: A subset containing the 50 most frequent codes, used to evaluate performance on common diagnoses.

4. Results and Discussion

4.1 Performance Metrics

On the MIMIC-III-Full dataset, the two-stage decoder achieved a Micro F1 score of 58.4%. This represents the highest performance recorded for a "single" model—defined as one that does not rely on external knowledge bases or massive ensemble techniques. The model performed on par with significantly more complex architectures, such as MSMN and KEPTLongformer.

4.2 Addressing the Long Tail

A primary strength of the hierarchical approach is its efficacy on rare codes. In an ablation study comparing the model to JointLAAT (a leading hierarchical model), the two-stage decoder showed a 25% relative improvement in Micro F1 for codes appearing only 1 to 10 times in the dataset. This suggests that learning robust representations for frequent parent categories provides essential guidance for identifying their rarer sub-codes.

4.3 Computational Efficiency

Unlike Transformer-based models that require extensive hardware resources, this LSTM-based framework is highly efficient. The model requires approximately 1.25 hours per training epoch, compared to 11 hours for several leading competitors. This efficiency makes the model more accessible for clinical environments with limited computing power.

5. Conclusion and Future Work

The two-stage decoding framework demonstrates that mimicking human intuition—categorizing before specifying—can significantly improve the accuracy and efficiency of automated ICD coding. While currently validated on the ICD-9 codes within the MIMIC-III dataset, the underlying logic is applicable to the more modern ICD-10 standard.

Future research will focus on testing the model across multi-institutional data and adapting the framework for non-English clinical notes. Additionally, there is potential to integrate this two-stage decoder with more advanced document encoders, such as clinical Transformers, to further enhance predictive precision.

Summary updated

BibTeX
@inproceedings{nguyen2023two,
  author = {Thanh-Tung Nguyen and Viktor Schlegel and Abhinav Ramesh Kashyap and Stefan Winkler},
  title = {{A Two-Stage Decoder for Efficient ICD Coding}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.findings-acl.285},
}
Figure