From Small to Large: Generalization Bounds for Transformers on Variable-Size Inputs
Not on the map. Why?
Abstract (arXiv)
Transformers exhibit a notable property of size generalization, demonstrating an ability to extrapolate from smaller token sets to significantly longer ones. This behavior has been documented across diverse applications, including point clouds, graphs, and natural language. Despite its empirical success, this capability still lacks some rigorous theoretical characterizations. In this paper, we develop a theoretical framework to analyze this phenomenon for geometric data, which we represent as discrete samples from a continuous source (e.g., point clouds from manifolds, graphs from graphons). Our core contribution is a bound on the error between the Transformer's output for a discrete sample and its continuous-domain equivalent. We prove that for Transformers with stable positional encodings, this bound is determined by the sampling density and the intrinsic dimensionality of the data manifold. Experiments on graphs and point clouds of various sizes confirm the tightness of our theoretical bound.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 42 of its 54 references that are in the map. First posted on arXiv 14 Dec 2025.
Builds on
42 of 54 references.
References · 42
- 2017Attention Is All You Needcited by 60,361
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
- 2017Graph Attention Networkscited by 8,923
- 2016PointNet: Deep Learning on Point Sets for 3D Classification and Segmentationcited by 5,248
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,850
- 2020Point Transformercited by 1,470
- 2018Self-Attention with Relative Position Representationscited by 1,120
- 2022Recipe for a General, Powerful, Scalable Graph Transformercited by 713
- 2023Point Transformer V3: Simpler, Faster, Strongercited by 589
- 2021Graph Neural Networks with Learnable Structural and Positional Representationscited by 333
- 2021Do Transformers Really Perform Bad for Graph Representation?cited by 320
30 more
- 2022Exploring Length Generalization in Large Language Modelscited by 206
- 2023What Algorithms can Transformers Learn? A Study in Length Generalizationcited by 199
- 2023Rethinking the Expressive Power of GNNs via Graph Biconnectivitycited by 119
- 2020Graphon Neural Networks and the Transferability of Graph Neural Networkscited by 118
- 2022Particle Transformer for Jet Taggingcited by 98
- 2020Molecular representation learning with language models and domain-relevant auxiliary taskscited by 94
- 2022Equivariant and Stable Positional Encoding for More Powerful Graph Neural Networkscited by 94
- 2024Transformers Can Achieve Length Generalization But Not Robustlycited by 86
- 2022Generalization Analysis of Message Passing Neural Networks on Large Random Graphscited by 59
- 2021Stable, Fast and Accurate: Kernelized Attention with Relative Positional Encodingcited by 51
- 2024A Formal Framework for Understanding Length Generalization in Transformerscited by 45
- 2021Transferability Properties of Graph Neural Networkscited by 43
- 2023On the Stability of Expressive Positional Encodings for Graphscited by 33
- 2023A graphon-signal analysis of graph neural networkscited by 30
- 2023Sequence Length Independent Norm-Based Generalization Bounds for Transformerscited by 29
- 2025Learning Efficient Positional Encodings with Graph Neural Networkscited by 24
- 2021Point Cloud Transformers applied to Collider Physicscited by 23
- 2024Position Coupling: Improving Length Generalization of Arithmetic Transformers Using Task Structurecited by 23
- 2024Comparing Graph Transformers via Positional Encodingscited by 20
- 2023Limits, approximation and size transferability for GNNs on sparse graphs via graphopscited by 18
- 2024Generalization Bounds for Message Passing Networks on Mixture of Graphonscited by 17
- 2025Extrapolation by Association: Length Generalization Transfer in Transformerscited by 13
- 2024Locality-Sensitive Hashing-Based Efficient Point Transformer with Applications in High-Energy Physicscited by 12
- 2022Convergence of Invariant Graph Networkscited by 9
- 2021Geometric Transformer for End-to-End Molecule Properties Predictioncited by 8
- 2023Predicting Hateful Discussions on Reddit using Graph Transformer Networks and Communal Contextcited by 8
- 2025The Role of Sparsity for Length Generalization in Transformerscited by 8
- 2024Enhancing Size Generalization in Graph Neural Networks through Disentangled Representation Learningcited by 7
- 2024Positional Attention: Expressivity and Learnability of Algorithmic Computationcited by 7
- 2025Higher-Order Graphon Neural Networks: Approximation and Cut Distancecited by 7
Built on by
Citing papers per year: 2026: 1.
1 paper.
- 2026Sharper Generalization Bounds for Transformercited by 3
- 2026Sharper Generalization Bounds for Transformer23 Mar 2026