One Block, Multiple Depths: Recurrent Vision Transformers with Depth-Programmed Experts

Adrian Bulat, Yassine Ouali, Georgios TzimiropoulosarXiv 2026

TL;DR

reViT is a recurrent Vision Transformer that replaces a deep stack of independent layers with a single shared block that adapts its behavior based on its current depth. By merging a small bank of "experts" using a continuous depth coordinate, reViT matches the accuracy of standard ViTs while reducing parameter counts by up to 70% and enabling flexible, "elastic" inference-time depth.

What Problem Does This Paper Address?

Standard Vision Transformers (ViTs) are parameter-hungry. They typically consist of a stack of $L$ independent transformer blocks, each with its own set of weights. While researchers have tried using recurrent architectures—where a single block is reused multiple times—these models often suffer from a "representation collapse" or lower accuracy.

The core issue is that early, middle, and late layers in a transformer perform different roles (e.g., low-level feature extraction vs. high-level semantic reasoning). A purely shared recurrent block lacks the flexibility to adapt to these different "computational phases." The authors of reViT ask: Can we maintain the parameter efficiency of recurrence while restoring the depth-specific transformations needed for high performance?

Methods

The authors introduce reViT, which utilizes two main components to solve the recurrence problem:

  1. Full-Depth Recurrence: A single Transformer module (Attention + LayerNorm) is reused for all $L$ steps of the encoder.
  2. Depth-Programmed Experts: Instead of a static Feed-Forward Network (FFN), reViT uses a small bank of $E$ shared experts. At each recurrent step $t$, a tiny "router" takes a normalized depth coordinate $s_t = t/(L-1)$ and generates mixing coefficients. These coefficients are used to merge the weights of the experts into one dense FFN for that specific depth.
Overview of reViT architecture showing full-depth recurrence and the depth-programmed expert merging mechanism.

Crucially, because the merging happens in "weight space" before the FFN runs, the model only executes one dense FFN per step. This means the computational cost (FLOPs) remains identical to a standard ViT, even though the model has access to a larger pool of stored parameters.

Datasets

The models were evaluated across several standard computer vision benchmarks:

  • ImageNet-1k: For supervised training from scratch and linear-probe evaluation.
  • DINOv2: Used as a frozen teacher model for distillation experiments.
  • ADE20k: For evaluating semantic segmentation transfer.
  • NYUv2: For evaluating monocular depth prediction.

Key Insights and Ideas

  • Weight Merging > Token Dispatch: Most Mixture-of-Experts (MoE) models route individual tokens to different experts. The authors found that for recurrent vision models, merging weights based on depth is significantly more effective and efficient.
  • Continuous Trajectories: By using a continuous depth coordinate, the model learns a smooth path through parameter space. As shown in Figure 3, the router learns to transition between experts at specific stages of the recurrence, effectively mimicking the "phases" found in deep, non-recurrent models.
  • Elastic Depth Inference: Because the depth signal is a continuous coordinate $s \in [0, 1]$, a single trained reViT checkpoint can be run at different depths (e.g., 8, 12, or 24 steps) at inference time by simply resampling the coordinate grid. This "elasticity" allows for a dynamic trade-off between speed and accuracy without retraining.
Comparison of routing variants under elastic-depth training, showing reViT's robustness to changing depth at inference.

Key Results

  • Parameter Efficiency: A reViT-B/16 model with 4 experts matches the accuracy of a standard DeiT III-B/16 but uses 73% fewer parameters (23.6M vs 86.6M).
  • State-of-the-Art Recurrence: reViT outperforms other recent recurrent models like Raptor across all tested scales (Small, Base, and Large).
  • Distillation Success: When distilled from a DINOv2-B/14 teacher, an 8-expert reViT student retains nearly all the teacher's performance on downstream tasks like segmentation and depth prediction while being much more compact.
  • Effective Rank: Analysis shows that smaller models (reViT-S) utilize the expert bank more diversely than larger models (reViT-L), suggesting that depth-programming is particularly potent for scaling down models.

Limitations and Future Work

  • Deployment Storage Trade-off: While reViT is compact in terms of stored parameters, if one chooses to "materialize" the model into a standard non-recurrent graph for maximum deployment speed (to avoid online weight merging), the storage requirement expands back to that of a full-depth model.
  • Attention Sharing: Currently, only the FFN weights are depth-programmed. The Attention (MHSA) parameters are fully shared across all steps. The authors suggest that applying similar depth-programming to the attention mechanism could yield further improvements.
  • Training Complexity: Like all recurrent models, training requires unrolling the graph, which can be more memory-intensive or slower than training shallow stacks, though the authors mitigated this with standard optimization recipes.

Summary updated

BibTeX
@misc{bulat2026one,
  author = {Adrian Bulat and Yassine Ouali and Georgios Tzimiropoulos},
  title = {{One Block, Multiple Depths: Recurrent Vision Transformers with Depth-Programmed Experts}},
  year = {2026},
  eprint = {2610.12448},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.12448},
}
Figure