Introduction
Recent advancements in text-to-image (T2I) synthesis, driven by models like DALL-E 2 and Stable Diffusion, have revolutionized digital content creation. These models generate high-fidelity images by mapping textual descriptions to visual concepts. However, because these models are trained on vast, uncurated datasets like LAION-5B, they often inherit and amplify societal biases. This research explores a subtle yet potent vulnerability: the use of homoglyphs to trigger latent cultural biases embedded within Unicode scripts.
The Homoglyph Vulnerability
Homoglyphs are characters that appear visually identical or nearly identical to the human eye but possess distinct Unicode representations. For example, the Latin letter "a" (U+0061) is visually indistinguishable from the Cyrillic "а" (U+0430). While a human reader perceives no difference, a T2I model's text encoder treats these as distinct tokens.
The researchers discovered that these models associate specific scripts with cultural characteristics. By replacing a single Latin character with a homoglyph from a non-Latin script, users can inadvertently—or intentionally—shift the model's output toward specific cultural aesthetics, settings, or stereotypes. This "script leakage" suggests that the models do not just process the semantic meaning of words, but also the cultural context associated with the script itself.
Identifying the Root Cause
Through qualitative and quantitative analysis, the authors isolated the text encoder as the primary source of this behavior. The encoder’s embedding space maps homoglyphs to different regions than their Latin counterparts. Because the training data (e.g., internet-scraped images and captions) often contains script-specific cultural contexts, the encoder learns these associations. Consequently, a prompt containing a Cyrillic homoglyph might nudge the generative process toward Eastern European visual styles, even if the prompt is written in English.
Mitigation: Homoglyph Unlearning
To address this, the authors propose a "homoglyph unlearning" method. This approach involves fine-tuning the text encoder to ensure that visually identical characters result in consistent embeddings. By forcing the model to "unlearn" the distinction between a Latin character and its homoglyphs, the researchers successfully neutralized the script-based bias. This method is more efficient than retraining the entire generative model, as it focuses specifically on the interpretation layer.
Results and Ethical Implications
The study demonstrated that even a single character swap is sufficient to significantly alter an image's cultural output. While this could be viewed as a "feature" for users seeking a simple way to customize imagery to reflect their own backgrounds, it presents a significant security risk. Malicious actors could use "unnoticed script attacks" to bypass safety filters or generate harmful stereotypes by subtly steering the model’s cultural output.
The proposed mitigation strategy proved effective in increasing the robustness of text encoders. After fine-tuning, the models were significantly less sensitive to homoglyph manipulations, providing a path toward more predictable and secure T2I systems.
Conclusion
The discovery of script-based cultural bias highlights the complexity of training models on global, uncurated data. As T2I models become more integrated into creative workflows, ensuring they are robust against subtle character manipulations is crucial. Future research may expand this investigation to entirely different scripts (such as Arabic or Kanji) and explore how service providers can implement proactive defense layers to normalize inputs before they reach the generative pipeline.
Reference: Struppek, L., Hintersdorf, D., Friedrich, F., Brack, M., Schramowski, P., & Kersting, K. (2023). Exploiting cultural biases via homoglyphs in text-to-image synthesis. J. Artif. Intell. Res., 78:1017–1068.
Summary updated