返回全部动态

用户画像如何影响LLM代码生成:偏见实证研究

原标题:When Who You Are Can Change the Code You Get: A Study of Persona-Induced Bias in LLM Code Generation

arXiv cs.SE一手来源研究质量 88

AI 摘要

该研究对LLM代码生成中的用户画像偏见进行了大规模实证分析,测试了Gemini 2.5 Pro和GPT-OSS-120B两个模型,使用覆盖国籍、性别和经验水平的18种人口统计画像,对比中性基线,分析了超过35,000个生成程序。结果显示,人口统计标记在高达65%的回复和70%的推理轨迹中出现,尽管与任务语义无关;在LiveCodeBench上,画像提示使Gemini正确率平均下降1.54个百分点,而GPT-OSS模型在所有画像下准确率提升3.4-5.7%。可维护性和代码风格指标有统计显著但效应量可忽略,安全漏洞无系统性画像特定模式。

以上摘要由 AI 生成,可能存在误差。事实请以原文为准。

正文节选

∎ When Who You Are Can Change the Code You Get: A Study of Persona-Induced Bias in LLM Code Generation Abstract Large Language Models (LLMs) are widely used as programming assistants, yet it remains unclear whether and how user’s demographic information impacts the technical quality of generated code. We conduct a large-scale empirical study of persona-induced bias in LLM-based code generation, focusing a proprietary model (Gemini 2.5 Pro) and an open-weight model (GPT-OSS-120B). Using 18 demogr


发布时间:2026-09-22 12:00
抓取时间:2026-09-22 12:56
来源机构:arXiv
阅读原文arxiv.org