In classical computer vision, the Convolutional Neural Network (CNN) reigned supreme because of a built-in assumption: pixels close to each other are more related than pixels far apart. This "spatial inductive bias" is hard-coded into the architecture. However, the rise of the Vision Transformer (ViT) shifted the paradigm toward a more flexible, but fundamentally "blind" mechanism: self-attention.
The core challenge in modern vision research is that Transformers are inherently permutation invariant. As noted by Xiangxiang Chu and Yahui Liu, a Transformer treats a set of image patches like a "bag of words." If you shuffle the patches of an image, the self-attention mechanism—without external help—sees exactly the same data. This lack of inherent geometric context forces researchers to find new ways to teach models that "where" a feature is matters just as much as "what" it is.
The Geometry of Attention
If self-attention is a general-purpose tool, how does it relate to the specialized tool of convolution? Andreas Loukas, Jean-Baptiste Cordonnier, and Martin Jaggi mathematically proved in On the Relationship between Self-Attention and Convolutional Layers that multi-head self-attention is actually a generalization of convolution. Given enough heads, a Transformer can become a CNN. In practice, they found that when trained on images, Transformers naturally "discover" local, grid-like patterns in their early layers, effectively learning their own inductive biases from scratch.
However, relying on the model to learn these biases is inefficient. Behnam Neyshabur explored this in Towards Learning Convolutions from Scratch, showing that while models can discover local connectivity even when pixel order is hidden, they often require specific algorithmic guidance like $\beta$-LASSO to do so effectively.
Encoding the Grid
To solve permutation invariance, researchers usually inject "positional encodings"—extra vectors that tell the model the coordinates of each patch. But not all encodings are created equal.
- Relative and Rotary Encodings: Instead of absolute coordinates, models can learn the relative distance between patches. Connor Schenck and colleagues introduced STRING, a framework that generalizes Rotary Positional Encodings (RoPE) to 2D and 3D. By maintaining translation invariance, STRING ensures that the model understands a "shift" in the image doesn't change the fundamental relationship between objects.
- Geometric Priors: Some researchers use explicit geometric shapes to guide the model. Jochen Triesch and Zhengyang Yu proposed Circle Relationship Embedding (CRE), which maps patches onto concentric circles to provide a structured geometric bias. Similarly, Leyla Naz Candogan used space-filling curves in the VIOLIN module to inject spatial priors into data-scarce regimes.
- Adaptive Normalization: A subtle but powerful finding by Runyi Yu in Position Embedding Needs an Independent Layer Normalization suggests that spatial information is often "washed out" by standard normalization. By giving position embeddings their own dedicated Layer Normalization (LaPE), the model can refine spatial cues more effectively at every layer.
Learning to See Structure
Beyond architectural tweaks, a growing body of work focuses on self-supervised pretext tasks that force the model to respect spatial structure.
In DropPos, Haochen Wang and colleagues proposed a training regime where the model must reconstruct the original positions of patches after their embeddings have been removed. This forces the Transformer to look at the content of a patch and deduce where it belongs in the 2D grid. Similarly, Xun Gong used Positional Labels as a training target, turning spatial awareness into a primary objective rather than a side effect.
Why It Works: Beyond Statistical Correlation
The danger of permutation-invariant models is that they might rely on "statistical shortcuts"—identifying an image of a cat simply by the presence of fur-like textures, regardless of where they are. Kumara Kahatapitiya and Michael S Ryoo highlighted this in their work on SWAT, noting that models often perform well even when patches are shuffled.
By re-introducing spatial structure—whether through Geometric Transform Attention (GTA) for 3D scenes or Head-wise Adaptive RoPE (HARoPE) for fine-grained generation—researchers are moving Transformers away from being simple "set processors" and toward becoming true geometric reasoners. The goal is a model that doesn't just see a collection of parts, but understands the rigid, 2D, or 3D stage upon which those parts interact.