测试Stable Diffusion生成程序员图像时的性别种族偏见,发现普遍偏向男性和白人。
How Do Generative Models Draw a Software Engineer? A Case Study on Stable Diffusion Bias
- 用三版Stable Diffusion模型,对含与不含'软件工程师'关键词的提示词生成6720张图
- 所有模型生成的程序员形象中,男性占比显著偏高,黑人和阿拉伯人严重被低估
- SD 3相比其他版本更倾向生成亚裔形象,但仍存在明显种族偏见
生成式模型广泛用于生成网页、艺术、广告等图形内容,但已有研究表明其生成的图像可能强化已有社会偏见。本文聚焦于这些模型在生成软件工程相关图像时是否存在偏见。软件工程领域本身存在性别与族裔不平等,若未加警惕地使用生成模型,可能加剧此类偏见。我们对三版流行的开源文生图模型Stable Diffusion(SD 2、SD XL、SD 3)进行了系统性评估,针对软件工程任务设计两组提示词:一组包含'软件工程师'关键词,另一组不指定执行者。共生成6720张图像,并分析其性别与族裔分布。结果表明,所有模型在表示软件工程师时均显著偏向男性;其中SD 2和SD XL强烈偏向白人,而SD 3则略微偏向亚裔。然而,无论提示词风格如何,所有模型均严重低估黑人与阿拉伯人形象。研究揭示了生成模型在软件工程场景中应用的严重风险,呼吁未来开展针对性的偏见缓解研究。
原文摘要 · Abstract (English)
Generative models are nowadays widely used to generate graphical content used for multiple purposes, e.g. web, art, advertisement. However, it has been shown that the images generated by these models could reinforce societal biases already existing in specific contexts. In this paper, we focus on understanding if this is the case when one generates images related to various software engineering tasks. In fact, the Software Engineering (SE) community is not immune from gender and ethnicity disparities, which could be amplified by the use of these models. Hence, if used without consciousness, artificially generated images could reinforce these biases in the SE domain. Specifically, we perform an extensive empirical evaluation of the gender and ethnicity bias exposed by three versions of the Stable Diffusion (SD) model (a very popular open-source text-to-image model) - SD 2, SD XL, and SD 3 - towards SE tasks. We obtain 6,720 images by feeding each model with two sets of prompts describing different software-related tasks: one set includes the Software Engineer keyword, and one set does not include any specification of the person performing the task. Next, we evaluate the gender and ethnicity disparities in the generated images. Results show how all models are significantly biased towards male figures when representing software engineers. On the contrary, while SD 2 and SD XL are strongly biased towards White figures, SD 3 is slightly more biased towards Asian figures. Nevertheless, all models significantly under-represent Black and Arab figures, regardless of the prompt style used. The results of our analysis highlight severe concerns about adopting those models to generate content for SE tasks and open the field for future research on bias mitigation in this context.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。