Skip to main content
QUICK REVIEW

[Paper 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 Science3 citations
TL;DR

Lformer proposes a semi-autoregressive text-to-image generation model that accelerates inference by decoding image tokens in mirrored L-shape blocks in parallel, leveraging the 2D structure of tokens to maintain high generation quality while reducing inference time. It achieves faster generation than autoregressive baselines and enables zero-shot image editing without fine-tuning.

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.

Motivation & Objective

  • To address the slow inference speed of autoregressive generative transformers in text-to-image generation.
  • To maintain high image quality and training stability while significantly accelerating generation.
  • To enable efficient image editing and regeneration without fine-tuning by leveraging the trackable, discrete token space.
  • To design a decoding strategy that combines parallelism with unidirectional modeling compatibility for better training and inference efficiency.

Proposed method

  • The model encodes images into $ h \times h $ discrete tokens using a VQ-VAE, then divides them into $ h $ mirrored L-shape blocks from top-left to bottom-right.
  • In each step, the model generates all tokens within one L-shape block in parallel, expanding the context to a larger square with each step.
  • The L-block prediction is adjacent to the current context, ensuring strong local coherence and compatibility with unidirectional techniques like teacher forcing and attention caching.
  • The model uses a transformer-based decoder that attends only to previously generated tokens within the current context, ensuring autoregressive-like stability.
  • Image editing is enabled by regenerating specific L-blocks corresponding to a region of interest, either by rolling back to an earlier step or by replacing tokens with a new text prompt.
  • The method supports both unconditional repainting and conditional inpainting with bounding boxes and text prompts, without requiring fine-tuning.

Experimental results

Research questions

  • RQ1Can L-shape block parallel decoding achieve faster inference speed than autoregressive or non-autoregressive methods while maintaining high image quality?
  • RQ2How well can a semi-autoregressive model with block-level parallelism preserve generation diversity and text-image alignment?
  • RQ3Can a pretrained Lformer model perform image editing tasks such as repainting and inpainting without fine-tuning?
  • RQ4What is the impact of pre-training data scale on the performance of the Lformer model?

Key findings

  • Lformer achieves an FID score of 15.01 and IS of 26.22 on the LAION90M dataset, which is competitive among transformer-based methods.
  • On MS-COCO 2014, the finetuned Lformer achieves a FID score of 9.57, outperforming CogView2 and NUWA in the fine-tuned setting.
  • The model generates high-fidelity, diverse, and text-aligned images, including photorealistic and artistic content, as shown in qualitative samples.
  • Lformer enables zero-shot image editing: repainting with different text prompts and inpainting with bounding boxes, without any fine-tuning.
  • The model reduces generation time significantly compared to autoregressive baselines, achieving faster inference with only $ h $ steps for $ h \times h $ token generation.
  • The Lformer model can generate counterfactual images with good quality, demonstrating strong controllability and disentangled representation in the token space.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.