Rectifying Magnitude Neglect in Linear Attention
As the core operator of Transformers, Softmax Attention exhibits excellent global modeling capabilities. However, its quadratic complexity limits its applicability to vision tasks. In contrast, Linear Attention shares a similar formulation with Softmax Attention while achieving linear complexity, enabling efficient global information modeling. Nevertheless, Linear Attention suffers from a significant performance degradation compared to standard Softmax Attention. In this paper, we analyze the underlying causes of this issue based on the formulation of Linear Attention. We find that, unlike Softmax Attention, Linear Attention entirely disregards the magnitude information of the Query. This prevents the attention score distribution from dynamically adapting as the Query scales. As a result, despite its structural similarity to Softmax Attention, Linear Attention exhibits a significantly different attention score distribution. Based on this observation, we propose Magnitude-Aware Linear Attention (MALA), which modifies the computation of Linear Attention to fully incorporate the Query's magnitude. This adjustment allows MALA to generate an attention score distribution that closely resembles Softmax Attention while exhibiting a more well-balanced structure. We evaluate the effectiveness of MALA on multiple tasks, including image classification, object detection, instance segmentation, semantic segmentation, natural language processing, speech recognition, and image generation. Our MALA achieves strong results on all of these tasks. Code will be available at https://github.com/qhfan/MALA
Code (0)
등록된 구현이 없습니다.
Tasks
Instance SegmentationSemantic SegmentationImage ClassificationSpeech RecognitionSimilar Papers 제목 키워드 기반
Deep Convolutional Networks are Hierarchical Kernel Machines
In i-theory a typical layer of a hierarchical architecture consists of HW modules pooling the dot products of the inputs to the layer with the transformations of a few templates under a group. Such layers include as spec…
Parameterization of All Output-Rectifying Retrofit Controllers
This study investigates a parameterization of all output-rectifying retrofit controllers for distributed design of a structured controller. It has been discovered that all retrofit controllers can be characterized as a c…
AllSR-GAN: Semantic Rectifying Generative Adversarial Network for Zero-shot Learning
The existing Zero-Shot learning (ZSL) methods may suffer from the vague class attributes that are highly overlapped for different classes. Unlike these methods that ignore the discrimination among classes, in this paper,…
Generative Adversarial NetworkZero-Shot LearningLearning DNN networks using un-rectifying ReLU with compressed sensing application
The un-rectifying technique expresses a non-linear point-wise activation function as a data-dependent variable, which means that the activation variable along with its input and output can all be employed in optimization…
Combinatorial Optimizationcompressed sensingAnalysis of function approximation and stability of general DNNs in directed acyclic graphs using un-rectifying analysis
A general lack of understanding pertaining to deep feedforward neural networks (DNNs) can be attributed partly to a lack of tools with which to analyze the composition of non-linear functions, and partly to a lack of mat…
DiversityMathematical Induction