Source-linked AI summary

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

arXiv:2608.29847v1cs.CVcs.CL

TL;DR

The paper examines whether role-linked visual associations in text-to-image models change when professional roles appear in different contexts. It introduces ContextBias and ContextBench to isolate contextual variation across roles, prompts, models, and generated images. The results show persistent demographic, garment, and tool associations, with scene composition and camera framing more context-sensitive.

  • Problem

    It is unclear how learned role-linked visual associations behave under context variation, although such associations matter for evaluating models and studying stereotypical fairness.

  • Method

    ContextBias varies location and activity while fixing role identity, using ContextBench and a schema-guided visual pipeline to compare attribute distributions across conditions.

  • Results

    Many demographic, garment, and tool-related associations persist across contexts and prompt reformulations, while scene composition and camera framing show greater context-sensitivity.

  • Takeaways & Limitations

    Controlled contextual variation complements context-free bias evaluation by revealing persistence patterns in role-linked visual representations.

  • Takeaways & Limitations

    The evaluation varies only location and activity, excluding lighting, cultural setting, and interpersonal interactions.

Abstract

from arXiv · show

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://huggingface.co/datasets/shaghayegh/ContextBias , https://github.com/Sina-Emami/ContextBias

1 Introduction

This paper asks whether role-linked visual associations adapt when professional roles appear in varied contexts. It introduces controlled contextual evaluation and finds that many associations persist while scene composition and framing change more readily.

  • Motivation: Text-to-image models associate professions with visual attributes that can reproduce stereotypical patterns in generated imagery.Examples include demographic cues, characteristic clothing, tools, and surrounding features associated with particular roles.
  • Research gap: Existing bias evaluations largely study roles in isolation, limiting insight into how learned visual associations behave when contextual information changes.The paper frames this as a question of which representation components adapt and which remain stable.
  • Approach: ContextBias varies location and activity while fixing role identity to test whether role-linked cues adapt to scene context.The framework measures changes in the concentration and prevalence of visual attributes across contextual conditions.
  • Findings: Many role-linked associations remain stable in unrelated contexts, while contextual variation primarily affects scene composition and camera framing.Demographic cues, characteristic garments, and role-specific tools frequently persist across contexts.
  • Contributions: ContextBench spans 92 roles and 1,656 semantically controlled prompts across context-free, related, and unrelated conditions.The benchmark supports controlled comparisons of role representations under contextual variation.
  • Contributions: Four state-of-the-art text-to-image models were evaluated on 66,240 generated images, with persistence tested under semantic prompt reformulation.The evaluation targets both contextual persistence and robustness to alternative prompt wording.

2 Related Work

Prior work documents stereotypical and compositional weaknesses in text-to-image models, but provides limited evidence about role-linked associations under controlled context variation.

  • Bias in T2I models: Studies report demographic, cultural, and role-based disparities in generated imagery, including persistent gender and role stereotypes.This literature examines how models reproduce or amplify patterns present in training data.
  • Evaluation frameworks: Existing bias-measurement approaches use systematic pipelines, probing, counterfactual prompts, and structured analysis to uncover latent associations.These methods include open-set detection without predefined categories and unified multimodal evaluation frameworks.
  • Compositional reliability: Prior compositionality research identifies difficulties with attribute binding and contextual consistency in text-to-image generation.Reported problems include hallucinated objects and incorrect compositional relationships.
  • Contextual consistency: ContextBias addresses the remaining gap by isolating location and activity context to identify attributes that adapt versus remain invariant.The benchmark focuses specifically on role-based representation under controlled contextual variation.

3 ContextBias

ContextBias measures whether role-linked visual associations persist when location and activity contexts vary, using controlled prompts, generated images, structured attribute extraction, and BI/CCS metrics.

  • Framework: ContextBias varies context while keeping role identity fixed, then compares extracted attribute distributions to quantify persistence or change.The framework uses context-free, related, and unrelated conditions.
  • Benchmark design: ContextBench isolates context effects with role-related and role-unrelated location and activity banks that are manually filtered for semantic consistency.Prompts use context-free, context-related, and context-unrelated templates.
  • Benchmark design: 1,656 prompts constrain variation to location and activity while including semantically equivalent phrasings and contextual substitutions.These prompt variants reduce sensitivity to individual wording.
  • Attribute extraction: The attribute schema covers four cohorts and 30 dimensions, with open-vocabulary extraction for items, clothing garments, and activities.Closed-vocabulary dimensions use predefined labels, while open-vocabulary dimensions capture fine-grained role-related signals.
  • Bias quantification: Bias Intensity measures distributional concentration around dominant labels, whereas Context Consistency Score measures whether a label remains prevalent and stable across conditions.BI is reported both pooled over roles and as an average of per-role values.

4 Experiments

The experiments evaluate the extraction pipeline and validate ContextBias with human annotations, reporting strong automated accuracy and high agreement among annotators and between humans and the pipeline.

  • Benchmark construction: The evaluation uses 92 roles drawn from the U.S. Bureau of Labor Statistics Standard Occupational Classification and manually normalized role titles.Context banks were reviewed to remove rare, implausible, or stereotype-inducing entries.
  • Image generation: Four generators produce 66,240 images total, with fixed inference parameters except random seed and 10 images generated per prompt-model combination.Each generator contributes 16,560 images.
  • Pipeline validation: The extraction validation uses 220 role-attribute prompts containing explicit ground-truth attributes, testing unambiguous cases separately from contextual images.The human annotation study evaluates the harder setting where attributes are implied rather than stated.
  • Pipeline validation: 90.3%/90.3% accuracy/recall on SD 3.5, 92.1%/92.1% on SDXL, 86.4%/86.4% on FLUX.1, and 92.0%/92.0% on Qwen-Image are reported.F1 scores are 94.9, 95.9, 92.7, and 95.8 respectively.
  • Human validation: The human study covers 1,200 images across 10 roles, three contexts, and four generators, with three independent annotators answering 23 schema-aligned questions per triplet.Raw agreement is 0.914, mean pairwise Cohen’s κ is 0.912, and Fleiss’ κ is 0.89 with 95% CI [0.87, 0.91].
  • Human validation: Human consensus versus the automated pipeline yields raw agreement of 0.826 and Cohen’s κ of 0.822.The comparison supports schema reliability and large-corpus scaling.

5 Results

Across models and contextual conditions, person-level role attributes remain concentrated, while scene composition and camera framing are more context-sensitive. Unrelated contexts increase pooled cross-role concentration without increasing concentration within individual roles.

  • 5.1 Attribute Concentration Increases in Unrelated Contexts: +0.047 pooled BI increase occurs under unrelated context, while role-level BI decreases by 0.031.The pooled increase reflects a cross-role effect rather than sharpening individual role prototypes.
  • 5.1 Attribute Concentration Increases in Unrelated Contexts: +0.093 context shift makes Scene attributes most reactive, followed by Objects at +0.058 and People at +0.042.Camera shows no net cohort-level change, despite opposing dimension-level trends.
  • 5.1 Attribute Concentration Increases in Unrelated Contexts: Camera framing becomes more concentrated (+0.120), while perspective is nearly unchanged (+0.011) and depth_of_field becomes more diverse (−0.154).These opposing shifts explain why Camera has near-zero pooled change.
  • 5.1 Attribute Concentration Increases in Unrelated Contexts: BI ranges from 0.030 for facial_hair_present to 0.978 for age_range, with the highest dimensions almost exclusively in the People cohort.Expression and accessories have low scores, distinguishing persistent from context-sensitive attributes.
  • 5.2 Specific Role–Label Associations Survive Contextual Variation: Demographic cues show the strongest persistence, including Dancer as female in 98–100% of images with CCS = 79.9 and ∆ = 1.0 pp.Other persistent examples include flight attendant as female and mechanic as male across models and conditions.
  • 5.3 Persistence Patterns Are Robust to Prompt Reformulation: Across prompt variants, 93.3% of role–label tuples are invariant, with People and Object attributes more robust than Camera attributes.People show 92.1% invariance, Objects 95.0%, and Camera 64.9%.

6 Conclusion

ContextBias and ContextBench assess whether role-linked visual associations change when professional roles are placed in varied contexts. Across four models, unrelated contexts do not suppress many demographic, garment, and tool associations, while scene composition and camera framing are more context-sensitive.

  • 6 Conclusion: ContextBias introduces a controlled framework and ContextBench benchmark for testing role-linked visual associations under contextual variation.The benchmark spans 92 roles and 1,656 semantically controlled prompts.
  • 6 Conclusion: Evaluating four models on 66,240 images shows that unrelated contexts are not associated with suppressing role-linked attributes.Attribute concentration frequently increases under contextually incongruent conditions.
  • 6 Conclusion: Demographic, garment, and tool-related associations remain stable across contexts and semantic prompt reformulations, whereas scene composition and camera framing are more context-sensitive.The pattern is reported consistently across the evaluated models and prompt reformulations.
  • 6 Conclusion: Role-based concepts are not yet represented in a fully context-conditioned manner: context reshapes the surrounding scene while leaving role visual characterization largely intact.The conclusion connects this pattern to compositional generalization and stereotype-bias analysis.

7 Limitations

The evaluation is bounded by its contextual, cultural, measurement, and extraction choices. Results should therefore be interpreted within the benchmark’s predominantly Western scope and as measures of persistence rather than harm.

  • Context scope: ContextBias varies location and activity while excluding lighting, cultural setting, and interpersonal interactions.These omitted dimensions are identified as directions for future work.
  • Context scope: The 92-role benchmark reflects a specific occupational and cultural context rather than exhaustive global coverage.It is based on the U.S. SOC taxonomy and a predominantly Western, English-language setting.
  • Interpretation: BI measures attribute-distribution concentration, not whether an association is harmful or stereotypical.Interpreting an individual association as a stereotype requires normative judgment beyond these measurements.
  • Measurement: Attribute extraction relies on GPT-5-mini and may inherit occupational priors, although human annotation showed strong agreement with automated judgments.The reported agreement was κ = 0.822; images lacking sufficient visual evidence are excluded from frequency analyses.

8 Ethical Statement and Broader Impact

The paper frames ContextBias as a diagnostic study of contextual bias intended to support safer and fairer AI deployment. Its benchmark isolates contextual effects through controlled role, location, activity, and prompt variations.

  • Ethical statement: The study is strictly diagnostic and aims to improve safety, fairness, and responsible AI deployment without reinforcing stereotypes.It uses machine-generated images and publicly available datasets.
  • Benchmark design: ContextBench holds role identity fixed while systematically isolating the effects of location and activity context.The design enables controlled measurement of how these contexts influence generated visual attributes.
  • Benchmark design: Role-related contexts naturally co-occur with occupations, whereas unrelated contexts lack an inherent semantic relationship with them.Examples include doctors in clinics and people in supermarkets, residential streets, kitchens, or parks.
  • Benchmark design: Contexts and candidate cues are manually filtered to remove implausible, rare, stereotype-inducing, or strongly culture-dependent entries.The filtering reduces additional associations independent of occupational role.
  • Prompt construction: Controlled templates use context-free, related, and unrelated conditions, with paraphrases and substitutions expanding coverage to 1,656 prompts.The protocol yields 18 prompt configurations per role.

B Image Generation

Images are generated across the benchmark’s occupational conditions using standardized settings and four text-to-image generators. The protocol documents model coverage, native resolutions, and the schema-guided audit pipeline.

  • Generation protocol: All models use the same prompts and standardized generation parameters, with only the random seed varied.This is intended to make contextual-condition differences reflect model behavior rather than generation settings.
  • Models and coverage: Images are generated with SDXL, Stable Diffusion 3.5, FLUX.1, and Qwen-Image.The benchmark’s Table 4 covers 92 occupations under CF, CA-rel, and CA-unrel prompts.
  • Generation protocol: Native resolution is 1024×1024 for SDXL, Stable Diffusion 3.5, and FLUX.1, versus 1328×1328 for Qwen-Image.Resolution differences may affect fine-grained attribute rendering and extraction.
  • Generation protocol: A consistent photographic style descriptor is applied across models to encourage photorealistic imagery.
  • Audit pipeline: The schema-guided audit pipeline is documented as the implementation basis for structured attribute extraction.Its complete attribute schema is reported in Table 6.

C.1 Implementation Details

The audit pipeline uses a schema-constrained vision-language agent to convert generated images into structured attribute records and preserve reproducibility metadata.

  • Attribute extraction: GPT-5-mini, coordinated through CrewAI, extracts schema-constrained attributes for each image.Closed-vocabulary dimensions use predefined labels, while open-vocabulary dimensions receive short evidence-grounded descriptions.
  • Attribute extraction: Missing visual evidence is represented as unknown for scalar attributes or [] for list attributes.
  • Reproducibility: Each image record stores prompt-template and schema versions plus a vision-tool-response hash.Fixed agent configuration and schema support reproducible re-runs and consistent annotations across large batches.

D.1 Quantitative Validation

The quantitative validation constructs role–attribute prompts from dominant labels mined from the generated corpus, using explicit attributes as ground-truth references. Human annotation separately evaluates the harder setting where attributes are implied in contextual images.

  • Prompt construction: 220 role–attribute prompts were automatically constructed by inserting mined role and attribute labels into a fixed template.Examples include prompts specifying hair color, age, clothing, facial hair, or occupational accessories.
  • Prompt construction: Ten images were generated per prompt and model, producing 2,200 images for the explicit-attribute evaluation.Because each attribute was explicitly specified, it served as the ground-truth reference.

E.1 Cluster Bootstrap Analysis

The cluster-bootstrap analysis estimates uncertainty in role-level BI differences and shows that unrelated context generally increases pooled attribute concentration. This increase is concentrated in People, Objects, and Scene attributes, while camera effects vary by dimension and generator.

  • Bootstrap procedure: B = 1,000 role-level bootstrap replicates produced 95% percentile confidence intervals for pooled BI differences.Roles, rather than individual images, were resampled to match the unit of analysis.
  • Cohort-level differences: +0.045 pooled attribute concentration was observed when comparing unrelated context with context-free prompts.The estimate had a 95% CI of [0.030, 0.050] in the structurally matched CA-U−CF comparison.
  • Per-generator differences: Unrelated context increased concentration in the People, Objects, and Scene cohorts across all four generators.The Camera cohort was more heterogeneous, with negative or null shifts for SD 3.5 and SDXL and positive shifts for FLUX.1 and Qwen-Image.
  • Camera dimensions: +0.120 framing concentration and −0.154 depth_of_field concentration produced a near-zero pooled Camera shift of −0.003.Framing collapsed toward fewer dominant configurations, whereas depth of field became more varied under unrelated context.
  • Aggregation interpretation: Unrelated context made the benchmark-wide label distribution more concentrated while leaving each role’s own distribution no more concentrated than baseline.The two aggregation forms measure different quantities, with role-conditional estimates computed at matched support.
  • Role–label associations: Table 11 extends role–label associations with prevalence, stability, homogeneity statistics, and model-invariance indicators.The table reports pooled prevalence, χ2/p homogeneity tests, and models meeting the stated invariance criteria.
Loading 2608.29847v1…