An Empirical Analysis of Parameter-Efficient Methods for Debiasing Pre-Trained Language Models (2023)

Abstract: The increasingly large size of modern pre-trained language models not only makes them inherit more human-like biases from the training corpora, but also makes it computationally expensive to mitigate such biases. In this paper, we investigate recent parameter-efficient methods in combination with counterfactual data augmentation (CDA) for bias mitigation. We conduct extensive experiments with prefix tuning, prompt tuning, and adapter tuning on different language models and bias types to evaluate their debiasing performance and abilities to preserve the internal knowledge of a pre-trained model. We find that the parameter-efficient methods (i) are effective in mitigating gender bias, where adapter tuning is consistently the most effective one and prompt tuning is more suitable for GPT-2 than BERT, (ii) areless effective when it comes to racial and religious bias, which may be attributed to the limitations of CDA, and (iii) can perform similarly to or sometimes better than full fine-tuning with improved time and memory efficiency, as well as maintain the internal knowledge in BERT and GPT-2, evaluated via fact retrieval and downstream fine-tuning.

## introduction pre-trained language models are able to encode rich linguistic and factual knowledge by learning the co-occurrence information of words in large realworld corpora @xcite @xcite . since most of these corpora are internet-based and not carefully curated, they are likely to contain unbalanced or stereotyped information for certain demographic groups. as a result, pre-trained language models are often demonstrated to inherit bias from human society and exhibit potential harms @xcite @xcite @xcite @xcite . hence, much re-search effort has been devoted to debias pre-trained language models @xcite . with the size of language models becoming incredibly large @xcite @xcite , they are not only at higher risk of exhibiting biased behaviors @xcite , but also hard to debias because of prohibitive computational cost. therefore, recent parameter-efficient methods @xcite have been applied to bias mitigation, where only a small portion of the parameters are updated @xcite . however, these works are limited in terms of evaluation dimensions, making it unclear how different parameter-efficient methods' performance compare to each other, whether one parameter-efficient method is effective across different types of language models, and whether they are also effective for mitigating religious and racial bias in addition to gender bias. moreover, direct comparisons with strong post-hoc debiasing methods @xcite , as well as evaluations of bias mitigation's impact on the language model's internal knowledge, are often insufficient. given these observations, we investigate three popular parameter-efficient methods, i.e., prefix tuning (li and @xcite , prompt tuning @xcite , and adapter tuning @xcite , in combination with counterfactual data augmentation @xcite @xcite to debias pretrained language models. we conduct extensive experiments to study the parameter-efficient methods' performance on two types of language models (bert @xcite for masked language models and gpt-2 @xcite for autoregressive language models), three types of social biases (gender, race, and religion), and four types of performance measures (debiasing performance on crows-pairs @xcite and stere-oset @xcite , language modeling per-formance on wikitext-2 @xcite and stereoset @xcite , fact retrieval performance on lama @xcite , as well as downstream fine-tuning performance on wino-bias @xcite ). we empirically compare to the performance of full fine-tuning and two posthoc debiasing methods (sentencedebias @xcite and selfdebias @xcite ), aiming to comprehensively study the effectiveness of parameter-efficient methods for bias mitigation. 1 our main findings are as follows: ## parameter-efficient methods in this section, we briefly review three popular parameter-efficient methods investigated in our study: prefix tuning (li and liang, 2021), prompt tuning @xcite , and adapter tuning @xcite . in contrast to traditional full fine-tuning where all the model parameters are updated during training, these parameter-efficient methods introduce a small number of extra tunable parameters φ on top of a frozen pre-trained language model. pre-trained language models usually adopt the transformer architecture @xcite consisting of multiple stacked layers. assume that there are n layer layers, and h (i) 0 ∈ r t ×d is the input to the i-th layer, where t is the sequence length, and d is the model dimension. then, h (i) 0 is transformed by the following equations to obtain the output of the i-th layer h (i) 5 , which is in turn adopted as the input for the (i + 1)-th layer: here, eqs. (1) and ( 2 ) constitute the multi-head attention sublayer, where prefix tuning. li and liang (2021) prepend l tunable prefix vectors to the key vectors (h 1 ) for each layer: prompt tuning. @xcite prepend l tunable prompt vectors (continuous tokens) only to the input embeddings (x), and compute the activations of these prompt vectors in the subsequent layers using the pre-trained transformer's parameters. so, the only modification is: adapter tuning. houlsby et al. (2019) insert the following adapter module between the transformer's sublayers: in our implementation, we adopt pfeiffer et al. (2021)'s setting where only a single adapter is inserted after the feed-forward sublayer, since it is found to be the optimal setting among other alternatives @xcite . thus, all the tunable parameters are φ = {w ## conceptual comparisons with existing debiasing methods most existing debiasing methods are trainingbased, where they introduce a specific debiasing loss to fine-tune a pre-trained model on certain balanced debiasing corpora @xcite @xcite @xcite . these methods are, in general, orthogonal to our parameterefficient debiasing framework in that we could substitute the (masked) language modeling loss in eq. ( 9 ) with their specific debiasing loss. in this paper, we only focus on the simple language modeling loss, and leave other kinds of debiasing loss for future work. another important line of debiasing methods applies post-hoc mathematical operations on the frozen representations of a language model, such as sentencedebias @xcite and selfdebias @xcite . we briefly review these methods below and make empirical comparisons to parameter-efficient debiasing methods in section 5. liang et al. (2020) assume that there is a linear subspace that can capture demographic information in the embedding space, thus trying to identify and remove the demographic information via linear algebra operations. specifically, they first leverage a procedure similar to cda to extract and augment sentences containing bias attribute words from a source corpus. then, they encode the sentences to embeddings with a pre-trained language model, and obtain a set of difference vectors between the embeddings of sentences in different demographic groups. next, they perform principle component analysis on the set of difference vectors, and use the first k components to expand a bias subspace. once the bias subspace is identified, we could debias a new sentence embedding by subtracting its projection on the bias subspace. ## impact on internal knowledge 6.1 fact retrieval to investigate the impact of bias mitigation on the factual knowledge encoded in pre-trained language models, we take the gender-debiased models from section 5.2 and evaluate them on the four lama datasets @xcite . 6 the results are shown in comparing the performance between full finetuning and parameter-efficient tuning, we find that the former performs best on squad with bert and google-re with gpt-2, while the latter performs better in the rest of the settings. in general, the performance gaps are marginal. ## conclusion in this study, we investigated the performance of prefix tuning, prompt tuning, and adapter tuning on mitigating social bias and preserving the linguistic and factual knowledge for two types of pre-trained language models. our results demonstrated the effectiveness and efficacy of parameter-efficient methods in combination with cda, and also revealed their performance limitations by comparing to post-hoc debiasing methods. we hope that our study can make it more accessible for others to debias pre-trained language models with reduced computational requirements, and contribute to fair and inclusive nlp.