LangFair: A Python Package for Assessing Bias and Fairness in Large Language Model Use Cases

Dylan Bouchard, Mohit Singh Chauhan, David Skarbrevik, Viren Bajaj, Zeya Ahmad
1/6/2025
cs.CLcs.AIcs.CY

No official code found. Best implementation: cvs-health/langfair (262 stars, last commit 2026-01-09). 1 more below.

Abstract

Large Language Models (LLMs) have been observed to exhibit bias in numerous ways, potentially creating or worsening outcomes for specific groups identified by protected attributes such as sex, race, sexual orientation, or age. To help address this gap, we introduce LangFair, an open-source Python package that aims to equip LLM practitioners with the tools to evaluate bias and fairness risks relevant to their specific use cases. The package offers functionality to easily generate evaluation datasets, comprised of LLM responses to use-case-specific prompts, and subsequently calculate applicable metrics for the practitioner's use case. To guide in metric selection, LangFair offers an actionable decision framework.

View on arXivView PDF

Code Implementations(2)

cvs-health/langfairCommunity100%

LangFair is a Python library for conducting use-case level LLM bias and fairness assessments

26249Python, Jupyter NotebookSep 20, 20249 months agoNOASSERTION
aiai-safetyartificial-intelligencebiasbias-detection+12 more

A GitHub repository implementing LangFair, a Python package for assessing bias and fairness in Large Language Models.

10PythonJan 10, 20251 years agoNOASSERTION

Cite this paper

@article{bouchard2025langfair,
  title  = {LangFair: A Python Package for Assessing Bias and Fairness in Large Language Model Use Cases},
  author = {Dylan Bouchard and Mohit Singh Chauhan and David Skarbrevik and Viren Bajaj and Zeya Ahmad},
  year   = {2025},
  eprint = {2501.03112},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2501.03112v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2501.03112.svg)](https://codeofpaper.com/paper/2501.03112)

Discussion