KERPLE: Kernelized Relative Positional Embedding for Length Extrapolation
Not on the map. Why?
Abstract (arXiv)
Relative positional embeddings (RPE) have received considerable attention since RPEs effectively model the relative distance among tokens and enable length extrapolation. We propose KERPLE, a framework that generalizes relative position embedding for extrapolation by kernelizing positional differences. We achieve this goal using conditionally positive definite (CPD) kernels, a class of functions known for generalizing distance metrics. To maintain the inner product interpretation of self-attention, we show that a CPD kernel can be transformed into a PD kernel by adding a constant offset. This offset is implicitly absorbed in the Softmax normalization during self-attention. The diversity of CPD kernels allows us to derive various RPEs that enable length extrapolation in a principled way. Experiments demonstrate that the logarithmic variant achieves excellent extrapolation performance on three large language modeling datasets. Our implementation and pretrained checkpoints are released at https://github.com/chijames/KERPLE.git.
Key facts. Cited by 84 papers in the map (data through 7 Oct 2026). Builds on 36 of its 57 references that are in the map. First posted on arXiv 20 May 2022.
Builds on
36 of 57 references.
References · 36
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,874
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
- 2019XLNet: Generalized Autoregressive Pretraining for Language Understandingcited by 2,801
- 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,772
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
- 2020DeBERTa: Decoding-enhanced BERT with Disentangled Attentioncited by 2,157
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
24 more
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
- 2019Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelismcited by 1,829
- 2020Rethinking Attention with Performerscited by 1,584
- 2018Self-Attention with Relative Position Representationscited by 1,112
- 2019PEGASUS: Pre-training with Extracted Gap-sentences for Abstractive Summarizationcited by 1,100
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
- 2020Recipes for building an open-domain chatbotcited by 593
- 2017Convolutional Sequence to Sequence Learningcited by 550
- 2021Nystr"omformer: A Nystr"om-Based Algorithm for Approximating Self-Attentioncited by 468
- 2021Random Feature Attentioncited by 350
- 2019A Study of BFLOAT16 for Deep Learning Trainingcited by 227
- 2022cosFormer: Rethinking Softmax in Attentioncited by 212
- 2019Transformer Dissection: A Unified Understanding of Transformer's Attention via the Lens of Kernelcited by 211
- 2021Rethinking and Improving Relative Position Encoding for Vision Transformercited by 206
- 2020Rethinking Positional Encoding in Language Pre-trainingcited by 197
- 2021Position Information in Transformers: An Overviewcited by 103
- 2020Improve Transformer Models with Better Relative Position Embeddingscited by 73
- 2021Skyformer: Remodel Self-Attention with Gaussian Kernel and Nystr"om Methodcited by 61
- 2021Stable, Fast and Accurate: Kernelized Attention with Relative Positional Encodingcited by 50
- 2021CAPE: Encoding Relative Positions with Continuous Augmented Positional Embeddingscited by 47
- 2021A Simple and Effective Positional Encoding for Transformerscited by 37
- 2021SHAPE: Shifted Absolute Position Embedding for Transformerscited by 37
- 2020DA-Transformer: Distance-aware Transformercited by 23
- 2021The Case for Translation-Invariant Self-Attention in Transformer-Based Language Modelscited by 23
Built on by
Citing papers per year: 2022: 2; 2023: 14; 2024: 23; 2025: 31; 2026: 14.
84 papers.
Sort:
By area:
- 2024LLM Inference Unveiled: Survey and Roofline Model Insightscited by 147
- 2022A Length-Extrapolatable Transformercited by 123
- 2024Transformers Can Achieve Length Generalization But Not Robustlycited by 82
- 2024Transformers Can Do Arithmetic with the Right Embeddingscited by 77
- 2023Advancing Transformer Architecture in Long-Context Large Language Models: A Comprehensive Surveycited by 71
- 2024What is Wrong with Perplexity for Long-context Language Modeling?cited by 68
- 2023Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Contextcited by 63
- 2024Human-inspired Episodic Memory for Infinite Context LLMscited by 62
- 2025On the Emergence of Position Bias in Transformerscited by 57
- 2025Forgetting Transformer: Softmax Attention with a Forget Gatecited by 50
- 2025Rope to Nope and Back Again: A New Hybrid Attention Strategycited by 46
- 2023CLEX: Continuous Length Extrapolation for Large Language Modelscited by 43
38 more
- 2022Dissecting Transformer Length Extrapolation via the Lens of Receptive Field Analysiscited by 39
- 2024Fourier Position Embedding: Enhancing Attention's Periodic Extension for Length Generalizationcited by 37
- 2024DAPE: Data-Adaptive Positional Encoding for Length Extrapolationcited by 30
- 2023Primal-Attention: Self-attention through Asymmetric Kernel SVD in Primal Representationcited by 28
- 2023The Efficiency Spectrum of Large Language Models: An Algorithmic Surveycited by 25
- 2024Universal Length Generalization with Turing Programscited by 25
- 2024Two Stones Hit One Bird: Bilevel Positional Encoding for Better Length Extrapolationcited by 23
- 2024LongRecipe: Recipe for Efficient Long Context Generalization in Large Language Modelscited by 23
- 2025Learning the RoPEs: Better 2D and 3D Position Encodings with STRINGcited by 19
- 2024Exploring Context Window of Large Language Models via Decomposed Positional Vectorscited by 18
- 2025Long-Context Generalization with Sparse Attentioncited by 18
- 2023Linearized Relative Positional Encodingcited by 17
- 2024HoPE: A Novel Positional Encoding Without Long-Term Decay for Enhanced Context Awareness and Extrapolationcited by 17
- 2024BA-SAM: Scalable Bias-Mode Attention Mask for Segment Anything Modelcited by 15
- 2024UncertaintyRAG: Span-Level Uncertainty Enhanced Long-Context Modeling for Retrieval-Augmented Generationcited by 14
- 2023Transformer Working Memory Enables Regular Language Reasoning and Natural Language Length Extrapolationcited by 13
- 2024CLongEval: A Chinese Benchmark for Evaluating Long-Context Large Language Modelscited by 13
- 2025ParallelComp: Parallel Long-Context Compressor for Length Extrapolationcited by 13
- 2025Native-Resolution Image Synthesiscited by 13
- 2024Rethinking Transformer for Long Contextual Histopathology Whole Slide Image Analysiscited by 12
- 2025A Survey on Transformer Context Extension: Approaches and Evaluationcited by 11
- 2023From Interpolation to Extrapolation: Complete Length Generalization for Arithmetic Transformerscited by 10
- 2024DAPE V2: Process Attention Score as Feature Map for Length Extrapolationcited by 10
- 2025HoPE: Hyperbolic Rotary Positional Encoding for Stable Long-Range Dependency Modeling in Large Language Modelscited by 10
- 2023Attention Alignment and Flexible Positional Embeddings Improve Transformer Length Extrapolationcited by 9
- 2023Exploring Transformer Extrapolationcited by 8
- 2024Let the Code LLM Edit Itself When You Edit the Codecited by 8
- 2025Selective Rotary Position Embeddingcited by 8
- 2024How Transformers Get Rich: Approximation and Dynamics Analysiscited by 7
- 2025On Vanishing Variance in Transformer Length Generalizationcited by 6
- 2023CoCA: Fusing Position Embedding with Collinear Constrained Attention in Transformers for Long Context Window Extendingcited by 5
- 2025Group Representational Position Encodingcited by 5
- 2024Self-Attention through Kernel-Eigen Pair Sparse Variational Gaussian Processescited by 4
- 2025Rethinking Addressing in Language Models via Contexualized Equivariant Positional Encodingcited by 4
- 2025Where is this coming from? Making groundedness count in the evaluation of Document VQA modelscited by 4
- 2025Deconstructing Positional Information: From Attention Logits to Training Biasescited by 4
- 2023Long-MIL: Scaling Long Contextual Multiple Instance Learning for Histopathology Whole Slide Image Analysiscited by 3
- 2024MEP: Multiple Kernel Learning Enhancing Relative Positional Encoding Length Extrapolationcited by 3
50 most cited of 84 All 84 (JSON)
- 2026RoPE is Dead, Long Live RoPE: Towards Scalable Data-aware Positional Encodings28 Sep 2026
- 2026Training Trajectories Determine Circuit Removability in Annealable Soft-Prior Transformers9 Sep 2026
- 2026Ask Self, Ask Others: Relation Is All You Need20 Aug 2026
- 2026When Attention Goes Blind: Numerical Failure in ALiBi Positional Encodings4 Aug 2026
- 2026RoVE: Rotary Value Embeddings Attention for Relative Position-dependent Value Pathways9 Jun 2026
- 2026PJ-RoPE: A Fourier-Jet-Affine Position Space for Relative Attention3 Jun 2026
- 2026Give it Space! Explicit Disentangling of Positional and Semantic Representations in Encoders28 May 2026
- 2026Conditional KRR: Injecting Unpenalized Features into Kernel Methods with Applications to Kernel Thresholding25 May 2026
- 2026Remember to Forget: Gated Adaptive Positional Encoding11 May 2026
- 2026Positional LSH: Binary Block Matrix Approximation for Attention with Linear Biases10 May 2026
- 2026Jordan-RoPE: Non-Semisimple Relative Positional Encoding via Complex Jordan Blocks5 May 2026
- 2026Position Encoding with Random Float Sampling Enhances Length Generalization of Transformers15 Feb 2026
38 more
- 2026Attention's Gravitational Field:A Power-Law Interpretation of Positional Correlation6 Feb 2026
- 2026Kernelized Edge Attention: Addressing Semantic Attention Blurring in Temporal Graph Neural Networks31 Jan 2026
- 2025Alternative positional encoding functions for neural transformers22 Dec 2025
- 2025RePo: Language Models with Context Re-Positioning16 Dec 2025
- 2025Group Representational Position Encoding8 Dec 2025
- 2025ShaRP: SHAllow-LayeR Pruning for Efficient Video Large Language Models5 Dec 2025
- 2025Selective Rotary Position Embedding21 Nov 2025
- 2025DoPE: Denoising Rotary Position Embedding12 Nov 2025
- 2025A Circular Argument : Does RoPE need to be Equivariant for Vision?11 Nov 2025
- 2025Indirect Attention: Turning Context Misalignment into a Feature30 Sep 2025
- 2025HoPE: Hyperbolic Rotary Positional Encoding for Stable Long-Range Dependency Modeling in Large Language Models5 Sep 2025
- 2025Compact Vision Transformer by Reduction of Kernel Complexity17 Jul 2025
- 2025SAS: Simulated Attention Score10 Jul 2025
- 2025Long-Context Generalization with Sparse Attention19 Jun 2025
- 2025Long-Short Alignment for Effective Long-Context Modeling in LLMs13 Jun 2025
- 2025Mitigating Posterior Salience Attenuation in Long-Context LLMs with Positional Contrastive Decoding10 Jun 2025
- 2025Native-Resolution Image Synthesis3 Jun 2025
- 2025Deconstructing Positional Information: From Attention Logits to Training Biases19 May 2025
- 2025Dual Filter: A Transformer-like Inference Architecture for Hidden Markov Models1 May 2025
- 2025Between Linear and Sinusoidal: Rethinking the Time Encoder in Dynamic Graph Learning10 Apr 2025
- 2025FactGuard: Leveraging Multi-Agent Systems to Generate Answerable and Unanswerable Questions for Enhanced Long-Context LLM Extraction8 Apr 2025
- 2025On Vanishing Variance in Transformer Length Generalization3 Apr 2025
- 2025Where is this coming from? Making groundedness count in the evaluation of Document VQA models24 Mar 2025
- 2025A Survey on Transformer Context Extension: Approaches and Evaluation17 Mar 2025
- 2025Context-aware Biases for Length Extrapolation11 Mar 2025
- 2025Forgetting Transformer: Softmax Attention with a Forget Gate3 Mar 2025
- 2025Self-Adjust Softmax25 Feb 2025
- 2025ParallelComp: Parallel Long-Context Compressor for Length Extrapolation20 Feb 2025
- 2025Learning the RoPEs: Better 2D and 3D Position Encodings with STRING4 Feb 2025
- 2025On the Emergence of Position Bias in Transformers4 Feb 2025
- 2025Rope to Nope and Back Again: A New Hybrid Attention Strategy30 Jan 2025
- 2025Softplus Attention with Re-weighting Boosts Length Extrapolation in Large Language Models23 Jan 2025
- 2025Rethinking Addressing in Language Models via Contexualized Equivariant Positional Encoding1 Jan 2025
- 2024Fourier Position Embedding: Enhancing Attention's Periodic Extension for Length Generalization23 Dec 2024
- 2024Provable Length Generalization in Sequence Prediction via Spectral Filtering1 Nov 2024
- 2024What is Wrong with Perplexity for Long-context Language Modeling?31 Oct 2024
- 2024HoPE: A Novel Positional Encoding Without Long-Term Decay for Enhanced Context Awareness and Extrapolation28 Oct 2024
- 2024Rethinking Transformer for Long Contextual Histopathology Whole Slide Image Analysis18 Oct 2024
50 newest of 84 All 84 (JSON)
- 2024LLM Inference Unveiled: Survey and Roofline Model Insightscited by 147
- 2025ParallelComp: Parallel Long-Context Compressor for Length Extrapolationcited by 13
- 2024Let the Code LLM Edit Itself When You Edit the Codecited by 8
- 2022A Length-Extrapolatable Transformercited by 123
- 2024Transformers Can Achieve Length Generalization But Not Robustlycited by 82
- 2024Transformers Can Do Arithmetic with the Right Embeddingscited by 77
- 2023Advancing Transformer Architecture in Long-Context Large Language Models: A Comprehensive Surveycited by 71
- 2024What is Wrong with Perplexity for Long-context Language Modeling?cited by 68
- 2023Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Contextcited by 63
- 2024Human-inspired Episodic Memory for Infinite Context LLMscited by 62
- 2025On the Emergence of Position Bias in Transformerscited by 57
- 2025Forgetting Transformer: Softmax Attention with a Forget Gatecited by 50
- 2025Rope to Nope and Back Again: A New Hybrid Attention Strategycited by 46
- 2023CLEX: Continuous Length Extrapolation for Large Language Modelscited by 43
- 2022Dissecting Transformer Length Extrapolation via the Lens of Receptive Field Analysiscited by 39
12 most cited of 78 All 78 (JSON)
- 2026RoPE is Dead, Long Live RoPE: Towards Scalable Data-aware Positional Encodings28 Sep 2026
- 2026Training Trajectories Determine Circuit Removability in Annealable Soft-Prior Transformers9 Sep 2026
- 2026Ask Self, Ask Others: Relation Is All You Need20 Aug 2026
- 2026When Attention Goes Blind: Numerical Failure in ALiBi Positional Encodings4 Aug 2026
- 2026RoVE: Rotary Value Embeddings Attention for Relative Position-dependent Value Pathways9 Jun 2026
- 2026PJ-RoPE: A Fourier-Jet-Affine Position Space for Relative Attention3 Jun 2026
- 2026Give it Space! Explicit Disentangling of Positional and Semantic Representations in Encoders28 May 2026
- 2026Conditional KRR: Injecting Unpenalized Features into Kernel Methods with Applications to Kernel Thresholding25 May 2026
- 2026Remember to Forget: Gated Adaptive Positional Encoding11 May 2026
- 2026Positional LSH: Binary Block Matrix Approximation for Attention with Linear Biases10 May 2026
- 2026Jordan-RoPE: Non-Semisimple Relative Positional Encoding via Complex Jordan Blocks5 May 2026
- 2026Position Encoding with Random Float Sampling Enhances Length Generalization of Transformers15 Feb 2026
12 newest of 78 All 78 (JSON)