Why Knowledge Distillation Amplifies Gender Bias and How to Mitigate from the Perspective of D istil BERT (2022)

Abstract: Knowledge distillation is widely used to transfer the language understanding of a large model to a smaller model. However, after knowledge distillation, it was found that the smaller model is more biased by gender compared to the source large model. This paper studies what causes gender bias to increase after the knowledge distillation process. Moreover, we suggest applying a variant of the mixup on knowledge distillation, which is used to increase generalizability during the distillation process, not for augmentation. By doing so, we can significantly reduce the gender bias amplification after knowledge distillation. We also conduct an experiment on the GLUE benchmark to demonstrate that even if the mixup is applied, it does not have a significant adverse effect on the model’s performance.

## introduction knowledge distillation @xcite is one way to use the knowledge of a large language model under the limited resources by transferring the knowledge of a larger model to a smaller model. under the supervision of the teacher model, the small model is trained to produce the same result as that of the teacher model. by doing so, small models can leverage the knowledge of larger models @xcite . to maintain the performance of the model trained by knowledge distillation, the distilled model focuses more on the majority appearing in the data @xcite . recent studies have described that pre-trained language model also results in a more biased representation when distillation proceeds @xcite . however, only the issue is reported, and what part of knowledge distillation causes an increase in bias is not explored, and no solution is provided. this paper studies which part of knowledge distillation causes the increase of social bias and how to alleviate the problem in terms of dis-tilbert @xcite . we first examine what part that contributes to knowledge distillation brings social bias amplification. there is no difference between the distilled and original models except for size and training loss. thus, we check from two perspectives: (1) the capacity of the model being distilled and (2) the loss used in knowledge distillation. then we suggest leveraging mixup @xcite on the knowledge distillation loss to mitigate this amplification by giving generalizability during the training. we conduct the experiments from two measurements: social bias with the sentence embedding test (seat) @xcite and downstream task performance with the glue benchmark @xcite . we report that the factors that increase the social bias are the student model's limited capacity and the cross-entropy loss term between the logit distribution of the student model and that of the teacher model. we also demonstrate that applying the mixup to knowledge distillation can reduce this increase without significant effect on the downstream task performance. our contributions can be summarized as follows: ## background knowledge distillation is trained so that a student model outputs the same output as a teacher model's for one input. it makes the student model have the problem-solving ability of the large model, even though the student model has a smaller structure. distilbert, the model this study is mainly about, is trained with three loss terms. first, cross-entropy loss (l ce ) forces the logit distribution between the student model and the teacher model to be similar. next, the student model learns language understanding itself with masked language modeling loss (l mlm ). lastly, cosine loss between two model's output (l cos ) makes the direction of output embeddings between the student model and the teacher model closer @xcite . in total, the loss term of distilbert is as follows: ## bias statement in this paper, we investigate stereotypical associations between male and female gender and attribute pairs, particularly from the perspective of sentence embeddings in knowledge distillation language models. for the attribute pairs, we consider careers and family, math and arts, and science and arts. if there exists a correlation between a certain gender and an attribute, the language model intrinsically and perpetually causes representational harm @xcite through improper preconceptions. additionally, when the language model is trained for other downstream tasks, such as occupation prediction @xcite , it may lead to an additional risk of genderstereotyped biases. since knowledge distillation (kd) has become a prevalent technique to efficiently train smaller models, it is vital to figure out to what extent the gender biases are amplified after knowledge distillations and which loss terms exacerbate the biases during the training. our work firstly conducts the in-depth analysis and then proposes mitigation methods for the gender bias amplification during the kd process. we measure the streotypical associations with the sentence embedding association test (seat) @xcite 1 . the seat uses semantically bleached sentence templates such as "this is a [attribute-word]" or "here is [gender-word]". then the associations between a gender and an attribute are calculated by cosine similarities of sentence encoded embeddings. we leave the detailed equations to calculate the seat scores in appendix b. there are several tests in seat. this study focuses on c6, c7, and c8 categories related to gender bias. c6 tests similarity between embedding of male/female names, and career/family attribute words. c7 and c8 measure the similarity between embeddings of male and female pronouns and embeddings of math/arts related words and math/science related words, respectively. ## gender bias amplification after kd in this section, we conduct in-depth analyses about what brings gender bias amplification after knowledge distillation from the perspective of (1) the student model's capacity and (2) the loss used in the knowledge distillation process. ## conclusion in this paper, we study what causes gender bias amplification in the knowledge distillation process and how to alleviate the amplification by applying mixup in the knowledge distillation process. we confirmed that both the cross-entropy loss between the logits and the model capacity affects the increase of gender bias. since this study focused on the distilbert, we alleviated the problem by modifying the knowledge distillation loss. we reported that the seat score decreased when the mixup was applied to the student's input embedding and the teacher's output logit in the distillation method when gender-related words appeared. we also showed that this method does not have a significant adverse effect on downstream tasks. there are limitations in this study. first, we used sub-samples of the pre-training corpus. although we checked that there was no significant differences when trained with a fraction of data in terms of the seat score and the glue score, the experimental results for the entire data should be explored. second, we do not yet know why the seat score increases when the mixup is applied to the output embedding. the embeddings between the two genders are expected to be close, but we do not yet figure out why the scores are reversed contrary to expectations. we leave these as our future work. and reading books. in proceedings of the ieee international conference on computer vision, pages 19-27.