Manuscript Offprint
arXiv:2610.29526Geometric knowledge spaces, Attention pairing and Architectures
SHANG XU
ABSTRACT. In this paper, we propose a geometric approach to deriving attention mechanisms and exploring potential new transformer architectures. We begin by formalizing the notions of knowledge worlds and attention pairings, then demonstrate how this framework naturally leads to the architectures of standard attention, causal attention, linear attention, tensor attention, and recurrent neural networks. Finally, we introduce several new geometric spaces that may inspire novel neural network architectures.
CONTENTS
- Introduction 1
- Formalization of Characters, Knowledge and Intelligence and Attention 2
2.1. An intuitive abstraction of the axioms 3
2.2. A categorical formalization 4
2.3. Examples 5 - From the formalization to architectures 5
3.1. Bilinear pairing and attention 5
3.2. Matrix trace pairing and linear attention 7
3.3. Tensor-valued knowledge and natural attention pairings 8
3.4. Fixed-dimensional knowledge worlds and recurrent neural networks 9 - Geometric spaces that lead to new designs 12
4.1. Further geometric knowledge worlds 12
References 14
The use of geometry to understand and design neural networks has an established foundation. Geometric deep learning emphasizes how the structure and symmetries of a learning problem can guide the construction of architectures, bringing together methods for grids, groups, graphs, and manifolds within a common perspective [BBCV21]. The study of permutation-invariant learning provides a particularly concrete example: the requirement that a function be insensitive to input order leads to structured architectures for processing sets . These developments illustrate the value of treating mathematical structure as a source of architectural constraints and design principles. Complementing this perspective, we focus on the relationship between the space in which information is stored, the operations by which it is accumulated, and the pairings through which it is evaluated.
In this paper, we introduce a geometric framework organized around the notions of a knowledge world and an intelligence. A character space represents elementary units of encoded information, while a sequence of spaces describes the possible knowledge states after successive inputs. Update maps specify how a new character is incorporated into an existing state. An intelligence assigns to each state a function that evaluates characters in a stage-dependent evaluation space . In a concrete setting, these
SHANG XU
structures are expressed by maps
The spaces may have several coordinates, corresponding to different evaluation criteria, and their dimensions may vary with the stage. We call an attention pairing, using the term “pairing” for a structured two-input evaluation map without requiring it to be bilinear.
An important feature of the framework is the distinction between evaluating information and using that evaluation in a computation. A pairing may produce compatibility scores, a proposed memory increment, or a candidate hidden representation. Additional operations determine how these evaluations affect the model: they may be normalized, used to rescale and aggregate stored information, or incorporated into a subsequent knowledge state. For example, scaled dot-product attention combines a query-key pairing with softmax normalization and weighted aggregation of values . In our formulation, these are separate choices rather than inseparable parts of the definition of intelligence. Likewise, learned encoders may determine how input data enter the character space, while the pairing on that space can be fixed by its geometric structure. This separation makes it possible to vary the representation, evaluation, and update mechanisms independently, subject to their compatibility.
We illustrate the framework by realizing the central computations of several established architectures. Sequence-valued knowledge states equipped with inner-product pairings recover dot-product attention. Restricting evaluation and normalization to prefix states gives causal attention without changing the underlying pairing. Additive accumulation of rank-one contributions yields a knowledge world whose normalized readout recovers positive-feature linear attention, consistent with its recurrent formulation [KVPF20]. Low-rank tensor-valued characters, together with contractions that retain the separate attention heads, provide a geometric realization of Tensor Product Attention [ZLY 25]. Finally, state spaces that stabilize in dimension support recurrent architectures: bilinear evaluations can generate accumulated interaction memories, while nonlinear evaluations can recover the affine-plus-activation recurrence of a vanilla RNN [SMH11]. These examples concern the core computational mechanisms; their incorporation into complete models requires further choices of parametrization, layer composition, and output maps.
The framework also makes several structural distinctions explicit. We call a knowledge world abelian when incorporating two characters in either order gives the same state. Starting from a fixed initial state, this condition makes the final accumulated knowledge insensitive to permutations of the input characters. We separately consider a placeholder-free condition, which requires insertion of a distinguished null character to commute with other updates. This condition does not, by itself, require null insertion to act as the identity. Causality is different from both properties: it concerns which information is available when an output is computed. An abelian accumulation rule can therefore support causal computations when each output is evaluated on the corresponding prefix. Distinguishing properties of storage, evaluation, and information availability helps clarify which architectural choices are responsible for particular computational behaviors. More generally, topology, differential geometry, and algebraic geometry offer spaces and operations that can be investigated within this framework. The aim is not merely to translate existing architectures into geometric terminology, but to make geometric constructions available as inputs to the design process.
This perspective separates mathematical specification from computational and empirical validation. A geometric system satisfying the proposed axioms does not automatically determine a unique architecture, nor does it guarantee efficient implementation or effective learning. Parametrization, numerical stability, computational cost, and the interaction between layers remain essential design questions. Nevertheless, making the underlying structures explicit provides a way to formulate these questions and to compare candidate designs. We begin with an accessible description of the framework and its categorical formalization, then examine attention and recurrent architectures as examples, and finally explore geometric constructions that may lead to new computational attention layers.
Acknowledgments. Thanks Ziang Li and Pengcheng Wang for very useful discussions.
AI disclosures. In this first version of paper, ChatGPT is used for literature searches, computation check and language polishing. The ideas and mathematical interference are original and the author takes full responsibility for its correctness.
2. FORMALIZATION OF CHARACTERS, KNOWLEDGE AND INTELLIGENCE AND ATTENTION
In this section we explain our abstraction of learning theory to both computer scientists and mathematicians. Subsection 2.1 is for computer scientists to quickly understand our setting, and 2.2 is a categorical formalism for mathematicians.
2.1. An intuitive abstraction of the axioms. We begin by introducing a mathematical framework for describing how information is accumulated, processed, and evaluated. The basic objects are characters, knowledge states, processes, and intelligence. We first explain these notions in the language of Euclidean spaces, so that the framework can be understood without any background in abstract mathematics.
Let be a space of characters, together with a distinguished element , called the null character. A character represents an elementary piece of information. For example, in a language model, a character may represent a token embedding; in computer vision, it may represent a feature vector extracted from an image patch. Thus, the word “character” should be understood as a general unit of information, rather than necessarily a letter or symbol.
For each nonnegative integer , let be a space of knowledge states. Intuitively, represents all possible internal states of a system after receiving characters. These spaces need not be Euclidean spaces themselves: they may be submanifolds or other geometric subsets of . Moreover, the dimensions are allowed to vary with . Of course, we would like to let so that the first stage of knowledge is just our character space. Now, to connect those stages, there should be a family of maps
which describe how knowledge is updated upon receiving a new character. More precisely, given a current knowledge state and a character , the new state is
Starting from an initial state , a sequence of characters therefore generates a sequence of knowledge states recursively:
This is a formalization of how information unit establish the knowledge.
We are particularly interested in two properties of these updates. First, we call the system placeholder-free if
for every and . In other words, inserting a null character before or after another character leads to the same knowledge state. Notice that this condition does not require the null character to have no effect; it only requires its update to commute with other character updates.
Second, we call the system abelian if
for every and . This means that the order in which two characters are incorporated does not affect the resulting knowledge state. Consequently, the final state obtained from a fixed initial state depends only on the multiset of input characters, rather than their order. A simple example is obtained by taking for all , with
Since matrix addition is commutative, this system is abelian. More generally, the maps may involve nonlinear transformations or geometric constraints, and need not satisfy the abelian property. Abelian systems are natural candidates for tasks involving unordered information, such as learning from sets of feature vectors.
Having established the knowledge space, we now introduce two additional structures.
(1) A process is a sequence of maps
This can be understood as given a sentence with n characters, we can determine the next in a machinery manner. Composing with the updating map, we get the generating map :
One may think of this as intelligence because it automatically feedback once you have some input. However, an intelligence should be able to 'see' all possible results and 'determine' which to choose. This is formalized as following.
(2) For each , we obtain an evaluation space , which one can consider as a multi-dimensional evaluation criteria at the stage , and we may initially take to be , where is the number of factors we want to consider. Let denote the space of functions from to . An intelligence is a sequence of maps
SHANG XU
Thus, each knowledge state determines an evaluation function
Mathematically, one usually has an adjunction to the functor , namely , where could be another operation between spaces that behaves like the tensor product of vector spaces. The key is we want
To understand this intuitively, if we denote for and , we see that a map from to gives a function (a map to ) on . If spaces and maps are linear, this reduces to a map from to . Different choices of structured maps (such as continuous, differentiable, or polynomial) could lead to different constructions of the Map space/tensor constructions, so we need to formalize this here. mathematically, we call a function on a pairing on and . For this specific structure, we call the attention pairing at the stage , due to its close relationship with the attention mechanism which we will explain in the following sections.
2.2. A categorical formalization. This subsection is for mathematics For mathematicians, the following categorical formulation may be preferable, as it allows the spaces above to be replaced by more general geometric or algebraic objects.
Fix a locally small category of spaces with a terminal object , and suppose that binary products exist in . A space of characters is a pointed object , where and is a distinguished morphism called the null character. A knowledge world with respect to is an -indexed sequence of objects with equipped with morphisms
For any character , we denote by the morphism induced by , defined as the composition
A knowledge world is said to be placeholder-free if
for every character and every . Similarly, it is called abelian if
for all characters and every . In particular, every abelian knowledge world is placeholder-free.
Having established the notion of a knowledge world, we now define processes and intelligence on this structure. A process is an N-indexed sequence of morphisms , where
Next, fix an evaluation object . We wish to define the object of functions on , denoted by , such that the morphism from objects in to makes sense. If objects in are sets, we may simply take . More generally, we suppose that admits an internal mapping object , characterized by natural bijections
for every . In this case, we define
Under either assumption, an intelligence on the knowledge world is an N-indexed sequence of morphisms
Equivalently, by the defining property of the internal mapping object, each corresponds to an evaluation morphism
This latter formulation remains meaningful even when the internal mapping object does not exist, and may therefore be used as a more general definition of intelligence.
Thus, a knowledge world, together with a process and an intelligence, provides a categorical description of information accumulation, state evolution, and evaluation, without imposing any particular geometric structure on the underlying objects.
2.3. Examples. In this section, we provide some examples of filtered geometric spaces satisfying our axioms, and we will talk about the concrete industry design derived by these structures in the next section.
Example 2.1. vector space and bilinear form Let be the character space, and take
A knowledge state records a sequence of characters, each already encoded as a vector in . We regard these vectors as the columns of . The knowledge-update map appends a new character:
Take . The inner product defines a linear intelligence
This leads to the usual attention and casual attention, we will explain in 3.1 and 3.1.1.
Example 2.2. Let and for some real vector space . Choose an initial state , the update is
Take , an intelligence is defined by
This would lead to RNN as we will explain in 3.4.
Example 2.3. Fix an ambient matrix space , let
We have an update
An intelligence is induced by the attention pairing
This leads to linear attention as explained in 3.2
There are also other interesting examples, for example, the tensor space in 3.3 that leads to tensor attention, the projective spaces, Grassmannians, Lie algebra orbits.
3. FROM THE FORMALIZATION TO ARCHITECTURES
In this section, we specify how the geometric constructions of the knowledge world and intelligence in last section's examples lead to the actual architectures in industry. Our examples cover attention, casual attention, linear attention, tensor attention and vanilla/multiplicative RNN, showing the strong potential ability of our formalization in architectural designs.
3.1. Bilinear pairing and attention. Let be the character space, and take
A knowledge state records a sequence of characters, each already encoded as a vector in . We regard these vectors as the columns of . The knowledge-update map appends a new character:
SHANG XU
3.1.1. Bilinear intelligence and attention. Take the evaluation space to be . The Euclidean inner product defines a linear intelligence
Each coordinate evaluates the compatibility of a character with one of the stored tokens. Thus, the number of evaluation criteria grows with the amount of stored information.
The corresponding attention pairing is
This map is linear in and linear in , and therefore corresponds to a linear map . The central evaluation structure is precisely this bilinear pairing: a knowledge state evaluates a character by comparing it with each character already stored.
We may now introduce a normalization on the evaluation space. For , define
Its output has positive coordinates summing to one, so the normalized evaluations can be interpreted as weights assigned to the stored tokens.
Because softmax is nonlinear, postcomposition with it does not preserve the space of linear maps. We therefore regard as a subspace of the larger function space . Softmax then induces a map
Applying this operation to the intelligence, together with a scaling factor , gives
This normalization is an additional architectural choice, rather than a requirement of our framework. Exponentiation makes the weights positive, while division by their sum normalizes them. These operations introduce a nonlinear transformation of the evaluation scores. The underlying intelligence is linear and its pairing is bilinear, whereas the normalized evaluation is no longer bilinear.
The coordinates of are exactly the attention weights in the scaled dot-product attention mechanism described in [VSP 17, Section 3.2.1]: the character is the query, and the stored vectors are the keys. To obtain the full attention output, associate a value vector with each key and form
where . In the simplest case, the stored vectors also serve as values, so .
3.1.2. Alternative choice: Causal Attention. Let's continue working on the knowledge world above and introduce causality, we require the output at position i to use only the prefix state , rather than the entire sequence . The input vectors themselves are assumed not to contain information from future tokens. Evaluating the current character and normalizing on gives
Explicitly, the weight assigned to position is
The crucial point is that both the available scores and the normalizing denominator involve only the prefix. Softmax remains an additional nonlinear normalization of the bilinear evaluations; causality determines which evaluations may participate.
Associate a value vector with each stored token. The retrieved output is
This is causal scaled dot-product self-attention, as used in the Transformer decoder of [VSP 17, Sections 3.2.1 and 3.2.3], in the special case where the token vectors themselves serve as queries and keys.
The usual trainable version replaces by and scales by the square root of the query-key dimension.
Causality is distinct from our commutativity axioms. The append-based world is neither abelian nor placeholder-free, since changing the order of appended characters changes the stored sequence. Nevertheless, its attention outputs are causal: appending future characters does not change the outputs already determined by a prefix.
Thus, causal attention retains the same bilinear intelligence as ordinary attention, but restricts each evaluation and its normalization to the knowledge available at that position.
Remark 3.1 (A query-key-value knowledge world). A more explicit formulation takes
Each character already consists of its query, key, and value components; these are coordinates of the character itself, not additional representations introduced by the intelligence. The knowledge-update maps remain concatenation.
For the Euclidean pairing, assume . Given a state , where , define
Applying softmax after scaling by gives weights for aggregating the stored value components .
The single-vector presentation above is an intuitive specialization in which the query and key components coincide; the value component may also be identified with them. Keeping these components separate gives the query-key-value formulation used in the tensor-valued construction. Causal attention uses the same pairing, restricted to prefix states.
3.2. Matrix trace pairing and linear attention. We now consider a knowledge world in which information is accumulated by adding rank-one matrices, rather than by storing an entire sequence.
Fix positive integers r, m, and define the character space
Here denotes the vectors with strictly positive coordinates. A nonzero character encodes a positive feature vector together with an information vector , while the zero matrix is the null character. Each nonzero character has rank one.
For each , define
Then
The rank bound expresses the fact that a state obtained from n characters is a sum of at most n rank-one contributions; its rank need not increase at every update.
Define the knowledge-update maps by addition:
These maps are well-defined because
More generally, . Writing , the update associated with is explicitly
Starting from , the characters therefore produce
Thus, the history is compressed into a matrix of fixed size.
This knowledge world is abelian, since
It is also placeholder-free. Indeed, is precisely the inclusion : a null character leaves the stored matrix unchanged. Consequently, the final memory depends only on the collection of encoded characters, not on their order. This does not imply that the intermediate prefix states are independent of order.
SHANG XU
To define intelligence, take . For a state and a character , we set the following pairing
where
is the Frobenius inner product. This defines an intelligence
The attention pairing is the restriction of a bilinear map on the ambient matrix spaces. Its first coordinate evaluates compatibility, while its second records the quantity used for normalization.
As in the previous example, normalization is an additional operation on the evaluation space. Since , we may fix and apply
This gives a scalar-valued normalized intelligence
The positive constant keeps this expression defined at the null state and null character. Since the formula is independent of the stage, inserting a null character also leaves all evaluations unchanged.
To interpret this intelligence, write a nonzero character as
Then
Thus, for each positive query vector q, the normalized intelligence is represented by the retrieved vector
Its evaluation on is simply .
This is the positive-feature linear attention construction of [KVPF20, Sections 3.2–3.4], with an added regularization constant . Here and are the query and key features, and are the values. For a nonzero memory and a positive query, setting in the readout gives positive attention weights summing to one. Unlike softmax attention, the similarities are , rather than exponentials of dot products; the two mechanisms are not generally identical.
The computational advantage is that the sums and can be maintained incrementally and reused for every query. Each update and readout requires operations, so updates and readouts require operations, with storage for the running state. Thus, “linear” refers to the dependence on sequence length, not to linearity of the normalized output.
In our framework, this construction combines a rank-filtered knowledge world, abelian and placeholder-free updates, an ambient bilinear attention pairing, and a nonlinear normalization of its evaluations.
3.3. Tensor-valued knowledge and natural attention pairings. Fix a number of heads h and a feature dimension r, and consider the tensor space
For a positive integer R, let
Thus, consists of tensors expressible as sums of at most R rank-one tensors.
Choose rank bounds , and define the character space by
A character already contains its query, key, and value tensors. These tensors are part of the encoded character itself, rather than representations constructed by the intelligence. The null character is .
Take , with consisting of the empty sequence, and define the knowledge-update maps by appending:
Since the rank-constrained character space need not be a vector space, here denotes a Cartesian product.
The tensor space carries a natural headwise pairing by
where denotes coordinatewise multiplication. Bilinearity then determines the pairing on arbitrary tensors. In coordinates, this map is:
Now, take the evaluation space to be
For a knowledge state , with , and a character , define
This gives an intelligence
Each evaluation coordinate records the compatibility between the query of a and the key of a stored character, within a particular head.
The pairing is the restriction of a bilinear map on the ambient tensor spaces. No additional trainable feature maps are required to define it: the tensor structure is already present in the character space.
As before, introduce a nonlinear normalization on the evaluation space:
Softmax acts separately on the evaluation coordinates of each head. Writing , the retrieved tensor is defined by
Thus, each head combines the corresponding rows of the stored value tensors according to its normalized evaluations.
This realizes the attention computation of Tensor Product Attention [ZLY 25, Section 3.1] directly on tensor-valued characters, before the final output projection. The low-rank constraints describe the geometry of the character space, while provides the evaluation pairing.
In the usual parametrized implementation, learned factor maps construct the tensors from input hidden vectors. In our formulation, these maps instead specify an encoder
The resulting scores are obtained by evaluating
Choosing the encoder to be the usual tensor-factor construction recovers the corresponding scores and head outputs. The factors may also be retained as a compact representation for computing the contraction, without materializing the full tensors.
Consequently, the learned encoding and the intelligence are conceptually separate: learning determines how information is represented in the tensor-valued character space, while intelligence evaluates those representations through a fixed pairing. Normalization and value aggregation then turn these evaluations into an attention readout.
3.4. Fixed-dimensional knowledge worlds and recurrent neural networks. Let and . Take the character space to be , with null character 0, and consider the state spaces
Unlike the sequence spaces , these spaces have a fixed dimension after the second stage. New information must therefore be incorporated into an existing representation, rather than stored by introducing new coordinates.
SHANG XU
The state spaces alone do not determine a recurrent architecture. Different choices of intelligence and knowledge-update maps lead to different ways of processing information. We illustrate this with two constructions: a bilinear accumulation model and a vanilla recurrent neural network.
In both constructions, take the evaluation spaces to be and write
Thus, an intelligence evaluates a candidate character by producing a vector in the memory space U. The knowledge updates below are explicitly constructed using these evaluations. This is a choice of architecture, rather than an additional requirement in the definition of intelligence.
3.4.1. A bilinear recurrent architecture. Choose a trainable bilinear map
For , interpret a state as consisting of accumulated character information and an interaction memory . Define the intelligence by
The corresponding attention pairing, for , is
It is bilinear in the knowledge state and the character. Its value represents the interaction between the accumulated character information and the new input, rather than the complete next memory state.
Define the knowledge-update maps by
and, for , by
Equivalently, the intelligence determines the increment to the interaction memory:
After identifying with , the evolution is described by the recurrence
with and . Bilinearity gives the explicit formulas
Thus, the first component stores a first-order summary of the inputs, while the second stores a summary of ordered pairwise interactions. The earlier character appears in the first argument of , and the later character in the second.
A concrete parametrization is
where are trainable matrices and denotes coordinatewise multiplication. The recurrence becomes
This is a recurrent architecture with multiplicative interactions and parameters shared across stages. It is related in this respect to multiplicative recurrent networks [SMH11, Section 3], although the particular accumulation rule above is not the architecture defined in that paper. We refer to it here as a bilinear accumulation RNN. One can also add nonlinearity and normalization here so that the structure is potential more generalizable in practice, but here we emphasize on the structure correspondence with our formalization.
The axioms of the knowledge world can be checked directly. Since , the null-character updates satisfy
Together with , these are the natural inclusions between successive state spaces. Consequently, inserting a null character leaves the encoded information unchanged, and the world is placeholder-free.
To examine the abelian condition, let
denote the update on H. Then
The same calculation applies at the initial stages under the inclusions above. Hence this knowledge world is abelian if and only if is symmetric. A nonsymmetric pairing can therefore preserve information about input order, while still satisfying the placeholder-free condition. It does not, however, retain the entire sequence: the state records only the displayed first-order and second-order summaries.
3.4.2. A nonlinear architecture: the vanilla RNN. We now use the same state spaces with a different interpretation and update rule. For , a state stores the most recent character and a hidden representation of the preceding computation.
Fix an initial hidden state , trainable matrices
and a bias . Choose a continuous activation , such as tanh, applied coordinatewise. Define
In this construction, intelligence evaluates the complete next hidden representation, rather than an increment to the existing memory. Set
The formula for accounts for the special state space : after the first character , the hidden representation is determined by as and need not be independently stored.
For , the associated attention pairing is
This pairing is generally nonlinear. Here, as in our general definition, “pairing” means a structured two-input evaluation map and does not imply bilinearity.
Define the knowledge updates by
In particular, for ,
The first component is replaced by the new character, and the second is replaced by the hidden representation evaluated by the intelligence.
Given characters , define
The corresponding knowledge states are
This is precisely the hidden-state recurrence of a vanilla recurrent neural network; see [SMH11, Section 2]. The parameters are shared across all stages. The additional V component retains the most recent character, while the usual recurrent memory is carried by U.
Unlike the bilinear accumulation model, this knowledge world is not placeholder-free when . Indeed, for ,
For , these states already differ in their first components. Hence this realization is also nonabelian. Moreover, even when considering only the hidden component, a zero input is not generally an inactive step, since
need not equal h. Ignoring padding would therefore require an additional masking rule, rather than merely encoding padding by the zero vector.
SHANG XU
4. GEOMETRIC SPACES THAT LEAD TO NEW DESIGNS
As we discussed above, the knowledge world and intelligence could leads to the design of architecture, as showed in table 1.
| Architecture | knowledge worlds | Intelligence | Update and readout |
|---|---|---|---|
| Attention (ordinary or causal) | , , , . | , , . | |
| Linear attention | , , , | , , , . | Normalized evaluation: |
| Tensor attention | , , , . | , . | Concatenate heads and apply . |
| Bilinear RNN | , , , . | , The evaluation is an increment to memory. | |
| Vanilla RNN | , , , . | , The evaluation is the next hidden state. | The hidden state is replaced by its evaluation. |
TABLE 1. knowledge worlds, intelligence pairings, and the resulting neural architectures. The RNN formulas describe the stabilized stages , with initial stages as defined in the preceding constructions.
An inspiring aspect of this correspondence is the possibility of designing new neural network architectures by constructing suitable geometric spaces. Topology, differential geometry, and algebraic geometry offer a wealth of structures to explore. This framework therefore provides a potential route for applying the objects and tools of modern mathematics to neural network design.
A possible design strategy within this framework proceeds as follows. Given a learning task involving data such as text, music, images, or motion, we first identify the relevant structural features of the data and choose geometric models that reflect them. For example, when the task does not depend on input order, abelian knowledge worlds provide a natural starting point. We then equip the chosen knowledge worlds with suitable update maps and intelligence, expressed through attention pairings, and use these structures to construct and test individual layers. Finally, we assemble promising layers into a model, specifying how information is passed between them.
The process can thus be summarized as

For mathematicians, a natural problem is to construct geometric systems satisfying the relevant axioms. Each such system may suggest a candidate for a new attention-based architecture, whose computational feasibility and effectiveness can then be investigated.
We now present several geometric constructions satisfying our axioms. The design of attention layers based on these constructions is left for future work.
4.1. Further geometric knowledge worlds. We begin with rank filtrations in real matrix spaces.
Example 4.1. The knowledge world underlying linear attention is an augmented version of the geometric knowledge world in Example 2.3, in which nonzero words are represented by rank-one matrices in . This suggests analogous constructions using other real Lie algebras.
For instance, define
and
Then and . The knowledge updates are given by addition:
In particular, the action of the empty word is the inclusion .
Fix a map
of the regularity required by the chosen category. The simplest choice is . We then define the attention pairing by
Analogous constructions arise from rank filtrations on symmetric matrices, the symplectic Lie algebra, and the special linear Lie algebra.
Example 4.2 (Symmetric matrices). Let denote the space of real symmetric matrices. Define
and
Then and . The knowledge updates are
Fix a map
of the regularity required by the chosen category, for example . Define the attention pairing by
Example 4.3 (The special linear Lie algebra). Define
and
Then and . Every word satisfies . The knowledge updates are
Fix a map
of the regularity required by the chosen category, for example . Define the attention pairing by
Example 4.4 (The symplectic Lie algebra). Let
Define
and
Then and . Every word satisfies . The knowledge updates are
Fix a map
SHANG XU
of the regularity required by the chosen category, for example F = id. Define the attention pairing by
Example 4.5 (Symmetric products). Let , pointed at the origin, and define
with the quotient topology. Here is a point and . The inclusions append the empty word:
The knowledge updates are
Define the attention pairing by
This expression is invariant under permutations of the and hence defines a continuous pairing on .
Example 4.6 (Projective polynomial spaces). We work in the smooth category. Let
where is a fixed nonzero vector, and define
Then is a point and . The knowledge updates are given by symmetric multiplication:
The inclusion is
Equip with a Hermitian inner product and its symmetric powers with the induced inner products. Define the attention pairing by
This expression is independent of the choices of homogeneous representatives and defines a smooth real-valued pairing.
REFERENCES
[BBCV21] Michael M. Bronstein, Joan Bruna, Taco Cohen, and Petar Veličković, Geometric deep learning: Grids, groups, graphs, geodesics, and gauges, arXiv preprint arXiv:2104.13478 (2021).
[BCB15] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio, Neural machine translation by jointly learning to align and translate, International Conference on Learning Representations, 2015.
[KVPF20] Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and François Fleuret, Transformers are RNNs: Fast autoregressive transformers with linear attention, Proceedings of the 37th International Conference on Machine Learning, Proceedings of Machine Learning Research, vol. 119, PMLR, 2020, pp. 5156–5165.
[SMH11] Ilya Sutskever, James Martens, and Geoffrey Hinton, Generating text with recurrent neural networks, Proceedings of the 28th International Conference on Machine Learning, 2011, pp. 1017–1024.
[VSP 17] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Łukasz Kaiser, and Illia Polosukhin, Attention is all you need, Advances in Neural Information Processing Systems, vol. 30, 2017.
[ZKR 17] Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabás Póczos, Ruslan Salakhutdinov, and Alexander J. Smola, Deep sets, Advances in Neural Information Processing Systems, vol. 30, 2017.
[ZLY 25] Yifan Zhang, Yifeng Liu, Huizhuo Yuan, Zhen Qin, Yang Yuan, Quanquan Gu, and Andrew Chi-Chih Yao, Tensor product attention is all you need, arXiv preprint arXiv:2501.06425 (2025).