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

Abstract

Modern text-to-image (T2I) diffusion models rely on massive text encoders like T5-XXL (11B parameters), which impose significant computational and memory overhead. This paper demonstrates that these encoders are over-engineered for visual tasks, containing substantial "non-visual" linguistic redundancy. We propose a vision-based knowledge distillation technique that leverages the diffusion model itself as a judge to train smaller student encoders. Our distilled T5-base (220M) model is 50x smaller than T5-XXL yet maintains comparable image quality and semantic alignment, reducing VRAM requirements from 11GB to 285MB and enabling faster inference.

Introduction

State-of-the-art T2I models such as FLUX and Stable Diffusion 3 utilize large-scale language models (LLMs) to interpret user prompts. However, these LLMs are typically pre-trained on general-purpose web crawls (e.g., C4) containing abstract concepts that lack direct visual counterparts. Consequently, much of the text encoder's parameter count serves as "dead weight" for image generation. This over-parameterization makes high-end T2I models inaccessible to users without professional-grade hardware. We address this by shrinking the text encoder while preserving its ability to guide complex visual synthesis.

Methodology: Vision-based Knowledge Distillation

Naive distillation, where a student model mimics the teacher's raw embeddings, often leads to mode collapse and a loss of semantic nuance. To avoid this, we introduce Vision-based Knowledge Distillation, which uses the diffusion process to evaluate embedding quality.

Overview of the Step-Following Training Scheme and Vision-based Knowledge Distillation Loss.

The training scheme consists of two main components:

  1. Step-Following Distillation: We feed embeddings from both a teacher (T5-XXL) and a student (e.g., T5-base) into a pretrained diffusion model (Flux.1-dev).
  2. Vision Loss: The student is optimized to produce embeddings that yield the same denoising predictions as the teacher's embeddings. This ensures the student captures the "visual" essence of the language.
  3. MLP Projector: A small Multi-Layer Perceptron maps the student's lower-dimensional embedding space to the teacher's space.

Experimental Setup

We curated a multi-stage dataset to instill specific capabilities:

  • Image Quality: 100,000 prompts from LAION-Aesthetics-6.5+.
  • Semantic Understanding: T2I-CompBench for attribute binding and spatial reasoning.
  • Text-Rendering: A new CommonText dataset (50,000 prompts) specifically designed to improve character-level precision in generated images.

Results and Discussion

Our approach achieves massive compression with minimal performance degradation. The distilled T5-base model (220M) is 50x smaller than the 11B teacher but retains high fidelity in image composition and style.

Performance metrics across different T5 model sizes. Note the sharp decline in text-rendering (CommonText) as model size decreases.

Key findings include:

  • Efficiency: Replacing T5-XXL with T5-base reduces the encoder's VRAM footprint from 11GB to 285MB, allowing the entire pipeline to run 2.7x faster on an A100 by avoiding CPU offloading.
  • Visual Robustness: General image quality (FID) and basic semantics (CLIP score) remain remarkably stable across scales.
  • Text-Rendering Sensitivity: Unlike general semantics, the ability to render accurate text in images is highly sensitive to encoder size. As shown in the metrics, performance on the CommonText benchmark drops significantly for the smallest models, indicating a scaling law for character-level precision.

Conclusion

By focusing distillation on the visual representations required by diffusion models, we can drastically reduce the resource requirements of T2I systems. While text-rendering remains a challenge for the smallest encoders, our vision-based distillation provides a path toward making state-of-the-art image generation accessible on consumer-grade hardware.

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