Lightweight clinical language modeling: QLoRA-based fine-tuning of LLaMA for domain-specific medical text analysis


Abstract

Large language models(LLMs) have performed remarkably well on NLP tasks, including the field of medicine and clinics. LLMs have redefined and revolutionized the way tasks like medical text and clinical text analysis are approached in NLP. General LLMs such as ChatGPT and Gemini are neither suitable nor reliable and trusted for use in the medical area. They lack efficiency and accuracy within the particular domaint. Full fine-tuning approaches are typically not viable in low-resource environment and not readily accessible for practical clinical deployment. To overcome this, we explore the use of Quantized Low-Rank Adaptation (QLoRA) for parameter-efficient LLaMA 3 fine-tuning for clinical text. QLoRA facilitates fine-tuning by adding low-rank adaptation (LoRA) layers on top of a quantized pre-trained model, which saves a lot of GPU memory without sacrificing model performance. In this paper, we utilize QLoRA to fine-tune LLaMA 3 on clinical corpora and test its performance. We compare QLoRA-enhanced models to baseline fine-tuning approaches to compare efficiency and performance trade-offs. Our results demonstrate that QLoRA offers competitive accuracy at greater than 50\% reduced memory consumption, supporting fine-tuning on consumer-grade GPUs.We also introduce a thoughtfully selected Indian clinical dataset of 100K annotated sentences, including Indian-specific drugs, diagnoses, symptoms, and prescriptions. We also extend our approach to include medical images (e.g., scans, prescriptions) as the input via multimodal integration. Our results indicate that QLoRA offers an economically feasible, scalable approach to fine-tuning LLM on clinical text analysis. With less computational overhead and preserved accuracy, the approach makes the usability of the deployment of LLaMA in actual medical environments feasible, enhancing the availability of clinical NLP applications.
Ask to review this manuscript

Notes for potential reviewers

  • Volunteering is not a guarantee that you will be asked to review. There are many reasons: reviewers must be qualified, there should be no conflicts of interest, a minimum of two reviewers have already accepted an invitation, etc.
  • This is NOT OPEN peer review. The review is single-blind, and all recommendations are sent privately to the Academic Editor handling the manuscript. All reviews are published and reviewers can choose to sign their reviews.
  • What happens after volunteering? It may be a few days before you receive an invitation to review with further instructions. You will need to accept the invitation to then become an official referee for the manuscript. If you do not receive an invitation it is for one of many possible reasons as noted above.

  • PeerJ Computer Science does not judge submissions based on subjective measures such as novelty, impact or degree of advance. Effectively, reviewers are asked to comment on whether or not the submission is scientifically and technically sound and therefore deserves to join the scientific literature. Our Peer Review criteria can be found on the "Editorial Criteria" page - reviewers are specifically asked to comment on 3 broad areas: "Basic Reporting", "Experimental Design" and "Validity of the Findings".
  • Reviewers are expected to comment in a timely, professional, and constructive manner.
  • Until the article is published, reviewers must regard all information relating to the submission as strictly confidential.
  • When submitting a review, reviewers are given the option to "sign" their review (i.e. to associate their name with their comments). Otherwise, all review comments remain anonymous.
  • All reviews of published articles are published. This includes manuscript files, peer review comments, author rebuttals and revised materials.
  • Each time a decision is made by the Academic Editor, each reviewer will receive a copy of the Decision Letter (which will include the comments of all reviewers).

If you have any questions about submitting your review, please email us at [email protected].