Skip to main content
QUICK REVIEW

[Paper Review] ZigMa: A DiT-style Zigzag Mamba Diffusion Model

Vincent Tao Hu, Stefan Andreas Baumann|arXiv (Cornell University)|Mar 20, 2024
Cellular Automata and ApplicationsComputer Science4 citations
TL;DR

ZigMa proposes a DiT-style diffusion model that replaces attention mechanisms with a novel Zigzag Mamba block to improve spatial continuity in 2D and 3D visual generation. By reordering Mamba's scan path in a zigzag pattern, it achieves state-of-the-art FID scores on 1024×1024 FacesHQ and MS-COCO, outperforming Mamba-based baselines with zero parameter overhead and superior speed and memory efficiency.

ABSTRACT

The diffusion model has long been plagued by scalability and quadratic complexity issues, especially within transformer-based structures. In this study, we aim to leverage the long sequence modeling capability of a State-Space Model called Mamba to extend its applicability to visual data generation. Firstly, we identify a critical oversight in most current Mamba-based vision methods, namely the lack of consideration for spatial continuity in the scan scheme of Mamba. Secondly, building upon this insight, we introduce a simple, plug-and-play, zero-parameter method named Zigzag Mamba, which outperforms Mamba-based baselines and demonstrates improved speed and memory utilization compared to transformer-based baselines. Lastly, we integrate Zigzag Mamba with the Stochastic Interpolant framework to investigate the scalability of the model on large-resolution visual datasets, such as FacesHQ $1024 imes 1024$ and UCF101, MultiModal-CelebA-HQ, and MS COCO $256 imes 256$ . Code will be released at https://taohu.me/zigma/

Motivation & Objective

  • Address the lack of spatial continuity in existing Mamba-based vision methods, which typically use linear row- or column-wise scan orders.
  • Improve the inductive bias of Mamba blocks for 2D and 3D visual data by incorporating spatial continuity through a heuristic scan path.
  • Enable scalable, efficient, and high-fidelity image and video generation using Mamba-based architectures within the Stochastic Interpolant framework.
  • Demonstrate the feasibility and superiority of Mamba-based diffusion models on large-scale datasets like FacesHQ 1024×1024 and UCF101.
  • Explore the scalability of the Stochastic Interpolant framework beyond 256×256 resolution, including 1024×1024 and video generation.

Proposed method

  • Propose a Zigzag Mamba block that reorders the scan path of Mamba from linear to zigzag, preserving spatial locality and enhancing position awareness.
  • Introduce a plug-and-play, zero-parameter technique that applies the zigzag scan pattern across all layers without modifying the Mamba architecture.
  • Extend the 2D zigzag scan to 3D by factorizing spatial and temporal sequences, using a spatial-first scan scheme to exploit temporal redundancy.
  • Integrate the Zigzag Mamba block into a DiT-style diffusion model backbone, replacing attention mechanisms with Mamba blocks.
  • Train the model using the Stochastic Interpolant framework, enabling unified training across diffusion, flow matching, and normalizing flow objectives.
  • Use a latent diffusion setup with 2×2 patchified latents, enabling high-resolution generation at 1024×1024 with 4,096 tokens.
Figure 1 : Motivation. Our Zigzag Mamba method improves the network’s position-awareness by arranging and rearranging the scan path of Mamba in a heuristic manner.
Figure 1 : Motivation. Our Zigzag Mamba method improves the network’s position-awareness by arranging and rearranging the scan path of Mamba in a heuristic manner.

Experimental results

Research questions

  • RQ1How does the lack of spatial continuity in standard Mamba scan orders affect visual generation performance?
  • RQ2Can a simple, parameter-free scan reordering strategy like zigzag scanning significantly improve Mamba-based vision models?
  • RQ3To what extent can Zigzag Mamba scale to high-resolution image and video generation tasks such as 1024×1024 FacesHQ and UCF101?
  • RQ4Does the Stochastic Interpolant framework enable effective training of Mamba-based diffusion models at scale?
  • RQ5How does the factorization of 3D sequences into 2D and 1D zigzag scans impact video generation quality and efficiency?

Key findings

  • Zigzag Mamba achieves a FID score of 26.6 on FacesHQ 1024×1024 using 32 A100 GPUs, outperforming Bidirectional Mamba (51.1 FID) and demonstrating superior scalability.
  • On MS-COCO 256×256, the Zigzag-8 variant achieves a FID of 41.8, significantly outperforming Bidirectional Mamba (60.2 FID) and Zigzag-1 (73.1 FID).
  • On UCF101 video generation, the Factorized 3D Zigzag Mamba achieves a Frame-FID of 121.2 and FVD of 140.1 with 16 A100 GPUs, surpassing Bidirectional Mamba (146.2 Frame-FID, 201.1 FVD).
  • The method maintains high-quality sample fidelity across resolutions, as shown in visualizations on FacesHQ 1024×1024 and MultiModal-CelebA 512×512.
  • The ablation study confirms that amortizing multiple scanning schemes improves inductive bias incorporation and leads to consistent performance gains.
  • The model demonstrates improved memory and speed efficiency compared to transformer-based baselines, even at large resolutions.
Figure 2 : ZigMa. Our backbone is structured in L layers, mirroring the style of DiT [ 65 ] . We use the single-scan Mamba block as the primary reasoning module across different patches. To ensure the network is positionally aware, we’ve designed an arrange-rearrange scheme based on the single-scan
Figure 2 : ZigMa. Our backbone is structured in L layers, mirroring the style of DiT [ 65 ] . We use the single-scan Mamba block as the primary reasoning module across different patches. To ensure the network is positionally aware, we’ve designed an arrange-rearrange scheme based on the single-scan

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.