Certifying Counterfactual Bias in LLMs

Isha Chaudhary, Qian Hu, Manoj Kumar, Morteza Ziyadi, Rahul Gupta +1 more
2/12/2026

No official code found. Best implementation: uiuc-focal-lab/LLMCert-B (25 stars, AGPL-3.0, last commit 2025-04-11).

Abstract

Large Language Models (LLMs) can produce biased responses that can cause representational harms. However, conventional studies are insufficient to thoroughly evaluate biases across LLM responses for different demographic groups (a.k.a. counterfactual bias), as they do not scale to large number of inputs and do not provide guarantees. Therefore, we propose the first framework, LLMCert-B that certifies LLMs for counterfactual bias on distributions of prompts. A certificate consists of high-confidence bounds on the probability of unbiased LLM responses for any set of counterfactual prompts - prompts differing by demographic groups, sampled from a distribution. We illustrate counterfactual bias certification for distributions of counterfactual prompts created by applying prefixes sampled from prefix distributions, to a given set of prompts. We consider prefix distributions consisting random token sequences, mixtures of manual jailbreaks, and perturbations of jailbreaks in LLM's embedding space. We generate non-trivial certificates for SOTA LLMs, exposing their vulnerabilities over distributions of prompts generated from computationally inexpensive prefix distributions.

View on arXivView PDF

Code Implementations(1)

AGPL-3.0

A certifier for bias in LLMs

253HTML, ShellMay 25, 20241 years agoAGPL-3.0

Similar Papers

Cite this paper

@article{chaudhary2026certifying,
  title  = {Certifying Counterfactual Bias in LLMs},
  author = {Isha Chaudhary and Qian Hu and Manoj Kumar and Morteza Ziyadi and Rahul Gupta and Gagandeep Singh},
  year   = {2026},
  eprint = {2405.18780},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2405.18780},
  journal = {ICLR 2024 2024}
}

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/2405.18780.svg)](https://codeofpaper.com/paper/2405.18780)

Discussion