Sliced Recursive Transformer

Zhiqiang Shen, Zechun Liu, Eric Xing
11/9/2021
cs.CVcs.AIcs.LG
transformer-attention

Official code: szq0214/SReT (67 stars, Python, MIT, last commit 2022-09-06).

Abstract

We present a neat yet effective recursive operation on vision transformers that can improve parameter utilization without involving additional parameters. This is achieved by sharing weights across the depth of transformer networks.

Show full abstract

The proposed method can obtain a substantial gain (~2%) simply using naive recursive operation, requires no special or sophisticated knowledge for designing principles of networks, and introduces minimal computational overhead to the training procedure. To reduce the additional computation caused by recursive operation while maintaining the superior accuracy, we propose an approximating method through multiple sliced group self-attentions across recursive layers which can reduce the cost consumption by 10~30% with minimal performance loss. We call our model Sliced Recursive Transformer (SReT), a novel and parameter-efficient vision transformer design that is compatible with a broad range of other designs for efficient ViT architectures. Our best model establishes significant improvement on ImageNet-1K over state-of-the-art methods while containing fewer parameters. The proposed weight sharing mechanism by sliced recursion structure allows us to build a transformer with more than 100 or even 1000 shared layers with ease while keeping a compact size (13~15M), to avoid optimization difficulties when the model is too large. The flexible scalability has shown great potential for scaling up models and constructing extremely deep vision transformers. Code is available at https://github.com/szq0214/SReT.

View on arXivView PDF

Code Implementations(1)

szq0214/SReTOfficial100%
MIT

Official PyTorch implementation of our ECCV 2022 paper "Sliced Recursive Transformer"

6711PythonNov 9, 20214 years agoMIT
efficient-neural-networksefficient-transformerstransformer-architecturevision-transformervit

Similar Papers

Cite this paper

@article{shen2021sliced,
  title  = {Sliced Recursive Transformer},
  author = {Zhiqiang Shen and Zechun Liu and Eric Xing},
  year   = {2021},
  eprint = {2111.05297},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2111.05297}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2111.05297.svg)](https://codeofpaper.com/paper/2111.05297)

Discussion