Modular and On-demand Bias Mitigation with Attribute-Removal Subnetworks (2023)

Abstract: Societal biases are reflected in large pre-trained language models and their fine-tuned versions on downstream tasks. Common in-processing bias mitigation approaches, such as adversarial training and mutual information removal, introduce additional optimization criteria, and update the model to reach a new debiased state. However, in practice, end-users and practitioners might prefer to switch back to the original model, or apply debiasing only on a specific subset of protected attributes. To enable this, we propose a novel modular bias mitigation approach, consisting of stand-alone highly sparse debiasing subnetworks, where each debiasing module can be integrated into the core model on-demand at inference time. Our approach draws from the concept of diff pruning, and proposes a novel training regime adaptable to various representation disentanglement optimizations. We conduct experiments on three classification tasks with gender, race, and age as protected attributes. The results show that our modular approach, while maintaining task performance, improves (or at least remains on-par with) the effectiveness of bias mitigation in comparison with baseline finetuning. Particularly on a two-attribute dataset, our approach with separately learned debiasing subnetworks shows effective utilization of either or both the subnetworks for selective bias mitigation.

## introduction a large body of research evidences the existence of societal biases and stereotypes in pre-trained language models (plms) @xcite @xcite , and their potential harms when used in down-stream tasks @xcite @xcite . common in-processing approaches to bias mitigation update a model's (typically all) parameters to satisfy specific attribute erasure criteria through optimization methods such as adversarial train-ing @xcite , and mutual information reduction @xcite . these methods are shown to be effective in reducing the footprint of protected attributes (e.g., gender, race, etc.) in the resulting model. however when using such debiasing models in practice and in specific use-cases, system designers or end-users might still prefer to instead use the original model, or a debiased variation in respect to a particular subset of protected attributes. this can be due to various reasons such as the nature of a given input, preference of an individual end-user, or fairness-utility trade-off considerations. for instance, while a bias-aware model should indeed be agnostic to genders when the input is about genderneutral occupations (such as nurse or ceo), certain topics like pregnancy may specifically require gender information for a correct model decision. 1 also as shown in previous studies @xcite @xcite , since improving fairness on specific tasks may come with the cost of performance degradation, it is necessary to provide on-demand control over whether to impose fairness/debiasing criteria. using existing approaches, this would require maintaining and deploying multiple large parallel models for every protected attribute, resulting in overly complex and resource-heavy pipelines and increased latency. to address this, we introduce a novel modular bias mitigation approach using sparse weightdifference networks. in our approach, the required changes in a model's parameters for erasing a bias attribute are stored in a decoupled subnetwork, trained simultaneously by a debiasing and a sparsification objective. at inference time, adding each debiasing module to the core model results in delivering debiasing qualities to a model's prediction in respect to the corresponding protected attribute. our approach extends the principle idea of diff pruning @xcite introduced for parameter-efficient task training to bias mitigation, by viewing the objective of erasing a protected attribute as a stand-alone diff module. this module replaces fine-tuning by training only a small set of parameters added to the corresponding plm's parameters, to deliver bias mitigation of a specific protected attribute. we further propose a novel procedure to train such debiasing subnetworks separately, and to selectively add an arbitrary set of them to the core model at inference time ( §3). our approach can be applied to any debiasing and representation disentanglement method, provided that its objective has separate learning signals for the task and each protected attribute. in comparison with adapter networks @xcite , as shown by @xcite and also evidenced in our experiments, even more parameter-efficiency can be provided. additionally, since our approach extends the base model with diff subnetworks, the resulting model is expected to perform (at least) as good as the fine-tuning variation, avoiding possible performance degradations. the modularity of our approach supports separating the process of developing debiasing solutions for a task from using them, such that stand-alone debiasing modules can be created and shared, and later be utilized in a final system on-demand. we evaluate our approach on three bias mitigation tasks: occupation prediction from biographies involving gender @xcite , hate speech detection with dialect-based race as sensitive attribute @xcite ; and mention prediction in tweets with two attributes of gender and age of the authors @xcite . the last dataset particularly enables the study of combining independently trained debiasing modules (details in §4). the evaluation results show that our approach, due to learning the subnetworks specialized on the narrow functionality of debiasing an attribute, provides on par or better debiasing performance in comparison with strong baselines. additionally, we observe that on the mention detection task, learning the debiasing subnetworks post-hoc to model training provides effective results when combining the two (independently trained) subnetworks at inference time. remarkably, these results are achieved with debiasing subnetworks of maximum 1% size of the core model (bert-base), in some cases (e.g., for gender attribute) even only 0.01% (details in §5). ## modular debiasing with diff subnets we start with defining the general approach to model bias mitigation. we consider an arbitrary plm denoted by f θ with the set of parameters θ. the model learns the task τ using the loss function l τ . the predictions of f θ might be sensitive to the variations in any of the k protected attributes of the set @xmath0, ..., ρ k }. the bias mitigation objective is to make the model invariant to these variations while maintaining the effectiveness on the task, approached by defining the debiasing loss l ρ i for the protected attribute ρ i . we discuss two realizations of this loss function in section 3.2. a debiased model in respect to attributes p is achieved by training on the following loss function: using l total , one can finetune all parameters of the model @xcite , or utilize any parameter-efficient training such as adapters @xcite , diff pruning @xcite , or binary masks @xcite . we use some of these methods as baselines, explained in the following sections. in the remainder of this section, we introduce our modular debiasing with diff subnetworks (moddiffy), explain its training and inference procedure, and describe two debiasing optimization methods. ## results and analysis starting from task accuracy, the models using subnetworks (variations of diffprun and mod-diffy shown at the lower part of the table) consistently perform the same as the fully finetuned models on both datasets and debiasing methods. we observe a slight decrease in performance for the adapter-based models on fcdl18. looking at the leakage probing performance of bias attributes, moddiffy models show better performance (lower values) among the subnetworkbased models on both datasets, and overall on bios. 2 in particular, moddiffy models outperform the directly comparable baselines finetune-debias and diffprun-debias on all configurations, indicating the benefits of learning separate debiasing modules on bias mitigation performance. this indeed comes with the core advantages of moddiffy models in proving modularized and on-demand bias mitigation. the results also show that moddiffy-post, while (as expected) slightly weaker than mod-diffy-par, provides competitive bias mitigation performance (i.e., on par with diffprun-debias). finally, comparing between debiasing optimizations, mi reduction shows consistently worse bias mitigation performance in comparison with adversarial training, particularly on fcdl18 where the protected attribute has more than two labels. ## conclusion we propose moddiffy, a novel bias mitigation approach which enables integration of an arbitrary subset of the debiasing modules at inference time. our method encapsulates the functionality of bias mitigation in respect to a protected attribute into a separate magnitude-difference subnetwork, which can then be applied to the core model on-demand. our experiments on three classification tasks show that moddiffy improves bias mitigation achieved by separating the debiasing from the task network, and effectively mitigates the bias of two (and possibly more) attributes when their respective subnetworks are simultaneously utilized.