Abstract
Text-to-image (T2I) models like Stable Diffusion and DALL-E 2 are known to inherit deep-seated cultural biases from their massive, uncurated training datasets. This paper identifies a novel vulnerability where visually identical characters from different Unicode scripts—known as homoglyphs—trigger these latent biases. We demonstrate that substituting a single Latin character with a non-Latin counterpart can radically alter the cultural context of generated images, shifting ethnicity, attire, and architecture toward stereotypical motifs. To mitigate this, we propose "homoglyph unlearning," a fine-tuning method for text encoders that ensures consistent and culturally neutral outputs regardless of the script used.
Introduction
The rapid advancement of generative AI has revolutionized content creation, yet these models remain susceptible to the biases present in their training data. While explicit prompts for stereotypical content are often blocked by safety filters, subtle triggers can still bypass these mechanisms. This research explores a specific, nearly invisible trigger: the Unicode script of the input text. By exploiting the way text encoders process different scripts, the authors show how stereotypical imagery can be intentionally or accidentally invoked.
The Homoglyph Vulnerability
Homoglyphs are characters that appear identical to the human eye but are represented by different code points in the Unicode standard. For example, the Latin "a" and the Cyrillic "а" are visually indistinguishable in most fonts. However, T2I models do not process pixels; they process numerical tokens.
The authors find that these script differences serve as proxies for cultural subsets of the training data. Even when a prompt is written in English, the inclusion of a single non-Latin homoglyph can act as a "shortcut" that forces the model to prioritize specific cultural aesthetics. For instance, a Cyrillic homoglyph may steer the diffusion process toward Eastern European imagery, while a Greek homoglyph might trigger Mediterranean motifs.
Identifying the Root Cause
Through qualitative and quantitative analysis of industry-standard models, the researchers pinpointed the text encoder (typically a CLIP-based model) as the primary source of the bias. The encoder treats different Unicode blocks as distinct signals, associating specific scripts with the cultural characteristics prevalent in the corresponding subsets of the training data. This allows for "invisible attacks" where a prompt looks normal to a human moderator but triggers biased or stereotypical output from the model.
Methodology: Homoglyph Unlearning
To address this vulnerability, the paper introduces a novel fine-tuning technique called "homoglyph unlearning." This approach teaches the text encoder to ignore script-specific distinctions for homoglyphs by aligning their numerical embeddings. By forcing the encoder to produce the same vector for a word regardless of its script composition, the downstream diffusion model becomes indifferent to the specific Unicode characters used. This method is computationally efficient, as it only requires fine-tuning the text encoder rather than retraining the entire diffusion model.
Key Results
The researchers successfully demonstrated that inserting single non-Latin characters is sufficient to trigger significant cultural shifts in generated images. However, after applying the homoglyph unlearning method, the models produced consistent results across all script variations. This suggests that the vulnerability can be effectively mitigated, preventing the use of homoglyphs to bypass safety filters or generate unintended stereotypes.
Conclusion and Future Work
This work highlights the critical importance of considering low-level text representations in AI safety. Homoglyph-based attacks represent a stealthy way to manipulate model output, but they can be neutralized through targeted unlearning strategies. Future research should investigate whether similar vulnerabilities exist in other modalities, such as large language models (LLMs), and expand unlearning techniques to cover a broader array of Unicode characters and scripts.
Summary updated