paper-with-me

홈 › Papers

Adaptively Sparse Transformers

2019-08-30 · IJCNLP 2019 11 · Gonçalo M. Correia, Vlad Niculae, André F. T. Martins

Attention mechanisms have become ubiquitous in NLP. Recent architectures, notably the Transformer, learn powerful context-aware word representations through layered, multi-headed attention. The multiple heads learn diverse types of word relationships. However, with standard softmax attention, all attention heads are dense, assigning a non-zero weight to all context words. In this work, we introduce the adaptively sparse Transformer, wherein attention heads have flexible, context-dependent sparsity patterns. This sparsity is accomplished by replacing softmax with $\alpha$-entmax: a differentiable generalization of softmax that allows low-scoring words to receive precisely zero weight. Moreover, we derive a method to automatically learn the $\alpha$ parameter -- which controls the shape and sparsity of $\alpha$-entmax -- allowing attention heads to choose between focused or spread-out behavior. Our adaptively sparse Transformer improves interpretability and head diversity when compared to softmax Transformers on machine translation datasets. Findings of the quantitative and qualitative analysis of our approach include that heads in different layers learn different sparsity preferences and tend to be more diverse in their attention distributions than softmax Transformers. Furthermore, at no cost in accuracy, sparsity in attention heads helps to uncover different head specializations.

📄 PDF Abstract BibTeX arXiv:1909.00015

Code (3)

deep-spin/entmax 공식 구현 pytorch
prajjwal1/adaptive_transformer pytorch
prajjwal1/fluence pytorch

Tasks

DiversityMachine TranslationTranslation

Methods 이 논문이 사용한 방법론

Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Absolute Position Encodings Absolute Position Encodings are a type of position embeddings for [Transformer-based models] where positional encodings are…
Position-Wise Feed-Forward Layer 설명 없음
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…
Interpretability 설명 없음
Adaptively Sparse Transformer The Adaptively Sparse Transformer is a type of Transformer.
Residual Connection 설명 없음
Attention Dropout Attention Dropout is a type of dropout used in attention-based architectures, where elements are randomly dropped out of the…

Similar Papers 제목 키워드 기반

SparseMAE: Sparse Training Meets Masked Autoencoders

2023-01-01 · ICCV 2023 1 · Aojun Zhou, Yang Li, Zipeng Qin, Jianbo Liu 외

Masked Autoencoders (MAE) and its variants have proven to be effective for pretraining large-scale Vision Transformers (ViTs). However, small-scale models do not benefit from the pretraining mechanisms due to limited…

Exploring the Benefit of Activation Sparsity in Pre-training

2024-10-04 · Zhengyan Zhang, Chaojun Xiao, Qiujieli Qin, Yankai Lin 외

Pre-trained Transformers inherently possess the characteristic of sparse activation, where only a small fraction of the neurons are activated for each token. While sparse activation has been explored through post-trainin…

Dynamic Grained Encoder for Vision Transformers

2023-01-10 · NeurIPS 2021 12 · Lin Song, Songyang Zhang, Songtao Liu, Zeming Li 외

Transformers, the de-facto standard for language modeling, have been recently applied for vision tasks. This paper introduces sparse queries for vision transformers to exploit the intrinsic spatial redundancy of natural …

image-classificationImage ClassificationLanguage ModelingLanguage Modelling+2

ScalingAttention: Discovering Intrinsic Sparse Attention Topology for Video Diffusion Transformers

2026-06-22 · Ruiliang Zhou, Xuecheng Wu, Kang He, Guangyun Han 외 arxiv

While Diffusion Transformers (DiTs) have revolutionized high-fidelity video generation, their reliance on 3D full attention creates a quadratic computational bottleneck. Existing sparse methods face a dilemma: dynamic pr…

Video Generation

Learning A Sparse Transformer Network for Effective Image Deraining

2023-03-21 · CVPR 2023 1 · Xiang Chen, Hao Li, Mingqiang Li, Jinshan Pan

Transformers-based methods have achieved significant performance in image deraining as they can model the non-local information which is vital for high-quality image reconstruction. In this paper, we find that most exist…

Image ReconstructionImage RestorationMixture-of-ExpertsRain Removal