Abstract
In this work, we present a comprehensive analysis of causal image modeling and introduce the Adventurer series models where we treat images as sequences of patch tokens and employ uni-directional language models to learn visual representations. This modeling paradigm allows us to process images in a recurrent formulation with linear complexity relative to the sequence length, which can effectively address the memory and computation explosion issues posed by high-resolution and fine-grained images. In detail, we introduce two simple designs that seamlessly integrate image inputs into the causal inference framework: a global pooling token placed at the beginning of the sequence and a flipping operation between every two layers. Extensive empirical studies demonstrate the significant efficiency and effectiveness of this causal image modeling paradigm. For example, our base-sized Adventurer model attains a competitive test accuracy of 84.0% on the standard ImageNet-1k benchmark with 216 images/s training throughput, which is 5.3 times more efficient than vision transformers to achieve the same result.
Introduction
Vision Transformers (ViTs) have revolutionized computer vision, but they suffer from a fundamental scaling problem: the computational cost of self-attention grows quadratically ($O(N^2)$) with the number of image patches. This makes processing high-resolution or fine-grained images prohibitively expensive. Recently, State Space Models (SSMs) like Mamba have emerged as a linear-complexity alternative. However, Mamba was designed for 1D sequences where information flows in one direction. Images are 2D and non-causal—a pixel's meaning depends on pixels both "before" and "after" it. Previous attempts to adapt Mamba for vision often relied on complex multi-directional scans that added significant overhead.
The Adventurer series asks a simpler question: Can we build a competitive vision model using a simple, one-way causal scan?
Methodology: Causal Image Modeling
The researchers propose a Causal Image Modeling (CIM) framework using a standard uni-directional Mamba-2 architecture with two key innovations:
- Heading Average: In a causal model, the first token is typically "blind" as it has no preceding context. Adventurer solves this by placing a global average pooling token (the average of all image patches) at the beginning of the sequence for every layer, providing immediate global context.
- Inter-Layer Flipping: To ensure information flows in both directions across the model, the sequence order is reversed between every two layers. If Layer $2n$ scans from top-left to bottom-right, Layer $2n+1$ scans from bottom-right to top-left.
This approach ensures every patch eventually "sees" every other patch without needing expensive multi-scan operations within a single layer. The final architecture uses Mamba-2 as the token mixer and a SwiGLU MLP as the channel mixer.
Experimental Results
Adventurer was evaluated on ImageNet-1k, ADE20k, and COCO 2017 benchmarks. The results demonstrate that causal modeling is not only sufficient but highly efficient.
- Superior Scaling: At a resolution of $1280 \times 1280$, Adventurer-Base is 11.7× faster and uses 14.0× less memory than a standard ViT-Base.
- Competitive Accuracy: Adventurer-Base achieves 84.3% top-1 accuracy on ImageNet-1k. It reaches this performance with a training throughput of 216 images/s, which is 6.2× faster than DeiT (a standard ViT).
- Downstream Performance: In semantic segmentation (ADE20k), Adventurer-Base outperformed MambaReg by 1.1% mIoU while maintaining significantly higher throughput.
Discussion and Future Work
The success of Adventurer suggests that "full visibility" in every layer of a Transformer might be computationally redundant. The authors liken their approach to an adventurer in a dark cave with a torch: by scanning a mural bit by bit and remembering what was seen (a "Saccade Mechanism"), the whole picture can be understood efficiently.
Future work includes exploring more sophisticated position encodings for causal sequences and scaling to "pixel-level" modeling. The linear complexity of this architecture makes it potentially viable for sequences of over 50,000 tokens, a feat currently impossible for standard Transformers.
Summary updated