Towards Poisoning Fair Representations

Tianci Liu, Haoyu Wang, Feijie Wu, Hengtong Zhang, Pan Li, Lu Su, Jing Gao

Introduction

In the quest for algorithmic fairness, researchers increasingly rely on Fair Representation Learning (FRL). The goal of FRL is to transform raw data into a high-dimensional representation that retains all useful information for a target task (like predicting creditworthiness) while stripping away any information about sensitive attributes (like gender or race).

While classical fair machine learning models—such as shallow logistic regression—have known vulnerabilities to data poisoning, FRL was widely considered more robust due to its complex, non-convex deep learning architectures and high-dimensional outputs. However, recent research shatters this assumption. By injecting a small fraction of carefully crafted "poisoned" data into the training set, attackers can force FRL models to retain sensitive demographic information, effectively nullifying their fairness guarantees while remaining stealthy.

Poisoning Attack Framework

The Elastic-Net GradMatch (ENG) Attack

Attacking an FRL model is fundamentally a bilevel optimization problem: the attacker seeks to find poisoning samples that maximize unfairness once the victim model completes its training on the poisoned dataset. Because solving this directly is computationally prohibitive, the authors propose a novel framework called Elastic-Net GradMatch (ENG), which introduces several key innovations:

  1. The FLD Proxy: Instead of attempting to maximize Mutual Information—a notoriously difficult metric to calculate and differentiate—the attack uses the Fisher’s Linear Discriminant (FLD) score. This serves as a differentiable proxy to measure how easily demographic groups can be separated within the representation space.
  2. Gradient Matching: Rather than simulating the entire training process, the attack crafts poisoning samples whose gradients match the direction that increases the FLD score. If the victim's training algorithm follows these poisoned gradients, the model naturally drifts toward an unfair state.
  3. Elastic-Net Regularization: To maintain stealth, the framework applies an Elastic-Net penalty ($L_1$ and $L_2$ norms). This ensures that perturbations to the training data remain small and affect only a limited number of features, making the poisoned data difficult for human auditors or automated anomaly detection systems to spot.

Experimental Setup and Key Results

The ENG attack was evaluated on four standard fairness benchmark datasets: Adult (predicting income, sensitive feature: gender), German (predicting credit risk, sensitive feature: age), COMPAS (predicting recidivism, sensitive feature: race), and Drug Consumption (predicting drug usage, sensitive feature: age).

The researchers tested the attack against four state-of-the-art FRL models: CFAIR, CFAIR-EO, ICVAE-S, and ICVAE-US.

Attack Performance Across Datasets and Models

The results highlighted several critical insights:

  • Superiority and Effectiveness: The ENG attack consistently outperformed existing heuristic attacks (such as "Anchor Attacks") by a significant margin. It successfully increased Demographic Parity (DP) violations—a key measure of unfairness—while having a negligible impact on the model's primary task accuracy. Consequently, a victim might deploy the compromised model without ever realizing it is under attack.
  • Fairness is Fragile: Even sophisticated deep learning models designed specifically for fairness can be severely compromised by modifying as little as 5% of the training data.
  • Representations are the New Frontline: Most data poisoning research focuses on altering a model's final prediction. This study demonstrates that poisoning the intermediate representation is far more dangerous, as it compromises every downstream task that relies on those representations.
  • Sparsity: Thanks to the Elastic-Net penalty, the attack achieved high success rates while perturbing only a fraction of the available features, further enhancing its stealth.

Theoretical Insights and Defenses

Beyond empirical results, the authors derived a theoretical bound for the minimum number of poisoning samples required to execute a successful attack—a "tipping point" theory. They found that the necessary ratio of poisoned data depends heavily on the learning rate, batch size, and the inherent "noise" in the clean data gradients.

A surprising insight from this theoretical analysis is that reducing batch size can serve as a natural defense. Smaller batch sizes increase the relative noise of the clean data during training, making it significantly harder for the poisoned gradients to dominate the learning process.

Limitations and Future Work

While groundbreaking, the current study primarily focuses on tabular data. Although tabular data forms the backbone of many high-stakes decision-making systems (e.g., finance, legal, human resources), the vulnerability of FRL in large-scale computer vision or natural language processing domains remains an open question.

Additionally, the ENG attack currently assumes a white-box scenario, where the attacker has full knowledge of the victim's model architecture. Future research must explore whether these poisoned samples can transfer to different model architectures in a black-box setting. Finally, while reducing batch size offers a rudimentary defense, developing more robust, proactive defense mechanisms against gradient-matching attacks is a critical next step for the fair machine learning community.

Summary updated

BibTeX
@inproceedings{liu2024towards,
  author = {Tianci Liu and Haoyu Wang and Feijie Wu and Hengtong Zhang and Pan Li and Lu Su and Jing Gao},
  title = {{Towards Poisoning Fair Representations}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=YLJs4mKJCF},
}
Figure