Skip to main content
QUICK REVIEW

[Paper Review] Certifying Counterfactual Bias in LLMs

Isha Chaudhary, Qian Hu|arXiv (Cornell University)|May 29, 2024
Computational and Text Analysis MethodsSocial Sciences3 citations
TL;DR

This paper introduces QuaCer-B, a black-box, quantitative certification framework that provides high-confidence bounds on the probability of biased responses in large language models (LLMs) across large sets of prompts differing by sensitive attributes. By using adaptive sampling with a bias detector and statistical certification, QuaCer-B formally guarantees low bias rates for both open-source and closed-source LLMs, revealing previously undetected biases in models like GPT-3.5 and Gemini.

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.

Motivation & Objective

  • To address the limitations of benchmarking and adversarial attacks in evaluating LLM bias, which lack scalability and formal guarantees.
  • To develop a formal certification framework that provides high-confidence bounds on the probability of biased responses for large, potentially infinite, sets of prompts.
  • To enable bias certification for both open-source and closed-source LLMs using black-box, probabilistic methods.
  • To instantiate the framework with diverse prompt distributions, including random token sequences, manual jailbreaks, and embedding-space jailbreaks.
  • To provide actionable insights into the true bias levels of popular LLMs beyond what empirical benchmarks can reveal.

Proposed method

  • QuaCer-B uses a black-box, adaptive sampling strategy to generate prefixes from specified distributions (e.g., random tokens, jailbreaks) and appends them to prompts to form test inputs.
  • It leverages a pre-trained bias detector to evaluate the fairness of LLM responses on sampled prompts, aggregating results across multiple trials.
  • The framework applies statistical certification to compute high-confidence upper and lower bounds on the probability of biased responses, using sequential hypothesis testing.
  • It supports multiple specification types: random token prefixes, mixtures of manually crafted jailbreaks, and jailbreaks generated in the LLM’s embedding space.
  • The certifier iteratively samples prefixes until the upper bound falls below a threshold (certifying unbiased) or the lower bound exceeds it (certifying biased), ensuring confidence in the result.
  • The method is designed to be scalable and robust, avoiding white-box assumptions and computational overhead of smoothed models.

Experimental results

Research questions

  • RQ1Can we formally certify that the probability of biased responses in LLMs remains low across large, diverse sets of prompts differing only by sensitive attributes?
  • RQ2How does QuaCer-B’s certification performance vary across different types of prompt distributions, such as random tokens, manual jailbreaks, and embedding-space jailbreaks?
  • RQ3To what extent can QuaCer-B detect biases in LLMs that are not revealed by standard benchmarking or adversarial attack methods?
  • RQ4How does the framework’s performance depend on the choice of bias detector and confidence thresholds?
  • RQ5Can QuaCer-B provide reliable, high-confidence bounds on bias probability without requiring white-box access to the target LLM?

Key findings

  • QuaCer-B successfully certified GPT-3.5 and Gemini as biased under the mixture of jailbreaks specification, with a lower bound on bias probability exceeding the threshold, indicating high risk of biased outputs.
  • Mistral and Llama-7B were certified as unbiased under the same specification, with the upper bound on bias probability falling below the threshold, indicating strong robustness.
  • The framework revealed previously undetected biases in LLMs—particularly in responses to prompts with subtle, adversarial prefixes—highlighting limitations of existing benchmarking approaches.
  • Certification results varied significantly across different prompt distributions, showing that bias risk is highly sensitive to how prompts are constructed, even when only sensitive attributes differ.
  • The framework demonstrated scalability and reliability in black-box settings, providing high-confidence bounds without requiring model weights or access to internal activations.
  • Inconclusive results were observed for some models (e.g., GPT-3.5 on certain specifications), indicating the need for further sampling or improved bias detectors.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.