Efficiency at scale: Investigating the performance of diminutive language models in clinical tasks

Niall Taylor, Upamanyu Ghose, Omid Rohanian, Mohammadmahdi Nouriborji, Andrey Kormilitzin, David A. Clifton, Alejo J. Nevado-Holgado · DOI

TL;DR

This paper explores how Parameter-Efficient Fine-Tuning (PEFT) methods, particularly LoRA, can make large language models (LLMs) more accessible and efficient for clinical tasks, even with very small models. The findings suggest that PEFT, especially LoRA, offers a compelling trade-off between performance and computational cost, making specialized clinical AI more feasible.

What Problem Does This Paper Address?

The field of Natural Language Processing (NLP) is currently dominated by massive Large Language Models (LLMs). While these models show impressive general capabilities, they are computationally expensive to train and deploy, making them impractical for many real-world applications, especially in resource-constrained environments like healthcare. Furthermore, adapting these behemoths to specific clinical tasks often requires significant fine-tuning, which is also resource-intensive. The paper addresses the need for more efficient ways to adapt LLMs for clinical tasks, focusing on smaller, "diminutive" models and exploring Parameter-Efficient Fine-Tuning (PEFT) methods as a solution. The goal is to achieve high performance on clinical tasks without the prohibitive computational costs associated with full fine-tuning of large models.

Methods

The researchers investigated the effectiveness of PEFT methods on various transformer-based LLM architectures, ranging from tiny models with 13.8 million parameters to larger ones like Llama-2-7b. They focused on two prominent PEFT methods:

  • LoRA (Low-Rank Adaptation): This method injects trainable low-rank matrices into specific layers (typically attention mechanisms) of the LLM. The original weights of the LLM are frozen, and only these new, smaller matrices are trained. This significantly reduces the number of trainable parameters.
  • IA³ (Infused Adapter by Inhibiting and Amplifying Inner Activation): This method also introduces learnable vectors to scale activations within the model, similar to adapter methods, but applied to specific parts of the attention and feed-forward networks.

For downstream tasks, they used a traditional fine-tuning approach by adding task-specific classification heads on top of the base LLM and updating all model parameters (full fine-tuning) for comparison. They also explored the impact of domain-specific pre-training (general, biomedical, and clinical) on model performance.

Datasets

The study utilized several commonly used clinical datasets for evaluation across different NLP tasks:

  • Sequence Classification Tasks:
    • MIMIC-III ICD-9 Triage: Classifying patient records into seven triage groups based on ICD-9 codes.
  • MIMIC-III - Clinical Outcomes: Predicting patient mortality (binary classification) and length of stay (multi-class classification) from ICU discharge summaries.
  • Relation Extraction Task:
    • I2B2 2010 Relation Extraction: Classifying the medical relationship between concepts in text (e.g., treatment improving a medical problem).
  • Named Entity Recognition (NER) Tasks:
    • I2B2 2010, 2012: Identifying clinical concepts, departments, evidentials, and occurrences in text.
  • I2B2 2014: A de-identification task to classify protected health information (PHI) like names and addresses.

Key Insights and Ideas

  • LoRA is a Champion: LoRA consistently demonstrated strong performance across various model sizes and clinical tasks, often matching or even surpassing full fine-tuning, especially for smaller models. This makes it a highly versatile PEFT method.
  • Small Models Can Be Mighty: Even extremely small LLMs (as few as 25 million parameters) can achieve competitive performance on clinical tasks when fine-tuned with PEFT methods like LoRA. This opens doors for on-device or low-resource deployments.
  • Domain Matters: Pre-training LLMs on domain-specific data (biomedical or clinical) significantly boosts performance compared to general-domain pre-trained models, particularly for smaller models. This highlights the importance of specialized knowledge.
  • Efficiency vs. Performance Trade-off: While larger models generally offer higher peak performance, PEFT methods allow smaller models to achieve comparable results with drastically reduced computational costs (time, memory, and budget). The efficiency gains often outweigh the marginal performance differences.
  • LoRA Rank Tuning: While a default LoRA rank of 8 is a good starting point, tuning this hyperparameter can yield further performance improvements, though the gains might be marginal and come with increased tuning time.

Key Results

  • LoRA's Dominance: LoRA consistently achieved high performance across all tested models and tasks, often approaching full fine-tuned performance. For instance, in sequence classification tasks, LoRA models frequently achieved the highest scores among PEFT methods.
  • Efficiency Gains: The study showed that PEFT methods, particularly LoRA, significantly reduce training time and memory requirements. For example, training a Llama-2-7b model with LoRA was feasible on a single GPU, whereas full fine-tuning would be prohibitive. Table 4 indicates that larger models like Llama-2-7b can be 20-94 times more expensive than smaller models like BioBERT for training and storage.
  • Domain Pre-training Impact: Clinically pre-trained models showed a 1-4% improvement over general models on the i2b2-2010 relation extraction task, especially for smaller models.
  • Model Size vs. Time: Smaller LLMs like TinyBERT could complete 5 epochs of training much faster than the Llama-2 model, even when Llama-2 used LoRA. However, Llama-2 eventually reached slightly higher peak performance with sufficient time.

Limitations and Future Work

  • Limited PEFT Methods: The study focused on a select few PEFT methods (LoRA and IA³), acknowledging that the field is rapidly evolving and newer methods might offer different advantages.
  • Single GPU Constraint: Experiments were limited to a single GPU, which might have disadvantaged larger models like Llama-2, forcing reduced precision and limiting hyperparameter tuning. Future work could explore these models more thoroughly with more resources.
  • Holistic Efficiency: The paper proposes a holistic efficiency metric but notes that a true representation would require considering pre-training costs and other factors not fully known. Further profiling is suggested.
  • Domain Leakage: The authors acknowledge that clinically pre-trained models might have an "unfair advantage" due to training on similar data, and the potential for data leakage in models like Llama-2 is difficult to ascertain.
  • Future Exploration: The authors suggest exploring newer PEFT methods and conducting more extensive hyperparameter optimization for larger models, though they note the significant resource requirements.

Summary updated

BibTeX
@article{taylor2024efficiency,
  author = {Niall Taylor and Upamanyu Ghose and Omid Rohanian and Mohammadmahdi Nouriborji and Andrey Kormilitzin and David A. Clifton and Alejo J. Nevado-Holgado},
  title = {{Efficiency at scale: Investigating the performance of diminutive language models in clinical tasks}},
  journal = {Artif. Intell. Medicine},
  year = {2024},
  doi = {10.1016/j.artmed.2024.103002},
}
Figure