Linear-Time Global Visual Modeling without Explicit Attention

Ruize He, Dongchen Han, Gao HuangarXiv 2026

TL;DR

This paper mathematically reframes the attention mechanism of Transformers as a Multi-Layer Perceptron (MLP) with dynamically predicted parameters. By replacing explicit attention matrices with lightweight, linear-time dynamic weight prediction strategies, the authors introduce WeightFormer—an architecture that achieves Transformer-level global modeling capability with strictly linear ($O(N)$) time and memory complexity.

What Problem Does This Paper Address?

Transformers have become the dominant architecture for global sequence modeling, a success largely attributed to the self-attention mechanism. However, computing the standard attention matrix requires calculating pairwise token similarities, which incurs a quadratic computational and memory cost ($O(N^2)$) relative to the sequence length $N$. This quadratic bottleneck makes scaling to long sequences or high-resolution images incredibly expensive.

While previous efforts have attempted to approximate, sparsify, or kernelize the attention matrix, they remain bound to the conventional paradigm of explicit token-to-token feature recombination. The authors of this paper challenge this foundation, asking a fundamental question: Can we achieve global context modeling entirely without explicit attention matrices while maintaining linear complexity?

Methods

The authors begin with a mathematical insight: the standard attention formulation can be rewritten to show that the key ($K^\top$) and value ($V$) matrices actually function as the weights of a two-layer MLP, where the weights are dynamically generated based on the input.

Figure 2: (a) Explicit weighted aggregation, where attention weights are computed and applied to val- ues. (b) Attention as a dynamic MLP with param- eters W = G(X), where K⊤and V are dynamic weights and Softmax acts as non-linearity, enabling implicit global modeling via O = FW (X).

To bypass the quadratic complexity of standard attention, the authors decouple parameter generation from sequence length using spatial compression. They introduce WeightFormer, an architecture that replaces explicit attention blocks with standard convolutional network layers (linear and depthwise convolutions) modulated by global context:

  1. Dynamic Linear Layers: Instead of token mixing, these layers integrate global context into channel transformations. The authors use a Bilateral Activation strategy to factorize weight prediction into two non-linear branches, distilling global second-order statistics into a dynamic weight update.
  2. Dynamic Depthwise Convolutions (DWC): To provide spatial inductive bias while retaining global reach, depthwise kernels are predicted dynamically. The authors use a Spatially Adaptive strategy, pooling the input feature map to a fixed $K \times K$ grid aligned with the target kernel size to generate input-conditioned filters.

To balance performance and computational overhead, WeightFormer uses a sparse distribution strategy: dynamic parameterization is inserted only every third block, while the remaining blocks use standard static weights.

Datasets

The architecture was trained and evaluated across several standard computer vision benchmarks:

  • ImageNet-1K: Used for image classification (1.28M training images) and class-conditional image generation.
  • COCO 2017: Used to evaluate object detection and instance segmentation via the ViTDet framework.
  • ADE20K: Used to evaluate semantic segmentation performance using the UperNet framework.

Key Insights and Ideas

  • The Source of Quadratic Scaling: In the dynamic MLP interpretation of attention, the effective hidden width of the MLP scales with the number of tokens $N$ ($K^\top \in \mathbb{R}^{d \times N}$). This provides a principled, alternative explanation for why standard attention scales quadratically.
  • Implicit Global Modeling: Global context does not strictly require explicit token-to-token routing. Compressing global information directly into network parameters allows a simple forward pass to naturally integrate long-range dependencies.
  • Receptive Field Expansion: Analyzing Effective Receptive Fields (ERFs) demonstrates that while static CNN baselines remain highly localized, adding input-conditioned dynamic weights causes the network's receptive field to instantly expand across the entire image, mimicking a Transformer.
Figure 3: Comparison of ERF [26] between DeiT, static and dynamic weight prediction strategies. Pixels with higher intensity indicate larger responses related to the central pixel.

Key Results

WeightFormer achieves competitive performance against state-of-the-art Transformers and CNNs while offering massive efficiency gains at high resolutions.

Figure 1: ImageNet accuracy of WeightFormer and baselines. ◦represent models with O(N 2), while • represent models with O(N). Each bubble’s area is proportional to FLOPs.
  • ImageNet-1K Classification: WeightFormer-S achieves 81.3% top-1 accuracy, outperforming DeiT-S (79.8%) and ConvNeXt-S (79.7%) using comparable resources.
  • High-Resolution Efficiency: Thanks to its linear complexity, at a resolution of $1248 \times 1248$ (6,084 tokens), WeightFormer scales effortlessly—achieving $7.7\times$ higher throughput and a 91% reduction in GPU memory compared to DeiT.
  • Downstream Tasks: On COCO object detection, WeightFormer-T improves box/mask AP over DeiT-T while dropping backbone FLOPs from 106G to 77G. On ADE20K semantic segmentation, WeightFormer-S achieves 45.6 mIoU, outperforming DeiT-S (44.0 mIoU).

Limitations and Future Work

The primary limitation acknowledged by the authors is that their evaluation is currently restricted to vision tasks; it remains unclear how well this dynamic parameterization paradigm generalizes to other domains like natural language processing (NLP).

Additionally, optimizing input-conditioned dynamic parameters introduces non-trivial training challenges, as generating weights on the fly can complicate gradient flow and impact training stability. Future work will focus on improving weight generation mechanisms, exploring broader modalities, and developing a deeper theoretical understanding of the expressivity and inductive biases behind dynamic networks.

Summary updated

BibTeX
@misc{he2026linear,
  author = {Ruize He and Dongchen Han and Gao Huang},
  title = {{Linear-Time Global Visual Modeling without Explicit Attention}},
  year = {2026},
  eprint = {2605.01711},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.01711},
}
Figure