paper-with-me

Papers

SLAB: Efficient Transformers with Simplified Linear Attention and Progressive Re-parameterized Batch Normalization

2024-05-19 · Jialong Guo, Xinghao Chen, Yehui Tang, Yunhe Wang

Transformers have become foundational architectures for both natural language and computer vision tasks. However, the high computational cost makes it quite challenging to deploy on resource-constraint devices. This paper investigates the computational bottleneck modules of efficient transformer, i.e., normalization layers and attention modules. LayerNorm is commonly used in transformer architectures but is not computational friendly due to statistic calculation during inference. However, replacing LayerNorm with more efficient BatchNorm in transformer often leads to inferior performance and collapse in training. To address this problem, we propose a novel method named PRepBN to progressively replace LayerNorm with re-parameterized BatchNorm in training. Moreover, we propose a simplified linear attention (SLA) module that is simple yet effective to achieve strong performance. Extensive experiments on image classification as well as object detection demonstrate the effectiveness of our proposed method. For example, our SLAB-Swin obtains $83.6\%$ top-1 accuracy on ImageNet-1K with $16.2$ms latency, which is $2.4$ms less than that of Flatten-Swin with $0.1\%$ higher accuracy. We also evaluated our method for language modeling task and obtain comparable performance and lower latency.Codes are publicly available at https://github.com/xinghaochen/SLAB and https://github.com/mindspore-lab/models/tree/master/research/huawei-noah/SLAB.

📄 PDF Abstract BibTeX arXiv:2405.11582

Code (3)

mindspore-lab/models 공식 구현 mindspore
xinghaochen/slab 공식 구현 pytorch
MS-P3/code4/tree/main/SLAB mindspore

Tasks

image-classificationImage ClassificationLanguage ModelingLanguage Modellingobject-detectionObject Detection

Similar Papers 제목 키워드 기반

2Mamba2Furious: Linear in Complexity, Competitive in Accuracy

2026-02-19 · Gabriel Mongaras, Eric C. Larson arxiv

Linear attention transformers have become a strong alternative to softmax attention due to their efficiency. However, linear attention tends to be less expressive and results in reduced accuracy compared to softmax atten…

Understanding Factual Recall in Transformers via Associative Memories

2024-12-09 · Eshaan Nichani, Jason D. Lee, Alberto Bietti

Large language models have demonstrated an impressive ability to perform factual recall. Prior work has found that transformers trained on factual recall tasks can store information at a rate proportional to their parame…

LT2: Linear-Time Looped Transformers

2026-05-20 · Chunyuan Deng, Yizhe Zhang, Rui-Jie Zhu, Yuanyuan Xu 외 arxiv

Looped Transformers (LT) have emerged as a powerful architecture by iterating their layers multiple times before decoding the final token. However, pairing them with full attention retains quadratic complexity, making th…

SGFormer: Single-Layer Graph Transformers with Approximation-Free Linear Complexity

2024-09-13 · Qitian Wu, Kai Yang, Hengrui Zhang, David Wipf 외

Learning representations on large graphs is a long-standing challenge due to the inter-dependence nature. Transformers recently have shown promising performance on small graphs thanks to its global attention for capturin…

Deep AttentionRepresentation Learning

LiT: Delving into a Simplified Linear Diffusion Transformer for Image Generation

2025-01-22 · Jiahao Wang, Ning Kang, Lewei Yao, Mengzhao Chen 외

In commonly used sub-quadratic complexity modules, linear attention benefits from simplicity and high parallelism, making it promising for image synthesis tasks. However, the architectural design and learning strategy fo…

Image GenerationKnowledge DistillationMambaText to Image Generation+1