When Attention Meets 150-Year-Old Mathematics: A Revolution in Representation
> Paper: The Token Is a Group Element: On Lie-Algebra Attention over Matrix Lie Groups > Author: Przemyslaw Musialski > arXiv: 2606.20547
This post is a deep-dive walkthrough of the paper, from attention basics to Lie theory to the core proposal.
Background: Attention Assumes Vectors
Since the Transformer (Vaswani et al., 2017, *Attention Is All You Need*), attention has worked by computing pairwise similarity scores between token embeddings:
Each token's new representation is a weighted average of all tokens' values. The hidden assumption: tokens are vectors in \(\mathbb{R}^d\).
But many real-world quantities are not naturally vectors. "Rotate the chair by 30 degrees" or "scale the image 2x and translate 10 pixels" describe transformations, which compose, have inverses, and contain an identity — i.e., they form a group.
Lie Groups and Lie Algebras
A Lie group is a continuous group of transformations. Key examples, all matrix Lie groups where the group operation is matrix multiplication:
- SO(2): planar rotations
- SE(2): planar rigid transforms (rotation + translation)
- SO(3): 3D rotations
- Aff(2): 2D affine transforms (rotation, translation, scaling, shear)
- Token: \(g_i \in G\), a matrix Lie group element (not a vector)
- Relative geometry: \(g_i^{-1} g_j\) — an intrinsic, frame-independent relative transform
- Attention score:
- Zero parameters: scores are closed-form
- Automatic equivariance: transforming all inputs by the same group element transforms outputs consistently
- Cocycle condition: metric consistency \(d(i,j) + d(j,k) = d(i,k)\) holds automatically
- Reaches Aff(2): handles scaling and shear, which methods based on irreducible representations or surjective exponential maps cannot
- Vision transformers: image patches as SE(2)/Aff(2) elements for natural equivariance under rotation/scale/translation (robotics, medical imaging)
- 3D point clouds: SO(3)-equivariant attention
- Physics simulation / world models: physically consistent predictions when states are transforms
- Flow matching: possible deep mathematical connections, since flow matching also learns transformations on manifolds
- Musialski, P. (2026). *The Token Is a Group Element: On Lie-Algebra Attention over Matrix Lie Groups*. arXiv:2606.20547.
- Vaswani, A., et al. (2017). *Attention Is All You Need*. NeurIPS.
- Weiler, M., et al. (2018). *3D Steerable CNNs*. NeurIPS.
- Cohen, T., & Welling, M. (2016). *Group Equivariant Convolutional Networks*. ICML.
Lie groups are curved manifolds, but near the identity element each has a Lie algebra — a flat, linear approximation space. Vectors in the Lie algebra map back to the group via the exponential map, and the difference between two group elements is captured by the logarithm map:
The Core Idea: Tokens as Group Elements
The paper's proposal:
This is a closed-form, parameter-free score: no MLP, no learned kernel. It measures how large a transform is needed to go from token \(i\) to token \(j\) — larger transforms mean weaker attention.
Why this matters
Experimental Results
Validated on three sequence-completion tasks:
1. SE(2) sequence completion: the closed-form score matches, and even beats, a learned MLP kernel, with 50-80x fewer parameters 2. SO(3) rotation prediction: strong performance on 3D rotation sequences 3. Aff(2) affine transforms: the hardest case (non-compact, non-abelian, with scaling/shear). Traditional methods fail here entirely; Lie-algebra attention still works
Critically, a vector-token baseline breaks invariance by five to twelve orders of magnitude, i.e., it essentially fails at geometric consistency.
Significance
The paper resonates with physics, where laws must be invariant under transformation, and offers a new path for geometric deep learning: instead of the heavy machinery of representation theory (irreducible representations, spherical harmonics, as in steerable CNNs and group-equivariant CNNs), simply work directly with Lie algebras.
Limitations
1. Applicability: only validated on sequence completion; mapping real images/words to group elements is itself an open research problem 2. Log-map domain: the logarithm map is only defined in a neighborhood of the identity; distant transforms require an atlas of charts, which the paper's single-chart assumption may not cover 3. Compute cost: matrix exponentials/logarithms are more expensive than vector dot products, though no bottleneck appeared in the experiments
Future Directions
Conclusion
The post argues this is more than an engineering tweak: moving AI from vector spaces to group manifolds means describing the world in a more fundamental language. The essence of attention is not computing similarity but understanding relations — and when relations themselves are transformations, placing tokens on a group returns attention to its conceptual source.