Manuscript Offprint

arXiv:2608.29847

ContextBias: Controlled Evaluation of Bias Persistence Under Context Shift in Text-to-Image Models

Shaghayegh Kolli, Sina Emami, Moreno D'Incà, Pouyan Nejadi, Nicu Sebe, Massimiliano Mancini, Jana Diesner

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Text-to-image models learn associations between concepts - in the case of this paper, people's professions, which we refer to as roles - and visual attributes. These associations can underpin many observed forms of stereotypical bias. A key open question in this area is whether these associations are stable or change when visual representations of people in professional roles are placed in different prompted contexts. We introduce ContextBias, a controlled evaluation framework, and ContextBench, a benchmark spanning 92 roles and 1,656 semantically controlled prompts, designed to isolate the effect of contextual variation on role-linked visual representations. Evaluating four state-of-the-art models on 66,240 generated images, we find that placing a role in a semantically unrelated context does not suppress role-linked attributes; instead, cross-role attribute concentration increases (pooled BI +0.047). Demographic cues, characteristic garments, and role-specific tools remain highly prevalent across context-free, related, and unrelated conditions, and are robust to semantic prompt reformulation. Scene composition and camera framing show the greatest context-sensitivity. These findings reveal a form of stereotypical persistence that remains largely invisible to context-free evaluations, highlighting the need for controlled contextual variation in bias benchmarking. Code and dataset: https://github.com/Sina-Emami/ContextBias, https://huggingface.co/datasets/shaghayegh/ContextBias.

1 Introduction

Text-to-image (T2I) models learn associations between concepts (in this paper, people's professions, which we also refer as roles) and attributes of visual representations of these concepts. These associations impact many observed forms of stereotypical bias (Bianchi et al., 2023; Luccioni et al., 2023;

Figure

Figure 1: Our overall logic for testing whether role-linked cues adapt to scene context by varying the scene while fixing the role.

Naik and Nushi, 2023; Vandewiele et al., 2026; Raza et al., 2025; Bhattacharya et al., 2025). As a result, generated images can reproduce recurring patterns involving, for example, demographic cues, items, and features of the surroundings associated with particular concepts. Recent studies have shown that T2I models frequently reproduce stereotypical role attribute associations learned from their training data, such as linking doctors with white coats, mechanics with men, or judges with robes (Seshadri et al., 2024; Shi et al., 2025; Wu et al., 2025b; Bianchi et al., 2023; Malakouti and Kovashka, 2025).

As generative models are increasingly used to produce visual content at scale, these associations do not merely reflect patterns in the training data; they actively shape how roles are visually defined and portrayed in downstream applications. Understanding when such associations persist, weaken, or change is therefore important for both evaluating models and studying stereotypical fairness.

Despite extensive work on stereotypical bias in T2I models (Cho et al., 2023; Zhang et al., 2023; D'Incà et al., 2024; Friedrich et al., 2025; Naik and Nushi, 2023), little is known about how learned visual associations behave under context variation. Existing studies primarily evaluate concepts in iso-lation (D'Incà et al., 2024), and have shown that roles such as doctor or chef are consistently depicted with characteristic clothing, tools, and visual attributes (Bianchi et al., 2023; Wu et al., 2025b). However, these evaluations provide limited insight into what happens when contextual information is varied.

In practice, prompts might not describe roles in isolation, but instead place people within environments and activities, such as a doctor examining a patient or exercising in a park. Context may reinforce learned associations, weaken them, or introduce competing visual signals (Girrbach et al., 2025). This raises a fundamental question: does context reshape learned visual associations, or merely change the scene around objects or people?

This question is closely related to the idea of compositional generalization, where models are expected to combine concepts and contextual information rather than rely on dominant learned associations (Lake and Baroni, 2018; Thrush et al., 2022; Sun et al., 2025). In image generation, this translates into a simple challenge: when contextual information changes, which aspects of a generated representation adapt and which remain stable?

To address this question, we introduce ContextBias, a controlled evaluation framework that systematically varies location and activity context while keeping role identity fixed. We further introduce ContextBench, a benchmark spanning 92 roles and 1,656 semantically controlled prompts, and evaluate FLUX.1, Stable Diffusion XL, Stable Diffusion 3.5, and Qwen-Image on 66,240 generated images. Using a schema-guided visual pipeline, we measure how contextual variation influences both the concentration and prevalence of role-linked visual attributes (see Fig. 1).

Specifically, we investigate: (i) whether role-linked visual associations persist across contextual conditions; (ii) how contextual variation affects the prevalence and concentration of visual attributes; and (iii) whether observed persistence patterns remain robust under prompt reformulation.

Our results show that many role-linked visual associations remain stable even when roles are placed in semantically unrelated contexts. Across four state-of-the-art T2I models, contextual variation primarily affects scene composition and framing, while associations involving demographic cues, characteristic garments, and role-specific tools frequently persist across contexts.

Contributions. Our contributions are threefold:

(i) we introduce ContextBias, a controlled evaluation framework for studying role-linked visual associations under contextual variation;

(ii) we provide ContextBench, a benchmark spanning 92 roles and 1,656 semantically controlled prompts across context-free, context-aware related, and context-aware unrelated conditions;

(iii) we conduct a large-scale evaluation of four state-of-the-art text-to-image models on 66,240 generated images, showing that many role-linked visual associations persist across contextual conditions and remain robust under semantic prompt reformulation.

References (30)