arXiv(opens in a new tab)cs.CVOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.12448

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

Adrian Bulat, Yassine Ouali, Georgios Tzimiropoulos

Adrian Bulat 1,2^{1,2} Yassine Ouali 1^{1} Georgios Tzimiropoulos 1,3^{1,3}

1^{1}Samsung AI Cambridge 2^{2}Technical University of Iasi 3^{3}Queen Mary University of London

Abstract. In this work, we show that a single Transformer block, applied recurrently, can match the accuracy of a full-depth vision encoder at comparable inference FLOPs without intermediate feature distillation. reViT restores depth-specific transformations by representing the FFN at each recurrent depth as a convex combination of a small shared expert bank. A continuous normalized-depth coordinate programs this mixture, defining a resampleable trajectory through FFN parameter space. We evaluate this design in two regimes: supervised ImageNet-1k training and distillation from a DINOv2 teacher. Across both regimes, controlled adaptations identify weight-space merging as the strongest tested MoE family at a matching one-FFN budget, ahead of the token-dispatch and output-mixture alternatives. Trained from scratch, reViT-B/16 attains DeiT III accuracy with about 70% fewer stored parameters. An 8-experts model distilled using only the teacher's output features retains nearly all of its DINOv2 teacher's linear-probe accuracy and transfers across classification, segmentation, and depth prediction. Elastic-depth training allows one checkpoint (trained model) to operate at multiple tested depths by resampling the same normalized coordinate interval. For fixed-depth deployment, the recurrent block can be materialized as a conventional dense graph, removing online routing and merging without changing the one-FFN-per-depth compute but expanding deployment storage.

1 Introduction

Standard Vision Transformers (ViTs) process image tokens through a stack of L transformer blocks, each with its own parameters (Dosovitskiy et al., 2021). Although transformers develop distinct behaviors across depth (Ghiasi et al., 2022; Jawahar et al., 2019; Valeriani et al., 2023), ViTs exhibit greater representational similarity across layers than comparable CNNs (Raghu et al., 2021). This tension motivates our central question: can a ViT replace its depth-wise stack with a single recurrent block while retaining the depth-dependent computation needed for accuracy?

Residual and highway networks have long motivated an iterative view of depth (Greff et al., 2017), while Universal Transformers make weight reuse explicit by repeatedly applying a shared block (Dehghani et al., 2019). More recently, these ideas have been developed more extensively in language (Lan et al., 2020; Bae et al., 2025a; Tan et al., 2023; Csordás et al., 2024; Bae et al., 2025b). These results establish the promise of recurrent sharing in language, but leave open which expert formulations best preserve accuracy under full-depth sharing in vision.

For vision, mainstream ViTs are still built as fixed-depth stacks. Only recently, Jacobs et al. (2026) find that, across encoder families, the trained ViT blocks organize into a few contiguous computational phases separated by narrow transitions. Their Raptor model exploits this structure by replacing a depth-L stack with k≪Lk \ll L distinct blocks applied recurrently, recovering most of the original model's performance with k=4k=4. Raptor nevertheless leaves open the full-sharing case: its published distilled models retain several distinct blocks, align recurrent segments with intermediate teacher features, and still underperform compared to the network they approximate.

In this work, we take the remaining step with reViT, which reuses one Transformer module throughout the encoder (Fig. 1). We adapt differentiable weight-space expert merging to full-depth recurrence and use normalized recurrent depth as its sole conditioning signal. At depth t, a small router maps st=t/(L−1)s_t = t/(L-1) to soft coefficients over an E-expert FFN bank. Their weighted combination produces one dense FFN that is applied to every token. Across depth, these mixtures trace a continuous path through FFN parameter space, replacing the independently

Figure

Shared parameters

(a) Full-depth recurrence.

(b) Depth-programmed experts.

Figure

(c) Elastic-depth inference.

Figure 1 reViT overview. (a) One shared module runs for L steps. (b) At depth t, sts_t softly mixes E expert parameter sets into one dense FFN shared by all tokens. (c) Selecting L resamples the depth program on a new grid. Teal marks shared parameters and amber marks depth and gating.

learned FFNs of a standard stack. Changing L resamples the same path on a different grid, separating stored expert capacity from executed depth. Because the schedule is depth (but not image) dependent, a selected deployment depth can also be folded into a fixed sequence of dense FFNs before compilation, eliminating online routing and merging at the cost of materializing one FFN per depth. Under equal compute budget, our depth-programmed merge outperforms the tested token-dispatch and output-mixture alternatives (Csordás et al., 2024; Liu et al., 2024; Yang et al., 2025; Wang et al., 2025).

We evaluate reViT with supervised ImageNet-1k training or distillation from a frozen DINOv2 teacher. Trained from scratch, an E=4E=4 reViT-B/16 matches DeiT III (Touvron et al., 2022) at near-matched inference FLOPs with 73% fewer parameters. Under DINOv2 distillation (Oquab et al., 2024), an E=8E=8 model nearly matches the teacher's ImageNet linear-probe accuracy.

Our contributions are:

• A recurrent ViT with a continuous depth program: We present reViT, which replaces a ViT's depth-wise stack with one recurrent Transformer module. A normalized depth coordinate programs a continuous trajectory through a shared FFN expert bank, recovering depth-specific computation while remaining competitive with full-depth ViTs.

• Comparison under a common recurrent setting: Using the same recurrent backbone, task loss, and base training recipe, we compare seven alternative MoE mechanisms. At the nominal compute budget of one dense FFN (per block), our depth-programmed merge outperforms the tested token-dispatch and output-mixture adaptations.

• Resampleable depth and fixed-depth export: One reViT checkpoint (trained model) supports multiple tested inference depths by resampling the normalized coordinate interval. For deployment, reViT can retain its compact dynamic graph or materialize the depth-specific FFNs at a fixed depth, trading compact storage for conventional dense execution.

• Analysis of the learned depth program: Our analysis shows that, under final-layer distillation alone, the router learns where the dominant expert changes and blends experts across each transition, and that the learned gate-expert assignment matters for teacher alignment. Increasing expert capacity improves coverage of the teacher's layers, while larger backbones use fewer effective directions and gain less from additional experts.

References (38)

  • Relaxed recursive transformers: Effective parameter sharing with layer-wise lora
  • Mixture-of-recursions: Learning dynamic recursive depths for adaptive token-level computation
  • Moeut: Mixture-of-experts universal transformers
  • Towards ultimate expert specialization in mixture-of-experts language models
  • Universal transformers
  • An image is worth $16 \times 16$ words: Transformers for image recognition at scale
  • What do vision transformers learn? a visual exploration (opens arXiv in a new tab)
  • Alex Graves. Adaptive computation time for recurrent neural networks. arXiv preprint arXiv:1603.08983, 2016. (page 2) (opens arXiv in a new tab)
  • Highway and residual networks learn unrolled iterative estimation
  • Hypernetworks
  • Vision-mor: Scaling vision transformer via patch-level mixture-of-recursions
  • Deep networks with stochastic depth
  • Block recurrent dynamics in vision transformers
  • What does bert learn about the structure of language? In Proceedings of the 57th annual meeting of the association for computational linguistics, 2019
  • Similarity of neural network representations revisited
  • Albert: A lite bert for self-supervised learning of language representations
  • Edge-recvit: Efficient vision transformer via semantic-refined dynamic recursion
  • DeepSeek-V3 Technical Report
  • Soft merging of experts with adaptive routing
  • Transactions on Machine Learning Research, 2024
  • Film: Visual reasoning with a general conditioning layer
  • From sparse to soft mixtures of experts
  • Demons in the detail: On implementing load balancing loss for training specialized mixture-of-expert models
  • Do vision transformers see like convolutional neural networks? Advances in neural information processing systems, 2021
  • Scaling vision with sparse mixture of experts
  • The effective rank: A measure of effective dimensionality
  • Outrageously large neural networks: The sparsely-gated mixture-of-experts layer
  • Sliced recursive transformer
  • Sparse universal transformer
  • Deit iii: Revenge of the vit
  • The geometry of hidden representations of large transformer models
  • Auxiliary-loss-free load balancing strategy for mixture-of-experts (opens arXiv in a new tab)
  • Remoe: Fully differentiable mixture-of-experts with relu routing
  • Qwen3 Technical Report
  • Condconv: Conditionally parameterized convolutions for efficient inference
  • Minivit: Compressing vision transformers with weight multiplexing
  • Lory: Fully differentiable mixture-of-experts for autoregressive language model pre-training
  • St-moe: Designing stable and transferable sparse expert models (opens arXiv in a new tab)