TL;DR
DPAR (Dynamic Patchification for Autoregressive models) introduces a method to dynamically group image tokens into variable-length patches based on visual information density. By leveraging next-token prediction entropy from a lightweight model, DPAR reduces token counts by up to $2\times$ and training FLOPs by up to 40.4% while simultaneously improving image generation quality (FID) by up to 29.6%.
What Problem Does This Paper Address?
Autoregressive (AR) decoder-only models have shown immense promise in image generation, offering a seamless path toward unified multimodal AI. However, they face a fundamental scalability bottleneck: they typically flatten 2D images into a 1D sequence of fixed-length tokens. This causes the token count to grow quadratically with image resolution. For example, moving from a $256\times256$ image to a $1024\times1024$ image results in a $16\times$ increase in token sequence length, severely straining the computational and memory limits of standard self-attention mechanisms.
While previous works have attempted token compression, they often rely on fixed-size merging. This static approach blindly compresses high-information regions, leading to severe detail loss and degraded image quality. DPAR aims to solve this by dynamically merging tokens based on local information content while preserving the essential 2D spatial structure.
Methods
DPAR introduces a novel framework that dynamically aggregates discrete 1D token sequences into variable-length patches. The architecture consists of four main components:
- Entropy Model: A lightweight, unsupervised, unconditional GPT-style AR model that computes the next-token prediction entropy for each token. Low entropy indicates predictable, homogeneous regions (like sky or flat walls), while high entropy indicates complex, high-information details.
- Patchification & Patch Encoder: Tokens are sequentially grouped into a patch as long as their entropy remains below a threshold ($H_{Th}$) and the patch doesn't exceed a maximum length ($P_{max}$). A lightweight encoder then compresses the tokens within each patch into a single patch representation using causal self-attention and cross-attention.
- Patch Transformer: A standard decoder-only transformer (based on the LLaMA architecture) that operates on the reduced sequence of variable-length patches. It utilizes a custom Dynamic RoPE mechanism to handle positional encodings for patches of varying lengths.
- Patch Decoder: A lightweight module that maps the predicted patch states back into individual token probabilities for final image reconstruction.
Datasets
The models were trained and evaluated on the standard ImageNet class-conditional image generation benchmark at two resolutions:
- ImageNet-256 ($256 \times 256$ pixels)
- ImageNet-384 ($384 \times 384$ pixels)
Key Insights and Ideas
- Entropy as an Information Proxy: The authors demonstrate for the first time that next-token prediction entropy from a tiny, unsupervised model serves as a highly reliable metric for visual complexity. This allows the model to automatically allocate more compute to high-detail regions and save compute on background elements.
- Stronger Global Representations: Interestingly, forcing the transformer to process variable-length patches acts as a powerful regularizer. Because a single patch must keep track of future tokens across shifting sequence lengths, the model learns superior global context. Linear probing of DPAR's hidden layers showed a $\sim5$ percentage point improvement in top-1 and top-5 image classification accuracy over standard token-based baselines.
- Inference-Time Flexibility: Training with dynamically sized patches makes the learned representations highly robust to patch boundaries. As a result, DPAR can scale to larger patch sizes during inference to achieve further efficiency gains without severe quality degradation.
Key Results
- Token & FLOP Reduction: DPAR achieves a $1.81\times$ reduction in token count for $256\times256$ images and a $2.06\times$ reduction for $384\times384$ images. This translates to a reduction of up to 40.4% in training FLOPs (for the DPAR-XL model).
- Quality Improvement: Despite using significantly fewer tokens, DPAR consistently outperforms the baseline LlamaGen model in image quality, improving the Frechet Inception Distance (FID) score by up to 29.6% on the Base model variant.
- Faster Convergence: DPAR exhibits faster convergence throughout the training process across all model sizes (Base, Large, XL).
Limitations and Future Work
- Raster-Order Constraint: The current implementation of DPAR is optimized for standard raster-order (left-to-right, top-to-bottom) token generation. While the authors note that the strategy is theoretically compatible with random-order generation methods, they leave this integration to future work.
- Inference Speedups: Although training costs are significantly reduced, maximizing inference-time speedups requires developing specialized KV-Cache strategies tailored to this unique variable-length patch encoder-decoder architecture.
Summary updated