NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Scaling Down Text Encoders of Text-to-Image Diffusion Models

Lifu Wang, Daqing Liu, Xinchen Liu, Xiaodong He · DOI

Introduction

Modern Text-to-Image (T2I) diffusion models, such as FLUX.1 and Stable Diffusion 3, have achieved unprecedented levels of realism and prompt adherence. Much of this success is attributed to the integration of massive Large Language Models (LLMs) like T5-XXL (11 billion parameters) as text encoders. However, these encoders introduce significant computational overhead, requiring substantial GPU memory and slowing inference speeds, often necessitating expensive hardware or slow CPU offloading for consumer use.

Researchers have recently challenged the necessity of these massive encoders, proposing that they are significantly over-parameterized for the specific task of image generation. By introducing a novel vision-based knowledge distillation technique, they have successfully distilled the 11B parameter T5-XXL into a T5-Base model that is 50 times smaller while maintaining comparable image quality.

The Redundancy Hypothesis

The core motivation for this work is the observation that T5 was originally trained on the C4 dataset, which contains a vast array of non-visual information, such as abstract philosophy and legal text. When a T2I model is prompted with abstract concepts like "Love is patient," it often fails to produce a meaningful visual representation because the diffusion model itself has not learned to map those abstract embeddings to pixels. This suggests that a large portion of the T5-XXL's embedding space is "dead weight" for visual tasks. The goal, therefore, is to extract only the "visual subset" of the LLM's knowledge.

Methodology: Vision-based Knowledge Distillation

Standard distillation techniques typically involve forcing a smaller "student" model to replicate the exact numerical embeddings of a "teacher" model. The authors found that this "naive" approach leads to mode collapse, where the student fails to distinguish between distinct concepts because it cannot perfectly replicate the teacher's high-dimensional space.

To solve this, they proposed using the diffusion model itself as the objective function. Instead of comparing text embeddings directly, the training process compares the noise predictions made by the diffusion model. If the student's embedding leads the diffusion model to the same prediction as the teacher's, the student is considered successful.

The proposed vision-based knowledge distillation and step-following training scheme.

Step-Following Training

To ensure the student understands the entire iterative generation process, the authors implemented a "step-following" scheme. This involves mimicking the teacher's sampling trajectory across multiple denoising steps. A Multi-Layer Perceptron (MLP) projector is used to map the smaller student's hidden states into the dimensions required by the diffusion model (e.g., FLUX.1-dev).

Datasets and Scaling Patterns

The distillation process utilized a curated dataset focusing on three pillars:

  1. Image Quality: 100,000 prompts from LAION-Aesthetics-6.5+.
  2. Semantic Understanding: 4,200 prompts from T2I-CompBench, focusing on spatial relationships and attribute binding.
  3. Text Rendering: A new specialized dataset, CommonText, consisting of 50,000 prompts designed to teach the model accurate spelling and typography.

Analysis of these models revealed a distinct scaling pattern: while general image quality and basic semantics are highly robust to model shrinking, text-rendering is extremely sensitive. As the encoder size decreases, the ability to render accurate text drops significantly faster than the ability to generate high-quality visual compositions.

Key Results and Impact

The distilled T5-Base (220M parameters) achieves performance nearly identical to the T5-XXL (11B parameters) across most benchmarks. The practical benefits of this compression are substantial:

  • Memory Efficiency: The text encoder's memory footprint is reduced from ~11GB to just 285MB.
  • Inference Speed: Total pipeline inference speed increased by 2.7x on an A100 GPU (without CPU offloading).
  • Accessibility: High-end models like FLUX can now run comfortably on consumer-grade GPUs (e.g., RTX 4090) without the performance penalties of offloading.
Qualitative comparison across model scales for image quality, semantics, and text rendering.

Conclusion

By shifting the focus from numerical mimicry to functional utility through the "eyes" of the diffusion model, this research demonstrates that we can drastically reduce the size of T2I models without sacrificing performance. While T5-XXL still maintains a slight edge in extremely complex reasoning, the distilled T5-Base offers a highly efficient alternative that democratizes access to state-of-the-art image generation.

Summary updated

BibTeX
@inproceedings{wang2025scaling,
  author = {Lifu Wang and Daqing Liu and Xinchen Liu and Xiaodong He},
  title = {{Scaling Down Text Encoders of Text-to-Image Diffusion Models}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2025},
  doi = {10.1109/cvpr52734.2025.01717},
}
Figure