paper-with-me

홈 › Papers

Sliceformer: Make Multi-head Attention as Simple as Sorting in Discriminative Tasks

2023-10-26 · Shen Yuan, Hongteng Xu

As one of the most popular neural network modules, Transformer plays a central role in many fundamental deep learning models, e.g., the ViT in computer vision and the BERT and GPT in natural language processing. The effectiveness of the Transformer is often attributed to its multi-head attention (MHA) mechanism. In this study, we discuss the limitations of MHA, including the high computational complexity due to its `query-key-value'' architecture and the numerical issue caused by its softmax operation. Considering the above problems and the recent development tendency of the attention layer, we propose an effective and efficient surrogate of the Transformer, called Sliceformer. Our Sliceformer replaces the classic MHA mechanism with an extremely simple `slicing-sorting'' operation, i.e., projecting inputs linearly to a latent space and sorting them along different feature dimensions (or equivalently, called channels). For each feature dimension, the sorting operation implicitly generates an implicit attention map with sparse, full-rank, and doubly-stochastic structures. We consider different implementations of the slicing-sorting operation and analyze their impacts on the Sliceformer. We test the Sliceformer in the Long-Range Arena benchmark, image classification, text classification, and molecular property prediction, demonstrating its advantage in computational complexity and universal effectiveness in discriminative tasks. Our Sliceformer achieves comparable or better performance with lower memory cost and faster speed than the Transformer and its variants. Moreover, the experimental results reveal that applying our Sliceformer can empirically suppress the risk of mode collapse when representing data. The code is available at \url{https://github.com/SDS-Lab/sliceformer}.

📄 PDF Abstract BibTeX arXiv:2310.17683

Code (1)

sds-lab/sliceformer 공식 구현 jax

Tasks

image-classificationImage ClassificationMolecular Property PredictionProperty Predictiontext-classificationText Classification

Methods 이 논문이 사용한 방법론

Refunds@Expedia|||How do I get a full refund from Expedia? “How do I get a full refund from Expedia? How do I get a full refund from Expedia? – Call ☎️ +1-(888) 829 (0881) or +1-805-330-4056 or +1-805-330-4056 for Quick Help &…
Attention 설명 없음
Cosine Annealing Cosine Annealing is a type of learning rate schedule that has the effect of starting with a large learning rate that is relatively rapidly decreased to a minimum value before…
Label Smoothing Label Smoothing is a regularization technique that introduces noise for the labels. This accounts for the fact that datasets may have mistakes in them, so maximizing the…
Residual Connection 설명 없음
BPE Byte Pair Encoding, or BPE, is a subword segmentation algorithm that encodes rare and unknown words as sequences of subword units. The intuition is that various word…
Weight Decay 설명 없음
WordPiece 설명 없음

Similar Papers 제목 키워드 기반

Static Program Slicing Using Language Models With Dataflow-Aware Pretraining and Constrained Decoding

2026-04-09 · Pengfei He, Shaowei Wang, Tse-Hsun Chen, Muhammad Asaduzzaman arxiv

Static program slicing is a fundamental software engineering technique for isolating code relevant to specific variables. While recent learning-based approaches using language models (LMs) show promise in automating slic…

Are Sixteen Heads Really Better than One?

2019-05-25 · NeurIPS 2019 12 · Paul Michel, Omer Levy, Graham Neubig

Attention is a powerful and ubiquitous mechanism for allowing neural models to focus on particular salient pieces of information by taking their weighted average when making predictions. In particular, multi-headed atten…

Attention Head Purification: A New Perspective to Harness CLIP for Domain Generalization

2024-12-10 · Yingfan Wang, Guoliang Kang

Domain Generalization (DG) aims to learn a model from multiple source domains to achieve satisfactory performance on unseen target domains. Recent works introduce CLIP to DG tasks due to its superior image-text alignment…

Domain GeneralizationPrompt Learning

On Attention Redundancy: A Comprehensive Study

2021-06-01 · NAACL 2021 4 · Yuchen Bian, Jiaji Huang, Xingyu Cai, Jiahong Yuan 외

Multi-layer multi-head self-attention mechanism is widely applied in modern neural language models. Attention redundancy has been observed among attention heads but has not been deeply studied in the literature. Using BE…

Model CompressionSentence

Superiority of Multi-Head Attention in In-Context Linear Regression

2024-01-30 · Yingqian Cui, Jie Ren, Pengfei He, Jiliang Tang 외

We present a theoretical analysis of the performance of transformer with softmax attention in in-context learning with linear regression tasks. While the existing literature predominantly focuses on the convergence of tr…

In-Context Learningregression