mlsanityData to 7 Oct 2026

Attention is a smoothed cubic spline

arXiv 2408.09624 ↗First posted 19 Aug 2024cs.AI cs.LG cs.NAcited by 4

Not on the map. Why?

Abstract (arXiv)

We highlight a perhaps important but hitherto unobserved insight: The attention module in a transformer is a smoothed cubic spline. Viewed in this manner, this mysterious but critical component of a transformer becomes a natural development of an old notion deeply entrenched in classical approximation theory. More precisely, we show that with ReLU-activation, attention, masked attention, encoder-decoder attention are all cubic splines. As every component in a transformer is constructed out of compositions of various attention modules (= cubic splines) and feed forward neural networks (= linear splines), all its components -- encoder, decoder, and encoder-decoder blocks; multilayered encoders and decoders; the transformer itself -- are cubic or higher-order splines. If we assume the Pierce-Birkhoff conjecture, then the converse also holds, i.e., every spline is a ReLU-activated encoder. Since a spline is generally just C2, one way to obtain a smoothed C^∞-version is by replacing ReLU with a smooth activation; and if this activation is chosen to be SoftMax, we recover the original transformer as proposed by Vaswani et al. This insight sheds light on the nature of the transformer by casting it entirely in terms of splines, one of the best known and thoroughly understood objects in applied mathematics.

Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Builds on 15 of its 46 references that are in the map. First posted on arXiv 19 Aug 2024.

Builds on

15 of 46 references.

References · 15

  1. 2017Attention Is All You Needcited by 59,932
  2. 2015Deep Residual Learning for Image Recognitioncited by 51,809
  3. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  4. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
  5. 2023RT-2: Vision-Language-Action Models Transfer Web Knowledge to Robotic Controlcited by 2,993
  6. 2021Multi-Modal Fusion Transformer for End-to-End Autonomous Drivingcited by 372
  7. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
  8. 2016Understanding Deep Neural Networks with Rectified Linear Unitscited by 253
  9. 2022cosFormer: Rethinking Softmax in Attentioncited by 212
  10. 2019Universal Approximation with Deep Narrow Networkscited by 198
  11. 2019Sparse Sequence-to-Sequence Modelscited by 167
  12. 2021SOFT: Softmax-free Transformer with Linear Complexitycited by 128
3 more
  1. 2023Deep Transformers without Shortcuts: Modifying Self-attention for Faithful Signal Propagationcited by 44
  2. 2023Replacing softmax with ReLU in Vision Transformerscited by 43
  3. 2022SimA: Simple Softmax-free Attention for Vision Transformerscited by 32

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 3; 2026: 1.

4 papers.