AI
Researchers Use Synthetic Clinical Notes to Improve Rare Medical Code Prediction
A data-centric approach generates synthetic discharge summaries to address the underrepresentation of rare diagnostic codes in medical AI training.
Automatic assignment of diagnostic codes from clinical documents remains a stubborn challenge in medical artificial intelligence, particularly when datasets contain thousands of rare or never-before-seen billing codes. Researchers have proposed a framework that tackles this long-tail problem by synthetically generating training data.
The Challenge: Underrepresented Diagnostic Codes#
The task of coding clinical text with ICD (International Classification of Diseases) codes is essential for hospital billing and medical record organization. However, datasets like MIMIC-III suffer from severe imbalance—while common diagnoses appear frequently in training data, rare codes appear so seldom that machine learning models struggle to predict them accurately. This translates to low performance metrics when measuring how fairly the system handles all codes equally (macro-F1 scores).
Synthetic Data as a Solution#
The proposed approach generates synthetic clinical notes to expand the training distribution. Rather than simply fabricating random text, the method carefully constructs realistic multi-label code combinations by anchoring on rare diagnoses and incorporating:
- Real co-occurrence patterns from actual patient records
- ICD code descriptions and clinical synonyms
- Medical taxonomy relationships
- Similar real clinical notes as templates
Using structured prompts, the team generated roughly 90,000 synthetic discharge summaries covering 7,902 ICD codes, significantly broadening the dataset beyond the original scope.
Results and Trade-offs#
The researchers fine-tuned two advanced transformer-based models—PLM-ICD and GKI-ICD—on both the original and augmented datasets. The synthetic data approach showed modest improvements in macro-F1 scores (measuring performance across all codes fairly) while maintaining strong micro-F1 performance (overall accuracy). The improvements outperformed previous best-known results.
The authors acknowledge that while gains may appear marginal relative to computational investment, their work demonstrates that thoughtfully designed synthetic data can help reduce bias in long-tail medical coding—promoting fairer predictions for rare diagnoses.

