TL;DR
This paper explores the fundamental capabilities of the MetaFormer architecture, demonstrating that it achieves strong performance even with the simplest "token mixers" like identity mapping. By leveraging conventional convolutional and attention mechanisms, MetaFormer models achieve state-of-the-art results, suggesting the architecture itself is a key driver of performance, not just the complex token mixing components.
What Problem Does This Paper Address?
The success of Vision Transformers (ViTs) has largely been attributed to their attention mechanisms, leading to a proliferation of complex "token mixer" designs. However, recent research has shown that simpler operators can also yield competitive performance within Transformer-like architectures. This paper addresses the question of whether the underlying MetaFormer architecture, a generalized Transformer framework, is the primary factor behind these successes, rather than the specific, often intricate, token mixer designs. The authors aim to understand MetaFormer's inherent capacity by systematically evaluating it with basic and established token mixers.
Methods
The core of this work is the instantiation of MetaFormer models with various token mixers:
- IdentityFormer: Uses identity mapping as the token mixer, essentially passing tokens through without modification. This serves as a baseline to establish the lower bound of MetaFormer's performance.
- RandFormer: Employs a random matrix for token mixing. This tests MetaFormer's robustness and universality with arbitrary mixing operations.
- ConvFormer: Utilizes depthwise separable convolutions (a common CNN component) as the token mixer. This allows for a direct comparison with pure CNN architectures.
- CAFormer: Combines depthwise separable convolutions in the early stages with vanilla self-attention in the later stages. This hybrid approach aims to leverage the strengths of both local and global feature extraction.
Additionally, the paper introduces StarReLU, a novel activation function that aims to reduce computational cost (FLOPs) while maintaining or improving performance compared to GELU.
Datasets
The primary dataset used for training and evaluation is ImageNet-1K. For some models (ConvFormer and CAFormer), pre-training was also performed on the larger ImageNet-21K dataset, followed by fine-tuning on ImageNet-1K.
Key Insights and Ideas
- MetaFormer's Solid Lower Bound: Even with identity mapping (no actual mixing), MetaFormer achieves surprisingly high accuracy, indicating the architecture itself provides a strong foundation.
- Universality of Token Mixers: MetaFormer performs well with arbitrary token mixers, including random matrices, highlighting its flexibility and robustness.
- Simplicity Can Be State-of-the-Art: By using conventional, older token mixers (depthwise separable convolutions and vanilla self-attention), MetaFormer models can outperform recent, complex architectures.
- StarReLU's Efficiency: The proposed StarReLU activation function significantly reduces FLOPs compared to GELU while achieving comparable or better performance, offering a practical optimization.
Key Results
- IdentityFormer: Achieved >80% accuracy on ImageNet-1K with identity mapping, demonstrating a strong baseline.
- RandFormer: Outperformed IdentityFormer with >81% accuracy, validating MetaFormer's compatibility with arbitrary mixers.
- ConvFormer: Outperformed the strong CNN model ConvNeXt, even when considered a pure CNN architecture.
- CAFormer: Set a new record on ImageNet-1K with 85.5% top-1 accuracy at 224x224 resolution, using a combination of separable convolutions and self-attention, without external data or distillation.
- StarReLU: Reduced activation FLOPs by 71% compared to GELU and showed performance improvements of up to 0.3% on ConvFormer-S18/CAFormer-S18.
Limitations and Future Work
- StarReLU Optimization: The current implementation of StarReLU is not CUDA-optimized, leading to slower inference than GELU in some cases. The authors expect further speedups with optimization.
- StarReLU Variants: While the paper uses a default StarReLU with learnable scale and bias, the authors suggest future work could explore optimal StarReLU variant selection for different scenarios.
- MetaFormer's Broader Domain: The authors express optimism that MetaFormer will find broader applications in vision tasks and encourage readers to explore its potential with novel token mixers and architectures.
Summary updated