LangFair: A Python Package for Assessing Bias and Fairness in Large Language Model Use Cases
arXiv:2501.03112 · doi:10.21105/joss.07570
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.
Journal of Open Source Software; LangFair repository: https://github.com/cvs-health/langfair
References in corpus (5)
- BOLD: Dataset and Metrics for Measuring Biases in Open-Ended Language Generation
- Fairlearn: Assessing and Improving Fairness of AI Systems
- LiFT: A Scalable Framework for Measuring Fairness in ML Applications
- Towards Auditing Large Language Models: Improving Text-based Stereotype Detection
- RedditBias: A Real-World Resource for Bias Evaluation and Debiasing of Conversational Language Models