提出新型图像生成方法HMAR,速度更快、内存更低且可灵活调整采样策略。
HMAR: Efficient Hierarchical Masked Auto-Regressive Image Generation
- 分层掩码预测:每层只依赖前一层,减少计算冗余
- 多步掩码生成:每步只生成部分像素,提升推理效率
- 无需重训即可改采样流程,适合图像编辑等任务
视觉自回归建模(VAR)通过将图像分解为逐级分辨率来弥合自回归模型与扩散模型在速度和质量间的差距。但现有方法存在图像质量下降、序列长度随分辨率超线性增长、采样调度需重训练等问题。本文提出分层掩码自回归模型(HMAR),采用仅依赖前一尺度的马尔可夫化预测机制,并引入可控多步掩码生成过程,逐步生成当前分辨率中的部分像素。在ImageNet 256x256与512x512基准上,HMAR模型在参数相当条件下超越或匹配VAR、扩散模型及自回归基线。通过设计高效的输入输出感知块稀疏注意力核,训练与推理速度分别提升2.5倍和1.75倍,推理内存降低3倍以上。此外,HMAR支持零样本图像编辑,采样调度无需再训练,灵活性显著增强。
原文摘要 · Abstract (English)
Visual Auto-Regressive modeling (VAR) has shown promise in bridging the speed and quality gap between autoregressive image models and diffusion models. VAR reformulates autoregressive modeling by decomposing an image into successive resolution scales. During inference, an image is generated by predicting all the tokens in the next (higher-resolution) scale, conditioned on all tokens in all previous (lower-resolution) scales. However, this formulation suffers from reduced image quality due to the parallel generation of all tokens in a resolution scale; has sequence lengths scaling superlinearly in image resolution; and requires retraining to change the sampling schedule. We introduce Hierarchical Masked Auto-Regressive modeling (HMAR), a new image generation algorithm that alleviates these issues using next-scale prediction and masked prediction to generate high-quality images with fast sampling. HMAR reformulates next-scale prediction as a Markovian process, wherein the prediction of each resolution scale is conditioned only on tokens in its immediate predecessor instead of the tokens in all predecessor resolutions. When predicting a resolution scale, HMAR uses a controllable multi-step masked generation procedure to generate a subset of the tokens in each step. On ImageNet 256x256 and 512x512 benchmarks, HMAR models match or outperform parameter-matched VAR, diffusion, and autoregressive baselines. We develop efficient IO-aware block-sparse attention kernels that allow HMAR to achieve faster training and inference times over VAR by over 2.5x and 1.75x respectively, as well as over 3x lower inference memory footprint. Finally, HMAR yields additional flexibility over VAR; its sampling schedule can be changed without further training, and it can be applied to image editing tasks in a zero-shot manner.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。