arXiv:2608.29314cs.CLAug 2026

Manuscript Offprint

arXiv:2608.29314

All You Need Is Non-Commutative Words

Carla M. Quispe Flores, Stanley Salvatierra, Renan Cabrera

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Carla M. Quispe Flores, 1,∗^{1,*} Stanley Salvatierra, 2,†^{2,\dagger} and Renan Cabrera 3^{3}

1^{1}Department of Physics, Colorado School of Mines, Golden, Colorado 80401, USA

2^{2}Lookia MX, OR 0401, BO

3^{3}Yardley, PA 19067, USA

We represent lexical tokens as unitary matrices and encode each sentence as their ordered product. The noncommutativity of matrix product captures word order without positional encodings (PEs). The same algebra yields several capabilities, including antisymmetric self-attention with no query, key, or value projections, and parallel composition of variable-length text chunks at a reduced attention cost. Furthermore, it provides a canonical-coset readout layer that encodes all true unitary degrees of freedom compactly, while supporting continual learning through nested group extensions that enlarge the operator space with each new task preserving prior representations exactly. Across standard text-classification benchmarks, the method matches or exceeds bag-of-words baselines. Achieving higher accuracy on IMDB and comparable performance on AG News. Notably, this is accomplished by replacing the conventional ∼\sim30,000-dimensional vocabulary space with a dense, 64-parameter real-valued encoding, highlighting the expressive efficiency of our parameterization.

I. INTRODUCTION

Although sentences are inherently structured by sequence, widely adopted text representations exhibit permutation invariance. Bag-of-words (BoW) [1] aggregate word vectors by addition or averaging, and are therefore invariant under any permutation of the input. Transformer-based large language models (LLMs) encounter a complementary problem: the self-attention mechanism is insensitive to token ordering. Thus, positional information must be added separately, through additive encodings, relative-position biases, or rotary embeddings (RoPE) [2]. In both cases sequential structure is grafted onto the model via added parameters.

In contrast, group theory offers a natural framework to represent sequence structure intrinsically. Unitary evolution recurrent networks [3] and their efficient parametrizations [4] constrained hidden-to-hidden weights to the unitary group, resolving the vanishing- and exploding-gradient problem [5]; non-normal extensions [6] relaxed strict orthogonality to admit transient dynamics and reached state-of-the-art character-level modeling among non-gated architectures. In all of these models, the unitary matrix is a hidden-state transition operator: order is handled by the recurrence, and the word embedding remains a conventional vector.

Non-commutativity has also been recognized as a mechanism for encoding order directly. PaTH [7] represents position through accumulated, input-dependent Householder reflections, and such non-commutative products substantially improve state tracking and length extrapolation; yet the products serve strictly as a position code inside standard attention, with query, key, and value projections intact. Closer to our view, Bernardy and Lappin [8, 9] encode words as orthogonal matrices obtained by exponentiating skew-symmetric generators and compose sentences by sequential matrix products, achieving rule-like accuracy on subject-verb agreement and generalized Dyck bracket matching; their model, however, is a purely recurrent cell over real orthogonal matrices, evaluated only on syntactic prediction. The appeal of algebraically structured sentence spaces extends beyond order: [10] obtain interpretable and controllable sentence representations by disentangling the latent space of a language autoencoder with invertible neural networks, though the geometry there is learned from data, not fixed by a group.

Quantum-inspired language models pursue a complementary direction, modeling sentence semantics as the sequential unitary evolution of lexical superposition states and reporting parameter-efficient gains on question answering and text classification [11, 12]. In contrast, Anschuetz et al. [13] study genuinely quantum models: recurrent architectures built from unitary dynamics with non-Gaussian measurements, and proved an unconditional memory separation over trainable classical sequence models. Identifying quantum contextuality as the interpretable source of the advantage. Most of these efforts remain small in scale [12], and they retain the quantum state as the object of representation: the sentence is a density matrix updated word by word through a serial recursion that admits no parallel regrouping.

Despite these efforts, no existing framework simultaneously represents every token as a learnable unitary group element, encodes word order through matrix non-commutativity instead of added positional signals, and derives self-attention, chunk-parallel composition, and continual learning as direct consequences of the same algebraic structure. In this work we introduce such an architecture, implemented as a single forward network. Input token identifiers are mapped to real coordinates in a Chevalley basis; the coordinates assemble one Hermitian generator per word; matrix exponentiation, regulated by an adaptive per-word rotation budget εw\varepsilon_w, turns each generator into a unitary word operator; a time-ordered matrix product composes the operators into a single document unitary; and a canonical-coset readout extracts its intrinsic coordinates, which a batch-normalized linear head classifies, as shown in Fig. 1.

Order sensitivity follows from the non-commutativity of the composed operators, requiring neither positional encodings nor causal masks. The same algebra yields an exactly antisymmetric self-attention score computed from one learned

†^{\dagger} C. M. Quispe Flores and S. Salvatierra contributed equally to this work.

Figure

FIG. 1. Word order is captured natively by representing each word as a unitary matrix and composing the sentence via their ordered product. Because matrix multiplication is noncommutative, the resulting document state PLP_L preserves token ordering without positional encodings (PEs). A flattened readout followed by a single linear head then maps this state to the target label.

Hermitian matrix, with no query, key, or value projections; group closure lets variable-length chunks be composed in parallel at reduced attention cost; and the nesting U(n)⊂U(n+k)U(n) \subset U(n+k) supports continual learning that preserves prior tasks exactly. This construction is inspired by the mathematics of quantum mechanics, but every computation here is classical and we claim no quantum advantage. The model matches bag-of-words baselines on standard text-classification benchmarks, while replacing a ∼\sim30,000-dimensional vocabulary space with a dense 64-coordinate encoding.

The remainder of this paper is organized as follows. Section II develops the framework and the full network architecture, Section III presents and discusses the results, and Section IV concludes with contributions and outlook.