In recent years, large Transformer-based Pre-trained Language Models (PLM) have changed the Natural Language Processing (NLP) landscape, by pushing the performance boundaries of the state-of-the-art on a wide variety of tasks. However, this performance gain goes along with an increase in complexity, and as a result, the size of such models (up to billions of parameters) represents a constraint for their deployment on embedded devices or short-inference time tasks. To cope with this situation, compressed models emerged (e.g. DistilBERT), democratizing their usage in a growing number of applications that impact our daily lives. A crucial issue is the fairness of the predictions made by both PLMs and their distilled counterparts. In this paper, we propose an empirical exploration of this problem by formalizing two questions: (1) Can we identify the neural mechanism(s) responsible for gender bias in BERT (and by extension DistilBERT)? (2) Does distillation tend to accentuate or mitigate gender bias (e.g. is DistilBERT more prone to gender bias than its uncompressed version, BERT)? Our findings are the following: (I) one cannot identify a specific layer that produces bias; (II) every attention head uniformly encodes bias; except in the context of underrepresented classes with a high imbalance of the sensitive attribute; (III) this subset of heads is different as we re-fine tune the network; (IV) bias is more homogeneously produced by the heads in the distilled model.
翻译:近年来,基于Transformer的大规模预训练语言模型通过突破各类任务的最优性能边界,彻底改变了自然语言处理领域格局。然而,性能提升伴随着模型复杂度的增加,其参数规模(动辄数十亿级)制约了在嵌入式设备或低延迟推理任务中的部署。为应对这一挑战,压缩模型(如DistilBERT)应运而生,推动其越来越多地渗透到影响日常生活的应用场景中。关键问题随之浮现:预训练语言模型及其蒸馏版本预测结果的公平性。本文通过构建两个研究问题展开实证探索:(1) 能否识别BERT(及其衍生模型DistilBERT)中导致性别偏见的神经机制?(2) 知识蒸馏是增强还是削弱了性别偏见(即DistilBERT是否比未压缩版本BERT更易产生性别偏见)?研究主要发现如下:(Ⅰ) 无法定位产生偏见的特定网络层;(Ⅱ) 所有注意力头均均匀编码偏见,但敏感属性高度不平衡的少数类场景除外;(Ⅲ) 随网络重新微调,前述少数类子集注意力头产生变化;(Ⅳ) 蒸馏模型中注意力头产生的偏见分布更趋均匀。