arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.07820cs.SEcs.AIcs.CL
收藏

通过模型编辑缓解代码大型语言模型中的性别偏见

Mitigating Gender Bias in Code Large Language Models via Model Editing

Harbin Institute of Technology(哈尔滨工业大学);Anhui University(安徽大学)

Zhanyue Qin, Haochuan Wang, Zecheng Wang, Deyuan Liu, Cunhang Fan, Zhao Lv, Zhiying Tu, Dianhui Chu, Dianbo Sui

AI总结:

针对代码大型语言模型中的性别偏见问题,提出了CodeGenBias数据集和FB-Score评估指标,并开发了多粒度模型编辑方法MG-Editing,在保持通用代码生成能力的同时有效缓解了偏见。

摘要:

近年来,随着大型语言模型(LLM)技术的成熟和高质量编程代码数据集的出现,研究人员对自动解决程序合成的挑战越来越有信心。然而,由于LLM的大多数训练样本未经筛选,LLM的性能不可避免地可能与现实场景不一致,从而导致社会偏见的存在。为了评估和量化代码LLM中的性别偏见,我们提出了一个名为CodeGenBias(Gender Bias in the Code Generation)的数据集和一种名为FB-Score(Factual Bias Score)的评估指标,该指标基于相关职业的实际性别分布。在CodeGenBias和FB-Score的帮助下,我们评估并分析了八个主流代码LLM中的性别偏见。先前的工作表明,在知识编辑中表现良好的模型编辑方法具有缓解LLM中社会偏见的潜力。因此,我们开发了一种名为MG-Editing(Multi-Granularity model Editing)的模型编辑方法,该方法包括定位和编辑阶段。我们的模型编辑方法MG-Editing可以应用于五个不同级别的模型参数粒度:全参数级别、层级、模块级、行级和神经元级。大量实验不仅证明我们的MG-Editing能够有效缓解代码LLM中的性别偏见,同时保持其通用代码生成能力,还展示了其出色的泛化能力。同时,实验结果表明,综合考虑模型的性别偏见及其通用代码生成能力,MG-Editing在行级和神经元级粒度上应用时最为有效。

英文摘要:

In recent years, with the maturation of large language model (LLM) technology and the emergence of high-quality programming code datasets, researchers have become increasingly confident in addressing the challenges of program synthesis automatically. However, since most of the training samples for LLMs are unscreened, it is inevitable that LLMs' performance may not align with real-world scenarios, leading to the presence of social bias. To evaluate and quantify the gender bias in code LLMs, we propose a dataset named CodeGenBias (Gender Bias in the Code Generation) and an evaluation metric called FB-Score (Factual Bias Score) based on the actual gender distribution of correlative professions. With the help of CodeGenBias and FB-Score, we evaluate and analyze the gender bias in eight mainstream Code LLMs. Previous work has demonstrated that model editing methods that perform well in knowledge editing have the potential to mitigate social bias in LLMs. Therefore, we develop a model editing approach named MG-Editing (Multi-Granularity model Editing), which includes the locating and editing phases. Our model editing method MG-Editing can be applied at five different levels of model parameter granularity: full parameters level, layer level, module level, row level, and neuron level. Extensive experiments not only demonstrate that our MG-Editing can effectively mitigate the gender bias in code LLMs while maintaining their general code generation capabilities, but also showcase its excellent generalization. At the same time, the experimental results show that, considering both the gender bias of the model and its general code generation capability, MG-Editing is most effective when applied at the row and neuron levels of granularity.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑