Multi-Label Few-Shot ICD Coding as Autoregressive Generation with Prompt

Zhichao Yang, Sunjae Kwon, Zonghai Yao, Hong Yu

Abstract

Assigning International Classification of Diseases (ICD) codes to clinical notes is a complex multi-label task characterized by a massive label space and a long-tail distribution of rare codes. This paper introduces GPsoap (Generation with Prompt using SOAP structure), a novel approach that reframes ICD coding as a text generation problem. By leveraging clinical note structure for pretraining and using generative prompts to describe diseases, the proposed method achieves a significant performance leap, particularly for few-shot medical codes.

Introduction

ICD coding is essential for healthcare billing and clinical research, yet it presents two major challenges for machine learning. First, the Long-Tail Challenge involves over 150,000 possible codes, many of which appear rarely in training data, making it difficult for standard classifiers to learn them. Second, the "Missing Mention" Problem occurs when a diagnosis is implied by clinical evidence (e.g., lab results) but not explicitly named in the text. Standard models often lack the clinical reasoning required to infer these diagnoses.

Researchers hypothesize that treating codes as semantic text descriptions rather than arbitrary indices allows models to utilize medical knowledge learned during pretraining. For example, even if a model rarely sees a specific code for "Acute posthemorrhagic anemia," it can leverage its understanding of "acute" and "anemia" from general medical corpora.

Methodology: The GPsoap Approach

The authors introduce three primary innovations to overcome the limitations of traditional classification models:

SOAP-based Pretraining

Clinical notes often follow the SOAP format (Subjective symptoms, Objective labs, Assessment, and Plan). The researchers pretrained a Longformer encoder-decoder model on 3.6 million clinical notes by masking the "Assessment & Plan" sections. This task forces the model to learn the latent logic of medical diagnosis by inferring the assessment directly from symptoms and objective data.

Autoregressive Generation and Prompting

Instead of predicting a high-dimensional binary vector, GPsoap generates the actual text descriptions of ICD codes (e.g., "diabetes with ketoacidosis"). This generative approach allows for fine-grained interaction via cross-attention on every token of the note, providing more precise evidence-matching than standard bi-encoders.

Comparison of previous classification-based training versus the proposed generative fine-tuning approach.

Constrained Decoding and Reranking

To ensure clinical accuracy, the model employs Trie-Constrained Beam Search, restricting the vocabulary to valid ICD code descriptions and preventing "hallucinations." Additionally, an ensemble reranker combines predictions from GPsoap and existing state-of-the-art (SOTA) models, using a cross-attention mechanism to finalize the selection.

Experimental Results

The model was evaluated on the gold-standard MIMIC-III dataset and a specialized MIMIC-III-few subset focusing on 685 codes appearing five or fewer times in training.

Few-Shot Performance

GPsoap demonstrated a transformative improvement in rare code identification. On the MIMIC-III-few benchmark, it achieved a Macro F1 of 30.2, compared to the previous SOTA (MSMN) of 4.3. This performance highlights the power of semantic descriptions in low-data regimes.

Performance comparison on the MIMIC-III-few dataset, showing GPsoap's significant lead in Macro F1 and Recall.

Full Dataset and Clinical Inference

On the standard MIMIC-III-full benchmark, the ensemble reranker set a new SOTA, improving Macro F1 from 10.4 to 14.6. Furthermore, the model proved significantly more adept at identifying "unmentioned" diagnoses—cases where the code is required but the exact disease name is absent from the text—validating the effectiveness of SOAP-based pretraining.

Discussion and Limitations

While GPsoap sets a new standard for ICD coding accuracy, it faces practical hurdles. The autoregressive nature of the model makes it approximately 24 times slower than standard classifiers, which may limit real-time clinical use. Additionally, the model's peak performance relies on pretraining on a massive proprietary VA dataset. Future research will focus on improving inference speed and the recall of the initial candidate generation phase to further enhance the reranker's effectiveness.

Summary updated

BibTeX
@inproceedings{yang2023multi,
  author = {Zhichao Yang and Sunjae Kwon and Zonghai Yao and Hong Yu},
  title = {{Multi-Label Few-Shot ICD Coding as Autoregressive Generation with Prompt}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.1609/aaai.v37i4.25668},
}
Figure