WeightFormer: Realizing Global Visual Modeling in Linear Time via Dynamic Parameterization

Linear-Time Global Visual Modeling without Explicit Attention

Summary
Problem
Method
Results
Takeaways
Abstract

The paper introduces WeightFormer, a novel vision architecture that achieves global sequence modeling with linear complexity by replacing explicit attention with dynamic parameterization. It reframes attention as a dynamic Multi-Layer Perceptron (MLP) where global context is compressed into weights rather than computed via token-to-token similarity.

Executive Summary

The dominance of the Transformer in computer vision is largely credited to the Attention mechanism's ability to capture global dependencies. However, this comes at the cost of complexity. WeightFormer challenges the status quo by proposing that explicit attention weights are unnecessary. By reframing attention as a Dynamic MLP, the authors demonstrate that global modeling can be achieved by compressing input context into network weights, resulting in a strictly linear-time architecture that rivals SOTA Transformers in accuracy while being vastly more efficient at high resolutions.

Problem & Motivation: The Quadratic Trap

For years, the "Attention Matrix" has been viewed as the indispensable engine of global modeling. This view treats attention as an explicit token-wise aggregation process. The bottleneck is obvious: as image resolution grows, the memory and compute required grow quadratically.

While many have tried to "fix" attention via sparsification or low-rank approximations, the authors of WeightFormer ask a deeper question: Is explicit token-to-token routing actually required? Their insight is that attention can be mathematically viewed as an MLP where the weights ( and ) are dynamically generated from the input. If the weights themselves could "absorb" the global context, we could perform global modeling through a simple forward pass without ever materializing an matrix.

Methodology: The Dynamic MLP Perspective

The core of WeightFormer lies in and two innovative dynamic weight prediction strategies that decouple parameter generation from sequence length.

1. Reframing Attention

Instead of , the authors view the operation as , where is a set of weights derived from a global descriptor of . This shifts the paradigm from Explicit Weighting to Implicit Global Modeling.

Architecture of WeightFormer Figure 1: Comparison between explicit aggregation (Attention) and Implicit global modeling (Dynamic MLP).

2. Dynamic Linear Layers (Bilateral Activation)

To propagate global context through channel transformations, WeightFormer uses a Bilateral Activation strategy. It generates dynamic updates for linear weights by factorizing the process into two non-linear branches that act on the input correlation matrix .

3. Dynamic Depthwise Convolution (Spatially Adaptive)

While standard convolutions are local, WeightFormer uses Spatially Adaptive Prediction to generate kernels conditioned on the entire image. This allows a small convolution kernel to "know" about distant pixels, effectively granting it a global receptive field.

WeightFormer Architecture Detail Figure 2: The WeightFormer architecture, highlighting the sparse distribution of dynamic blocks.

Experiments & Results: Efficiency without Sacrifice

WeightFormer was tested across ImageNet-1K, COCO detection, and ADE20K segmentation.

  • Accuracy: WeightFormer-S reaches 81.3% accuracy, significantly higher than DeiT-S and ConvNeXt-S.
  • High-Resolution Scaling: At a resolution of , WeightFormer achieves 7.7x higher throughput than DeiT. The Effective Receptive Field (ERF) analysis confirms that the model indeed looks at the entire image, despite the lack of traditional attention.

Performance Highlights Figure 3: ImageNet performance vs. complexity. Note how WeightFormer (dots) maintains high accuracy with lower FLOPs.

Critical Analysis & Conclusion

WeightFormer is a powerful reminder that "Attention" is just one way to implement dynamic computation. By moving the "dynamism" into the weights themselves, the authors bypass the quadratic bottleneck.

Takeaway:

  • Global modeling is possible in : You don't need to compare every token to every other token.
  • Hybrid Approach: The authors found that inserting dynamic blocks every third layer (Sparse Placement) was optimal, suggesting that we don't need "globalness" in every single layer.

Limitations: The study focuses on Vision. Whether this "weight prediction" strategy can handle the complex linguistic dependencies required for Large Language Models (LLMs) remains an open, exciting question. Additionally, the optimization of dynamic weights can be trickier than standard training due to gradient flow through the weight-generator module.

Future Outlook: WeightFormer paves the way for a new generation of "Attention-free" Transformers that could potentially make high-resolution video processing and giant medical imaging analysis computationally trivial.

Find Similar Papers

Try Our Examples

  • Search for recent papers that interpret the Transformer attention mechanism as a form of Hypernetworks or dynamic weight generation.
  • Identify the origin of the 'Bilateral Activation' concept in dynamic neural networks and how it differs from traditional cross-attention.
  • Find studies evaluating the scaling laws of dynamic parameterization models (like WeightFormer) versus State Space Models (SSMs) in ultra-long sequence tasks.
Contents
WeightFormer: Realizing Global Visual Modeling in Linear Time via Dynamic Parameterization
1. Executive Summary
2. Problem & Motivation: The Quadratic Trap
3. Methodology: The Dynamic MLP Perspective
3.1. 1. Reframing Attention
3.2. 2. Dynamic Linear Layers (Bilateral Activation)
3.3. 3. Dynamic Depthwise Convolution (Spatially Adaptive)
4. Experiments & Results: Efficiency without Sacrifice
5. Critical Analysis & Conclusion