Evaluation of Language Models in the Medical Context Under Resource-Constrained Settings

Andrea Posada, Daniel Rueckert, Felix Meissen, Philip MüllerarXiv 2024 · DOI

TL;DR

This paper evaluates 53 open-source language models (110M to 13B parameters) for medical text classification and conditional text generation, focusing on resource-constrained environments. The study reveals that instruction-tuned models and effective prompting significantly boost performance, often outperforming larger, non-specialized models, and that model size alone isn't the sole determinant of success.

What Problem Does This Paper Address?

The rapid advancement of large language models (LLMs) has opened up exciting possibilities for applications in sensitive domains like medicine. However, deploying these powerful models in real-world clinical settings, especially in resource-limited environments (e.g., using consumer-grade hardware), requires a thorough understanding of their capabilities and limitations. Currently, there's a lack of comprehensive evaluations of pre-trained language models specifically for medical tasks under such constraints. This paper aims to fill this gap by systematically assessing a diverse range of models on medical text classification and generation tasks, providing insights for practitioners and researchers working with limited computational budgets.

Methods

The authors conducted a comprehensive evaluation of 53 open-source language models, ranging from 110 million to 13 billion parameters, covering various Transformer architectures (encoder-only, decoder-only, encoder-decoder) and domains (general, biomedical, clinical).

For text classification, they employed three zero-shot approaches:

  1. Contextual Embedding Similarity: Using pooling strategies (CLS, average, max) to represent text embeddings for classification. This approach primarily uses encoder-only models.
  2. Natural Language Inference (NLI): Determining the relationship between a premise (text) and a hypothesis (label). This approach uses encoder-only and encoder-decoder models.
  3. Multiple-Choice Question Answering (MCQA): Framing classification as a question-answering task, utilizing encoder-decoder and decoder-only models.

For conditional text generation, they focused on decoder-only models and evaluated them using perplexity.

A key aspect of their methodology was the use of prompt engineering for text classification, exploring how different prompts influence model performance without requiring fine-tuning. They also investigated the impact of using overflow (processing text in chunks) for models with input lengths exceeding their maximum context window.

Datasets

The study utilized the following datasets:

  • Transcriptions: A multi-label dataset of electronic health records (EHRs) covering various medical specialties. It was preprocessed to 29 classes and 2,074 samples.
  • MS-CXR: A multi-class dataset of X-ray report sections, with 8 classes and 718 unique samples.
  • MIMIC-CXR: A dataset of radiographic reports, from which relevant sections were extracted, resulting in 57,711 informative samples.

Key Insights and Ideas

  • Prompting is Paramount: The study strongly emphasizes the critical role of prompt engineering in text classification. Well-crafted prompts can significantly boost performance, sometimes even more than model architecture or size.
  • Instruction Tuning Wins: Instruction-tuned models, particularly those based on the T5 architecture (Flan-T5, T0), consistently demonstrated superior performance in multiple-choice QA tasks, often outperforming larger, non-instruction-tuned models.
  • Size Isn't Everything: While larger models can be powerful, the research suggests that for resource-constrained settings, factors like training data quality, training objectives (especially instruction tuning), and effective prompting can be more decisive than sheer parameter count. Smaller, well-tuned models can achieve remarkable results.
  • Domain Specialization Isn't Always Superior: For some tasks (like contextual embedding similarity), domain-specific models did not consistently outperform their general-domain counterparts, challenging the assumption that specialization always leads to better performance.
  • Prompt Brittleness is Real: The study highlights that models can be sensitive to prompt wording, and no single prompt works universally well. This underscores the need for careful prompt engineering and further research into mitigating prompt brittleness.

Key Results

  • Text Classification:
    • Instruction-tuned T5 models (Flan-T5, T0) and instruction-tuned LLaMA models were top performers in multiple-choice QA.
  • BioLORD and SapBERT models showed remarkable performance in contextual embedding similarity.
  • Base T5 models and their clinically fine-tuned versions performed poorly.
  • Prompting generally improved performance, with average AUC score increases of up to 8.03 for NLI and significant gains in MCQA.
  • Conditional Text Generation:
    • LLaMA models (m38-m39) exhibited the highest predictive capacity (lowest perplexity) on the MIMIC-CXR dataset.
  • Not using the BOS token was beneficial for most models (77.78%), except for GPT-2 and Palmyra Base 5B.
  • Domain specialization did not consistently lead to better performance for medium-sized models, though it showed benefits for larger models in some cases.

Limitations and Future Work

  • Model Size Diversity: While 53 models were evaluated, the authors suggest that more models, particularly in the NLI approach, are needed to draw more robust conclusions about model size impact.
  • Prompt Brittleness: The study acknowledges prompt brittleness and recommends further exploration into this phenomenon and techniques to mitigate it.
  • Medical NLP Tasks: The authors suggest extending future research to include quantized models and a broader range of medical NLP tasks.
  • Model Calibration and Bias: Further investigation into model calibration (confidence in outputs) and the detection/mitigation of hallucinations and biases is recommended for ethical and effective deployment in healthcare.
  • Outlier Analysis: For conditional text generation, further research is needed to understand the challenging samples that lead to outliers in perplexity scores.

Summary updated

BibTeX
@misc{posada2024evaluation,
  author = {Andrea Posada and Daniel Rueckert and Felix Meissen and Philip Müller},
  title = {{Evaluation of Language Models in the Medical Context Under Resource-Constrained Settings}},
  year = {2024},
  eprint = {2406.16611},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.16611},
}
Figure