[CVPR2025]Breaking the Low-Rank Dilemma of Linear Attention

March 11, 2025 ยท View on GitHub

Implementation of "Breaking the Low-Rank Dilemma of Linear Attention"

The Softmax attention mechanism in Transformer models is notoriously computationally expensive, particularly due to its quadratic complexity, posing significant challenges in vision applications. In contrast, linear attention provides a far more efficient solution by reducing the complexity to linear levels. However, compared to Softmax attention, linear attention often experiences significant performance degradation. Our experiments indicate that this performance drop is due to the low-rank nature of linear attention's feature map, which hinders its ability to adequately model complex spatial information. In this paper, to break the low-rank dilemma of linear attention, we conduct rank analysis from two perspectives: the KV buffer and the output features. Consequently, we introduce Rank-Augmented Linear Attention (RALA), which rivals the performance of Softmax attention while maintaining linear complexity and high efficiency. Based on RALA, we construct the Rank-Augmented Vision Linear Transformer (RAVLT). Extensive experiments demonstrate that RAVLT achieves excellent performance across various vision tasks. Specifically, without using any additional labels, data, or supervision during training, RAVLT achieves an 84.4% Top-1 accuracy on ImageNet-1k with only 26M parameters and 4.6G FLOPs. This result significantly surpasses previous linear attention mechanisms, fully illustrating the potential of RALA.

Citation

@inproceedings{fan2024breaking,
      title={Breaking the Low-Rank Dilemma of Linear Attention},
      author={Qihang Fan and Huaibo Huang and Ran He },
      year={2025},
      booktitle={CVPR},
}

Image Classification

ModelParams(M)FLOPs(G)ckpt
RAVLT-T152.4RAVLT-T
RAVLT-S264.6RAVLT-S
RAVLT-B489.9RAVLT-B
RAVLT-L9516.0RAVLT-L

Object Detection and Instance Segmentation

Retinanet 1x

BackboneParams(M)FLOPs(G)APbAPb50APb75APbSAPbMAPbLckpt
RAVLT-T2420145.967.449.428.550.160.8RAVLT-T
RAVLT-S3424448.369.852.132.752.863.6RAVLT-S
RAVLT-B5735349.871.254.034.054.364.9RAVLT-B
RAVLT-L10448250.972.255.034.755.765.4RAVLT-L

Mask R-CNN 1x

BackboneParams(M)FLOPs(G)APbAPb50APb75APmAPm50APm75ckpt
RAVLT-T3321947.369.151.942.766.246.0RAVLT-T
RAVLT-S4426249.871.354.544.668.548.2RAVLT-S
RAVLT-B6737251.272.756.445.769.949.5RAVLT-B
RAVLT-L11450152.373.857.346.471.150.4RAVLT-L

Mask R-CNN 3x

BackboneParams(M)FLOPs(G)APbAPb50APb75APmAPm50APm75ckpt
RAVLT-S4426251.472.356.545.569.748.8RAVLT-S
RAVLT-B6737252.773.557.746.470.650.2RAVLT-B
RAVLT-L11450153.674.458.947.371.651.2RAVLT-L

Cascade Mask R-CNN 3x

BackboneParams(M)FLOPs(G)APbAPb50APb75APmAPm50APm75ckpt
RAVLT-S8274154.272.958.746.870.550.9RAVLT-S
RAVLT-B10585155.373.860.147.771.452.1RAVLT-B
RAVLT-L15297955.674.160.548.071.852.3RAVLT-L

Semantic Segmentation

Semantic FPN 1x

BackboneParams(M)FLOPs(G)mIoU(%)ckpt
RAVLT-T1813647.9RAVLT-T
RAVLT-S2818049.5RAVLT-S
RAVLT-B5129251.9RAVLT-B
RAVLT-L9842452.6RAVLT-L

UperNet 2x

BackboneParams(M)FLOPs(G)mIoU(%)ckpt
RAVLT-S5593750.7RAVLT-S
RAVLT-B77105052.5RAVLT-B
RAVLT-L125118253.2RAVLT-L