Sliced Recursive Transformer

Zhiqiang Shen, Zechun Liu, Eric P. Xing

In the landscape of Vision Transformers (ViTs), the prevailing paradigm has often equated model scale with performance. However, massive parameter counts pose significant challenges for deployment on edge devices and increase training costs. The Sliced Recursive Transformer (SReT), proposed by Zhiqiang Shen et al., introduces a novel architectural shift: increasing effective model depth through recursive weight sharing without expanding the parameter footprint.

Addressing the Parameter Explosion

Standard ViTs rely on a stack of distinct layers, where increasing representational power typically necessitates adding more layers and, consequently, more parameters. Observations in deep ViTs have revealed high redundancy in weights and activations across adjacent layers. SReT addresses this by:

  1. Improving Parameter Efficiency: Increasing depth without increasing model size.
  2. Mitigating Computational Overhead: Overcoming the optimization difficulties and high FLOP counts typically associated with recursive models.

Methodology

SReT employs three primary innovations to enable effective recursion in Vision Transformers.

1. Atomic Recursive Operation & Non-linear Projection

Instead of a standard linear stack of $L$ layers, SReT utilizes a compact set of blocks through which data is passed $N$ times. To prevent the network from converging to a trivial identity mapping—a common failure mode in recursive architectures—the authors introduce a Non-linear Projection Layer (NLL). This small MLP, inserted between recursive passes, ensures that features are transformed at every step.

The Recursive Transformer Block architecture, featuring the recursive loop and internal components.

2. Sliced Group Self-Attention

To manage the computational cost ($O(N^2)$) of global self-attention during multiple recursive loops, SReT "slices" attention into multiple groups. By alternating these slices and using permutations between loops, the model facilitates information flow across the entire image. This approximates global attention while reducing FLOP consumption by 10–30%.

3. Learnable Residual Connections (LRC)

To stabilize the training of extremely deep architectures (exceeding 100 layers), learnable coefficients are added to the residual connections. This allows the network to dynamically balance the identity path and the transformation path during optimization.

Experimental Results

The SReT architecture was evaluated on ImageNet-1K for classification and on IWSLT/WMT datasets for Neural Machine Translation (NMT).

Performance comparison of SReT against state-of-the-art models in terms of Top-1 Accuracy vs. Parameters and FLOPs.

Key Findings

  • Efficiency Benchmarks: SReT-ExT (Extra Tiny) achieves 74.0% Top-1 accuracy on ImageNet with only 4.0M parameters and 0.7B FLOPs, outperforming the PiT-T baseline (4.9M parameters, 73.0% accuracy).
  • Competitive Performance: SReT-S (21M parameters) reaches 81.9% accuracy, surpassing Swin-T (29M parameters) while maintaining higher throughput.
  • Scalability: The authors successfully trained SReT-108, a 108-layer model, demonstrating that the architecture avoids the optimization "death spiral" common in ultra-deep transformers.
  • Generalization: Beyond vision, SReT showed consistent improvements in BLEU scores for NMT tasks compared to vanilla transformers.

Discussion and Future Work

SReT demonstrates that weight sharing across depth acts as a powerful regularizer, smoothing the loss landscape and making deep models easier to optimize. While recursion introduces sequential dependencies that can affect wall-clock time on specific hardware, throughput tests on modern GPUs show SReT remains highly competitive. Future research may explore "mixed-depth" training to further optimize the trade-off between computational speed and model accuracy.

Reference: Shen, Z., Liu, Z., & Xing, E. (2022). Sliced Recursive Transformer. GitHub Link

Summary updated

BibTeX
@inproceedings{shen2022sliced,
  author = {Zhiqiang Shen and Zechun Liu and Eric P. Xing},
  title = {{Sliced Recursive Transformer}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  doi = {10.1007/978-3-031-20053-3\_42},
}
Figure