Abstract
Hybrid Mamba-Transformer networks have recently garnered broad attention. These networks can leverage the scalability of Transformers while capitalizing on Mamba's strengths in long-context modeling and computational efficiency. However, the challenge of effectively pretraining such hybrid networks remains an open question. Existing methods, such as Masked Autoencoders (MAE) or autoregressive (AR) pretraining, primarily focus on single-type network architectures. In contrast, pretraining strategies for hybrid architectures must be effective for both Mamba and Transformer components. Based on this, we propose Masked Autoregressive Pretraining (MAP) to pretrain a hybrid Mamba-Transformer vision backbone network. This strategy combines the strengths of both MAE and Autoregressive pretraining, improving the performance of Mamba and Transformer modules within a unified paradigm. Experimental results show that the hybrid Mamba-Transformer vision backbone network pretrained with MAP significantly outperforms other pretraining strategies, achieving state-of-the-art performance. We validate the method's effectiveness on both 2D and 3D datasets and provide detailed ablation studies to support the design choices for each component.
Introduction
In the pursuit of an optimal vision backbone, hybrid architectures are emerging as a powerful solution. Transformers provide unmatched scalability and global relationship modeling, though they suffer from quadratic computational costs relative to image size. Conversely, Mamba (a State Space Model) offers linear scaling and superior long-context modeling but processes visual features sequentially rather than as a global grid.
A significant hurdle remains: effective pretraining for these hybrids. Standard Masked Autoencoders (MAE) excel for Transformers by teaching bidirectional context through "filling in the blanks," but they are less effective for Mamba. Conversely, Autoregressive (AR) pretraining—the standard for Mamba and Large Language Models—lacks the local bidirectional cues necessary for Transformers to master image textures. This paper introduces MAP (Masked Autoregressive Pretraining) to bridge this gap with a unified paradigm.
The MAP Framework
MAP is a hierarchical pretraining strategy that integrates the strengths of both MAE and AR. The framework operates on a structured masking and reconstruction process:
- Optimal Masking Ratio: The model masks 50% of input image patches. This ratio serves as a "Goldilocks" zone, providing enough context for AR modeling while maintaining the challenge required for robust feature learning in Transformers.
- Row-wise Autoregression: Reconstruction occurs row-by-row to satisfy both architectural needs:
- Intra-row (Local MAE): Within a single row, the model predicts all masked tokens simultaneously using visible tokens in that row, providing the bidirectional learning Transformers require.
- Inter-row (Global AR): The model predicts row $i$ based on all preceding rows ($<i$), leveraging Mamba’s sequential context strengths.
- Hybrid Decoder Strategy: The researchers utilize a Transformer decoder for reconstruction. They observed that Mamba decoders, due to their unidirectional nature, struggle to reconstruct entire local regions simultaneously.
Experimental Results and Insights
The effectiveness of MAP was validated across 2D (ImageNet-1K, ADE20K, COCO) and 3D (ScanObjectNN, ShapeNetPart) benchmarks.
Performance Gains
On ImageNet-1K, a hybrid model (HybridNet-B) pretrained with MAP achieved 84.9% top-1 accuracy. This significantly outperforms the same architecture trained with pure MAE (83.9%) or pure AR (83.8%). The benefits of MAP are particularly evident when compared to single-strategy pretraining on different architectures.
Key Findings
- Alignment is Critical: For Mamba components, the pretraining order must align with the architectural scanning order. Misalignment between the row-by-row scan and the autoregressive order leads to a significant drop in performance.
- Cross-Domain Generalization: MAP is not limited to 2D images. On the ScanObjectNN benchmark for real-world 3D objects, MAP-pretrained models showed substantial gains, demonstrating its utility as a fundamental improvement for hybrid architectures.
Conclusion and Future Work
MAP successfully unleashes the potential of hybrid Mamba-Transformer networks by providing a pretraining objective that respects the unique inductive biases of both components. While hybrid models occasionally face stiff competition from pure Transformers in narrow settings, the scaling benefits and computational efficiency of the hybrid approach are promising. Future research will explore applying MAP to video backbones, where Mamba’s long-sequence capabilities and MAP’s temporal-like autoregression could offer significant breakthroughs in efficiency.
Summary updated