Unlabeled Debiasing in Downstream Tasks via Class-wise Low Variance Regularization (2024)

Abstract: Language models frequently inherit societal biases from their training data. Numerous techniques have been proposed to mitigate these biases during both the pre-training and fine-tuning stages. However, fine-tuning a pre-trained debiased language model on a downstream task can reintroduce biases into the model. Additionally, existing debiasing methods for downstream tasks either (i) require labels of protected attributes (e.g., age, race, or political views) that are often not available or (ii) rely on indicators of bias, which restricts their applicability to gender debiasing since they rely on gender-specific words. To address this, we introduce a novel debiasing regularization technique based on the class-wise variance of embeddings. Crucially, our method does not require attribute labels and targets any attribute, thus addressing the shortcomings of existing debiasing methods. Our experiments on encoder language models and three datasets demonstrate that our method outperforms existing strong debiasing baselines that rely on target attribute labels while maintaining performance on the target task.

## introduction and background language models (lms) based on encoders are used for a variety of purposes such as document classification @xcite , job recommendation @xcite ), text generation @xcite , or as text encoder for multimodal models such as text-toaudio @xcite or text-to-image @xcite models. these models often encode societal biases rooted in the corpora used for training @xcite , which causes a distributional shift of embeddings, hence affecting their outputs either with disproportionate misclassification of documents belonging to minority groups or unfair ranking of the documents @xcite . several works focus on reducing the effect of these biases by improving model performance related to some specific fairness metric (empirical fairness) or by making the model blind to the existence of a certain attribute (representational fairness) @xcite . for instance, @xcite leverage contrastive learning to improve empirical fairness. recent works focus mostly on efficiency and user flexibility when it comes to debiasing using modular approaches such as sub-networks or adapters @xcite . @xcite introduce a modular debiasing scheme with adversarial training @xcite and mutual information reduction @xcite to control the bias in encoder lms. @xcite use adversarial training with adapters @xcite to improve representational fairness on document classification. @xcite used gated adapters to improve representational fairness while preserving task performance for classification and retrieval tasks. although these methods effectively reduce sensitive attribute information and enhance fairness @xcite through blindness, they depend on attribute labels to align the distribution of the target attribute. since the user input data contains numerous nuanced protected attributes, such as age, race, religion, etc., it is challenging to collect labeled data for each individual attribute across every task. moreover, supervised debiasing methods typically require training on each attribute individually, scaling linearly with the number of attributes. this complexity highlights the need for more efficient and scalable approaches to handle multiple protected attributes in debiasing efforts. to address this limitation, some works attempt to debias language models without using attribute labels. @xcite employ contrastive learning combined with instance weighting to reduce the bias encoded in the language model. moreover, @xcite utilize post-hoc contrastive learning to enhance the fairness of pre-trained encoder language models concerning gender bias. @xcite integrate the masking objective used during the pre-training of encoder language models with fine-tuning on genderspecific tasks to address gender bias. these methods address gender bias without requiring labeled data using explicit gender indicators present within the text. however, they are ineffective against other biases such as age, race, or political view of the user, as well as implicit gender bias when gender information is removed from the text, limiting their possible use cases. in this work, we bridge this gap by introducing a new regularization scheme based on classwise variance to reduce unknown (unlabeled) representational bias in the embeddings of lms. our regularization enforces low-variance embeddings, which results in mitigating any possible distributional shift caused by unknown attributes in the model's embeddings. with this method we force the model to produce robust embeddings that are informative about the classification task but contain less information about the protected attributes resulting in fair representation of the protected attributes. this gives our method the advantage of not relying on any type of information on the attribute during debiasing. to the best of our knowledge, we are the first to address the debiasing of arbitrary attributes without having access to attribute labels. we demonstrate the effectiveness of our method on document classification taskss using adapters @xcite and two commonly used encoder lms, bert-base and roberta-base. furthermore, we show that our method, when compared to existing supervised debiasing methods, can enhance attribute removal while still showing competitive classification task performance. ## problem formulation in recent years, adapter networks @xcite have emerged as an efficient way of training models on downstream tasks. in addition to their improved training efficiency, in our initial study, we assess how much gender information can be extracted from commonly used encoder lms. we use adapters @xcite in combination with @xcite and, additionally, a gender-debiased version of the same model @xcite debiased for empirical fairness, on two downstream classification tasks. we then train probes on the embeddings of the fine-tuned models to check how much information about gender can be extracted from both model variations and report the average balanced accuracy as indicator of gender information in the embeddings. this provides strong motivation for using debiasing methods during fine-tuning, even when using an already debiased pre-trained lm. however, as surveyed in § 1, existing debiasing methods either rely on attribute labels or are limited to attributes with explicit indicators in the text, such as gender. furthermore, there exists a plethora of sensitive attributes, and labeling them all is challenging across tasks. this increase in number also affects debiasing complexity as it scales with the number of attributes. thus, a method that addresses this gap would be highly desirable. in the following, we outline how we solve this gap. we start with our problem setting, formulated as follows: given a set of n documents with k classes, we are interested in having robust high-dimensional embeddings (@xmath0. our approach to debiasing deviates from existing ones in two crucial ways: (i) it is independent of labeled attributes, and (ii) it targets any protected attribute simultaneously. ## low variance regularization (lvr) we formulate our regularization scheme based on k centers, each representing a class in the dataset with d dimension {c 1 , c 2 , ...c k |c @xmath1, where d is the model's embedding size. we aim to adjust the parameters of the network if the variance of the embeddings in a batch is high, which intuitively results in the mitigation of any undesirable distributional shift that might exist in the embeddings. since we have k classes, class-wise variance is a good proxy for this regularization loss. we define the regularization loss as the distance between embeddings (@xmath2. for each batch, we calculate the center of embeddings that belong to the same class (c i ), which results in k centers. to account for noisy data points and empty batches, we use the weighted sum of the current batch center c b i and the normalized weighted sum of previous batch centers c b-1 i ## experimental setup for our experiments, we follow previous works and focus on transformer-based language models. we use bert-base and roberta-base, in combination with adapters @xcite for each task. trained in this way, we denote models using our debiasing method as adplvr. we use the following document classification datasets: occupation prediction (bios; de-arteaga et al. (2019) 2016 )), corresponding to a multi-attribute setting with age and gender as protected attributes. for each dataset, we remove all explicit indicators of protected attributes following previous works @xcite @xcite from the text. baselines. we choose baselines as follows: ft, adp and adpnli as fine-tuned versions of the entire model and adapter-based training of the model and adapter-based training for bert model trained on debiased nli, respectively, without using any additional bias mitigation method. we also select recent in-process debiasing algorithms as strong baselines, relying either on adversarial training @xcite , ftadv; ad-padv) or mutual information reduction @xcite to reduce the bias encoded within the embeddings and increase representational fairness. note that all supervised methods use labels of the target attribute to align the embeddings, while adplvr does not have access to any attribute label throughout the training. training. we follow the setup of previous works using the same datasets @xcite @xcite . specifically, we use a maximum of 120 tokens for the bios dataset and 40 tokens for fdcl18 and pan16 since they comprise comparatively short tweets. we train each model for 15 epochs with a learning rate of 2 × 10 -5 . we select reduction factors for adapters on bios, pan16, and fcdl18 as 2, 1, and 2, respectively, as they led to the best task performance. since each loss term affects each model differently, we train baselines with a fixed λ = 1 for supervised debiasing and our unsupervised adplvr with λ = 0.1. we also select ω = 0.3 as it performed best across all datasets in our grid search. we train five probes consisting of two-layer fully connected networks and tanh activation function for 40 epochs and a learning rate of 1 × 10 -4 to predict protected attributes from embeddings @xcite . to evaluate task performance, we use accuracy as the evaluation metric. in order to evaluate the performance of bias mitigation methods we use balanced accuracy of the probes. we choose balanced accuracy to account for any unbalanced dataset with regard to the distribution of the protected attributes. for gender and dialect attributes, if balanced accuracy is around 50% it shows that the model is confusing the protected attribute; for age this value should be close to 20% because there are five classes for age. furthermore, we run our experiments three times for each model and report the mean and standard deviation of three runs to account for variations in the training process. ## results and discussion in our single attribute experiments on fcdl18 and bios, using both bert-base and roberta-base, adplvr is able to remove information about protected attributes considerably better than all the baselines on bios and fcdl18. as for task performance, we observe a decrease in accuracy with adplvr compared to the baselines on bios. remarkably, our regularization method even shows an improvement in task performance on fcdl18, demonstrating the robustness of its embeddings. in our multi-attribute experiment on pan16 (2 protected attributes), we observe that adplvr performs slightly worse than the best-performing model, adpadv, on the main task. however, unlike adpadv, which has access to the protected attribute label during training, adplvr crucially does not rely on attribute labels for bias mitigation; yet, it still outperforms the baselines in protected attribute information removal. overall, we observe that, with bert-base, adplvr shows slightly higher balanced accuracy compared to ad-padv for both protected attributes, while with roberta-base, adplvr similarly shows improved mitigation performance. notably, other debiasing methods show similar decreases in task performance. still, on fcdl18, adplvr clearly outperforms all supervised baselines on the main task and information removal. ## conclusion in this work, we focus on representational fairness and introduce a novel regularization and optimization scheme to debias encoder lms without accessing protected attribute labels. we show the effectiveness of our method using two encoder lms across three datasets and multiple protected attributes. we demonstrate that our method enhances debiasing while maintaining task performance compared to strong baselines. to the best of our knowledge, our method is the first that can mitigate bias of any arbitrary target attribute by generating robust embeddings best suited for the classification task. since our method does not rely on attribute labels, we hope it paves the future for more accessible, effective, and efficient debiasing of encoder-based transformer models.