Abstract
Recent advancements in text-to-image (T2I) synthesis have enabled the generation of high-fidelity images, yet these models frequently struggle with semantic binding—the ability to correctly associate attributes with their corresponding objects. This paper introduces ToMe (Token Merging), a training-free framework designed to mitigate attribute leakage and improve compositional accuracy. ToMe leverages the semantic additivity of CLIP embeddings to merge object and attribute tokens into composite representations, utilizes End Token Substitution (ETS) to refine global signals, and employs a lightweight iterative optimization during the early stages of the diffusion process. Experimental results on T2I-CompBench and a novel GPT-4o-based benchmark demonstrate that ToMe significantly outperforms existing state-of-the-art methods in attribute binding without requiring model fine-tuning or complex layout planning.
Introduction
State-of-the-art diffusion models, such as SDXL and Midjourney, often exhibit a phenomenon known as "semantic binding failure." For instance, when prompted with "a cat in a red hat and a dog in a blue scarf," the model may inadvertently swap the colors or bleed the attributes across objects. This occurs because the cross-attention mechanism, which maps textual tokens to spatial regions, often produces overlapping or "leaky" attention maps.
Existing solutions typically rely on expensive fine-tuning or complex layout-based pipelines that require Large Language Models (LLMs) to generate bounding boxes. ToMe offers a more efficient alternative: a training-free, plug-and-play framework that ensures attributes remain tethered to their intended objects by modifying how the model perceives and optimizes text tokens.
Methodology
1. Token Merging (ToMe)
The core innovation of this work is the observation that CLIP text embeddings are semantically additive. By performing vector addition on an object token (e.g., "dog") and its attribute token (e.g., "hat"), the researchers create a single "composite token." This forces the diffusion model to utilize a unified cross-attention map for the pair, physically preventing the attribute from drifting toward unrelated objects in the scene.
2. End Token Substitution (ETS)
The [EOT] (End of Text) token in CLIP acts as a global descriptor, but in complex prompts, it often absorbs conflicting information from multiple entities, contributing to global attribute leakage. ToMe addresses this by replacing the [EOT] token of a complex prompt with one derived from a simplified version of the prompt. This "cleans" the global signal, ensuring that the overall image structure is not compromised by semantic confusion at the embedding level.
3. Iterative Composite Token Update
Recognizing that the spatial layout of a generated image is largely determined during the initial 20% of the diffusion process, ToMe applies a lightweight optimization during these early steps. This process utilizes two specific loss functions:
- Entropy Loss: Encourages attention maps to be sharp and localized, reducing blurriness and overlap.
- Semantic Binding Loss: Ensures the composite token maintains the semantic integrity of the original prompt by aligning its noise prediction with the full-sentence context.
Experimental Results
The effectiveness of ToMe was validated using two primary benchmarks:
- T2I-CompBench: A standard benchmark for compositional generation. ToMe achieved superior BLIP-VQA scores compared to SDXL, ELLA, and SynGen across color, texture, and shape categories.
- GPT-4o Object Binding Benchmark: The authors introduced a more rigorous test involving 50 complex prompts (e.g., "a [objectA] with a [itemA] and a [objectB] with a [itemB]"). Using GPT-4o as an automated judge, ToMe scored 0.95, nearly doubling the 0.49 score of the baseline SDXL model.
Furthermore, ToMe maintains high efficiency. By restricting optimization to the early denoising stages and avoiding LLM-based layout generation, it introduces minimal computational overhead compared to existing layout-guided methods.
Discussion and Limitations
ToMe demonstrates that the "intent" of tokens can be locked in early in the generation process to ensure structural accuracy. However, the method is not without limitations. Its performance is inherently tied to the capabilities of the base model (e.g., SDXL) and the CLIP text encoder. If the base model lacks the capability to render a specific concept, or if CLIP fails to capture a particular semantic nuance, ToMe cannot compensate for those fundamental deficiencies. Additionally, the framework relies on syntactic parsing (via SpaCy) to identify mergeable tokens; errors in parsing can lead to incorrect token compositions.
Conclusion
Token Merging (ToMe) provides a robust, training-free solution to the persistent problem of attribute leakage in T2I synthesis. By unifying object-attribute pairs into composite embeddings and refining the global attention signal, ToMe enables existing diffusion models to follow complex, multi-object instructions with significantly higher fidelity. Future research may explore extending this semantic binding approach to video generation and more sophisticated token fusion techniques.
Summary updated