paper-with-me

홈 › Papers

LMSA: Low-relation Mutil-head Self-Attention Mechanism in Visual Transformer

2021-09-29 · JingJie Wang, Xiang Wei, Xiaoyu Liu

The Transformer backbone network with the self-attention mechanism as the core has achieved great success in the field of natural language processing and computer vision. However, through the self-attention mechanism brings high performance, it also brings higher computational complexity compared to the classic visual feature extraction methods. To further reduce the complexity of self-attention mechanism and explore its lighter version in computer vision, in this paper, we design a novel lightweighted self-attention mechanism: Low-relation Mutil-head Self-Attention (LMSA), which is superior than the recent self-attention. Specifically, the proposed self-attention mechanism breaks the barrier of the dimensional consistency of the traditional self-attention mechanism, resulting in lower computational complexity and occupies less storage space. In addition, employing the new mechanism can release part of the computing consumption of the Transformer network and make the best use of it. Experimental results show that the dimensional consistency inside the traditional self-attention mechanism is unnecessary. In particular, using Swin as the backbone model for training, the accuracy in CIFAR-10 image classification task is improved by 0.43$\%$, in the meanwhile, the consumption of a single self-attention resource is reduced by 64.58$\%$, and the number of model parameters and model size are reduced by more than 15$\%$. By appropriately compressing the dimensions of the self-attention relationship variables, the Transformer network can be more efficient and even perform better. The results prompt us to rethink the reason why the self-attention mechanism works.

📄 PDF Abstract BibTeX

Code (0)

등록된 구현이 없습니다.

Tasks

image-classificationImage ClassificationRelation

Methods 이 논문이 사용한 방법론

Multi-Head Attention 설명 없음
Attention 설명 없음
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Residual Connection 설명 없음
Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Dropout Dropout is a regularization technique for neural networks that drops a unit (along with connections) at training time with a specified probability $p$ (a common value is…
Dense Connections Dense Connections, or Fully Connected Connections, are a type of layer in a deep neural network that use a linear operation where every input is connected to every output…
Absolute Position Encodings Absolute Position Encodings are a type of position embeddings for [Transformer-based models] where positional encodings are…

Similar Papers 제목 키워드 기반

A Framework for Real-time Safeguarding the Text Generation of Large Language Model

2024-04-29 · Ximing Dong, Dayi Lin, Shaowei Wang, Ahmed E. Hassan

Large Language Models (LLMs) have significantly advanced natural language processing (NLP) tasks but also pose ethical and societal risks due to their propensity to generate harmful content. Existing methods have limitat…

Language ModelingLanguage ModellingLarge Language ModelText Generation+1

LMSanitator: Defending Prompt-Tuning Against Task-Agnostic Backdoors

2023-08-26 · Chengkun Wei, Wenlong Meng, Zhikun Zhang, Min Chen 외

Prompt-tuning has emerged as an attractive paradigm for deploying large-scale language models due to its strong downstream task performance and efficient multitask serving ability. Despite its wide adoption, we empirical…

MiniLMv2: Multi-Head Self-Attention Relation Distillation for Compressing Pretrained Transformers

2020-12-31 · Findings (ACL) 2021 8 · Wenhui Wang, Hangbo Bao, Shaohan Huang, Li Dong 외

We generalize deep self-attention distillation in MiniLM (Wang et al., 2020) by only using self-attention relation distillation for task-agnostic compression of pretrained Transformers. In particular, we define multi-hea…

RelationXLM-R

AlbanianLLMSafety: A Safety Evaluation Dataset for Large Language Models in Albanian

2026-05-26 · Wajdi Zaghouani, Kholoud K. Aldous, Isra Fejzullaj arxiv

Safety evaluation of Large Language Models (LLMs) has largely focused on high-resource languages, leaving low-resource languages critically underserved. We present AlbanianLLMSafety, the first publicly available safety e…

Do Attention Heads in BERT Track Syntactic Dependencies?

2019-11-27 · Phu Mon Htut, Jason Phang, Shikha Bordia, Samuel R. Bowman

We investigate the extent to which individual attention heads in pretrained transformer language models, such as BERT and RoBERTa, implicitly capture syntactic dependency relations. We employ two methods---taking the max…

CoLA