A subscription to JoVE is required to view this content. Sign in or start your free trial.

Research Article

Enhancing Fairness in Large Language Models for Clinical Artificial Intelligence Applications Through Fine-Tuning and Prompting

470 views

DOI:

10.3791/69132

January 2nd, 2026

In This Article

Summary

Healthcare-specific large language models face ethical and technical challenges, as they, like other large language models, reflect the biases inherent in their training data. The protocol presented here verifies the suppression of four types of bias (gender, race, occupation, religion) using prompt variants across three open-source models.

Abstract

Large Language Models (LLMs) are increasingly being applied to sensitive domains such as medical care, which pose multiple technical and ethical challenges. The most immediate issues include biases built into these models, which are trained on large datasets that may reflect societal prejudices. Such biases can yield outputs that are unfair, ungeneralizable, or even harmful, rendering them clinically inapplicable in the real world and noncompliant with ethical and regulatory constraints. We examine how well bias suppression works when fine-tuned models are prompted across four critical categories (gender, race, profession, and religion). We manually curate a diverse inference dataset and create twelve prompt variants -- six of which are debiased -- to test the outputs of three open-source LLMs: Llama2-7B, Mistral-7B, and Dolly-7B. The fairness and interpretability of the outputs are evaluated using a bias-scoring metric, where lower scores indicate better fairness and interpretability. We also note that debiased prompts reduce bias, and fine-tuning the model performs even better. The results emphasize the critical importance of timely action, model robustness, and ongoing ethical scrutiny for trustworthy and fair LLM deployment in real-world settings, such as medical imaging, and the maintenance of Electronic Health Records (EHR).

Introduction

Large Language Models have prodigious reverberation as tools to support diverse tasks, including decision-making1,2, text generation3, text translation4, customer sentiment analysis5, question answering6, and generating clinical reports7. Several instances have occurred in recent times in which applications have used LLMs to generate content that harms socially disadvantaged individuals or groups8,9,10

Access restricted. Please log in or start a trial to view this content.

Protocol

All the experiments are conducted on the Google Colab platform (A100 with 40 GB RAM). For performing experiments, API keys (Model cards) of Llama2-7B, Mistral-7B, and Dolly-7B were collected from Hugging Face.

The protocol is divided into three parts. First, build a dataset that serves as a basis for evaluating social bias in LLMs. Then design twelve distinct prompt variants, aligned with the work done by Kamruzzaman and Kim38 to investigate the presence of social bias in the inferences generated by LLMs. Then, fine-tune the LLMs on a dataset of unbiased sentences related to race, religion, gender, and profession, an....

Access restricted. Please log in or start a trial to view this content.

Results

Using the bias score defined in Equation 1, we systematically answer our research questions and evaluate societal biases in LLMs across four social dimensions. The statistically significant reductions of bias scores observed provide empirical validation of the proposed protocol for bias reduction in LLMs for high-stakes tasks. To assess the effectiveness of NeutralSet, i.e., the curated inference dataset, we query all three vanilla LLMs on both StereoSet and NeutralSet through the baseline standard prompt and calculate t.......

Access restricted. Please log in or start a trial to view this content.

Discussion

In this work, we present a scalable protocol for reducing social biases in LLMs that leverages Llama2-7B13, Mistral-7B14, and Dolly-7B15. This approach combines HP2 prompt engineering, debiasing prompt modifications, and targeted fine-tuning to develop a protocol for continued reduction of bias in LLM-generated outputs across the four major societal dimensions of gender, race, profession, and religion. While evaluating vanilla models with basic and d.......

Access restricted. Please log in or start a trial to view this content.

Disclosures

The authors have nothing to disclose.

Materials

List of materials used in this article
NameCompanyCatalog NumberComments
Google ColabGooglehttps://colab.research.google.com/used for running the experiments 
Mendeley DesktopMendeleyhttps://www.mendeley.com/used for managing citations and references.

References

  1. STRUX: An LLM for decision-making with structured explanations. Lu, Y., Hu, Y., Foroosh, H., Jin, W., Liu, F. Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies, , (2025).
  2. Eigner, E., Händler, T. Determinants of LLM-assisted decision-making. arXiv. , (2024).
  3. Wu, Y. Large Language Model and Text Generation.

Access restricted. Please log in or start a trial to view this content.

Reprints and Permissions

Tags

Bias SuppressionModel Fine TuningPrompt EngineeringFairness EvaluationBias ScoringDebiased PromptsModel RobustnessElectronic Health Records
Video Coming Soon