Skip to content

Fisher-Rao Geodesic Attention: Spherical and Hyperbolic Attention from Information Geometry

Eduardo Quiñelen Rojas, Miguel Contreras Torrejon

cs.LG

Abstract

We propose attention in which queries and keys are probability distributions and the score is their exact Fisher-Rao geodesic distance. Once the family is chosen, invariance under sufficient statistics fixes the metric up to scale: categorical tokens give a spherical kernel, isotropic Gaussian tokens a hyperbolic one, and Euclidean distance attention is the flat Gaussian location family. The Gaussian kernel is hyperbolic distance attention in half-space coordinates; its exact distance costs one matrix multiplication plus an elementwise arccosh (2.3-2.8x a dot-product module on CPU). On Dyck-2 with matched parameters and a fixed budget, accuracy beyond the training length ranks dot-product 85.8% < spherical 86.6% < hyperbolic 88.4%, with the same margin within it, so the kernel learns nested structure better rather than extrapolating separately; the contrast holds over 20 paired seeds (+2.10 pp, 95% CI 1.74-2.46), is larger in one 19M-parameter configuration (+4.7 pp, 3 seeds) and persists with rotary positions (+1.82 pp, n=20, pre-registered). With Gaussian tokens fixed, it beats Wasserstein-Bures and KL kernels, and a variant without per-token scales keeps most of the gain: the evidence points to the geodesic kernel, not yet separating curvature from slow score growth. With untrained absolute positions, a norm-capped variant degrades less than dot-product attention beyond the training length on code and English prose (pre-registered), but not on Spanish clinical text; these small models are near character-bigram quality. Pre-registered probes find second-layer query scales narrowing and key scales widening with nesting depth, a decodable code whose removal from the query scales costs 0.15 pp beyond the training length (0.41 pp within it). A reimplementation of curvature-adaptive routing (CAT) shows no significant difference. Negative results are reported alongside the positive ones.

Create a lesson

Metadata

Comments
34 pages, 4 figures. Code, logs and pre-registration protocols: https://github.com/quinelen/fisher-rao-attention (archived at doi:10.5281/zenodo.23424909). Earlier versions were archived on Zenodo under the subtitle &#34;Exact Constant-Curvature Kernels for Sequence Models at Near-Matmul Cost&#34;