mlsanityData to 7 Oct 2026

Your Transformer May Not be as Powerful as You Expect

arXiv 2205.13401 ↗First posted 26 May 2022cs.LG cs.CL stat.MLcited by 55

Not on the map. Why?

Abstract (arXiv)

Relative Positional Encoding (RPE), which encodes the relative distance between any pair of tokens, is one of the most successful modifications to the original Transformer. As far as we know, theoretical understanding of the RPE-based Transformers is largely unexplored. In this work, we mathematically analyze the power of RPE-based Transformers regarding whether the model is capable of approximating any continuous sequence-to-sequence functions. One may naturally assume the answer is in the affirmative -- RPE-based Transformers are universal function approximators. However, we present a negative result by showing there exist continuous sequence-to-sequence functions that RPE-based Transformers cannot approximate no matter how deep and wide the neural network is. One key reason lies in that most RPEs are placed in the softmax attention that always generates a right stochastic matrix. This restricts the network from capturing positional information in the RPEs and limits its capacity. To overcome the problem and make the model more powerful, we first present sufficient conditions for RPE-based Transformers to achieve universal function approximation. With the theoretical guidance, we develop a novel attention module, called Universal RPE-based (URPE) Attention, which satisfies the conditions. Therefore, the corresponding URPE-based Transformers become universal function approximators. Extensive experiments covering typical architectures and tasks demonstrate that our model is parameter-efficient and can achieve superior performance to strong baselines in a wide range of applications. The code will be made publicly available at https://github.com/lsj2408/URPE.

Key facts. Cited by 55 papers in the map (data through 7 Oct 2026). Builds on 61 of its 80 references that are in the map. First posted on arXiv 26 May 2022.

Builds on

61 of 80 references.

References · 61

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2014Adam: A Method for Stochastic Optimizationcited by 36,960
  4. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
  5. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
  6. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  7. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  8. 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,082
  9. 2016Semi-Supervised Classification with Graph Convolutional Networkscited by 11,282
  10. 2017Graph Attention Networkscited by 8,854
  11. 2015Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shiftcited by 6,979
  12. 2017Inductive Representation Learning on Large Graphscited by 6,284
38 more
  1. 2016Layer Normalizationcited by 5,579
  2. 2018How Powerful are Graph Neural Networks?cited by 4,355
  3. 2017Neural Message Passing for Quantum Chemistrycited by 3,460
  4. 2016Pointer Sentinel Mixture Modelscited by 2,992
  5. 2020DeBERTa: Decoding-enhanced BERT with Disentangled Attentioncited by 2,157
  6. 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
  7. 2017Modeling Relational Data with Graph Convolutional Networkscited by 1,684
  8. 2019fairseq: A Fast, Extensible Toolkit for Sequence Modelingcited by 1,486
  9. 2019Simplifying Graph Convolutional Networkscited by 1,470
  10. 2018An Empirical Evaluation of Generic Convolutional and Recurrent Networks for Sequence Modelingcited by 1,447
  11. 2019Root Mean Square Layer Normalizationcited by 1,425
  12. 2018Self-Attention with Relative Position Representationscited by 1,112
  13. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
  14. 2016Deep Networks with Stochastic Depthcited by 973
  15. 2016Language Modeling with Gated Convolutional Networkscited by 688
  16. 2020Benchmarking Graph Neural Networkscited by 672
  17. 2020A Generalization of Transformer Networks to Graphscited by 653
  18. 2020Principal Neighbourhood Aggregation for Graph Netscited by 477
  19. 2016Geometric deep learning on graphs and manifolds using mixture model CNNscited by 468
  20. 2021Rethinking Graph Transformers with Spectral Attentioncited by 468
  21. 2021Attention is Not All You Need: Pure Attention Loses Rank Doubly Exponentially with Depthcited by 411
  22. 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 404
  23. 2017Residual Gated Graph ConvNetscited by 341
  24. 2021OGB-LSC: A Large-Scale Challenge for Machine Learning on Graphscited by 328
  25. 2017The Expressive Power of Neural Networks: A View from the Widthcited by 318
  26. 2019On the Relationship between Self-Attention and Convolutional Layerscited by 299
  27. 2020SIGN: Scalable Inception Graph Neural Networkscited by 283
  28. 2020DeeperGCN: All You Need to Train Deeper GCNscited by 249
  29. 2020UniLMv2: Pseudo-Masked Language Models for Unified Language Model Pre-Trainingcited by 204
  30. 2020Combining Label Propagation and Simple Models Out-performs Graph Neural Networkscited by 199
  31. 2020Rethinking Positional Encoding in Language Pre-trainingcited by 197
  32. 2018Constituency Parsing with a Self-Attentive Encodercited by 196
  33. 2017Approximating Continuous Functions by ReLU Nets of Minimal Widthcited by 120
  34. 2020Infinite attention: NNGP and NTK for deep attention networkscited by 117
  35. 2021Learnable Fourier Features for Multi-Dimensional Spatial Positional Encodingcited by 93
  36. 2021Do Transformer Modifications Transfer Across Implementations and Applications?cited by 87
  37. 2020O(n) Connections are Expressive Enough: Universal Approximability of Sparse Transformerscited by 82
  38. 2016Improving Neural Language Models with a Continuous Cachecited by 81

50 most cited of 61 All 61 (JSON)

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2022: 2; 2023: 21; 2024: 17; 2025: 13; 2026: 2.

55 papers.

Sort:

By area:

  1. 2023The Falcon Series of Open Language Modelscited by 526
  2. 2023Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspectivecited by 293
  3. 2023Graph Inductive Biases in Transformers without Message Passingcited by 150
  4. 2023Rethinking the Expressive Power of GNNs via Graph Biconnectivitycited by 119
  5. 2023Attending to Graph Transformerscited by 81
  6. 2022One Transformer Can Understand Both 2D & 3D Molecular Datacited by 77
  7. 2023A Complete Expressiveness Hierarchy for Subgraph GNNs via Subgraph Weisfeiler-Lehman Testscited by 64
  8. 2023Are Transformers with One Layer Self-Attention Using Low-Rank Weight Matrices Universal Approximators?cited by 46
  9. 2024Transformers are Universal In-context Learnerscited by 42
  10. 2023Memorization Capacity of Multi-Head Attention in Transformerscited by 39
  11. 2024Beyond Weisfeiler-Lehman: A Quantitative Framework for GNN Expressivenesscited by 38
  12. 2023Never Lost in the Middle: Mastering Long-Context Question Answering with Position-Agnostic Decompositional Trainingcited by 31
38 more
  1. 2023Approximation Rate of the Transformer Architecture for Sequence Modelingcited by 28
  2. 2025Can Classic GNNs Be Strong Baselines for Graph-level Tasks? Simple Architectures Meet Excellencecited by 24
  3. 2023Highly Accurate Quantum Chemical Property Prediction with Uni-Mol+cited by 22
  4. 2023TorchDEQ: A Library for Deep Equilibrium Modelscited by 21
  5. 2024StableMask: Refining Causal Masking in Decoder-only Transformercited by 20
  6. 2025Understanding Multimodal LLMs Under Distribution Shifts: An Information-Theoretic Approachcited by 15
  7. 2023CIN++: Enhancing Topological Message Passingcited by 14
  8. 2025Sample Complexity and Representation Ability of Test-time Scaling Paradigmscited by 12
  9. 2023Learning a Fourier Transform for Linear Relative Positional Encodings in Transformerscited by 10
  10. 2023The Languini Kitchen: Enabling Language Modelling Research at Different Scales of Computecited by 10
  11. 2024DAPE V2: Process Attention Score as Feature Map for Length Extrapolationcited by 10
  12. 2023Monotonic Location Attention for Length Generalizationcited by 9
  13. 2024Rethinking Transformers in Solving POMDPscited by 9
  14. 2024Subgraphormer: Unifying Subgraph GNNs and Graph Transformers via Graph Productscited by 8
  15. 2024Let the Code LLM Edit Itself When You Edit the Codecited by 8
  16. 2024Transformers are Expressive, But Are They Expressive Enough for Regression?cited by 6
  17. 2024GeoMFormer: A General Architecture for Geometric Molecular Representation Learningcited by 6
  18. 2025Transformers Can Overcome the Curse of Dimensionality: A Theoretical Study from an Approximation Perspectivecited by 5
  19. 2025Transformers through the lens of support-preserving maps between measurescited by 5
  20. 2023Optimizing a Transformer-based network for a deep learning seismic processing workflowcited by 4
  21. 2024CKGConv: General Graph Convolution with Continuous Kernelscited by 4
  22. 2022Why self-attention is Natural for Sequence-to-Sequence Problems? A Perspective from Symmetriescited by 3
  23. 2023Parrot Mind: Towards Explaining the Complex Task Reasoning of Pretrained Large Language Models with Template-Content Structurecited by 3
  24. 2023Positional Embedding-Aware Activationscited by 2
  25. 2024A Structure-Aware Lane Graph Transformer Model for Vehicle Trajectory Predictioncited by 2
  26. 2024Bridging Geometric States via Geometric Diffusion Bridgecited by 2
  27. 2025Plain Transformers Can be Powerful Graph Learnerscited by 2
  28. 2025A unified framework for establishing the universal approximation of transformer-type architecturescited by 2
  29. 2025DoPE: Denoising Rotary Position Embeddingcited by 2
  30. 2023Model-Generated Pretraining Signals Improves Zero-Shot Generalization of Text-to-Text Transformerscited by 1
  31. 2024How Out-of-Distribution Detection Learning Theory Enhances Transformer: Learnability and Reliabilitycited by 1
  32. 2024Generalizable autoregressive modeling of time series through functional narrativescited by 1
  33. 2025On the Existence of Universal Simulators of Attentioncited by 1
  34. 2025Deep Learning Empowered Super-Resolution: A Comprehensive Survey and Future Prospectscited by 1
  35. 2026Algebraic Invariants of Lightning Self-Attentioncited by 1
  36. 2023Hybrid Focal and Full-Range Attention Based Graph Transformerscited by 0
  37. 2024Topological Neural Networks: Mitigating the Bottlenecks of Graph Neural Networks via Higher-Order Interactionscited by 0
  38. 2024Non-autoregressive Personalized Bundle Generationcited by 0

50 most cited of 55 All 55 (JSON)