Preserving Two Dimensional Topology in Visual Transformers

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

Version 1 of 127 papers37 conceptsfrozen 2026-10-04

The standard recipe for a Vision Transformer (ViT) begins with a destructive act: an image is chopped into patches, and those patches are flattened into a one-dimensional sequence of tokens. While this allows the Transformer's self-attention mechanism to treat images like text, it discards the natural two-dimensional geometry of the visual world.

A growing body of research suggests that this "flattening" is a fundamental bottleneck. By instead preserving the 2D spatial topology of visual data throughout the network, models can achieve better localization, higher efficiency, and superior generalization to complex environments.

The Problem with One-Dimensional Flattening

In a standard ViT, the spatial relationship between two neighboring pixels is only recovered through learned positional embeddings. Kumara Kahatapitiya and Michael S Ryoo argue in SWAT: Spatial Structure Within and Among Tokens that this process permanently discards the internal geometry of image patches. When a patch is projected into a 1D vector, the model loses the "local inductive bias"—the inherent understanding that nearby pixels are more likely to be related than distant ones.

This loss is particularly felt in tasks requiring precision. For example, in medical imaging, Hong-Yu Zhou and colleagues found that standard tokenization fails to maintain the fine-grained local structures necessary for volumetric segmentation. Their work on nnFormer demonstrates that interleaving convolutional layers—which naturally respect 2D grids—with attention mechanisms allows the model to retain precise spatial encoding that global attention alone misses.

Convolutional Bridges to Global Attention

To fix the "flattening" problem, researchers are replacing simple linear projections with "structure-aware" tokenization. Instead of a single-layer patch projection, Sheng He and Yangming Ou in U-Netmer use a shared convolutional encoder to generate tokens. This ensures that local 2D spatial relationships are baked into the tokens before they ever reach the Transformer layers.

Similarly, Xiufeng Qian showed that using a convolutional layer for initial feature extraction helps models "tune out" background noise and focus on small, discrete features, such as lesions on a leaf, which are often blurred or lost during standard 1D patchification.

2D-Aware Token Compression

As Multimodal Large Language Models (MLLMs) scale to handle hundreds of images, the number of visual tokens becomes a computational burden. However, simply pruning tokens or flattening them for 1D pooling can destroy the model's ability to "ground" objects in space.

The solution is topology-preserving compression. Linli Yao and the DeCo team found that parameter-free 2D pooling methods outperform complex "smart" projectors because they maintain the relative positions of visual features. By keeping the grid intact, the LLM can still perform precise spatial reasoning.

Other researchers have refined this via:

  • 2D Bilinear Pooling: Xidong Wang and the LongLLaVA team use 2D downsampling to reduce token counts while preserving the underlying grid structure, which is essential for localization.
  • Sliding Windows: Yifan Li introduced WiCo, which aggregates tokens using a 2D sliding window. This preserves local details necessary for high-precision tasks like OCR and object grounding, even when reducing token counts by 75%.
  • Checkerboard Masking: To accelerate video understanding, Xinqi Jin developed StreamingAssistant, which prioritizes the retention of local spatial neighborhoods to avoid disrupting the positional embeddings the model uses to understand image structure.

Spatial-to-Channel Rearrangement

A more radical approach to preserving topology is to shift spatial information into the channel dimension rather than the sequence dimension. In AstraNav-Memory, Botao Ren and colleagues use "pixel unshuffling" to condense visual tokens. By moving local spatial neighborhoods into the channel dimension, they preserve environmental landmarks and geometric layouts that are critical for long-horizon navigation.

This concept of "stacking" or "rearranging" is also explored by Lingchen Meng in DeepStack. By grouping neighboring pixels together before layer-wise injection, the model maintains a 2D topology across the entire depth of the network, leading to more robust visual representations.

Why Topology Matters for Embodied AI

The benefits of preserving 2D structure are most visible in robotics. Ruihan Yang and Nicklas Hansen 0001 demonstrated that for quadrupedal robots, treating visual features as discrete spatial tokens—rather than a flattened vector—significantly enhances the robot's ability to navigate unseen, rugged terrain.

When the spatial structure is preserved, the robot doesn't just "see" a list of features; it maintains a proactive map of the environment. As Han Lin notes in the context of Bifrost-1, maintaining this 2D layout is what allows for precise control and reasoning in complex scenes, bridging the gap between abstract logic and the physical, geometric world.

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_preserving_two_dimensional_topology_in_v_f69e46db,
  title = {Preserving Two Dimensional Topology in Visual Transformers},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/preserving-two-dimensional-topology-in-visual-transformers/rdr_f69e46dbc97b4e99a3f02344a503cca2},
  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_preserving_two_dimensional_topology_in_v_f69e46db_v1,
  title = {Preserving Two Dimensional Topology in Visual Transformers},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/preserving-two-dimensional-topology-in-visual-transformers/rdr_f69e46dbc97b4e99a3f02344a503cca2/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-12-02},
}