# How Do Generative Models Draw a Software Engineer? A Case Study on Stable Diffusion Bias

arXiv: https://arxiv.org/abs/2501.09014 · HTML: https://mlsanity.com/paper/2501.09014/

## Key facts

- Cited by 2 papers in the map (data through 14 Oct 2026).
- Placed in Image generation, text-to-image and editing, one of 14 directions in Diffusion models.
- Builds on 15 of its 32 references that are in the map.
- First posted on arXiv 15 Jan 2025.

## Placed in

- Diffusion models / [Image generation, text-to-image and editing](https://mlsanity.com/diffusion/image-generation-text-to-image-and-editing/)

## Builds on (most cited first, 15 of 15)

- [High-Resolution Image Synthesis with Latent Diffusion Models](https://mlsanity.com/paper/2112.10752/) (2021)
- [SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesis](https://mlsanity.com/paper/2307.01952/) (2023)
- [BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generation](https://mlsanity.com/paper/2201.12086/) (2022)
- [Scaling Rectified Flow Transformers for High-Resolution Image Synthesis](https://mlsanity.com/paper/2403.03206/) (2024)
- [LAION-5B: An open large-scale dataset for training next generation image-text models](https://mlsanity.com/paper/2210.08402/) (2022)
- [Easily Accessible Text-to-Image Generation Amplifies Demographic Stereotypes at Large Scale](https://mlsanity.com/paper/2211.03759/) (2022)
- [Stable Bias: Analyzing Societal Representations in Diffusion Models](https://mlsanity.com/paper/2303.11408/) (2023)
- [Social Biases through the Text-to-Image Generation Lens](https://mlsanity.com/paper/2304.06034/) (2023)
- [Survey of Bias In Text-to-Image Generation: Definition, Evaluation, and Mitigation](https://mlsanity.com/paper/2404.01030/) (2024)
- [Large-scale Text-to-Image Generation Models for Visual Artists' Creative Works](https://mlsanity.com/paper/2210.08477/) (2022)
- [Smiling Women Pitching Down: Auditing Representational and Presentational Gender Biases in Image Generative AI](https://mlsanity.com/paper/2305.10566/) (2023)
- [She Elicits Requirements and He Tests: Software Engineering Gender Bias in Large Language Models](https://mlsanity.com/paper/2303.10131/) (2023)
- [Understanding Fairness in Software Engineering: Insights from Stack Exchange](https://mlsanity.com/paper/2402.19038/) (2024)
- [GreenStableYolo: Optimizing Inference Time and Image Quality of Text-to-Image Generation](https://mlsanity.com/paper/2407.14982/) (2024)
- [Data-Driven Analysis of Gender Fairness in the Software Engineering Academic Landscape](https://mlsanity.com/paper/2309.11239/) (2023)

## Built on by (most cited first, 2 of 2)

- [SustainDiffusion: Optimising the Social and Environmental Sustainability of Stable Diffusion Models](https://mlsanity.com/paper/2507.15663/) (2025)
- ["Draw me a curator" Examining the visual stereotyping of a cultural services profession by generative AI](https://mlsanity.com/paper/2508.07132/) (2025)

## Abstract (arXiv)

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.
