Block-Recurrent Dynamics in Vision Transformers

Mozes Jacobs, Thomas Fel, Richard Hakim, Alessandra Brondetta, Demba E. Ba, T. Andy Keller · DOI

Abstract

In contemporary deep learning, the depth of a neural network is typically viewed as a sequence of unique, specialized transformations. However, recent evidence suggests that Vision Transformers (ViTs) may organize themselves into a few distinct "phases" of computation. This paper explores the Block-Recurrent Hypothesis (BRH), which posits that trained ViTs can be accurately modeled as low-complexity dynamical systems where a small number of recurrent blocks ($k \ll L$) replace $L$ unique layers. Through the development of recurrent surrogates called Raptors, we demonstrate that these models exhibit functional recurrence, where the same mathematical "program" is reused across multiple layers.

Introduction

Despite the empirical success of Vision Transformers, a mechanistic understanding of how they process information through successive layers remains elusive. While architectural features like residual connections and high representational similarity between adjacent layers hint at iterative processing, representational similarity does not inherently imply functional similarity. Two layers may produce similar outputs while performing different mathematical operations. This study investigates whether ViTs exhibit genuine functional recurrence and how this structure emerges during the training process.

Methodology

The researchers utilize a three-step framework to analyze and validate the Block-Recurrent Hypothesis:

1. Phase Discovery via Max-Cut

To identify functional boundaries within a model, the authors analyze layer-layer similarity matrices. They employ a weighted max-cut algorithm, solved via dynamic programming, to partition the $L$ layers into $k$ contiguous "phases." Each phase represents a segment of the network where the layers appear to perform similar computational work.

2. Raptor: Recurrent Approximations

To test the functional consistency of these phases, the authors construct Raptor (Recurrent Approximations to Phase-structured TransfORmers) models. These are weight-tied versions of the original ViT where a single representative block is applied multiple times to simulate a discovered phase. This effectively compresses the model's depth into a recurrent loop.

3. Hybrid Training Strategy

Training recurrent models is challenging due to "drift," where small errors compound over iterations. To mitigate this, a two-stage training approach is used:

  • Stage 1 (Teacher Forcing): Each recurrent block learns to predict the next layer's activation using the original "teacher" ViT's activations as the ground truth.
  • Stage 2 (Autoregressive): The blocks are connected and fine-tuned to handle their own previous outputs, ensuring the surrogate model remains self-consistent during inference.

4. Dynamical Interpretability

The flow of data through the network is treated as a trajectory in vector space. Tools from dynamical systems theory, such as Dynamic Mode Decomposition (DMD) and Principal Component Analysis (PCA), are applied to characterize how representations evolve and converge.

Key Insights and Results

The Emergence of Recurrence

The study finds that block-recurrent structure is not an inherent default but an emergent property promoted by training. Specifically, stochastic depth (the practice of dropping layers during training) significantly strengthens this structure. This suggests that regularization forces the network to find normative, reusable solutions rather than layer-specific specializations.

Token Dynamics and Low-Rank Collapse

Analysis of the data trajectories reveals a divergence between patch tokens and the cls (class) token:

  • Patch Tokens: Exhibit smooth, collective motion toward a mean direction.
  • cls Token: Acts as a global aggregator, undergoing sharp "reorientations" in the final layers to finalize the representation.
  • Attractors: In the later stages of the network, updates to representations collapse into a low-rank subspace (approximately rank 6). This is a hallmark of a dynamical system settling into a low-dimensional attractor.

Empirical Performance

The results provide a striking existence proof for the BRH:

  • Extreme Compression: A Raptor model using only 2 recurrent blocks recovered 96% of the linear probe accuracy of a 12-layer DINOv2-Base on ImageNet.
  • Near-Parity: With 3 blocks, Raptor achieved 83.0% top-1 accuracy (98% of the teacher's performance), outperforming the smaller, non-recurrent DINOv2-ViT-S.
  • Causal Validation: Layer-swapping experiments confirmed that layers within the same discovered phase are functionally interchangeable, whereas swapping layers between different phases leads to immediate model collapse.

Discussion and Future Work

The findings suggest that ViTs possess a much lower Levin complexity than their parameter counts imply. Because they can be compressed into a few recurrent blocks without significant loss in performance, they function more like iterative programs than a sequence of unique filters.

While the Block-Recurrent Hypothesis is strongly supported, a small performance gap remains between the full teacher model and the recurrent surrogate. Future research may focus on closing this gap by introducing time-varying parameters or developing methods to train recurrent models from scratch, potentially leading to highly efficient, high-performance architectures that require a fraction of the parameters used today.

Summary updated

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