Block Recurrent Dynamics in Vision Transformers

Mozes Jacobs, Thomas Fel, Richard Hakim, Alessandra Brondetta, Demba E. Ba, T. Anderson Keller

Summary

Vision Transformers (ViTs) might appear as deep sequences of unique layers, but they actually learn to reuse a small set of computational "phases" over and over. By replacing a deep foundation model with a shallow, recurrent surrogate called Raptor, researchers recovered up to 98% of DINOv2's performance using just 3 distinct blocks. This proves that ViTs are algorithmically simpler than their depth suggests, opening the door to understanding them as predictable dynamical systems.

Introduction & Motivation

Vision Transformers have become the default architecture for visual foundation models like DINOv2 and CLIP. However, their internal computational flow remains largely a black box. While a ViT might have 12, 24, or more layers, it is unclear if each layer performs a fundamentally unique operation or if the network relies on simpler, repetitive processes.

Previous research has shown that adjacent layers in residual networks often have highly similar representations. But representational similarity doesn't guarantee functional equivalence—just because two layers output similar things doesn't mean they are executing the exact same computation. This paper asks a critical question: Does the apparent "phase structure" in ViTs reflect genuinely reusable computation? If so, can we compress the network's depth into a few recurrent blocks to better interpret how it processes information?

Methodology: The Raptor Framework

To prove that ViTs reuse computations, the authors introduce the Block-Recurrent Hypothesis (BRH) and operationalize it through a framework called Raptor (Recurrent Approximations to Phase-structured TransfORmers).

  1. Phase Discovery: The authors analyze the layer-to-layer representational distance of trained ViTs. Using a max-cut algorithm, they partition the network's depth into $k$ contiguous blocks (e.g., layers 1-7, 8-10, 11-12) based on these similarity phases.
Layer-to-layer distance heatmaps reveal distinct, contiguous block structures across various Vision Transformer architectures.
  1. Building Raptor: They create a surrogate model with only $k$ distinct layers. Instead of passing data through 12 unique layers, Raptor routes data through Block 1 seven times, Block 2 three times, and so on.
  2. Hybrid Training: Training deep recurrent networks is notoriously unstable. To overcome this, Raptor is trained to mimic the exact internal activations of the teacher ViT using a two-stage process. Stage 1 uses Teacher Forcing (feeding the block the actual previous layer from the teacher to predict the next). Stage 2 switches to Autoregressive training (the block uses its own predictions) to ensure it can run independently at inference time.
  3. Dynamical Interpretability: By framing the network as a recurrent dynamical system, the authors apply physics and math tools to study how token representations flow and evolve across depth.

Experimental Setup

The framework was evaluated across several benchmarks:

  • CIFAR-100: Used for small-scale, controlled experiments, such as testing the impact of stochastic depth during training.
  • ImageNet-1k: Used to train the Raptor surrogate on DINOv2 and for linear probe classification evaluation.
  • ADE20k & NYUv2: Used to evaluate dense prediction tasks like semantic segmentation and monocular depth estimation.

Dynamical Interpretability & Insights

  • Recurrence Finds a Way: The block-recurrent structure isn't hardcoded; it emerges naturally. Training with stochastic depth (randomly dropping layers during training) strongly promotes this recurrent compressibility.
  • Algorithmic Parsimony: ViTs exhibit a strong simplicity bias. They trade parameters for iterations, meaning their true algorithmic complexity is much lower than their parameter count suggests.
  • Angular Attractors & Self-Correction: When token trajectories are mapped on a unit sphere, they converge directionally into class-dependent "basins." If noise is injected to perturb a token, its trajectory bends back toward its original path, demonstrating a highly stable and self-correcting system.
  • Token-Specific "Division of Labor": Different tokens behave differently over time. patch tokens synchronize early in a highly coordinated, mean-field-like behavior. Meanwhile, the cls (class) token stays relatively quiet until the very late layers, where it executes sharp reorientations to aggregate global information.
  • Low-Rank Collapse: In the final layers, computational updates collapse into a very low-dimensional subspace, acting as a funnel that compresses visual variation into a few collective directions.

Empirical Results

  • Massive Parameter Reuse: A Raptor model with only 2 recurrent blocks recovered ~96% of DINOv2 ViT-B's ImageNet-1k linear probe accuracy (81.2% vs 84.5%).
  • Near-Perfect Fidelity: Expanding Raptor to 3 blocks recovered ~98% of the original accuracy (83.0%), while also maintaining strong performance on dense prediction tasks like ADE20k and NYUv2.
  • Causal Proof of Phases: In a layer-swapping experiment, swapping a layer with another from the same block preserved model accuracy. However, swapping it with a layer from a different block caused complete model collapse. This proves that layer identity is functionally unique to each phase, but interchangeable within it.

Limitations & Future Directions

While Raptor recovers the vast majority of DINOv2's performance, a small residual gap remains. Closing this gap might require improved recurrent distillation techniques or the addition of time-varying components, as the current blocks are strictly parameter-tied. Furthermore, while stochastic depth acts as a catalyst for recurrence in small models, isolating the exact causal mechanisms driving this behavior in massive foundation models requires further study. Ultimately, this "recurrence-induced simplicity" paves the way for building better mechanistic interpretability tools for state-of-the-art AI.

Summary updated

BibTeX
@inproceedings{jacobs2026block,
  author = {Mozes Jacobs and Thomas Fel and Richard Hakim and Alessandra Brondetta and Demba E. Ba and T. Anderson Keller},
  title = {{Block Recurrent Dynamics in Vision Transformers}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=gH3HhnfWLC},
}
Figure