CVApr 8, 2024

MLP Can Be A Good Transformer Learner

arXiv:2404.05657v126 citationsh-index: 7Has CodeCVPR
Originality Incremental advance
AI Analysis

This addresses the high computational demands of transformers for vision tasks, offering a practical improvement but is incremental as it builds on existing pruning methods.

The paper tackles the computational inefficiency of vision transformers by selectively removing non-essential attention layers based on entropy analysis, achieving a 40% reduction in attention layers for DeiT-B on ImageNet-1k without performance loss.

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.

Code Implementations1 repo
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes