Runtime Monitoring of Dynamic Fairness Properties

Thomas A. Henzinger, Mahyar Karimi, Konstantin Kueffner, Kaushik Mallik · DOI

Abstract

A machine-learned system that is fair in static decision-making tasks may have biased societal impacts in the long-run. This may happen when the system interacts with humans and feedback patterns emerge, reinforcing old biases in the system and creating new biases. While existing works try to identify and mitigate long-run biases through smart system design, we introduce techniques for monitoring fairness in real time. Our goal is to build and deploy a monitor that will continuously observe a long sequence of events generated by the system in the wild, and will output, with each event, a verdict on how fair the system is at the current point in time. The advantages of monitoring are two-fold. Firstly, fairness is evaluated at run-time, which is important because unfair behaviors may not be eliminated a priori, at design-time, due to partial knowledge about the system and the environment, as well as uncertainties and dynamic changes in the system and the environment, such as the unpredictability of human behavior. Secondly, monitors are by design oblivious to how the monitored system is constructed, which makes them suitable to be used as trusted third-party fairness watchdogs. They function as computationally lightweight statistical estimators, and their correctness proofs rely on the rigorous analysis of the stochastic process that models the assumptions about the underlying dynamics of the system. We show, both in theory and experiments, how monitors can warn us (1) if a bank's credit policy over time has created an unfair distribution of credit scores among the population, and (2) if a resource allocator's allocation policy over time has made unfair allocations. Our experiments demonstrate that the monitors introduce very low overhead. We believe that runtime monitoring is an important and mathematically rigorous new addition to the fairness toolbox.

Introduction: The Dynamic Nature of Bias

In the current fairness literature, bias is often treated as a static problem. Most audits are "one-and-done" checks where researchers examine training data or a model's predictions at a single point in time. However, real-world machine learning systems are inherently dynamic. When an algorithm makes a decision about a human—such as granting or denying a loan—that individual reacts. They may repay the loan or default, which in turn changes the underlying data distribution, such as their credit score.

These feedback loops can cause systems that appear fair in a static context to produce disastrously unfair societal outcomes over time. While some researchers attempt to design "robust" models at the outset, these efforts often fail because human behavior and environmental shifts are unpredictable. This research addresses a critical gap: the lack of tools to detect emerging biases in real-time as a system operates in the wild.

The Runtime Monitoring Framework

We propose a framework for the Runtime Monitoring of Dynamic Fairness. Instead of attempting to build a perfectly fair model a priori, we introduce a "fairness watchdog" that observes the interaction between a decision-making agent and its environment. This monitor treats the underlying model as a black box, making it ideal for third-party auditing where the internal logic of the AI may be proprietary or unknown.

Key Methodological Components

  1. The ExpEstimator: This novel statistical estimator observes a sequence of events and outputs a "Probably Approximately Correct" (PAC-style) estimate of fairness. It provides real-time verdicts on the system's state with associated confidence intervals.
  2. The Change Function (Δ): To track bias over time, the monitor utilizes a change function that models how specific events (e.g., a loan repayment) are expected to shift a feature (e.g., average credit score).
  3. Martingale Analysis: Standard "i.i.d." (independent and identically distributed) statistics are insufficient for feedback loops where sequential observations are statistically dependent. We employ Doob martingales and Azuma-style concentration inequalities to ensure that the monitor’s confidence intervals remain mathematically sound even when data points are highly correlated.

Experimental Evaluation

To test the efficacy of these monitors, we utilized ml-fairness-gym, a toolkit developed by Google Research for simulating the long-term effects of ML systems. We focused on two primary benchmarks:

  • The Lending Problem: A simulation of a bank granting loans to two demographic groups with different initial credit score distributions. The monitor tracks whether the bank's policy leads to an unfair distribution of credit scores over time.
  • Attention Allocation: A simulation of an automated system (such as a city inspector) distributing limited resources across different locations. The monitor evaluates whether the allocation policy results in disparate discovery rates of "incidents" between locations.

Key Results

The experiments yielded three major insights:

  • High Accuracy: The monitor’s estimates consistently aligned with the "ground truth" bias—a metric usually hidden in real-world scenarios—staying within the predicted mathematical confidence intervals.
  • Minimal Computational Overhead: The monitors are designed to be lightweight. In our tests, the Lending Monitor required only 3 μs to update its estimate per observation, while the Attention Monitor required 28 μs. This efficiency allows for deployment in high-speed, real-time applications.
  • Policy Counter-intuitiveness: We discovered that some policies designed to be fair in the short term (such as Equalized Opportunity) can actually result in worse long-term disparity than "greedy" policies. This finding underscores the necessity of continuous monitoring over static design.

Discussion and Future Work

While runtime monitoring provides a powerful new tool for AI safety, it currently relies on a predefined "change function" to understand how the world shifts. If this function is inaccurately modeled, the monitor's precision may decrease. Additionally, the current framework assumes perfect observability of actions and reactions, which may not always be possible in noisy, real-world environments.

Future research will focus on expanding these monitors to handle high-dimensional feature vectors and multiple overlapping demographic groups. Ultimately, we aim to link these monitors to "safety-supervisory" layers that can automatically trigger corrective interventions the moment a system drifts into unfair territory. By moving from "open-loop" design to "closed-loop" monitoring, we can create ML systems that are more resilient to the complexities of human society.

Summary updated

BibTeX
@inproceedings{henzinger2023runtime,
  author = {Thomas A. Henzinger and Mahyar Karimi and Konstantin Kueffner and Kaushik Mallik},
  title = {{Runtime Monitoring of Dynamic Fairness Properties}},
  booktitle = {FAccT},
  year = {2023},
  doi = {10.1145/3593013.3594028},
}
Figure