TL;DR
The paper introduces T2MD (Transformer-to-Mamba Distillation), a novel training pipeline that distills a pre-trained Diffusion Transformer (DiT) into an efficient, linear-complexity hybrid Mamba model. By using layer-level teacher forcing to bridge the architectural gap between non-causal attention and causal state-space models, T2MD achieves high-quality text-to-image generation up to 4K resolution while delivering up to a 2.1× inference speedup.
What Problem Does This Paper Address?
Diffusion Transformers (DiTs) have become the gold standard backbone for generative image models. However, they suffer from a major scalability bottleneck: the self-attention mechanism scales quadratically ($O(N^2)$) with the number of image tokens. This makes generating high-resolution images (such as 2K or 4K) exceptionally computationally expensive.
State-Space Models (SSMs) like Mamba offer a promising alternative due to their linear complexity ($O(N)$). Unfortunately, training Mamba-based diffusion models from scratch is notoriously difficult because they struggle to converge. Furthermore, it has been an open question whether Mamba’s sequential, causal nature can effectively capture the non-causal, multi-directional spatial dependencies inherent in images. Consequently, prior Mamba-based diffusion models have been capped at a 512×512 resolution.
Methods
The authors propose a multi-stage framework to transfer knowledge from a dense DiT teacher (PixArt-$\alpha$) to a hybrid Mamba student model, bypassing the need for expensive training from scratch.
- Hybrid Architecture: The student model features 28 blocks consisting of 86% Mamba blocks (Mamba 2) and 14% self-attention blocks. This hybrid approach preserves global context anchoring while maintaining linear-complexity scaling. To handle 2D images sequentially, it employs a bidirectional scanning strategy (interleaved width-first and height-first scans).
- Layer-Level Teacher Forcing: Distilling a non-causal transformer into a causal Mamba model typically suffers from severe error accumulation across layers. To mitigate this, the authors inject intermediate outputs from the teacher's self-attention layers directly as "pseudo-ground-truth" inputs for each corresponding student layer during the initial training phase.
- Knowledge Distillation: The token mixers are optimized using a joint loss function that combines standard diffusion MSE, a pseudo-loss against teacher soft labels, and a feature-matching token mixer loss.
- Model Adaptation & Fine-Tuning: To push past the teacher's 512×512 resolution limit, the authors replace the original VAE with SDXL’s VAE and update the positional encodings. This is followed by progressive high-resolution fine-tuning up to 2048×2048.
Datasets
- Training: A large-scale dataset comprising 200 million image-text pairs.
- Evaluation:
- GenEval: A benchmark focusing on compositional text-to-image alignment (e.g., attribute binding, counting, and position).
- MS-COCO 2014 validation set: Used to evaluate zero-shot image quality via Frechet Inception Distance (FID-30K).
Key Insights and Ideas
- Causal Models Can Model Spatial Data: The paper successfully demonstrates that sequential, causal SSMs can model long-range, non-causal spatial dependencies in large images, provided they use bidirectional scanning and are guided by structural distillation.
- Teacher Forcing Prevents the Snowball Effect: Standard distillation fails across fundamentally different architectures because minor early-layer deviations compound deeply. Forcing layer-wise input alignment stabilizes the student's representation learning.
- A Little Attention Goes a Long Way: Incorporating just a small fraction of self-attention blocks (14%) provides the necessary global context to match transformer quality without sacrificing Mamba's computational efficiency.
Key Results
- Generation Quality: T2MD achieves a GenEval score of 0.485, significantly outperforming a baseline hybrid Mamba trained from scratch (0.301) and effectively matching the teacher PixArt-$\alpha$ model (0.481).
- Zero-Shot FID: On MS-COCO, T2MD scores an FID-30k of 8.63, outperforming other linear-complexity distillation methods like LinFusion (12.57) and standard diffusion models like SDv1.5 (9.62).
- Inference Speedups: T2MD is 1.5× faster than the baseline DiT at 2048×2048 resolution and achieves a 2.1× speedup in latency for zero-shot 4K (3840×2160) image generation. It represents the first SSM-based model to successfully generate images beyond 2K resolution.
Limitations and Future Work
Although T2MD successfully bridges the architectural divide, the underlying formulation mismatch between sequential causal Mamba and non-causal vision tasks still warrants deeper theoretical exploration. Additionally, because the pipeline relies heavily on a pre-trained DiT teacher to bootstrap the student model, the initial performance ceiling of the base model remains tied to the quality of the chosen teacher before the high-resolution fine-tuning stage begins.
Summary updated