Skip to main content
QUICK REVIEW

[论文解读] Lformer: Text-to-Image Generation with L-shape Block Parallel Decoding

Jiacheng Li, Longhui Wei|arXiv (Cornell University)|Mar 7, 2023
Generative Adversarial Networks and Image SynthesisComputer Science被引用 3
一句话总结

Lformer 提出了一种半自回归的文本到图像生成模型,通过并行解码图像标记的镜像 L 形块来加速推理,利用标记的二维结构在保持高生成质量的同时减少推理时间。该方法比自回归基线模型生成更快,并且无需微调即可实现零样本图像编辑。

ABSTRACT

Generative transformers have shown their superiority in synthesizing high-fidelity and high-resolution images, such as good diversity and training stability. However, they suffer from the problem of slow generation since they need to generate a long token sequence autoregressively. To better accelerate the generative transformers while keeping good generation quality, we propose Lformer, a semi-autoregressive text-to-image generation model. Lformer firstly encodes an image into $h{ imes}h$ discrete tokens, then divides these tokens into $h$ mirrored L-shape blocks from the top left to the bottom right and decodes the tokens in a block parallelly in each step. Lformer predicts the area adjacent to the previous context like autoregressive models thus it is more stable while accelerating. By leveraging the 2D structure of image tokens, Lformer achieves faster speed than the existing transformer-based methods while keeping good generation quality. Moreover, the pretrained Lformer can edit images without the requirement for finetuning. We can roll back to the early steps for regeneration or edit the image with a bounding box and a text prompt.

研究动机与目标

  • 为解决自回归生成变换器在文本到图像生成中的推理速度缓慢问题。
  • 在显著加速生成的同时,保持高图像质量和训练稳定性。
  • 通过利用可追踪的离散标记空间,实现无需微调的高效图像编辑和重生成。
  • 设计一种结合并行性与单向建模兼容性的解码策略,以提升训练和推理效率。

提出的方法

  • 该模型使用 VQ-VAE 将图像编码为 $ h \times h $ 的离散标记,然后从左上角到右下角将它们划分为 $ h $ 个镜像 L 形块。
  • 在每一步中,模型并行生成一个 L 形块内的所有标记,随着每一步推进,上下文扩展为更大的方形区域。
  • L 块的预测与当前上下文相邻,确保强局部一致性,并与教师强制和注意力缓存等单向技术兼容。
  • 该模型使用基于 Transformer 的解码器,仅关注当前上下文内先前生成的标记,确保类似自回归的稳定性。
  • 通过重新生成对应于感兴趣区域的特定 L 块来实现图像编辑,方法包括回退到早期步骤或用新文本提示替换标记。
  • 该方法支持无微调的无条件重绘和带边界框与文本提示的条件修复,无需微调。

实验结果

研究问题

  • RQ1L 形块并行解码是否能在保持高图像质量的同时,实现比自回归或非自回归方法更快的推理速度?
  • RQ2具有块级并行性的半自回归模型在保留生成多样性与图文对齐方面表现如何?
  • RQ3预训练的 Lformer 模型是否能无需微调即可执行如重绘和修复等图像编辑任务?
  • RQ4预训练数据规模对 Lformer 模型性能有何影响?

主要发现

  • 在 LAION90M 数据集上,Lformer 的 FID 得分为 15.01,IS 得分为 26.22,表现与基于 Transformer 的方法相当。
  • 在 MS-COCO 2014 数据集上,微调后的 Lformer 模型 FID 得分为 9.57,优于微调设置下的 CogView2 和 NUWA。
  • 该模型生成了高保真度、多样化且与文本对齐的图像,包括照片级真实感和艺术风格内容,如定性样本所示。
  • Lformer 支持零样本图像编辑:通过不同文本提示进行重绘,以及通过边界框进行修复,且无需任何微调。
  • 与自回归基线相比,该模型显著减少了生成时间,在 $ h \times h $ 标记生成中仅需 $ h $ 步即可完成。
  • Lformer 模型能够生成高质量的反事实图像,展示了在标记空间中强大的可控性和解耦表征能力。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。