Language Agents for Detecting Implicit Stereotypes in Text-to-image Models at Scale

Qichao Wang, Tian Bian, Yian Yin, Tingyang Xu, Hong Cheng, Helen M. Meng, Zibin Zheng, Liang Chen, Bingzhe Wu · DOI

Abstract

Text-to-image (T2I) models frequently exhibit implicit societal stereotypes, yet auditing these biases at scale remains a significant challenge. This paper introduces an autonomous LLM-based agent framework designed to systematically detect and quantify these biases. By employing the ReAct paradigm and a specialized suite of multimodal tools, the agent autonomously generates prompts, triggers image generation, and evaluates outputs. Experimental results demonstrate that the agent achieves 92.15% precision compared to human auditors, uncovering significant biases across gender, race, and religion in popular models.

Introduction

As text-to-image (T2I) generation moves into the mainstream, the risk of reinforcing harmful societal stereotypes increases. Implicit biases—where "political elites" are depicted as exclusively male or "terrorists" as a specific ethnicity—are often embedded in the subtle language of training data. Traditional auditing methods are manual and struggle to keep pace with the rapid proliferation of new models and fine-tuned plugins. There is a critical need for an automated, scalable approach to stereotype risk governance.

Methodology: The Agent Framework

The proposed solution utilizes a language agent that follows the ReAct (Reasoning and Acting) paradigm. When presented with a query such as "Is Model X racially biased?", the agent undergoes a multi-step reasoning process to determine which tools are necessary to provide an answer.

The autonomous agent architecture and task-solving trajectory.

The agent’s workflow is divided into three core phases:

  1. Instruction Pair Generation: The agent extracts "prompt-subgroup" pairs from natural language datasets (e.g., extracting "African" from a prompt about "thugs").
  2. Image Generation: The agent invokes the target T2I model to generate a batch of images based on these optimized prompts.
  3. Stereotype Detection: Using a Vision-Language Model (BLIP), the agent classifies the subjects in the generated images and calculates a "Stereotype Score" based on the alignment between the image content and the suspected stereotype.

The SPIG Dataset

To evaluate the framework, the researchers developed the Stereotypical Prompts for Image Generation (SPIG) dataset. Curated from five major toxic NLP corpora (SBIC, HateExplain, DYNAHATE, IHC, and SMTD), the dataset contains 4,123 painting prompts. These are categorized into three primary social dimensions: Gender (55%), Race (33.6%), and Religion (11.5%).

Experimental Results and Insights

The agent demonstrated high reliability, with an average precision of 92.15% in detecting stereotypes. A case study on Midjourney using highly biased prompts revealed that 33% of these prompts resulted in a 100% stereotype ratio, such as depicting "cotton pickers" exclusively as individuals of African descent.

Comparison of implicit stereotypes across different T2I models.

Key findings include:

  • Religion as a High-Risk Dimension: Religion was found to be the most heavily stereotyped category, likely due to a combination of data scarcity and deep-seated societal biases in text-image pairs.
  • Preference-Driven Bias: Certain models, such as "Chilloutmix," showed extreme gender bias. This suggests that fine-tuning to meet specific user preferences (e.g., for female subjects) can inadvertently amplify gender stereotypes.
  • Racial Tropes in Violent Contexts: Prompts involving crime or violence consistently triggered racialized outputs, particularly depicting African or Latino subgroups.

Conclusion

The integration of autonomous agents into the AI development pipeline offers a scalable path forward for ethical governance. While limitations remain—such as the VLM's occasional difficulty in fine-grained racial classification—the agent-based approach successfully moves auditing from a manual "whack-a-mole" process to a systematic, automated framework. Future work will focus on "red-teaming" capabilities, allowing agents to creatively generate adversarial prompts to further stress-test model boundaries.

Summary updated

BibTeX
@misc{wang2023language,
  author = {Qichao Wang and Tian Bian and Yian Yin and Tingyang Xu and Hong Cheng and Helen M. Meng and Zibin Zheng and Liang Chen and Bingzhe Wu},
  title = {{Language Agents for Detecting Implicit Stereotypes in Text-to-image Models at Scale}},
  year = {2023},
  eprint = {2310.11778},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.11778},
}
Figure