Relative Positional Encoding for Transformers with Linear Complexity
Not on the map. Why?
Abstract (arXiv)
Recent advances in Transformer models allow for unprecedented sequence lengths, due to linear space and time complexity. In the meantime, relative positional encoding (RPE) was proposed as beneficial for classical Transformers and consists in exploiting lags instead of absolute positions for inference. Still, RPE is not available for the recent linear-variants of the Transformer, because it requires the explicit computation of the attention matrix, which is precisely what is avoided by such methods. In this paper, we bridge this gap and present Stochastic Positional Encoding as a way to generate PE that can be used as a replacement to the classical additive (sinusoidal) PE and provably behaves like RPE. The main theoretical contribution is to make a connection between positional encoding and cross-covariance structures of correlated Gaussian processes. We illustrate the performance of our approach on the Long-Range Arena benchmark and on music generation.
Key facts. Cited by 37 papers in the map (data through 14 Oct 2026). Builds on 46 of its 71 references that are in the map. First posted on arXiv 18 May 2021.
Builds on
46 of 71 references.
References · 46
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
- 2014Very Deep Convolutional Networks for Large-Scale Image Recognitioncited by 15,364
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,548
- 2019The Curious Case of Neural Text Degenerationcited by 2,916
- 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,790
- 2020DeBERTa: Decoding-enhanced BERT with Disentangled Attentioncited by 2,181
- 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
34 more
- 2020Rethinking Attention with Performerscited by 1,601
- 2019Generating Long Sequences with Sparse Transformerscited by 1,546
- 2020Linformer: Self-Attention with Linear Complexitycited by 1,474
- 2018Self-Attention with Relative Position Representationscited by 1,120
- 2020Long Range Arena: A Benchmark for Efficient Transformerscited by 700
- 2018Universal Transformerscited by 647
- 2017Convolutional Sequence to Sequence Learningcited by 552
- 2020Efficient Content-Based Sparse Attention with Routing Transformerscited by 471
- 2018Efficient Attention: Attention with Linear Complexitiescited by 368
- 2019Transformer Dissection: A Unified Understanding of Transformer's Attention via the Lens of Kernelcited by 213
- 2020Rethinking Positional Encoding in Language Pre-trainingcited by 197
- 2020DDSP: Differentiable Digital Signal Processingcited by 178
- 2018ListOps: A Diagnostic Dataset for Latent Tree Learningcited by 129
- 2021Compound Word Transformer: Learning to Compose Full-Song Music over Dynamic Directed Hypergraphscited by 110
- 2021LambdaNetworks: Modeling Long-Range Interactions Without Attentioncited by 107
- 2018The Best of Both Worlds: Combining Recent Advances in Neural Machine Translationcited by 102
- 2019Language Modeling with Deep Transformerscited by 96
- 2017Onsets and Frames: Dual-Objective Piano Transcriptioncited by 94
- 2020Improve Transformer Models with Better Relative Position Embeddingscited by 73
- 2020Positional Encoding as Spatial Inductive Bias in GANscited by 69
- 2016madmom: a new Python Audio and Music Signal Processing Librarycited by 64
- 2020Learning to Encode Position for Transformer with Continuous Dynamical Modelcited by 61
- 2019LakhNES: Improving multi-instrumental music generation with cross-domain pre-trainingcited by 54
- 2019Encoding word order in complex embeddingscited by 53
- 2020What Do Position Embeddings Learn? An Empirical Study of Pre-Trained Language Model Positional Encodingcited by 52
- 2019Transformers with convolutional context for ASRcited by 44
- 2019T-GSA: Transformer with Gaussian-weighted self-attention for speech enhancementcited by 34
- 2020Relative Positional Encoding for Speech Recognition and Direct Translationcited by 23
- 2020Local Self-Attention over Long Text for Efficient Document Retrievalcited by 18
- 2020Pop Music Transformer: Beat-based Modeling and Generation of Expressive Pop Piano Compositionscited by 16
- 2019Improving Generalization of Transformer for Speech Recognition with Parallel Schedule Sampling and Relative Positional Embeddingcited by 12
- 2015Cross-Covariance Functions for Multivariate Geostatisticscited by 8
- 2019Lattice-Based Transformer Encoder for Neural Machine Translationcited by 5
- 2019Positional Encoding by Robots with Non-Rigid Movementscited by 1
Built on by
Citing papers per year: 2021: 6; 2022: 5; 2023: 9; 2024: 5; 2025: 10; 2026: 2.
37 papers.
Sort:
By area:
- 2022cosFormer: Rethinking Softmax in Attentioncited by 213
- 2021Learnable Fourier Features for Multi-Dimensional Spatial Positional Encodingcited by 93
- 2025Edit Flows: Flow Matching with Edit Operationscited by 55
- 2021From block-Toeplitz matrices to differential equations on graphs: towards a general theory for scalable masked Transformerscited by 38
- 2022A Text Attention Network for Spatial Deformation Robust Scene Text Image Super-resolutioncited by 35
- 2025PaTH Attention: Position Encoding via Accumulating Householder Transformationscited by 34
- 2024ActionFlow: Equivariant, Accurate, and Efficient Policies with Spatially Symmetric Flow Matchingcited by 26
- 2023Efficient Attention via Control Variatescited by 23
- 2025ComRoPE: Scalable and Robust Rotary Position Embedding Parameterized by Trainable Commuting Angle Matricescited by 18
- 2023Linearized Relative Positional Encodingcited by 17
- 2021Variable-Length Music Score Infilling via XLNet and Musically Specialized Positional Encodingcited by 14
- 2025Positional Encoding in Transformer-Based Time Series Models: A Surveycited by 14
25 more
- 2021BERT-like Pre-training for Symbolic Piano Music Classification Taskscited by 12
- 2023Stochastic positional embeddings improve masked image modelingcited by 12
- 2023Learning a Fourier Transform for Linear Relative Positional Encodings in Transformerscited by 10
- 2024Natural Language Processing Methods for Symbolic Music Generation and Information Retrieval: a Surveycited by 10
- 2023Simplex Random Featurescited by 9
- 2025Softmax Transformers are Turing-Completecited by 9
- 2023Exploring Transformer Extrapolationcited by 8
- 2024Linear Transformer Topological Masking with Graph Random Featurescited by 7
- 2023Transformers as Graph-to-Graph Modelscited by 5
- 2024Structure-informed Positional Encoding for Music Generationcited by 5
- 2022Melody Infilling with User-Provided Structural Contextcited by 4
- 2025Moonbeam: A MIDI Foundation Model Using Both Absolute and Relative Music Attributescited by 4
- 2021Ripple Attention for Visual Perception with Sub-quadratic Complexitycited by 2
- 2024LeaPformer: Enabling Linear Transformers for Autoregressive and Simultaneous Tasks via Learned Proportionscited by 2
- 2025F-StrIPE: Fast Structure-Informed Positional Encoding for Symbolic Music Generationcited by 2
- 2021Finding Strong Gravitational Lenses Through Self-Attentioncited by 1
- 2022FastRPB: a Scalable Relative Positional Encoding for Long Sequence Taskscited by 1
- 2022Lightweight Structure-Aware Attention for Visual Understandingcited by 1
- 2023Enhancing Multivariate Time Series Classifiers through Self-Attention and Relative Positioning Infusioncited by 1
- 2023Deep Multiple Instance Learning with Distance-Aware Self-Attentioncited by 1
- 2025CoPE: A Lightweight Complex Positional Encodingcited by 1
- 2025Of All StrIPEs: Investigating Structure-informed Positional Encoding for Efficient Music Generationcited by 0
- 2025Evaluation of Coding Schemes for Transformer-based Gene Sequence Modelingcited by 0
- 2026BSAT: B-Spline Adaptive Tokenizer for Long-Term Time Series Forecastingcited by 0
- 2026Beyond Static Positional Encoding: Bayesian Time-aware Attention for Non-Stationary Long-term Time Series Forecastingcited by 0
- 2026Beyond Static Positional Encoding: Bayesian Time-aware Attention for Non-Stationary Long-term Time Series Forecasting14 Oct 2026
- 2026BSAT: B-Spline Adaptive Tokenizer for Long-Term Time Series Forecasting2 Jan 2026
- 2025Softmax Transformers are Turing-Complete25 Nov 2025
- 2025CoPE: A Lightweight Complex Positional Encoding23 Aug 2025
- 2025Evaluation of Coding Schemes for Transformer-based Gene Sequence Modeling20 Jul 2025
- 2025Edit Flows: Flow Matching with Edit Operations10 Jun 2025
- 2025ComRoPE: Scalable and Robust Rotary Position Embedding Parameterized by Trainable Commuting Angle Matrices4 Jun 2025
- 2025PaTH Attention: Position Encoding via Accumulating Householder Transformations22 May 2025
- 2025Moonbeam: A MIDI Foundation Model Using Both Absolute and Relative Music Attributes21 May 2025
- 2025Of All StrIPEs: Investigating Structure-informed Positional Encoding for Efficient Music Generation7 Apr 2025
- 2025Positional Encoding in Transformer-Based Time Series Models: A Survey17 Feb 2025
- 2025F-StrIPE: Fast Structure-Informed Positional Encoding for Symbolic Music Generation14 Feb 2025
25 more
- 2024Linear Transformer Topological Masking with Graph Random Features4 Oct 2024
- 2024ActionFlow: Equivariant, Accurate, and Efficient Policies with Spatially Symmetric Flow Matching6 Sep 2024
- 2024LeaPformer: Enabling Linear Transformers for Autoregressive and Simultaneous Tasks via Learned Proportions18 May 2024
- 2024Natural Language Processing Methods for Symbolic Music Generation and Information Retrieval: a Survey27 Feb 2024
- 2024Structure-informed Positional Encoding for Music Generation20 Feb 2024
- 2023Transformers as Graph-to-Graph Models27 Oct 2023
- 2023Stochastic positional embeddings improve masked image modeling31 Jul 2023
- 2023Exploring Transformer Extrapolation19 Jul 2023
- 2023Linearized Relative Positional Encoding18 Jul 2023
- 2023Deep Multiple Instance Learning with Distance-Aware Self-Attention17 May 2023
- 2023Enhancing Multivariate Time Series Classifiers through Self-Attention and Relative Positioning Infusion13 Feb 2023
- 2023Efficient Attention via Control Variates9 Feb 2023
- 2023Learning a Fourier Transform for Linear Relative Positional Encodings in Transformers3 Feb 2023
- 2023Simplex Random Features31 Jan 2023
- 2022Lightweight Structure-Aware Attention for Visual Understanding29 Nov 2022
- 2022Melody Infilling with User-Provided Structural Context6 Oct 2022
- 2022A Text Attention Network for Spatial Deformation Robust Scene Text Image Super-resolution17 Mar 2022
- 2022FastRPB: a Scalable Relative Positional Encoding for Long Sequence Tasks23 Feb 2022
- 2022cosFormer: Rethinking Softmax in Attention17 Feb 2022
- 2021Finding Strong Gravitational Lenses Through Self-Attention18 Oct 2021
- 2021Ripple Attention for Visual Perception with Sub-quadratic Complexity6 Oct 2021
- 2021Variable-Length Music Score Infilling via XLNet and Musically Specialized Positional Encoding11 Aug 2021
- 2021From block-Toeplitz matrices to differential equations on graphs: towards a general theory for scalable masked Transformers16 Jul 2021
- 2021BERT-like Pre-training for Symbolic Piano Music Classification Tasks12 Jul 2021
- 2021Learnable Fourier Features for Multi-Dimensional Spatial Positional Encoding5 Jun 2021
- 2022cosFormer: Rethinking Softmax in Attentioncited by 213
- 2025Softmax Transformers are Turing-Completecited by 9
- 2025Softmax Transformers are Turing-Complete25 Nov 2025
- 2022cosFormer: Rethinking Softmax in Attention17 Feb 2022
- 2021Learnable Fourier Features for Multi-Dimensional Spatial Positional Encodingcited by 93
- 2021From block-Toeplitz matrices to differential equations on graphs: towards a general theory for scalable masked Transformerscited by 38
- 2022A Text Attention Network for Spatial Deformation Robust Scene Text Image Super-resolutioncited by 35
- 2025PaTH Attention: Position Encoding via Accumulating Householder Transformationscited by 34
- 2023Efficient Attention via Control Variatescited by 23
- 2025ComRoPE: Scalable and Robust Rotary Position Embedding Parameterized by Trainable Commuting Angle Matricescited by 18
- 2023Linearized Relative Positional Encodingcited by 17
- 2021Variable-Length Music Score Infilling via XLNet and Musically Specialized Positional Encodingcited by 14
- 2025Positional Encoding in Transformer-Based Time Series Models: A Surveycited by 14
- 2021BERT-like Pre-training for Symbolic Piano Music Classification Taskscited by 12
- 2023Stochastic positional embeddings improve masked image modelingcited by 12
- 2023Learning a Fourier Transform for Linear Relative Positional Encodings in Transformerscited by 10
12 most cited of 32 All 32 (JSON)
- 2026BSAT: B-Spline Adaptive Tokenizer for Long-Term Time Series Forecasting2 Jan 2026
- 2025CoPE: A Lightweight Complex Positional Encoding23 Aug 2025
- 2025Evaluation of Coding Schemes for Transformer-based Gene Sequence Modeling20 Jul 2025
- 2025ComRoPE: Scalable and Robust Rotary Position Embedding Parameterized by Trainable Commuting Angle Matrices4 Jun 2025
- 2025PaTH Attention: Position Encoding via Accumulating Householder Transformations22 May 2025
- 2025Moonbeam: A MIDI Foundation Model Using Both Absolute and Relative Music Attributes21 May 2025
- 2025Of All StrIPEs: Investigating Structure-informed Positional Encoding for Efficient Music Generation7 Apr 2025
- 2025Positional Encoding in Transformer-Based Time Series Models: A Survey17 Feb 2025
- 2025F-StrIPE: Fast Structure-Informed Positional Encoding for Symbolic Music Generation14 Feb 2025
- 2024Linear Transformer Topological Masking with Graph Random Features4 Oct 2024
- 2024LeaPformer: Enabling Linear Transformers for Autoregressive and Simultaneous Tasks via Learned Proportions18 May 2024
- 2024Natural Language Processing Methods for Symbolic Music Generation and Information Retrieval: a Survey27 Feb 2024
12 newest of 32 All 32 (JSON)