Pith. sign in

REVIEW 2 cited by

Attention is a smoothed cubic spline

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2408.09624 v1 pith:6ZXVA4T5 submitted 2024-08-19 cs.AI cs.LGcs.NAmath.NA

classification cs.AIcs.LGcs.NAmath.NA
keywords attentiontransformercubicsplinessplinesmoothedactivationcomponent
verification ladder T0 review T1 audit T2 compute T3 formal
0 comments
abstract

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 $C^2$, one way to obtain a smoothed $C^\infty$-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.

Discussion (0). Continue with ORCID to comment.

Forward citations

Cited by 2 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score. Full citation record

  1. Pierce-Birkhoff conjecture is true for splines

    math.AG 2025-07 conditional novelty 7.0 of 10

    Every continuous spline of any degree on any hyperplane partition of R^n is a finite lattice combination of ordinary polynomials.

  2. Softplus Attention with Re-weighting Boosts Length Extrapolation in Large Language Models

    cs.CL 2025-01 conditional novelty 4.0 of 10

    A two-stage softplus-based attention mechanism with re-weighting (LSSAR) is reported to keep validation loss nearly flat when a 124M-parameter GPT-2 is tested at up to 16x its 1024-token training length.

Pith tools