Can GPT-3.5 generate and code discharge summaries?

Matús Falis, Aryo Pradipta Gema, Hang Dong, Luke Daines, Siddharth Basetti, Michael Holder, Rose S. Penfold, Alexandra Birch, Beatrice Alex

Abstract

Automated medical coding using the International Classification of Diseases (ICD) is a critical yet challenging task due to the "long-tail" distribution of medical conditions and strict data privacy regulations. This study investigates the utility of GPT-3.5 as both an autonomous medical coder and a data augmentor for training specialized neural models. While GPT-3.5 performs poorly as a zero-shot coder on real-world clinical notes, it proves to be a powerful tool for generating synthetic discharge summaries. These synthetic notes significantly improve the performance of local models on rare medical codes, offering a viable path to mitigate data sparsity in clinical NLP.

Introduction: The Data Sparsity Challenge

Automated ICD coding involves assigning standardized codes to clinical documents like discharge summaries. The primary hurdle is the "long-tail" distribution: common conditions like hypertension are overrepresented, while thousands of rare conditions lack sufficient training data. Furthermore, the sensitive nature of clinical data limits large-scale sharing. Researchers explored whether Large Language Models (LLMs) like GPT-3.5 could bridge this gap by generating realistic synthetic summaries for rare conditions to "teach" smaller, specialized models.

Methodology

The study employed GPT-3.5 (gpt-3.5-turbo-0613) in two primary roles:

  1. Data Generation: "Silver standard" label sets were created by substituting rare "sibling" codes into real clinical code combinations. GPT-3.5 was then prompted to write detailed discharge summaries based on these descriptions.
  2. Zero-Shot Coding: The model's ability to extract ICD-10 codes from both real MIMIC-IV notes and its own synthetic notes was evaluated.
Overview of the synthetic discharge summary generation pipeline using GPT-3.5.

The resulting synthetic dataset (9,606 documents) was used to augment real data for training three neural architectures: CAML, LAAT, and Multi-Res CNN.

Dataset Characteristics

The research utilized the MIMIC-IV dataset, specifically the Nguyen split to preserve the long tail of rare codes. The synthetic augmentation set consisted of 9,606 summaries based on 114 low-population "generation codes."

Comparison of document statistics (word counts and label distributions) between original MIMIC-IV data and GPT-generated summaries.

As shown in Figure 6, synthetic summaries tended to be shorter and contained fewer labels per document compared to the original MIMIC-IV data, reflecting the constraints of the LLM's context window and prompting strategy.

Key Insights

  • In-Prompt Bias: GPT-3.5 excels at coding its own synthetic data (F1 ~48) because it often reproduces prompt descriptions verbatim. However, its performance on messy, real-world clinical notes is significantly lower (F1 ~14).
  • Augmentation vs. Autonomy: LLMs are better "tutors" than "practitioners" in this context. Synthetic data improved the Macro-F1 for rare classes in Multi-Res CNN and CAML by 26% and 78%, respectively.
  • The "Uncanny Valley": Clinicians found synthetic summaries to be "correct" but "unnatural" and "fragmented," often failing to link diagnoses into a coherent patient narrative (e.g., treating diabetes and its complications as unrelated facts rather than a linked progression).

Results and Limitations

Augmented models showed a significant reduction in "out-of-family" errors for rare codes. However, GPT-3.5's zero-shot precision on real notes was under 10%, frequently hallucinating codes or failing to identify standard clinical concepts without explicit guidance.

The primary limitations included:

  • Token Limits: The 4,096-token limit of GPT-3.5 resulted in shorter summaries than many real-world documents, which can reach much greater lengths.
  • Narrative Coherence: The model struggled to prioritize "critical" vs. "minor" diagnoses, often giving equal weight to a life-threatening event and minor ailments.

Future work suggests using In-Context Learning (ICL) and restructured prompts to improve the narrative flow and authenticity of synthetic clinical data, potentially helping the model build more plausible patient histories.

Summary updated

BibTeX
@article{falis2024can,
  author = {Matús Falis and Aryo Pradipta Gema and Hang Dong and Luke Daines and Siddharth Basetti and Michael Holder and Rose S. Penfold and Alexandra Birch and Beatrice Alex},
  title = {{Can GPT-3.5 generate and code discharge summaries?}},
  journal = {J. Am. Medical Informatics Assoc.},
  year = {2024},
  doi = {10.1093/jamia/ocae132},
}
Figure