- The paper introduces learnable global merging, a novel method for variable-length tokenization in diffusion transformers that adapts compression by merging similar latent tokens instead of truncating them.
- Empirical results demonstrate superior generative alignment and image quality across various compression ratios, significantly outperforming methods like nested dropout.
- The approach employs position-specific learnable embeddings and a dedicated alignment loss, ensuring consistent reconstruction quality and efficient performance in image synthesis.
The paper "Variable-Length Tokenization via Learnable Global Merging for Diffusion Transformers" (2606.20076) addresses a fundamental limitation in latent diffusion pipelines for image synthesis: the inflexibility imposed by fixed-length tokenization, which limits adaptive control over quality-compute trade-offs. Conventional latent diffusion models depend on a tokenizer with a fixed compression ratio, requiring separate models for varying computational budgets and target fidelities. Variable-length tokenizers (VLTs) promise adaptive compression, but prevalent methods (notably nested dropout) introduce representational misalignment across token lengths due to positional semantic driftโearly tokens encode higher-level semantics while tail truncation drops low-level detail, resulting in length-dependent shifts in latent distributions.
Learnable Global Merging: Methodological Innovations
To overcome these representational alignment issues, the authors introduce a merging-based variable-length tokenizer. Length modulation is achieved by merging similar latent tokens rather than truncating ordered sequences. The merging operation is guided via learnable global embeddings, yielding a data-independent merging pattern. This allows direct alignment of latent representations across token lengths, as each reduced-length latent can be projected to a full-length equivalent via the merging pattern, facilitating standard alignment losses over matched cardinalities.
The merging pattern is constructed using position-specific learnable embeddings, optimized via a straight-through estimator over agglomerative clustering assignments. A dedicated alignment loss encourages the embeddings to reflect latent token-wise similarity (i.e., token pairs with high cosine similarity are assigned to the same cluster). The resulting assignment matrix enables consistent proportional attention and positional embedding merges within the diffusion transformer, ensuring compatibility during both training and generation.
Figure 1: Overview of the methodโlength modulation via learnable global merging is performed image-agnostically but optimized for alignment and tokenization.
Empirical Evaluation and Numerical Results
Experiments are conducted on class-conditional ImageNet generation at 256ร256 and 512ร512 resolutions using a SoftVQ-based 1D tokenizer and LightningDiT transformer backbone. The merging-based VLT achieves substantially higher representational alignment across token lengths relative to nested dropout, as measured by Centered Kernel Nearest-Neighbor Alignment (CKNNA).
Figure 2: CKNNA between encoded tokens with different token counts reveals consistently high cross-length alignment for learnable global merging versus nested dropout.
The generation quality, evaluated using conditional Frรฉchet Inception Distance (gFID), demonstrates minimal deterioration under joint training for all token lengths, contrasting sharply with nested dropout where joint training introduces a 0.8โ1.7 gFID gap. Using LoRA fine-tuning per length further narrows the performance gap, with gFID improving to within 0.05 of separately trained models.
Figure 3: Image generation results under different FLOPs, highlighting superior gFID-compute trade-offs for merging-based VLT.
System-level comparisons show the proposed method outperforms prior VLT baselines (Semanticist, FlexTok) and fixed-length strategies across all CRs, using fewer parameters and without necessitating complex diffusion-based decoder architectures. The method achieves rFID, PSNR, and SSIM metrics that are competitive or superior at high compression ratios.
Figure 4: Reconstruction quality (rFID, PSNR, SSIM) across token lengthsโmerging-based VLT excels, especially under aggressive compression.
Ablations and Analytical Observations
Ablation studies isolate the contributions of global merging, learnable embeddings, and alignment loss. Data-dependent merging without global mergingโakin to ToMeโyields significantly worse gFID, underlining the need for consistency in positional and attention mechanisms within the transformer. Learnable embeddings and alignment loss robustly enhance both generation and reconstruction quality.
Token similarity analyses confirm that global merging effectively groups similar tokens, with merged pairs exhibiting substantially higher average cosine similarity than the all-pair average.
Figure 5: Comparison of reconstruction between LGM (learnable global merging) and ToMe-style mergingโLGM sacrifices little reconstruction quality but attains much better generative alignment.
Qualitative Generation and Scalability
Qualitative samples illustrate high visual coherence on ImageNet at token lengths as low as 32.
Figure 6: Generated class-conditional images on ImageNet 256ร256 with LightningDiT-XL (+LoRA) at token length 32.
Scalability experiments at 512ร512 resolution confirm that merging-based VLT maintains superior alignment and reconstruction under increased image size and compression. gFID at 32 tokens improves by 1.66 compared to nested dropout.
Figure 7: Reconstruction quality at 512ร512 resolution remains robust for merging-based VLT.
Figure 8: Cross-length representational alignment at 512ร512 resolution remains high for merging-based VLT.
Practical and Theoretical Implications
The learnable global merging paradigm fundamentally improves the compatibility of variable-length tokenization with latent diffusion models. This enables a single diffusion transformer to effectively operate over a spectrum of token counts, facilitating adaptive deployment in resource-constrained and high-fidelity settings. The technique aligns well with recent advances in representation alignment [repa, reg] and transformer attention mechanisms [tome]. The approach is extensible to hybrid architectures and multi-modal generative pipelines where efficient length modulation is desirable. Theoretically, it suggests a new direction for designing latent spaces with consistent inter-sample similarity structure under variable cardinality.
Conclusion
The paper realizes a practical and theoretically sound solution for variable-length tokenization in diffusion transformers by introducing learnable global merging, which enforces representational alignment and ensures generative compatibility across token counts. Empirical results on large-scale benchmarks demonstrate improvements in both quality-compute trade-offs and representational consistency compared to established VLTs. The method's implementation is efficient, and its conceptual framework offers promising avenues for future research in scalable generative modeling and adaptive compression mechanisms in vision-language systems.