TaylorShift: Shifting the Complexity of Self-Attention from Squared to Linear (and Back) using Taylor-Softmax
Not on the map. Why?
Abstract (arXiv)
The quadratic complexity of the attention mechanism represents one of the biggest hurdles for processing long sequences using Transformers. Current methods, relying on sparse representations or stateful recurrence, sacrifice token-to-token interactions, which ultimately leads to compromises in performance. This paper introduces TaylorShift, a novel reformulation of the Taylor softmax that enables computing full token-to-token interactions in linear time and space. We analytically determine the crossover points where employing TaylorShift becomes more efficient than traditional attention, aligning closely with empirical measurements. Specifically, our findings demonstrate that TaylorShift enhances memory efficiency for sequences as short as 800 tokens and accelerates inference for inputs of approximately 1700 tokens and beyond. For shorter sequences, TaylorShift scales comparably with the vanilla attention. Furthermore, a classification benchmark across five tasks involving long sequences reveals no degradation in accuracy when employing Transformers equipped with TaylorShift. For reproducibility, we provide access to our code under https://github.com/tobna/TaylorShift.
Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). Builds on 34 of its 42 references that are in the map. First posted on arXiv 5 Mar 2024.
Builds on
34 of 42 references.
References · 34
- 2017Attention Is All You Needcited by 60,361
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,305
- 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,139
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,850
- 2020Big Bird: Transformers for Longer Sequencescited by 1,684
- 2020Reformer: The Efficient Transformercited by 1,668
- 2020Rethinking Attention with Performerscited by 1,601
- 2020Linformer: Self-Attention with Linear Complexitycited by 1,474
- 2020Efficient Transformers: A Surveycited by 790
22 more
- 2020Long Range Arena: A Benchmark for Efficient Transformerscited by 700
- 2021Nystr"omformer: A Nystr"om-Based Algorithm for Approximating Self-Attentioncited by 471
- 2022DeiT III: Revenge of the ViTcited by 419
- 2021A Survey of Transformerscited by 401
- 2021Random Feature Attentioncited by 354
- 2021XCiT: Cross-Covariance Image Transformerscited by 338
- 2015Explaining NonLinear Classification Decisions with Deep Taylor Decompositioncited by 250
- 2022On The Computational Complexity of Self-Attentioncited by 139
- 2023Focused Transformer: Contrastive Training for Context Scalingcited by 133
- 2018ListOps: A Diagnostic Dataset for Latent Tree Learningcited by 129
- 2023Scaling Transformer to 1M tokens and beyond with RMTcited by 98
- 2023MB-TaylorFormer: Multi-branch Efficient Transformer Expanded by Taylor Formula for Image Dehazingcited by 81
- 2021A Practical Survey on Faster and Lighter Transformerscited by 73
- 2019Explaining Convolutional Neural Networks using Softmax Gradient Layer-wise Relevance Propagationcited by 29
- 2022ViTALiTy: Unifying Low-rank and Sparse Approximation for Vision Transformer Acceleration with a Linear Taylor Attentioncited by 29
- 2015An Exploration of Softmax Alternatives Belonging to the Spherical Loss Familycited by 27
- 2023Efficient Attention via Control Variatescited by 23
- 2020Exploring Alternatives to Softmax Functioncited by 16
- 2014Efficient Exact Gradient Update for training Deep Networks with Very Large Sparse Targetscited by 10
- 2022CAB: Comprehensive Attention Benchmarking on Long Sequence Modelingcited by 10
- 2023Which Transformer to Favor: A Comparative Analysis of Efficiency in Vision Transformerscited by 9
- 2023Taylorformer: Probabilistic Modelling for Random Processes including Time Seriescited by 2
Built on by
Citing papers per year: 2024: 3; 2025: 1; 2026: 3.
7 papers.
- 2024Understanding the differences in Foundation Models: Attention, State Space Models, and Recurrent Neural Networkscited by 26
- 2025On the Expressiveness of Softmax Attention: A Recurrent Neural Network Perspectivecited by 6
- 2026ZeroS: Zero-Sum Linear Attention for Efficient Transformerscited by 5
- 2024Optimizing Vision Transformers with Data-Free Knowledge Transfercited by 1
- 2024A Low-Resolution Image is Worth 1x1 Words: Enabling Fine Image Super-Resolution with Transformers and TaylorShiftcited by 1
- 2026Self-Attention at Constant Cost per Token via Symmetry-Aware Taylor Approximationcited by 0
- 2026Not All Dimensions Are Equal: Outlier-Aware Attention Linearization with Grouped Quadratic Kernelscited by 0
- 2026Not All Dimensions Are Equal: Outlier-Aware Attention Linearization with Grouped Quadratic Kernels9 Oct 2026
- 2026ZeroS: Zero-Sum Linear Attention for Efficient Transformers5 Feb 2026
- 2026Self-Attention at Constant Cost per Token via Symmetry-Aware Taylor Approximation30 Jan 2026
- 2025On the Expressiveness of Softmax Attention: A Recurrent Neural Network Perspective31 Jul 2025
- 2024A Low-Resolution Image is Worth 1x1 Words: Enabling Fine Image Super-Resolution with Transformers and TaylorShift15 Nov 2024
- 2024Optimizing Vision Transformers with Data-Free Knowledge Transfer12 Aug 2024
- 2024Understanding the differences in Foundation Models: Attention, State Space Models, and Recurrent Neural Networks24 May 2024