Restoring Spatial Structure in Vision Transformers

This direction is no longer present in the current build. Its last version stays readable and citable here.

Version 1 of 118 papers18 conceptsfrozen 2026-10-04

Standard Transformer architectures treat images like sentences. To process visual data, they typically "flatten" a two-dimensional grid of pixels or patches into a one-dimensional sequence of tokens. While this enables the use of powerful self-attention mechanisms, it comes at a significant cost: the destruction of the image's inherent spatial topology.

In a flattened sequence, a pixel’s vertical neighbor—originally just one row away—suddenly becomes distant, separated by the entire width of the image. As Zhihang Xin and Xitong Hu argue in Beyond flattening, this "unnatural flattening" forces models to redundantly relearn geometric relationships that were already present in the original grid. A growing body of research aims to bridge this gap by reintroducing spatial awareness directly into the sequence-modeling pipeline.

The Cost of Linearization

The primary issue with linearization is the loss of spatial priors. In natural images, neighboring pixels are highly correlated, and geometric structures like edges and shapes are defined by local connectivity. When Lin Zheng and colleagues introduced Ripple Attention, they noted that standard Transformers ignore these correlations, treating every patch pair with equal structural weight regardless of their 2D distance.

This lack of geometric context is particularly damaging for tasks requiring precise localization. For instance, in Referring Expression Comprehension (REC), models often fail to distinguish between "the car on the left" and "the car on the right" because the 1D sequence lacks the 2D constraints necessary for spatial grounding, a problem highlighted by Jorge Sánchez and his team in their analysis of reference resolution errors.

Injecting Geometric Priors

To fix this, researchers are moving away from generic positional encodings toward "spatially-aware" mechanisms.

  1. Gaussian and Frequency Biases: In SFTransT, Chuanming Tang and Xiao Wang inject Gaussian spatial biases into the attention map to favor local neighborhoods and amplify high-frequency signals, preventing the "low-pass filter" effect of standard attention that often blurs fine details.
  2. Box and Point Encodings: Rather than treating tokens as abstract points in a sequence, Duy-Kien Nguyen et al. proposed BoxeR, which uses "box-attention" to learn spatial transformations directly. Similarly, for 3D detection, Changyong Shu developed 3DPPE, which replaces directional encodings with precise 3D point locations to maintain physical consistency.
  3. Structural Tokenization: Wanpeng Zhang suggests that the problem starts at the beginning of the pipeline. By applying Byte-Pair Encoding (BPE) to visual data, frequently co-occurring patches are merged into higher-level "visual words," effectively baking structural priors into the tokens themselves.

Architectural Alternatives to Flattening

Beyond just modifying Transformers, new architectures seek to avoid the 1D bottleneck entirely.

The Visual Attention Network (VAN), developed by Meng-Hao Guo and Shimin Hu, uses Large Kernel Attention (LKA) to combine the local focus of convolutions with the global reach of self-attention. This allows the model to maintain a 2D feature map throughout, preserving spatial relationships without the quadratic cost of standard attention.

Efficiency is a recurring theme. Ce Zheng and Chen Chen introduced HeatER, which uses a dimensional decomposition strategy. Instead of flattening a $H \times W$ grid into a $HW$ sequence, they process height and width dimensions separately. This not only preserves the geometric layout but also slashes computational costs—achieving state-of-the-art human reconstruction with a fraction of the parameters.

Beyond Transformers: The Mamba Perspective

The flattening problem isn't unique to Transformers; it also plagues newer sequence models like State-Space Models (SSMs). Linlin Fan and J JIANG demonstrated in UltraLBM-UNet that bidirectional processing and local perception modules are essential for Mamba-based models to segment complex medical images. Without these "2D-aware" additions, the 1D scan of the SSM fails to capture the full geometric structure of skin lesions.

Whether through SimViT's sliding windows or ViG's gated linear attention, the research direction is clear: for a model to truly "see," it must respect the two-dimensional nature of the visual world, rather than just reading it like a book.

Papers in this version

History & citationVersion 1 · 2026-10-04

No longer present in the current build · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_restoring_spatial_structure_in_vision_tr_80177a1a,
  title = {Restoring Spatial Structure in Vision Transformers},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/restoring-spatial-structure-in-vision-transformers/rdr_80177a1a10a74c25997acbaaeeefbc42},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-12-02},
}

This exact version (version 1, frozen text):

@misc{lacuna_restoring_spatial_structure_in_vision_tr_80177a1a_v1,
  title = {Restoring Spatial Structure in Vision Transformers},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/restoring-spatial-structure-in-vision-transformers/rdr_80177a1a10a74c25997acbaaeeefbc42/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-12-02},
}