TensorX
返回文献探索

Paper · arXiv 2309.08586

Replacing softmax with ReLU in Vision Transformers

Mitchell Wortsman, Jaehoon Lee, Justin Gilmer, Simon Kornblith

18 upvotesSeptember 15, 2023arXiv 预印本
AI 摘要

Replacing the attention softmax with ReLU and dividing by sequence length in vision transformers can maintain or improve performance compared to using softmax alone.

attention softmaxReLU-attentionsequence lengthvision transformers

Abstract

Previous research observed accuracy degradation when replacing the attention softmax with a point-wise activation such as ReLU. In the context of vision transformers, we find that this degradation is mitigated when dividing by sequence length. Our experiments training small to large vision transformers on ImageNet-21k indicate that ReLU-attention can approach or match the performance of softmax-attention in terms of scaling behavior as a function of compute.

北京市昌平区探索星信息技术及软件开发工作室

京ICP备2026059466号
Replacing softmax with ReLU in Vision Transformers | TensorX