Abstract
Current text-to-image models frequently fail to render legible text because their underlying text encoders are "character-blind." By replacing standard subword-based encoders with character-aware alternatives like ByT5, researchers have achieved significant improvements in visual spelling accuracy. This paper explores the transition from subword tokenization to character-level processing, demonstrating state-of-the-art performance in rendering text within generated images.
Introduction: The Spelling Problem in AI
Despite the impressive artistic capabilities of modern generative models like DALL-E 2 or Stable Diffusion, they are notoriously poor at spelling. A common failure mode occurs when a user requests a specific text string, such as a "Vintage postage stamp for California," only to receive an image containing "CALIFORONIA" or "CALIFORNA."
The root cause is identified as character-blindness. Most modern AI models utilize subword tokenization (e.g., Byte Pair Encoding). In this paradigm, a model does not perceive the individual letters "c-a-t" but instead sees a single numerical ID representing the concept of "cat." This lack of internal word structure makes it difficult for the model to translate abstract concepts into precise visual glyphs.
Methods: Moving to Character-Awareness
To address this, researchers investigated the impact of character-aware text encoders. The study compared three primary architectures:
- Character-Blind (Standard): Models like T5 that use subword tokens.
- Character-Aware: Models like ByT5 that operate directly on UTF-8 bytes, effectively "seeing" every character.
- Concat (Hybrid) Model: A combination of a large character-blind encoder (T5-XXL) for semantic depth and a small character-aware encoder (ByT5-Small) for spelling precision.
These encoders were integrated into the Imagen architecture and trained on the LAION-400M dataset to isolate the effect of the text encoder on spelling performance.
Benchmarking Visual Text
The research introduced two new benchmarks to evaluate these models:
- WikiSpell: A text-only benchmark for spelling words from Wiktionary across seven languages, categorized by frequency to test generalization beyond memorization.
- DrawText: A visual benchmark consisting of 500 prompts for simple signs (DrawText Spelling) and 175 stylistically challenging prompts (DrawText Creative).
Key Insights
- The "Spelling Miracle" at Scale: Massive character-blind models (e.g., PaLM 540B) can eventually learn to spell through sheer scale, but this requires hundreds of billions of parameters and does not generalize well to non-English languages.
- Efficiency of Character-Awareness: A small character-aware model (ByT5-Base) can outperform a much larger character-blind model (T5-XXL) in spelling tasks.
- The Semantic Trade-off: While pure character-level models excel at spelling, they can sometimes lose "image-text alignment," occasionally omitting other requested objects in a prompt.
- The Hybrid Solution: The "Concat" model emerged as the optimal solution, retaining high-level semantic understanding while gaining precise spelling abilities.
Results and Performance
On the WikiSpell benchmark, character-aware models achieved nearly 100% accuracy across all languages and word frequencies. In visual rendering tasks (DrawText), these models outperformed the baseline Imagen-AR by over 15 points on frequent words and 30 points on rare words. Human preference studies confirmed that the hybrid "Concat" model was superior in image fidelity, prompt alignment, and text accuracy.
Limitations and Future Directions
While character-aware encoders solve the "spelling" part of the problem, the image generator still occasionally makes layout errors, such as repeating or merging letters. This suggests that the diffusion module itself requires further refinement in spatial positioning. Additionally, rendering non-Latin scripts remains a challenge due to the English-centric nature of current training datasets like LAION. Future work will focus on improving multilingual visual rendering and optimizing the inference costs associated with longer character-level sequences.
Summary updated