MetaFormer is Actually What You Need for Vision
Weihao YuRomy Mi LuoPan ZhouChenyang SiYichen ZhouXinchao WangJiashi FengShuicheng Yan
Demonstrates that the general macro-architecture of Vision Transformers matters more than self-attention by showing that replacing attention with simple spatial pooling outperforms standard transformer and MLP baselines with significantly fewer parameters.
Recent advancements in computer vision have heavily favored transformer-based architectures, largely attributing their breakthrough performance to complex, attention-based token-mixing mechanisms. However, developing increasingly complex token mixers has made these models computationally demanding, raising critical questions about what architectural component actually drives their success. Understanding these core drivers is vital for organizations seeking to optimize high-performance vision models under tight computational and memory constraints.
The article demonstrates that the overall foundational structure—termed "MetaFormer"—is the primary driver of performance, rather than the specific, sophisticated token-mixing components. By abstracting the standard transformer architecture to isolate the underlying layout from the token-mixing operator, the article evaluates whether a model can achieve competitive visual recognition capabilities using only a minimal, non-parametric pooling function.
To test this hypothesis, the authors developed "PoolFormer," a model that adopts the MetaFormer architecture while replacing complex attention mechanisms entirely with simple spatial average pooling. The authors conducted extensive empirical evaluations across standard computer vision benchmarks, including ImageNet-1K for image classification (comprising approximately 1.3 million training images), COCO for object detection and instance segmentation, and ADE20K for semantic segmentation, training models using standard 300-epoch schedules and modern data augmentation techniques.
The findings show that PoolFormer consistently achieves state-of-the-art efficiency and performance. On ImageNet-1K, PoolFormer-M36 achieved 82.1% top-1 accuracy, outperforming the well-tuned DeiT-B transformer baseline by 0.3% and the ResMLP-B24 baseline by 1.1%, while requiring 35% to 52% fewer parameters and 50% to 62% fewer multiply-accumulate operations. When evaluated on downstream tasks such as object detection, instance segmentation, and semantic segmentation, PoolFormer backbones consistently exceeded the accuracy of established convolutional and transformer alternatives like ResNet and PVT. Furthermore, ablation experiments revealed that MetaFormer maintains competitive accuracy even when using basic identity mappings or static random matrices as token mixers, whereas removing residual connections or channel multi-layer perceptrons causes performance to collapse completely.
These results significantly alter the conventional understanding of vision transformers by showing that the overarching architecture provides the baseline competence, while specific token mixers offer incremental refinement. For industry practitioners, this insight means that high-accuracy vision systems can be deployed with significantly lower computational overhead, reducing hardware costs, memory footprint, and execution latency in production environments.
The article recommends that researchers and system designers shift their primary focus from inventing complex token-mixing layers toward optimizing the broader MetaFormer architecture and exploring hybrid models. For instance, combining pooling layers in early stages with attention mechanisms in later stages achieved 81.0% accuracy on ImageNet-1K using only 16.5 million parameters—about seven times fewer parameters than comparable multi-layer perceptron models. While these results establish high confidence across standard supervised image benchmarks, future work remains necessary to validate the architecture across self-supervised learning, natural language processing, and varied transfer learning environments.
- Paper: An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale, Alexey Dosovitskiy et al. (2021). It introduces the standard Vision Transformer backbone whose general macro-architecture MetaFormer analyzes and abstracts.
- Paper: MLP-Mixer: An all-MLP Architecture for Vision, I. Tolstikhin et al. (2021). It demonstrates that attention can be replaced with spatial MLPs, providing the key motivating observation that inspires MetaFormer's token-mixer hypothesis.
- Paper: Training data-efficient image transformers & distillation through attention, Hugo Touvron et al. (2021). It provides the DeiT baseline architecture and training strategies directly benchmarked and compared against PoolFormer.
- Paper: Swin Transformer: Hierarchical Vision Transformer using Shifted Windows, Ze Liu et al. (2021). It establishes the hierarchical multi-stage vision transformer design that MetaFormer adopts for structured vision backbones.
- Paper: Transformers in Vision: A Survey, Salman Khan et al. (2021). It offers a comprehensive survey of early vision transformer designs and components that provides essential context for MetaFormer's structural abstraction.
- Paper: A ConvNet for the 2020s, Zhuang Liu et al. (2022). It continues the exploration of modernizing macro-architectures without attention by applying transformer-style structural designs to pure ConvNets.
- Paper: ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders, Sanghyun Woo et al. (2023). It builds upon modern non-transformer structural backbones like ConvNeXt by integrating masked autoencoder pre-training and global response normalization.
