Learning Stackable and Skippable LEGO Bricks for Efficient, Reconfigurable, and Variable-Resolution Diffusion Modeling

Huangjie Zheng, Zhendong Wang, Jianbo Yuan, Guanghan Ning, Pengcheng He, Quanzeng You, Hongxia Yang, Mingyuan Zhou

The Rigidity Bottleneck in Diffusion Models

Diffusion models are the current gold standard for photo-realistic image generation, but they are notoriously "heavy." They require massive computational resources for training and hundreds of iterative sampling steps to produce a single image.

A major bottleneck driving these costs is the rigidity of current network backbones. Standard architectures like the U-Net or the Diffusion Transformer (DiT) are fixed in their structure. If a model is trained on 256x256 images, it generally must sample at 256x256 using the exact same network depth. You cannot easily "shrink" the model at test-time to save power, nor can you seamlessly scale it to generate ultra-wide panoramas without significant artifacts or retraining.

To address this, researchers have introduced LEGO, a modular and reconfigurable network backbone that replaces rigid architectures. By stacking adaptable "bricks," LEGO enables faster training, reduces sampling time by up to 60%, and allows models to generate images at significantly higher resolutions than those used during training.

Enter the LEGO Brick: Modular and Reconfigurable

The core innovation of this framework is the LEGO brick, a fundamental unit designed to balance fine-grained detail with overall image coherence. Each brick integrates two main components:

  1. Local-feature Enrichment: Uses a Multi-Layer Perceptron (MLP) to process non-overlapping local patches. This step is computationally "light" and focuses on generating fine-grained details.
  2. Global-content Orchestration: Uses Transformer blocks (multi-head attention) to re-aggregate these local features into a coherent global structure.
Progressive refinement of an image through stacked LEGO bricks, demonstrating vertical spatial refinement from noise to a clear image.

Unlike a standard U-Net that relies on continuous downsampling and upsampling, LEGO maintains a consistent full-resolution image representation across all bricks. These bricks are stacked vertically, and the authors explore three primary configurations:

  • Progressive Growth (PG): Bricks move from processing small patches to larger ones.
  • Progressive Refinement (PR): Bricks move from large patches (global structure) to small ones (fine details).
  • LEGO-U: A hierarchical variant combining both approaches for optimal performance.

Crucially, because each brick is a self-contained unit with a consistent input/output interface, they can be selectively skipped during sampling. For example, when the image is mostly noise at the beginning of generation, the model can skip bricks focused on fine details. When the image is nearly finished, it can skip the computationally expensive global structure bricks.

Key Innovations and Insights

  • Vertical Spatial Refinement: While standard diffusion models refine an image over time (timesteps), LEGO adds a vertical dimension of refinement within each single timestep. Each brick in the stack progressively improves the spatial accuracy of the current prediction.
  • Training on Patches, Not Images: LEGO bricks can be trained on sampled patches rather than entire images. This drastically reduces the memory footprint and FLOPs required during training, leading to much faster convergence.
  • Test-Time Reconfigurability: Because the bricks are modular, users can choose the "depth" of the model at inference time. Skipping "image-level" bricks at certain timesteps results in a massive reduction in sampling time with negligible loss in image quality.
  • Resolution Independence: Because the bricks operate on patches and maintain a consistent interface, a model trained strictly on 256x256 patches can be "slid" across a much larger canvas to generate seamless, high-resolution panoramas (e.g., 2048x600).

Performance and Results

The model was rigorously evaluated on standard benchmarks including CelebA (64x64) and ImageNet (up to 512x512). The results demonstrate significant leaps in both efficiency and generation quality.

Performance comparisons showing LEGO's superior training efficiency (FID vs. Training hours) and inference efficiency (FID vs. GFLOPS) compared to baseline models.
  • Efficiency: The smaller LEGO-S variant achieved a lower Fréchet Inception Distance (FID)—indicating better image quality—than DiT-S on CelebA, while using 50% fewer FLOPs.
  • Speed: On ImageNet 256x256, LEGO's skippable architecture achieved a 60% reduction in sampling time compared to DiT, while maintaining the same number of functional evaluations (NFE).
  • State-of-the-Art Quality: The hierarchical LEGO-U variant achieved an impressive Inception Score (IS) of 338.08 on ImageNet 256, significantly outperforming established baselines like LDM and DiT.
  • Flexibility: The framework successfully generated stunning 2048x600 panoramas using a model that only ever saw 256x256 images during training, showcasing superior handling of spatial dependencies.

Looking Ahead: Limitations and Future Work

While LEGO presents a highly adaptable path forward for diffusion models, the authors note a few areas for future exploration. Currently, the decision of which bricks to skip at which timestep relies on predefined heuristics; developing a learned, automated skipping logic could further optimize inference. Additionally, generating images at resolutions vastly higher than the training data can sometimes lead to a loss in photorealism if the dataset lacks diversity. Finally, extending the LEGO architecture to handle complex text-to-image prompts (similar to Stable Diffusion) remains a highly promising, yet unexplored, next step.

Summary updated

BibTeX
@inproceedings{zheng2024learning,
  author = {Huangjie Zheng and Zhendong Wang and Jianbo Yuan and Guanghan Ning and Pengcheng He and Quanzeng You and Hongxia Yang and Mingyuan Zhou},
  title = {{Learning Stackable and Skippable LEGO Bricks for Efficient, Reconfigurable, and Variable-Resolution Diffusion Modeling}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=qmXedvwrT1},
}
Figure