近年来,随着大型语言模型(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.
DR.GAP: Mitigating Bias in Large Language Models using Gender-Aware Prompting with Decoupled Reasoning
School of Information Science and Technology, ShanghaiTech University(上海科技大学信息科学与技术学院);School of Computer and Cyber Sciences, Augusta University(奥古斯塔大学计算机与网络科学学院)
DualEdit: Mitigating Safety Fallback in LLM Backdoor Editing via Affirmation-Refusal Regulation
University of Science and Technology of China(中国科学技术大学);National University of Singapore(新加坡国立大学);Singapore Management University(新加坡管理大学);MoE Key Lab of BIPC, University of Science and Technology of China(中国科学技术大学信息与通信技术国家重点实验室)
Potential and Challenges of Model Editing for Social Debiasing
Zhejiang University School of Engineering(浙江大学工程学院);Westlake University(西湖大学);Institute of Advanced Technology, Westlake Institute for Advanced Study(西湖高等研究院先进技术研究所)
Image Tokens Matter: Mitigating Hallucination in Discrete Tokenizer-based Large Vision-Language Models via Latent Editing
Hasso Plattner Institute(霍普夫纳研究所);University of Potsdam(波茨坦大学);University of Cambridge(剑桥大学);University of Oxford(牛津大学);German University of Digital Science(德国数字科学大学)
Spurious Correlations and Beyond: Understanding and Mitigating Shortcut Learning in SDOH Extraction with Large Language Models
Department of Computer Science(计算机科学系);School of Nursing(护理学院);Department of Information Sciences and Technology(信息科学与技术系);Department of Biomedical Informatics & Medical Education(生物医学信息学与医学教育系)
Correct When Paired, Wrong When Split: Decoupling and Editing Modality-Specific Neurons in MLLMs
School of Information Science and Engineering, Yunnan University(云南大学信息科学与工程学院);School of Software, Yunnan University(云南大学软件学院);National University of Singapore(新加坡国立大学);School of Engineering, Yunnan University(云南大学工程学院)
Towards Fair Rankings: Leveraging LLMs for Gender Bias Detection and Measurement
Università della Svizzera italiana \& University of Amsterdam;University of Amsterdam The Netherland;Unviersity of Amsterdam The Netherland;University of Amsterdam
Gender and content bias in Large Language Models: a case study on Google Gemini 2.0 Flash Experimental
University of Perugia(佩鲁贾大学);Chapin Hall at University of Chicago(芝加哥大学查平学院);Berdyansk State Pedagogical University(别尔江斯克国立师范大学);Università di Bologna(博洛尼亚大学);University of North Texas(北得克萨斯大学);Chapin Hall(查平学院)
Knowledge Editing for Large Language Model with Knowledge Neuronal Ensemble
School of Computer Science and Engineering, Northeastern University(东北大学计算机科学与工程学院);Artificial Intelligence Innovation Center, Yangtze Delta Region Institute of Tsinghua University, Zhejiang(浙江清华长三角研究院人工智能创新中心);Key Laboratory of Intelligent Computing in Medical Image, Ministry of Education, Northeastern University(东北大学医学影像智能计算教育部重点实验室)
Uncovering Overfitting in Large Language Model Editing
Shandong University(山东大学);School of Computer Science, Beijing University of Posts and Telecommunications(北京邮电大学计算机学院);New Laboratory of Pattern Recognition (NLPR) State Key Laboratory of Multimodal Artificial Intelligence Systems (MAIS) Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所)
EvoEdit: Evolving Null-space Alignment for Robust and Efficient Knowledge Editing
Institute for Clarity in Documentation(文档清晰度研究所);Inria Paris-Rocquencourt(法国国家信息与自动化研究所巴黎-罗康库尔中心);Rajiv Gandhi University(拉吉夫·甘地大学);Tsinghua University(清华大学);Palmer Research Laboratories(帕默研究实验室)
DELMAN: Dynamic Defense Against Large Language Model Jailbreaking with Model Editing
ShanghaiTech University(上海科技大学);The State Key Laboratory of Blockchain and Data Security, Zhejiang University(浙江大学区块链与数据安全全国重点实验室);The CoAI group, Tsinghua University(清华大学CoAI课题组)