MLP Can Be A Good Transformer Learner

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Lin, Sihao, Lyu, Pumeng, Liu, Dongrui, Tang, Tao, Liang, Xiaodan, Song, Andy, Chang, Xiaojun
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910402581889024
author Lin, Sihao
Lyu, Pumeng
Liu, Dongrui
Tang, Tao
Liang, Xiaodan
Song, Andy
Chang, Xiaojun
author_facet Lin, Sihao
Lyu, Pumeng
Liu, Dongrui
Tang, Tao
Liang, Xiaodan
Song, Andy
Chang, Xiaojun
contents Self-attention mechanism is the key of the Transformer but often criticized for its computation demands. Previous token pruning works motivate their methods from the view of computation redundancy but still need to load the full network and require same memory costs. This paper introduces a novel strategy that simplifies vision transformers and reduces computational load through the selective removal of non-essential attention layers, guided by entropy considerations. We identify that regarding the attention layer in bottom blocks, their subsequent MLP layers, i.e. two feed-forward layers, can elicit the same entropy quantity. Meanwhile, the accompanied MLPs are under-exploited since they exhibit smaller feature entropy compared to those MLPs in the top blocks. Therefore, we propose to integrate the uninformative attention layers into their subsequent counterparts by degenerating them into identical mapping, yielding only MLP in certain transformer blocks. Experimental results on ImageNet-1k show that the proposed method can remove 40% attention layer of DeiT-B, improving throughput and memory bound without performance compromise. Code is available at https://github.com/sihaoevery/lambda_vit.
format Preprint
id arxiv_https___arxiv_org_abs_2404_05657
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle MLP Can Be A Good Transformer Learner
Lin, Sihao
Lyu, Pumeng
Liu, Dongrui
Tang, Tao
Liang, Xiaodan
Song, Andy
Chang, Xiaojun
Computer Vision and Pattern Recognition
Self-attention mechanism is the key of the Transformer but often criticized for its computation demands. Previous token pruning works motivate their methods from the view of computation redundancy but still need to load the full network and require same memory costs. This paper introduces a novel strategy that simplifies vision transformers and reduces computational load through the selective removal of non-essential attention layers, guided by entropy considerations. We identify that regarding the attention layer in bottom blocks, their subsequent MLP layers, i.e. two feed-forward layers, can elicit the same entropy quantity. Meanwhile, the accompanied MLPs are under-exploited since they exhibit smaller feature entropy compared to those MLPs in the top blocks. Therefore, we propose to integrate the uninformative attention layers into their subsequent counterparts by degenerating them into identical mapping, yielding only MLP in certain transformer blocks. Experimental results on ImageNet-1k show that the proposed method can remove 40% attention layer of DeiT-B, improving throughput and memory bound without performance compromise. Code is available at https://github.com/sihaoevery/lambda_vit.
title MLP Can Be A Good Transformer Learner
topic Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2404.05657