Introduction
Vision Transformers (ViTs) have revolutionized computer vision, yet they face a significant hurdle: computational complexity. The self-attention mechanism's cost scales quadratically with the number of input tokens, making high-resolution processing prohibitively expensive. While "token sparsification" (pruning less important patches) offers a solution, it often sacrifices global context and accuracy.
Vision Token Turing Machines (ViTTM) address this by decoupling heavy computation from information storage. Inspired by Neural Turing Machines (NTMs), ViTTM introduces a dual-token architecture that maintains a full representation of the input while restricting expensive operations to a small subset of "process tokens."
Architectural Innovation: Process and Memory Tokens
The core of ViTTM is the separation of tokens into two distinct streams:
- Process Tokens ($P$): A small, fixed set of tokens that undergo standard Transformer encoder processing.
- Memory Tokens ($M$): A larger set of tokens acting as a persistent storage bank, bypassing the expensive encoder blocks.
At each layer, the model executes a Read-Process-Write cycle. Process tokens use efficient Linear Attention to "read" from memory, are processed by a standard encoder block, and then "write" updated information back to the memory bank. This $O(N)$ complexity for memory management ensures that the system remains efficient even with large memory banks.
Performance and Efficiency
ViTTM significantly pushes the Pareto frontier for vision models. On the ImageNet-1K benchmark, ViTTM-B achieves 82.9% accuracy with a median latency of 234.1ms. This represents a 56% speedup over the standard ViT-B (81.0% accuracy, 529.5ms) while simultaneously improving classification performance.
The efficiency gains extend to dense prediction tasks. In semantic segmentation on ADE20K, ViTTM-B reached 26.8 FPS—a 94% increase in throughput over the baseline ViT-B—with negligible loss in mIoU (45.17 vs 45.65).
Key Insights
- Linear Attention Efficiency: Linear Attention serves as an effective, low-overhead gateway for memory access, matching the performance of standard cross-attention at a fraction of the cost.
- Storage vs. Computation: Experiments revealed that the memory stream's primary value lies in information retention rather than active computation; adding complex layers to the memory stream yielded diminishing returns.
- Asymmetric Patching: A simple yet effective strategy for initializing the two streams is using different patch sizes—larger for process tokens and smaller for memory—to balance global context with local detail.
Conclusion and Future Directions
ViTTM demonstrates that vision models do not need to "think" about every pixel at every layer. By utilizing a memory-augmented architecture, ViTTM achieves state-of-the-art efficiency. Future work may explore multi-modal memory initialization (e.g., text or audio) and hardware-level optimizations through custom fused kernels to further enhance performance.
Summary updated