A-ViT: Adaptive Tokens for Efficient Vision Transformer

Abstract

We introduce A-ViT, a method that adaptively adjusts the inference cost of vision transformer ViT for images of different complexity. A-ViT achieves this by automatically reducing the number of tokens in vision transformers that are processed in the network as inference proceeds. We reformulate Adaptive Computation Time (ACT) for this task, extending halting to discard redundant spatial tokens. The appealing architectural properties of vision transformers enables our adaptive token reduction mechanism to speed up inference without modifying the network architecture or inference hardware. We demonstrate that A-ViT requires no extra parameters or sub-network for halting, as we base the learning of adaptive halting on the original network parameters. We further introduce distributional prior regularization that stabilizes training compared to prior ACT approaches. On the image classification task (ImageNet1K), we show that our proposed A-ViT yields high efficacy in filtering informative spatial features and cutting down on the overall compute. The proposed method improves the throughput of DeiT-Tiny by 62% and DeiT-Small by 38% with only 0.3% accuracy drop, outperforming prior art by a large margin.

Cite

Text

Yin et al. "A-ViT: Adaptive Tokens for Efficient Vision Transformer." Conference on Computer Vision and Pattern Recognition, 2022. doi:10.1109/CVPR52688.2022.01054

Markdown

[Yin et al. "A-ViT: Adaptive Tokens for Efficient Vision Transformer." Conference on Computer Vision and Pattern Recognition, 2022.](https://mlanthology.org/cvpr/2022/yin2022cvpr-avit/) doi:10.1109/CVPR52688.2022.01054

BibTeX

@inproceedings{yin2022cvpr-avit,
  title     = {{A-ViT: Adaptive Tokens for Efficient Vision Transformer}},
  author    = {Yin, Hongxu and Vahdat, Arash and Alvarez, Jose M. and Mallya, Arun and Kautz, Jan and Molchanov, Pavlo},
  booktitle = {Conference on Computer Vision and Pattern Recognition},
  year      = {2022},
  pages     = {10809-10818},
  doi       = {10.1109/CVPR52688.2022.01054},
  url       = {https://mlanthology.org/cvpr/2022/yin2022cvpr-avit/}
}