Does Differential Privacy Impact Bias in Pretrained NLP Models?

Md. Khairul Islam, Andrew Wang, Tianhao Wang, Yangfeng Ji, Judy Fox, Jieyu ZhaoarXiv 2024

TL;DR

This paper investigates how applying differential privacy (DP) during the fine-tuning of pre-trained NLP models affects their bias towards different demographic groups. The study finds that DP, while enhancing privacy, can unfortunately exacerbate existing biases, particularly in models used for hate speech detection, making it harder for them to distinguish between sensitive and non-sensitive content for underrepresented groups.

What Problem Does This Paper Address?

Large language models (LLMs) are trained on vast datasets, raising concerns about the privacy of the individuals whose data is included. Differential privacy (DP) is a common technique to mitigate these privacy risks by adding noise during training, ensuring that the model's output is not overly influenced by any single data point. However, there's a growing concern that DP might inadvertently introduce or amplify biases in these models, especially for underrepresented groups. This is because the noise added for privacy could disproportionately affect the model's ability to learn subtle patterns associated with these groups. This paper specifically addresses this gap by empirically analyzing the impact of DP on bias in pre-trained NLP models, focusing on tasks like toxic language detection, where fairness is crucial.

Methods

The researchers fine-tuned pre-trained BERT-base-uncased models on two toxicity detection datasets. They employed DP-SGD (Differentially Private Stochastic Gradient Descent) for training, a standard method for incorporating DP into machine learning. The level of privacy was controlled by varying the epsilon ($\epsilon$) parameter, a key hyperparameter in DP that dictates the privacy budget. Smaller epsilon values correspond to stronger privacy guarantees. They then evaluated the models using a suite of bias metrics, including prediction-based metrics (like Equality of Odds and Demographic Parity) and probability-based metrics (like Subgroup AUC, BPSN, and BNSP). These metrics help assess how the model's performance or confidence differs across various demographic subgroups (gender and race).

Datasets

The study utilized two publicly available datasets for toxic language detection:

  • Jigsaw Unintended Bias Dataset: This dataset, with approximately 2 million examples, was developed to learn and minimize unintended bias. It includes annotations for demographic groups such as disability, gender, race, ethnicity, religion, and sexual orientation.
  • UCBerkeley Hate Speech Dataset: This dataset comprises online comments from social media platforms (YouTube, Twitter, Reddit) labeled for hate speech. It offers annotations for targeted groups within the comment text.

The researchers performed specific pre-processing steps for each dataset, including undersampling and splitting into training, validation, and test sets.

Key Insights and Ideas

  • DP can amplify bias: The most significant finding is that applying differential privacy, especially with stricter privacy budgets (lower $\epsilon$), tends to increase model bias against protected groups, particularly when measured by AUC-based metrics.
  • Difficulty in differentiation: DP makes it harder for models to distinguish between positive and negative examples for protected groups, leading to more errors and biased predictions.
  • Dataset distribution matters: The impact of DP on bias is not solely dependent on the privacy level but also on the underlying distribution of the dataset. Datasets with a more skewed distribution might see different effects from DP.
  • Trade-off between privacy and fairness: While DP aims to protect privacy, it can come at the cost of fairness, creating a complex trade-off that researchers need to navigate.
  • Impact on recall: DP often leads to a significant drop in recall for all social groups, which paradoxically can improve "equality of odds" metrics by making recall values more similar across groups, but this improvement is superficial and masks underlying issues.

Key Results

  • Increased bias with stricter privacy: For AUC-based bias metrics (Subgroup AUC, BPSN, BNSP), stricter privacy budgets (e.g., $\epsilon \le 0.5$) consistently showed increased bias compared to non-DP models. For instance, the decrease in BNSP for Jigsaw and BPSN for UCBerkeley dropped significantly with smaller $\epsilon$.
  • Mixed results for prediction-based metrics: While equality of odds metrics sometimes improved with DP (due to recall drops), demographic parity and protected accuracy showed mixed trends, often decreasing with stricter privacy.
  • Performance degradation: Overall model performance (measured by Accuracy and F1 score) decreased with stricter privacy settings across both datasets, indicating a utility-privacy trade-off.
  • Specific group impacts: The paper highlights that the impact of DP varies across different identity subgroups. For example, in the Jigsaw dataset, white and black identities showed lower AUC and BPSN scores, suggesting DP models more often misclassify non-toxic comments mentioning these identities as toxic.

Limitations and Future Work

The authors acknowledge several limitations:

  • Task-specific findings: Their observations are based on toxicity and hate speech detection tasks. It's unclear if these trends will hold for other NLP tasks like coreference resolution, sentiment analysis, or question answering.
  • Limited protected attributes: The study focused on gender and race. Future work could explore other sensitive attributes like religion and sexual orientation.

The paper suggests that future research should explore these trends across different NLP tasks and a wider range of protected attributes. Researchers in NLP are encouraged to be aware of the potential for DP to introduce or exacerbate bias when implementing privacy-preserving techniques.

Summary updated

Abstract

Differential privacy (DP) is applied when fine-tuning pre-trained large language models (LLMs) to limit leakage of training examples. While most DP research has focused on improving a model's privacy-utility tradeoff, some find that DP can be unfair to or biased against underrepresented groups. In this work, we show the impact of DP on bias in LLMs through empirical analysis. Differentially private training can increase the model bias against protected groups w.r.t AUC-based bias metrics. DP makes it more difficult for the model to differentiate between the positive and negative examples from the protected groups and other groups in the rest of the population. Our results also show that the impact of DP on bias is not only affected by the privacy protection level but also the underlying distribution of the dataset.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
Jigsaw Unintended BiasPre-trained BERT trained with differential privacyΔ Subgroup AUC0.097Toxicity Classification · subgroup=male identity · privacy-epsilon=≤0.5
Source quote
L210: Group │ \Delta Subgroup AUC │ \Delta BPSN │ \Delta BNSP │ \Delta Subgroup AUC │ \Delta BPSN │ \Delta BNSP Male │ 0.097 │ 0.064 │ 0.109 │ 0.081 │ 0.036 │ 0.108
Jigsaw Unintended BiasPre-trained BERT trained with differential privacyΔ BNSP0.109Toxicity Classification · subgroup=male identity · privacy-epsilon=≤0.5
Source quote
L210: Group │ \Delta Subgroup AUC │ \Delta BPSN │ \Delta BNSP │ \Delta Subgroup AUC │ \Delta BPSN │ \Delta BNSP Male │ 0.097 │ 0.064 │ 0.109 │ 0.081 │ 0.036 │ 0.108
Measuring Hate Speech · from UCBerkeleyPre-trained BERT trained with differential privacyΔ Subgroup AUC0.081Hate Speech Classification · subgroup=male identity · privacy-epsilon=≤0.5
Source quote
L210: Group │ \Delta Subgroup AUC │ \Delta BPSN │ \Delta BNSP │ \Delta Subgroup AUC │ \Delta BPSN │ \Delta BNSP Male │ 0.097 │ 0.064 │ 0.109 │ 0.081 │ 0.036 │ 0.108
Measuring Hate Speech · from UCBerkeleyPre-trained BERT trained with differential privacyΔ BNSP0.108Hate Speech Classification · subgroup=male identity · privacy-epsilon=≤0.5
Source quote
L210: Group │ \Delta Subgroup AUC │ \Delta BPSN │ \Delta BNSP │ \Delta Subgroup AUC │ \Delta BPSN │ \Delta BNSP Male │ 0.097 │ 0.064 │ 0.109 │ 0.081 │ 0.036 │ 0.108
BibTeX
@misc{islam2024does,
  author = {Md. Khairul Islam and Andrew Wang and Tianhao Wang and Yangfeng Ji and Judy Fox and Jieyu Zhao},
  title = {{Does Differential Privacy Impact Bias in Pretrained NLP Models?}},
  year = {2024},
  eprint = {2410.18749},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.18749},
}
Figure