Soft-prompt tuning to predict lung cancer using primary care free-text Dutch medical notes

Auke Elfrink, Iacopo Vagliano, Ameen Abu-Hanna, Iacer Calixto

Abstract

We investigate different natural language processing (NLP) approaches based on contextualised word representations for the problem of early prediction of lung cancer using free-text patient medical notes of Dutch primary care physicians. Because lung cancer has a low prevalence in primary care, we also address the problem of classification under highly imbalanced classes. Specifically, we use large Transformer-based pretrained language models (PLMs) and investigate: 1) how soft prompt-tuning compares to standard model fine-tuning; 2) whether simpler static word embedding models (WEMs) can be more robust compared to PLMs in highly imbalanced settings; and 3) how models fare when trained on notes from a small number of patients. We find that 1) soft-prompt tuning is an efficient alternative to standard model fine-tuning; 2) PLMs show better discrimination but worse calibration compared to simpler static word embedding models as the classification problem becomes more imbalanced; and 3) results when training models on small number of patients are mixed and show no clear differences between PLMs and WEMs.

Introduction

In the Netherlands, General Practitioners (GPs) act as gatekeepers to specialist care. Their medical notes contain years of patient history in free-text form, offering a unique opportunity to identify early, subtle symptoms of lung cancer. However, using AI to screen these notes faces three major hurdles: extreme class imbalance (lung cancer prevalence is approximately 0.4%), data scarcity for confirmed cancer cases, and the computational difficulty of processing long patient histories that can span decades.

Methods

The researchers evaluated two main types of models: Pretrained Language Models (PLMs), specifically Dutch-specific versions of RoBERTa (RobBERT and MedRoBERTa.nl), and a simpler static Word Embedding Model (WEM) baseline, FastText.

Two adaptation strategies for PLMs were compared:

  • Standard Fine-Tuning (FT): Updating all parameters of the large model for the specific task.
  • Soft-Prompt Tuning (ST): A parameter-efficient technique where the main model remains frozen, and only a small number of trainable "continuous embeddings" (soft prompts) are updated.

To handle long patient histories, the study employed a per-note to per-patient aggregation strategy, using the lowest predicted probability across all notes to suppress noise and generate a single patient-level score.

Key Results

Soft-Prompting vs. Fine-Tuning

Soft-prompt tuning consistently outperformed or matched standard fine-tuning across various metrics. On the balanced test set, RobBERT with soft-prompt tuning achieved a patient-level AUROC of 94.3, significantly higher than the 90.2 achieved via standard fine-tuning.

Performance comparison of models on the balanced dataset (D^bal) showing AUROC, AUPRC, and Brier scores for note-level (N) and patient-level (P) predictions.

Discrimination vs. Calibration in Imbalanced Settings

A critical finding of the study is the trade-off between discrimination and calibration as class imbalance increases. While PLMs like RobBERT maintained superior discrimination (ranking cancer patients higher than non-cancer patients), they became increasingly poorly calibrated in highly imbalanced scenarios.

In the realistic 1:250 imbalance setting, the best PLM (RobBERT ST) maintained an AUROC of 67.1 but had a poor Brier score of 17.8. In contrast, the simpler FastText model, while less discriminative (AUROC 56.1), was much better calibrated with a Brier score of 0.7. This suggests that while PLMs are better at ranking, their raw probability estimates may be less reliable for direct clinical decision-making in real-world, low-prevalence environments.

Model performance across varying class imbalance ratios (1:10 to 1:250), highlighting the trade-off between AUROC (discrimination) and Brier score (calibration).

Conclusion

Soft-prompt tuning is a computationally efficient and effective alternative to standard fine-tuning for clinical NLP tasks. However, the choice between complex PLMs and simpler WEMs involves a trade-off: PLMs offer better ranking performance, but simpler models like FastText provide more reliable probability calibration in the face of extreme class imbalance. Future work should focus on hybrid models that combine the discriminative power of Transformers with the calibration stability of simpler embedding methods.

Summary updated

Abstract

We investigate different natural language processing (NLP) approaches based on contextualised word representations for the problem of early prediction of lung cancer using free-text patient medical notes of Dutch primary care physicians. Because lung cancer has a low prevalence in primary care, we also address the problem of classification under highly imbalanced classes. Specifically, we use large Transformer-based pretrained language models (PLMs) and investigate: 1) how \textit{soft prompt-tuning} -- an NLP technique used to adapt PLMs using small amounts of training data -- compares to standard model fine-tuning; 2) whether simpler static word embedding models (WEMs) can be more robust compared to PLMs in highly imbalanced settings; and 3) how models fare when trained on notes from a small number of patients. We find that 1) soft-prompt tuning is an efficient alternative to standard model fine-tuning; 2) PLMs show better discrimination but worse calibration compared to simpler static word embedding models as the classification problem becomes more imbalanced; and 3) results when training models on small number of patients are mixed and show no clear differences between PLMs and WEMs. All our code is available open source in \url{https://bitbucket.org/aumc-kik/prompt_tuning_cancer_prediction/}.
BibTeX
@inproceedings{elfrink2023soft,
  author = {Auke Elfrink and Iacopo Vagliano and Ameen Abu-Hanna and Iacer Calixto},
  title = {{Soft-prompt tuning to predict lung cancer using primary care free-text Dutch medical notes}},
  booktitle = {AIME},
  year = {2023},
  url = {https://openreview.net/forum?id=pBjFfblQfy},
}
Figure