Home Knowledge Base Attention Distance

Attention Distance is a quantitative, diagnostic metric that measures the average physical spatial distance (in pixels or patch positions) between the Query patch and the patches it attends to most strongly — revealing how far across the image each attention head "reaches" at every layer of a Vision Transformer and exposing the fundamental difference in receptive field behavior between ViTs and Convolutional Neural Networks.

The Measurement Protocol

The Empirical Findings

The Critical Comparison with CNNs

Why Attention Distance Matters

This diagnostic reveals whether a ViT is actually utilizing its global attention capability or is wasting computational resources on purely local operations that a simple convolution could perform far more efficiently. It directly motivates hybrid architectures (like LeViT or CoAtNet) that explicitly use convolutions for the first few local-dominant layers and switch to Self-Attention only for the later global-dominant layers.

Attention Distance is the reach map of intelligence — measuring exactly how far each attention head stretches its sensory arms across the image, revealing whether the Transformer is truly leveraging its global vision or merely imitating a convolutional filter.

attention distance analysisexplainable ai

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.