TL;DR
Sparse-LaViDa introduces a sparse parameterization framework for Masked Discrete Diffusion Models (MDMs) that dynamically truncates redundant masked tokens during inference, achieving up to a 2.8× speedup across image generation, editing, and reasoning tasks. Crucially, unlike prior acceleration methods, it maintains the bidirectional context essential for multimodal tasks while enabling KV-cache acceleration.
What Problem Does This Paper Address?
Masked Discrete Diffusion Models (MDMs) have become a powerful alternative to autoregressive (AR) models for unified multimodal tasks like text-to-image generation, image editing, and visual understanding. Unlike AR models that generate tokens sequentially from left to right, MDMs can predict tokens in any order and leverage bidirectional context, making them naturally suited for tasks like image inpainting.
However, MDMs suffer from a major efficiency bottleneck: dense parameterization. During inference, the model must repeatedly process the entire sequence—including hundreds of redundant [MASK] tokens—at every single diffusion step. Prior attempts to fix this, such as Block Diffusion, truncate these masked tokens but force a strict left-to-right generation order. This destroys the bidirectional context, rendering the model ineffective for non-sequential tasks like image editing and inpainting.
Methods
Sparse-LaViDa solves this efficiency-versus-flexibility dilemma through three key innovations:
- Sparse Parameterization of Masked Sequences: Masked tokens carry no substantive information other than their positions. Instead of materializing all masks, Sparse-LaViDa inputs only the prompt tokens, previously decoded tokens, and the specific subset of masked tokens to be decoded in the current step. The positions of the remaining masked tokens are implicitly determined by providing the total sequence length.
- Specialized Register Tokens: Aggressively truncating masked tokens reduces the model's capacity and degrades generation quality. To counteract this, the authors introduce a constant number (64) of special "register tokens" at the end of the sequence. These tokens serve as compact, learnable representations that recover lost modeling capacity and enhance fine-grained visual details.
- Step-Causal Attention Mask: To enable KV-caching during inference and maintain consistency during training, the authors design a step-causal attention mask. During training, the sequence is partitioned into blocks where clean tokens can only attend to previous blocks, and masked tokens can interact with clean tokens but not with masked tokens in other blocks. This faithfully simulates the incremental token caching behavior of inference without sacrificing bidirectional flexibility.
Datasets
The model is initialized from the state-of-the-art unified MDM, LaViDa-O (10.4B), and undergoes supervised fine-tuning (SFT) on a high-quality data mix:
- Image Understanding: MAmmoth-VL and VisualWebInstruct.
- Text-to-Image Generation: A 20-million image-text pair subset from LAION-2B, COYO-700M, SA-1B, JourneyDB, BLIP3o-60k, and ShareGPT4o-Image.
- Image Editing: GPT-Edit-1.5M.
Evaluation is conducted across several established benchmarks: GenEval, DPG-bench, and MJHQ-30k for text-to-image generation; ImgEdit for image editing; and MathVista, MME-C, MMMU, ChartQA, DocVQA, and MathVerse for image understanding and reasoning.
Key Insights and Ideas
- Masks are placeholders, not data: The fundamental realization is that explicitly processing
[MASK]tokens through self-attention layers is computationally wasteful. Tracking them implicitly via sequence length and position IDs unlocks massive computational savings. - The Capacity-Efficiency Tradeoff: Truncating tokens shortchanges the transformer's attention mechanism. The introduction of register tokens acts as a fixed-size buffer that preserves the model's expressive power without scaling up computational costs as the sequence grows.
- Order-Agnostic Caching: Standard KV-caching assumes a causal, left-to-right progression. Sparse-LaViDa proves that you can cache tokens out-of-order as long as the attention mask prevents newly decoded tokens from corrupting the historical cache of previously finalized tokens.
Key Results
Sparse-LaViDa achieves substantial end-to-end latency reductions across the board while matching or exceeding the generation quality of the baseline LaViDa-O model:
- Text-to-Image Generation: Achieves a 1.96× speedup, cutting latency from 21.27 seconds to 10.86 seconds per image on GenEval, while slightly improving overall alignment scores.
- Image Editing: Delivers a 2.83× speedup (22.55s vs. 63.98s) on the ImgEdit benchmark, outperforming state-of-the-art unified models like BAGEL.
- Visual Math Reasoning: Reaches a 2.80× speedup on MathVista while maintaining identical accuracy to the base model.
Qualitative evaluations confirm that Sparse-LaViDa successfully retains complex bidirectional capabilities like image inpainting/outpainting and parallel object grounding, which are impossible with traditional causal block-diffusion methods.
Limitations and Future Work
The primary limitation of Sparse-LaViDa is that it is not training-free. Transitioning from a dense MDM to a sparse parameterization requires an additional post-training or fine-tuning phase to adapt the model to the step-causal attention mask and register tokens.
Due to compute constraints, the authors evaluated Sparse-LaViDa purely in a post-training setup. They note that a promising future direction is to integrate this sparse parameterization directly into the pre-training phase of large discrete diffusion models from scratch, which could yield even higher efficiency and representation scaling.
Summary updated