Pure Algebraic Primitives for Autoregressive Transformers

Standard transformer architectures depend fundamentally on transcendental functions: softmax attention computes exponentials, rotary position embeddings evaluate trigonometric functions, feed-forward networks evaluate sigmoidal activations, and output heads evaluate LogSumExp. On modern hardware accelerators, these operations demand specialized function units, extensive look-up tables, or polynomial series approximations that consume disproportionate silicon area, introduce precision asymmetries, and incur memory traffic. I present the Algebraic Transformer, an autoregressive sequence model whose training objective and gradient are completely devoid of transcendental operations. Rooted in hyperbolic geometry, this architecture establishes: (i) an exact hyperbolic attention mechanism parameterized by the birational link ρ(x) = x + √(1 + x²) = exp(asinh(x)), satisfying an Abelian rapidity group law ρ(x ⊕ y) = ρ(x)ρ(y); (ii) rational position rotations on SO(d) constructed via the birational Cayley transform with frequencies initialized through successive square roots; (iii) the Algebraic Linear Unit (ALU), a cancellation-free gated activation with a division-free vector-Jacobian product; and (iv) Alg-CE, a purely algebraic maximum-likelihood head with an exact rational-radical gradient and intrinsic Lorentzian logit regularization. I formally verify the mathematical foundations of this architecture in Lean 4, certifying 76 theorems across 11 modules with zero unproven axioms, and further proving on paper a dimension-independent 1-Lipschitz bound ||J|| ≤ 1 on the attention operator. Pretrained from scratch on FineWeb-Edu across three compute scales (125M, 350M, and 1B parameters), the Algebraic Transformer consistently achieves lower held-out cross-entropy loss by 0.025 to 0.042 nats (2.5% to 4.1% relative perplexity reduction) compared to standard transformer controls, while matching or exceeding baseline accuracy on most of 8 public zero-shot tasks and 4 long-range needle recall suites at every scale. A controlled factorial ablation over all 16 component permutations attributes the advantage primarily to asinh attention and the Alg-CE likelihood head, which interact super-additively, and a pure-algebraic cubic Hermite schedule matches or improves on transcendental cosine decay at a matched token budget. Custom fused Pallas kernels on Cloud TPU v4 achieve forward latency within 3.6% of standard FlashAttention at sequence length T = 2048 with a whole-head resident backward kernel measured at 2.783 ms at the same sequence length.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-30
DOI
https://doi.org/10.5281/zenodo.24688471
Primary Topic
Topic Modeling
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

Pure Algebraic Primitives for Autoregressive Transformers

Tasmai Keni
Zenodo (CERN European Organization for Nuclear Research)
Topic Modeling
preprint

Pure Algebraic Primitives for Autoregressive Transformers

Tasmai Keni
preprint en

Abstract

Standard transformer architectures depend fundamentally on transcendental functions: softmax attention computes exponentials, rotary position embeddings evaluate trigonometric functions, feed-forward networks evaluate sigmoidal activations, and output heads evaluate LogSumExp. On modern hardware accelerators, these operations demand specialized function units, extensive look-up tables, or polynomial series approximations that consume disproportionate silicon area, introduce precision asymmetries, and incur memory traffic. I present the Algebraic Transformer, an autoregressive sequence model whose training objective and gradient are completely devoid of transcendental operations. Rooted in hyperbolic geometry, this architecture establishes: (i) an exact hyperbolic attention mechanism parameterized by the birational link ρ(x) = x + √(1 + x²) = exp(asinh(x)), satisfying an Abelian rapidity group law ρ(x ⊕ y) = ρ(x)ρ(y); (ii) rational position rotations on SO(d) constructed via the birational Cayley transform with frequencies initialized through successive square roots; (iii) the Algebraic Linear Unit (ALU), a cancellation-free gated activation with a division-free vector-Jacobian product; and (iv) Alg-CE, a purely algebraic maximum-likelihood head with an exact rational-radical gradient and intrinsic Lorentzian logit regularization. I formally verify the mathematical foundations of this architecture in Lean 4, certifying 76 theorems across 11 modules with zero unproven axioms, and further proving on paper a dimension-independent 1-Lipschitz bound ||J|| ≤ 1 on the attention operator. Pretrained from scratch on FineWeb-Edu across three compute scales (125M, 350M, and 1B parameters), the Algebraic Transformer consistently achieves lower held-out cross-entropy loss by 0.025 to 0.042 nats (2.5% to 4.1% relative perplexity reduction) compared to standard transformer controls, while matching or exceeding baseline accuracy on most of 8 public zero-shot tasks and 4 long-range needle recall suites at every scale. A controlled factorial ablation over all 16 component permutations attributes the advantage primarily to asinh attention and the Alg-CE likelihood head, which interact super-additively, and a pure-algebraic cubic Hermite schedule matches or improves on transcendental cosine decay at a matched token budget. Custom fused Pallas kernels on Cloud TPU v4 achieve forward latency within 3.6% of standard FlashAttention at sequence length T = 2048 with a whole-head resident backward kernel measured at 2.783 ms at the same sequence length.

Zenodo (CERN European Organization for Nuclear Research)
Topic Modeling
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon