paper-with-me

Papers

You Need to Pay Better Attention: Rethinking the Mathematics of Attention Mechanism

2024-03-03 · Mehran Hosseini, Peyman Hosseini

Scaled Dot Product Attention (SDPA) is the backbone of many modern deep-learning models. It is so versatile that it has been used in natural language, vision, and multi-modal domains with very little change compared to its original formulation. This paper discusses why the current formulation is inefficient by delving into the mathematical details of the attention mechanism. We propose three improvements to mitigate these inefficiencies, thereby, introducing three enhanced attention mechanisms: Optimised, Efficient, and Super Attention. Optimised and Efficient Attention have one and two matrix multiplications fewer per head, respectively, and 25% and 50% fewer parameters, respectively, than standard SDPA, but perform similarly to standard SDPA in both vision and natural language tasks. They can be used in all applications where SDPA is used while offering smaller model sizes and faster training and inference without noticeable loss in performance. Super Attention introduces a new linear transformation on the values, transforming them from the left. It outperforms standard SPDA on vision and natural language tasks by up to 17% while having one fewer matrix multiplication per head and 25% fewer parameters than standard SDPA. Consequently, it is also faster than standard SDPA. Super Attention is ideal in applications where the attention layer's context length is fixed, such as Vision Transformers. In addition to providing mathematical reasoning, we evaluate the presented attention mechanisms on several datasets including MNIST, CIFAR100, ImageNet, IMDB Movie Reviews, and Amazon Reviews datasets, as well as combined Europarl and Anki English-Spanish datasets for neural machine translation.

📄 PDF Abstract BibTeX arXiv:2403.01643

Code (0)

등록된 구현이 없습니다.

Tasks

Machine TranslationMathematical Reasoning

Methods 이 논문이 사용한 방법론

Attention 설명 없음
Layer Normalization Unlike batch normalization, Layer Normalization directly estimates the normalization statistics from the summed inputs…
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…
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…
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$…
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…
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…
Adam 설명 없음

Similar Papers 제목 키워드 기반

Enhancing the Transformer with Explicit Relational Encoding for Math Problem Solving

2019-10-15 · Imanol Schlag, Paul Smolensky, Roland Fernandez, Nebojsa Jojic 외

We incorporate Tensor-Product Representations within the Transformer in order to better support the explicit representation of relation structure. Our Tensor-Product Transformer (TP-Transformer) sets a new state of the a…

MathQuestion Answering

A Mathematical Introduction to Generative Adversarial Nets (GAN)

2020-09-01 · Yang Wang

Generative Adversarial Nets (GAN) have received considerable attention since the 2014 groundbreaking work by Goodfellow et al. Such attention has led to an explosion in new ideas, techniques and applications of GANs. To …

Fast and Simplex: 2-Simplicial Attention in Triton

2025-07-03 · Aurko Roy, Timothy Chou, Sai Surya Duvvuri, Sijia Chen 외

Recent work has shown that training loss scales as a power law with both model size and the number of tokens, and that achieving compute-optimal models requires scaling model size and token count together. However, these…

valid

Shaping the Future of Mathematics in the Age of AI

2026-03-26 · Johan Commelin, Mateja Jamnik, Rodrigo Ochigame, Lenny Taelman 외 arxiv

Artificial intelligence is transforming mathematics at a speed and scale that demand active engagement from the mathematical community. We examine five areas where this transformation is particularly pressing: values, pr…

Better Models, Faster Training: Sigmoid Attention for single-cell Foundation Models

2026-04-29 · Vijay Sadashivaiah, Georgios Dasoulas, Judith Mueller, Soumya Ghosh arxiv

Training stable biological foundation models requires rethinking attention mechanisms: we find that using sigmoid attention as a drop in replacement for softmax attention a) produces better learned representations: on si…