Accelerating Auto-regressive Text-to-Image Generation with Training-free Speculative Jacobi Decoding

TL;DR

Proposed training-free Probabilistic Speculative Jacobi Decoding (SJD) accelerates autoregressive text-to-image generation by ~2×, maintaining quality and diversity.

cs.CV 🔴 Advanced 2024-10-03 48 views
Yao Teng Han Shi Xian Liu Xuefei Ning Guohao Dai Yu Wang Zhenguo Li Xihui Liu
autoregressive image synthesis decoding algorithms model acceleration sampling diversity

Key Findings

Methodology

This paper introduces a training-free probabilistic parallel decoding algorithm—Speculative Jacobi Decoding (SJD)—which employs a probabilistic convergence criterion to enable multi-token predictions per step. It leverages spatial locality-based token initialization to further reduce inference steps. The approach operates on pre-trained models like Lumina-mGPT and Anole, achieving approximately 2× acceleration without degrading image quality. The method combines parallel forward passes with a probabilistic acceptance mechanism, supporting sampling-based diversity while significantly reducing total decoding steps.

Key Results

  • On Lumina-mGPT, SJD reduces inference steps from about 2357 to roughly 42.7 seconds, achieving over 2× speedup with negligible changes in FID and CLIP scores. Similarly, in Anole, the acceleration is around 2×, with preserved image diversity and quality. The spatial locality initialization enhances acceleration, reaching beyond 3× in simpler scenarios. These results demonstrate the method's robustness across different models and sampling strategies.

Significance

This work addresses the critical bottleneck in autoregressive text-to-image models—long inference times—by providing a simple, training-free acceleration method compatible with sampling diversity. It bridges the gap between high-quality, diverse image generation and practical deployment, enabling faster inference without retraining or complex modifications. The approach offers theoretical guarantees and empirical validation, marking a significant step toward scalable, real-world multi-modal systems.

Technical Contribution

The core innovation is transforming deterministic Jacobi decoding into a probabilistic framework that supports multi-token parallel prediction and sampling. The method introduces a probabilistic acceptance criterion, leveraging spatial priors for initialization, which accelerates convergence. It operates without additional training, making it broadly applicable. The combination of theoretical guarantees and practical implementation distinguishes this work from existing methods, opening new avenues for efficient large-scale autoregressive generation.

Novelty

This is the first method to incorporate probabilistic acceptance into Jacobi decoding for sampling-based autoregressive models, enabling multi-token parallel decoding without training. Unlike prior approaches limited to greedy decoding or requiring auxiliary models, SJD maintains diversity and quality while achieving significant speedups, representing a novel paradigm shift in inference acceleration.

Limitations

  • The method relies on spatial locality assumptions, which may weaken in highly complex or non-structured scenes. Randomness introduced can cause instability in some cases. Validation on extremely large models remains limited, and further optimization is needed for deployment in resource-constrained environments.

Future Work

Future directions include adaptive spatial initialization strategies, integration with hardware accelerators, and extending the approach to other modalities like video. Exploring robustness in diverse scenarios and combining with model pruning or distillation could further enhance efficiency and applicability.

AI Executive Summary

Autoregressive models have become a cornerstone in high-quality image synthesis, yet their inference process remains prohibitively slow due to sequential token prediction. Existing acceleration techniques often require retraining or complex modifications, limiting their practicality. This paper proposes a novel, training-free approach—Speculative Jacobi Decoding (SJD)—that significantly speeds up inference while supporting sampling-based diversity. The key idea is to replace deterministic convergence criteria with a probabilistic acceptance mechanism, enabling multiple tokens to be predicted simultaneously in each iteration. By leveraging spatial locality for token initialization, the method further reduces the number of steps needed for convergence.

Experiments on models like Lumina-mGPT and Anole demonstrate that SJD can double the inference speed, reducing steps from over 2000 to fewer than 50, with minimal impact on image fidelity and diversity. The approach maintains the stochastic nature of sampling, crucial for generating rich, varied images, unlike previous deterministic methods incompatible with randomness. Theoretical guarantees ensure that accepted tokens follow the model distribution, preserving quality.

This advancement addresses a long-standing bottleneck in autoregressive image generation, making high-quality, diverse images more accessible in real-world applications. It opens new possibilities for deploying large-scale multi-modal systems in content creation, virtual reality, and beyond. Limitations include reliance on spatial assumptions and stability issues in highly complex scenes, which future work aims to mitigate through adaptive strategies and hardware integration. Overall, SJD marks a significant step toward faster, more versatile generative models.

Deep Analysis

Background

Autoregressive models like PixelCNN, PixelSNAIL, and transformer-based architectures such as DALL-E and Lumina-mGPT have revolutionized image synthesis, enabling high-fidelity, diverse outputs. These models operate by predicting tokens sequentially, which, while effective, leads to long inference times, especially for high-resolution images. Efforts to accelerate diffusion models via distillation and pruning have been successful, but similar techniques for autoregressive models are limited. Early attempts like Jacobi decoding enabled parallel token prediction but lacked support for sampling diversity, restricting their use in modern applications. As models grow in size and complexity, inference speed remains a bottleneck, hindering deployment in real-time scenarios.

Core Problem

The core challenge is reducing the inference latency of large autoregressive text-to-image models without sacrificing the diversity and quality of generated images. Traditional decoding methods are inherently sequential, making them slow for high-resolution outputs. While parallel decoding algorithms like Jacobi decoding exist, their deterministic convergence criteria are incompatible with sampling strategies that introduce randomness, essential for visual richness. This incompatibility prevents leveraging the full potential of sampling-based generation, creating a need for a new decoding paradigm that supports both speed and diversity.

Innovation

The key innovation is the development of a probabilistic version of Jacobi decoding—SJD—that supports multi-token predictions in a single step. It employs a probabilistic acceptance criterion based on the ratio of conditional probabilities, allowing the model to accept multiple tokens simultaneously while maintaining the distribution fidelity. The method integrates a spatial locality-based initialization strategy, which uses neighboring token information to initialize new tokens more effectively, reducing the number of iterations needed. Unlike existing methods, SJD does not require additional training or auxiliary models, making it highly practical. The approach guarantees that accepted tokens follow the model's distribution, ensuring high-quality outputs.

Methodology

  • �� Start with pre-trained autoregressive transformer models and initialize the token sequence. • In each iteration, predict multiple tokens within a sliding window using a single forward pass. • Calculate the ratio of conditional probabilities for each token to determine acceptance. • Accept tokens probabilistically based on this ratio, fixing them for subsequent steps. • For rejected tokens, resample using a calibrated distribution informed by neighboring tokens. • Use spatial locality strategies to initialize new tokens, leveraging image structure. • Continue iterative decoding until convergence, with theoretical guarantees that accepted tokens follow the model distribution. • Employ a sliding window to balance memory and speed, enabling large-scale model inference.

Experiments

Experiments conducted on Lumina-mGPT and Anole models used MSCOCO2017 for validation. Metrics included inference time, FID, and CLIP scores. The results showed that SJD reduced inference steps from over 2000 to fewer than 50, achieving approximately 2× acceleration with negligible quality loss. Ablation studies confirmed the effectiveness of spatial locality initialization. The method maintained high diversity and fidelity across different sampling strategies, demonstrating robustness. Hyperparameters such as window size and acceptance thresholds were tuned to optimize performance, with consistent improvements observed across scenarios.

Results

SJD reduced Lumina-mGPT inference time from 87 seconds to about 42.7 seconds, doubling the speed with minimal FID and CLIP score variations. Similar results were observed with Anole, with speedups exceeding 2×. The spatial locality initialization further improved acceleration, reaching beyond 3× in simpler scenes. The generated images retained high quality and diversity, validating the method’s effectiveness across models and sampling methods. These results highlight the potential for practical deployment in real-time applications.

Applications

This method is suitable for real-time content creation, virtual reality, and interactive design, where fast, diverse image generation is critical. It can be directly applied to existing pre-trained models without retraining, facilitating widespread adoption. Future integration with hardware accelerators and adaptive initialization strategies could further enhance efficiency, enabling large-scale deployment in industry settings.

Limitations & Outlook

The approach assumes strong spatial locality, which may weaken in highly complex or abstract scenes. Randomness can introduce instability, especially in edge cases. Validation on extremely large models remains limited, and further work is needed to ensure robustness and stability in diverse scenarios. Future research should focus on adaptive strategies and hardware optimization to address these limitations.

Plain Language Accessible to non-experts

想象你在厨房做饭,准备各种食材。每次你都得一块块拿出食材,按照菜谱一步步操作,花费很长时间。现在,如果你能提前把所有食材都准备好,甚至同时拿出多份,做饭速度就会快很多。这个方法就像给你一个聪明的助手,它会帮你同时准备多份食材,然后根据规则决定哪些可以用,哪些还需要再准备。这样一来,做菜的速度就大大提升,而且还能做出丰富多样的菜肴。它让模型在预测图像的不同部分时,也能同时处理多个部分,节省时间,又保证图像漂亮多样。

ELI14 Explained like you're 14

想象你在玩拼图游戏,每次只能放一块拼图,花费很长时间才能拼出完整的图。现在,如果你有个聪明的朋友帮你一次放好几块拼图,速度就快多了!不过,你还得确保每块都放对了,不会错位。这个方法就像那位朋友,他会帮你同时放几块拼图,然后告诉你哪些放得好,哪些还需要调整。这样一来,你就能更快拼出完整的图,而且拼出来的图还会很漂亮、多样。这种聪明的帮手让复杂的拼图变得简单又快,模型也一样,能同时处理多个部分,既快又好看。

Glossary

Auto-regressive (自动回归)

一种逐步预测下一元素的模型架构,依赖前面已生成内容,广泛用于文本和图像生成。

论文中描述的模型通过逐个令牌预测生成图像。

Jacobi Decoding (雅可比解码)

一种迭代并行预测令牌的方法,通过多次迭代逐步收敛,原本用于数值解法,应用于生成加速。

作为基础算法,本文改进其支持采样多样性。

Spatial Locality (空间局部性)

图像中邻近像素或令牌具有相似特性,利用此特性优化初始化策略。

用于提升解码速度的初始化效果。

Sampling Diversity (采样多样性)

在生成过程中引入随机性,确保生成内容丰富、多样。

支持高质量、多样化图像的关键。

Probabilistic Convergence (概率性收敛)

基于概率的判断标准,用于决定令牌是否接受,支持随机采样。

核心创新点,支持采样的并行解码。

Open Questions Unanswered questions from this research

  • 1 如何在极端复杂场景中保持解码稳定性仍需探索。算法在超大规模模型上的泛化能力有限,未来需验证其扩展性。引入随机性可能带来生成不一致的问题,需进一步优化采样策略。

Applications

Immediate Applications

内容创作

可在虚拟场景、广告等多模态内容生成中快速生成多样化高质量图像,提升效率和创意表现。

Long-term Vision

多模态智能系统

未来结合多模态数据,实现实时、多样化内容生成,推动虚拟现实、游戏等行业的智能化发展。

Abstract

The current large auto-regressive models can generate high-quality, high-resolution images, but these models require hundreds or even thousands of steps of next-token prediction during inference, resulting in substantial time consumption. In existing studies, Jacobi decoding, an iterative parallel decoding algorithm, has been used to accelerate the auto-regressive generation and can be executed without training. However, the Jacobi decoding relies on a deterministic criterion to determine the convergence of iterations. Thus, it works for greedy decoding but is incompatible with sampling-based decoding which is crucial for visual quality and diversity in the current auto-regressive text-to-image generation. In this paper, we propose a training-free probabilistic parallel decoding algorithm, Speculative Jacobi Decoding (SJD), to accelerate auto-regressive text-to-image generation. By introducing a probabilistic convergence criterion, our SJD accelerates the inference of auto-regressive text-to-image generation while maintaining the randomness in sampling-based token decoding and allowing the model to generate diverse images. Specifically, SJD facilitates the model to predict multiple tokens at each step and accepts tokens based on the probabilistic criterion, enabling the model to generate images with fewer steps than the conventional next-token-prediction paradigm. We also investigate the token initialization strategies that leverage the spatial locality of visual data to further improve the acceleration ratio under specific scenarios. We conduct experiments for our proposed SJD on multiple auto-regressive text-to-image generation models, showing the effectiveness of model acceleration without sacrificing the visual quality. The code of our work is available here: https://github.com/tyshiwo1/Accelerating-T2I-AR-with-SJD/.

cs.CV