Runtime Monitoring and Enforcement of Conditional Fairness in Generative AIs

Chih-Hong Cheng, Changshun Wu, Xingyu Zhao, Saddek Bensalem, Harald Ruess

TL;DR

Generative AI (GenAI) models can perpetuate societal biases, but existing fairness techniques don't apply well to their open-ended nature. This paper introduces "conditional fairness" – a flexible notion tailored to specific GenAI use cases – and proposes novel runtime monitoring and enforcement methods to ensure it, demonstrated on state-of-the-art GenAI systems.

What Problem Does This Paper Address?

Generative AI (GenAI) models, like those that create images or text, are increasingly powerful but also risk amplifying existing societal biases and stereotypes. Unlike traditional AI models designed for specific tasks, GenAI's broad capabilities mean fairness needs to be adaptable to the context of its output. For instance, ensuring fairness in generating images of "successful business leaders" might differ significantly from ensuring fairness when generating images of "economically disadvantaged people." Current methods for ensuring fairness in AI are often designed for specific tasks and don't easily translate to the black-box, open-ended nature of GenAI. This paper tackles this challenge by proposing a new way to define and enforce fairness in GenAI that is context-dependent and can be applied at runtime.

Methods

The core of this paper lies in its novel approach to defining and enforcing fairness in GenAI.

  • Conditional Fairness: The authors introduce "conditional fairness," a notion that tailors fairness specifications to specific use cases and sensitive attributes (e.g., gender, economic status). This moves beyond one-size-fits-all fairness definitions.
  • Two-Level Fairness Evaluation: They propose two levels of fairness assessment:
  • Output Fairness: Evaluating fairness in the generated content itself, independent of the specific prompts or models used.
  • Inherent Fairness: Assessing the GenAI's intrinsic fairness when presented with neutral prompts, meaning the model doesn't inherently bias outputs without explicit prompting.
  • Worst-Case Bounding: To handle the complexity of GenAI and fairness specifications, the paper focuses on bounding the worst-case scenarios. A system is deemed unfair if the "distance" between the appearances of different groups exceeds predefined thresholds.
  • Combinatorial Testing for Intersectional Fairness: To address the challenge of ensuring fairness across multiple intersecting attributes (e.g., gender and race), they adapt k-way combinatorial testing. This provides a more scalable way to check for fairness across combinations of subgroups.
  • Runtime Monitoring and Enforcement: A key contribution is an agent-based framework for real-time monitoring and enforcement. This system proactively detects potential fairness violations and injects specially crafted prompts to steer the GenAI towards fairer outputs with minimal intervention.

Datasets

Not discussed in the paper. The paper focuses on evaluating existing GenAI systems rather than training new models.

Key Insights and Ideas

  • Fairness is Contextual for GenAI: The most significant insight is that fairness in GenAI is not a universal property but is highly dependent on the specific context and the sensitive attributes being considered. This necessitates a "conditional" approach.
  • Inherent vs. Output Fairness is Crucial: Distinguishing between the fairness of the generated output and the inherent fairness of the model itself is vital. A model might be fair when guided by specific prompts but inherently biased when given neutral ones.
  • Intersectional Fairness is a Combinatorial Nightmare: The paper highlights the practical difficulty of ensuring fairness across all combinations of attributes due to exponential complexity. Their combinatorial testing approach offers a pragmatic solution.
  • Runtime Enforcement is Necessary for Black-Box GenAI: Given that many GenAI systems are black boxes, design-time fairness interventions are often impossible. Runtime monitoring and enforcement become essential.
  • Prompt Injection as a Gentle Nudge: The proposed enforcement mechanism uses prompt injection as a subtle way to guide the GenAI, aiming for minimal interference while still achieving fairness goals.

Key Results

The paper presents qualitative results and evaluations on state-of-the-art GenAI systems:

  • Demonstrated Fairness Gaps: Evaluations on OpenAI's ChatGPT 4.0 (with DALL-E3) and ZHIPU AI's GLM-4 revealed that fairness is not universally present across all concept groups. For example, gender fairness was observed for "successful business leaders" but was weaker for "poor persons."
  • Intersectional Fairness Challenges: Even with their approximate intersectional fairness criterion, GenAI models struggled to include all combinations of pair-wise features, with coverage often saturating at low levels.
  • Effective Enforcement: The implemented enforcement mechanism showed a clear improvement in fairness for ZHIPU GLM-4, as illustrated by a comparison of image sequences before and after enforcement.
  • Prototype Availability: A prototype implementation of their fairness evaluation and enforcement system is made available.

Limitations and Future Work

  • Finite Sequence Limitations: While the theoretical framework is based on infinite sequences, practical evaluation uses finite sequences. The paper discusses how to adapt definitions for finite traces, acknowledging that repeated appearance fairness becomes more complex.
  • Extending to Average Arrival View: The authors suggest that a future direction is to extend their notion of conditional fairness to an "average arrival view," which might offer a different perspective on fairness over time.
  • Scalability of Intersectional Fairness: While their combinatorial approach is more scalable than brute-force methods, ensuring fairness across a very large number of intersecting attributes remains a significant challenge.
  • Practical Deployment at Scale: The paper notes that a critical path forward is the practical application of these fairness enforcement techniques within larger organizations and at scale, requiring active operational management.

Summary updated

BibTeX
@inproceedings{cheng2025runtime,
  author = {Chih-Hong Cheng and Changshun Wu and Xingyu Zhao and Saddek Bensalem and Harald Ruess},
  title = {{Runtime Monitoring and Enforcement of Conditional Fairness in Generative AIs}},
  booktitle = {RV},
  year = {2025},
  doi = {10.1007/978-3-032-05435-7\_5},
}
Figure