Pixelated Butterfly: Simple and Efficient Sparse training for Neural Network Models

Beidi Chen, Tri Dao, Kaizhao Liang, Jiaming Yang, Zhao Song, Atri Rudra, Christopher Re

Pixelated Butterfly (Pixelfly) is a hardware-efficient sparse training method that leverages a fixed, structured sparsity pattern to accelerate neural network training without sacrificing accuracy. By combining "flat block butterfly" matrices with low-rank components, Pixelfly achieves up to a 2.5× wall-clock speedup for models like Transformers and MLP-Mixers across tasks ranging from ImageNet classification to language modeling.

The Challenge of Sparse Training

While the overparameterization of modern neural networks aids in generalization, it incurs massive computational costs. Sparse training—utilizing only a fraction of the network's weights—offers a promising solution, yet it faces three major hurdles:

  1. Accuracy Loss: Finding a sparsity pattern that matches the performance of a dense model is notoriously difficult.
  2. Hardware Inefficiency: Most sparse methods rely on "unstructured" sparsity (randomly scattered non-zeros). Because modern hardware like GPUs is optimized for dense, block-based computations, unstructured sparsity often yields zero actual speedup despite reducing theoretical FLOPs.
  3. Limited Scope: Many existing techniques only sparsify specific architectural components (such as the Attention mechanism in Transformers), leaving massive Multi-Layer Perceptron (MLP) layers as the primary computational bottleneck.

Introducing Pixelated Butterfly (Pixelfly)

To overcome these limitations, the authors introduce Pixelfly, which relies on a fixed sparsity mask inspired by the mathematical structure of "butterfly" matrices (commonly used in Fast Fourier Transforms).

The method is built on several key innovations:

  • Block Butterfly: To make butterfly matrices hardware-friendly, the sparsity pattern is aligned with hardware blocks (e.g., 32x32). This ensures coalesced memory accesses, significantly improving GPU throughput.
  • Flat Butterfly: Standard butterfly matrices are defined as a product of many sparse factors, which is difficult to parallelize. Pixelfly uses a "flat" version—a first-order Taylor approximation that turns the product into a sum, making it much faster to compute on parallel hardware.
  • Low-Rank Addition: Because the "flat" approximation loses some expressiveness, the authors add a low-rank component ($UV^T$). This combination of sparse and low-rank matrices is theoretically proven to be highly expressive and capable of approximating dense layers effectively.
  • Fixed Mask Training: Unlike "lottery ticket" or pruning methods that require expensive search phases or dynamic mask updates, Pixelfly uses a simple, fixed mask from the very start of training.
Pixelfly combines flat block butterfly matrices with low-rank components to create efficient sparse masks for both Attention and MLP layers.

Key Insights

A central takeaway from the paper is that FLOPs can be misleading. Reducing the number of operations does not automatically lead to faster training. Hardware-aware "block" sparsity is essential to achieve real-world "wall-clock" speedups on current GPUs.

Furthermore, the authors use the Neural Tangent Kernel (NTK) to theoretically justify their design. They demonstrate that the Pixelfly sparsity pattern results in training dynamics that closely mirror dense models, far outperforming other common patterns like random sparsity or BigBird. Crucially, Pixelfly is universally applicable: it is applied to all GEMM-based layers, including the massive MLP blocks that often account for over 60% of a model's compute.

Performance and Results

Pixelfly was evaluated across several standard benchmarks, including computer vision (CIFAR, ImageNet), language modeling (WikiText-103), and long-context modeling (Long Range Arena).

  • Speed vs. Accuracy: On ImageNet, Pixelfly-based MLP-Mixers and Vision Transformers (ViT) achieved up to a 2.3× speedup with no drop in top-1 accuracy compared to dense baselines.
  • Language Modeling: Training GPT-2 Medium on WikiText-103 was 2.5× faster while maintaining the same perplexity as the dense model.
  • Long Sequences: On the Long Range Arena benchmark (handling up to 4096 tokens), Pixelfly was 5.2× faster than a standard dense Transformer and significantly faster than specialized sparse models like Reformer or BigBird.
Performance comparison of Mixer and ViT models showing Pixelfly achieves significant speedups while maintaining or exceeding baseline accuracy on CIFAR and ImageNet.

Limitations and Future Work

While highly effective, the "flat" butterfly is a first-order approximation. Although the low-rank term compensates for this, more sophisticated approximations might further improve accuracy for even higher sparsity levels. Additionally, as hardware evolves (e.g., with native support for 2:4 sparsity), the optimal block size and pattern might shift. Finally, while the fixed mask is simple and fast, combining Pixelfly with a dynamic block-sparse mask could potentially yield even better results, provided the overhead of updating the mask remains low.

Summary updated

BibTeX
@inproceedings{chen2022pixelated,
  author = {Beidi Chen and Tri Dao and Kaizhao Liang and Jiaming Yang and Zhao Song and Atri Rudra and Christopher Re},
  title = {{Pixelated Butterfly: Simple and Efficient Sparse training for Neural Network Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=Nfl-iXa-y7R},
}
Figure