Skip to content
Language modelsPrototype

Verace V4

A language model with Cayley parallel-transport attention, Gaussian kernel attention, commutator logic and an orthogonal optimizer.

Verace Research
  1. Norm-preserving rotations: Orthogonal matrices keep vector norms
  2. Fiber value vector: The value at position j before transport
  3. Cayley rotation: Moves the value before causal softmax aggregation
  4. Skew-symmetric generator: Built from a key and a value for each token pair
Figure 1. A value vector rotated by Cayley parallel transport in Verace V4. Schematic: a value vector turned along a sphere by an orthogonal rotation before aggregation, as in Verace V4's transport attention. The model is an unit-tested prototype; no training results are recorded.
Open the simulator on its own pageA state that turns instead of growing: an interactive toy model of the principle. You can also try it below

Overview

Verace V4 is the version of the lab's Verace V series of language models that follows Verace V3. It replaces conventional attention with three operators drawn from geometry and algebra. In the first, each value vector is rotated by an orthogonal matrix before it is aggregated. In the second, positions are weighted by a Gaussian kernel on hidden states. The third is a block built on the commutator of two learned matrices. The question is whether a language model can be built from norm-preserving rotations and kernel operators, and trained with an optimizer that keeps square weight matrices orthogonal.

The design borrows the picture of a fiber bundle. Each token carries a fiber vector. Between positions ii and jj, a skew-symmetric generator is built from a key and a value. The Cayley transform turns that generator into a rotation Rij=(I−12A)−1(I+12A)R_{ij} = (I - \tfrac{1}{2}A)^{-1}(I + \tfrac{1}{2}A), which moves vjv_j before causal softmax aggregation. Each layer then applies causal RBF kernel attention and the commutator logic block. The backbone has tied embeddings, a final RMSNorm and an LM head. It also carries a copy of the MoonViT-V2 vision encoder, a component from the Kimi Team's technical report. Training uses Unitary Muon, the lab's orthogonality-preserving variant of the Muon optimizer, which is by other authors.

The research implementation holds the full model, the optimizer, a training step, a byte-level generator, a toy benchmark and unit tests. Its configuration sets vocab 524,288, hidden size 32,768, fiber size 1,024 and 128 layers, and the technical reference lists over 100B parameters for this configuration. A scaled-down verification model, with hidden size 256, 4 layers and the GPT-2 vocabulary, comes with a TinyStories training script and a five-point verification suite. The verification records give it about 13.8M parameters. The technical reference records all 5 test suites passing in 3.45s. The lab's audit of the code found a cancelling term in the logic block and a GPU kernel that does less than its description states.

The architecture, the optimizer and the verification pipeline are implemented and unit-tested. The full-size configuration exists only as a set of hyperparameters: no full-size model is recorded as trained. The verification suite checks that validation loss falls over 40 training steps. However, no loss, perplexity or benchmark figure from any training run is recorded, and the substring-match benchmark is a toy harness. The written records disagree with the code on several details, including the retraction method and the dimensions of the small model. Whether the geometric operators help language modelling has not been measured.

Status

Prototype. The model, optimizer and a scaled-down verification pipeline are implemented and pass their unit tests, but no training run with recorded loss, perplexity or benchmark figures exists.

Simulator

A state of length 1 is updated again and again by the same small step, in two ways. Switch between rotating it and adding to it, and watch its length.

  • the circle: every state of length 1
Length of the state at the end
1.000
Drift from length 1
0.0%
Turned in all
248°
Updates
24
How the state is updated

Switch between the two methods with the same step size. Adding the step leaves the circle; rotating cannot.

This simulator is an illustration of the principle, with made-up numbers. It does not run the lab's code or show the lab's data, and nothing in it is a measurement.

Architecture

  1. V4 layer stack

    Each layer applies Cayley parallel-transport attention, then causal RBF kernel attention, then the commutator logic block. The backbone runs 128 such layers in the full configuration, with tied embeddings, a final RMSNorm and an LM head, and has no flow module.

  2. Cayley parallel-transport attention

    An attention operator in which every token pair gets its own orthogonal rotation, built from that pair's fiber key and value. The rotation is applied to the value vector before causal softmax aggregation.

  3. Causal RBF kernel attention

    An attention operator whose weights come from a Gaussian kernel on the distances between hidden states, masked causally and row-normalised. Its output is added back as an RMSNorm residual.

  4. Commutator logic block

    A block that multiplies a sigmoid state by the commutator of two learned 64 by 64 matrices. It adds a sum of fuzzy logic gates as a residual.

  5. Unitary Muon optimizer

    The lab's variant of the Muon optimizer. It projects square gradients to skew-symmetric form, keeps momentum, and retracts weights onto orthogonal matrices with an SVD polar step and a Cayley step.

  6. MoonViT-V2 vision encoder

    A copy of the vision encoder from the Kimi Team's technical report, identical to the one in Verace V3. It has a patch convolution, 27 blocks, a 2 by 2 merge and a projector, and its outputs are spliced in at placeholder positions.

  7. Gauge thought template

    A chat template for reasoning blocks that records curvature and gamma values inside bracketed open and close markers. It follows the bracket structure of the XTML chat template from the Kimi Team's technical report.

  8. Generator and toy benchmark

    A text generator that encodes prompts as raw bytes and samples autoregressively, and an evaluator that scores generated outputs by substring match.

  9. Scaled-down verification model

    A small V4 configuration with a TinyStories data pipeline, a hybrid Unitary Muon and AdamW trainer, a GPT-2-tokenised sampler and a five-point verification suite. It exercises the full architecture at low cost and is not a separate model design.

  10. Unit and end-to-end tests

    Tests for the transport attention, the kernel attention, the logic block and the optimizer's orthogonality, plus an end-to-end pipeline and causality test.

Implementation

Mechanisms as they are implemented in the source code, with the constants the code uses.

Pairwise skew-symmetric generator
For every query position ii and key position jj, the transport attention forms Aij=0.05 (kivj⊤−vjki⊤)A_{ij} = 0.05\,(k_i v_j^{\top} - v_j k_i^{\top}) from the fiber key and value vectors. The antisymmetric construction makes AijA_{ij} an element of the Lie algebra of the orthogonal group, scaled by the constant 0.05.
Cayley-rotated value aggregation
Each generator becomes the rotation Rij=(I−12Aij)−1(I+12Aij)R_{ij} = (I - \tfrac{1}{2}A_{ij})^{-1}(I + \tfrac{1}{2}A_{ij}), and the output is oi=∑j≤isoftmaxj(ki⋅kj/d) Rijvjo_i = \sum_{j \le i} \mathrm{softmax}_j(k_i \cdot k_j / \sqrt{d})\, R_{ij} v_j. The result passes through W_out, a residual connection and RMSNorm.
Cayley transform as shared primitive
One routine maps a skew-symmetric AA to an orthogonal matrix, either (I−12A)−1(I+12A)(I - \tfrac{1}{2}A)^{-1}(I + \tfrac{1}{2}A) or the variant with the factors in the inverse order. Because the result is orthogonal, it preserves vector norms. The same transform serves as the attention rotation and as the optimizer's retraction.
Gaussian kernel weights on raw states
The kernel attention computes wij=exp⁡(−γ∥xi−xj∥2) [j≤i]/∑j′≤iexp⁡(−γ∥xi−xj′∥2)w_{ij} = \exp(-\gamma \lVert x_i - x_j \rVert^2)\,[j \le i] / \sum_{j' \le i} \exp(-\gamma \lVert x_i - x_{j'} \rVert^2) with γ=κ/d\gamma = \kappa / \sqrt{d}, where kernel_scale κ\kappa defaults to 1.0. The output is x+RMSNorm(w Wvx)x + \mathrm{RMSNorm}(w\, W_v x). Distances are taken on unprojected hidden states, so no learned map shapes the kernel.
Commutator state update
Two learned matrices AA and BB, each 64 by 64 and initialised as 0.02 times a standard normal draw, form C=AB−BAC = AB - BA. The block applies CC to a sigmoid state over 64 operator dimensions.
Fuzzy gates that cancel
The logic block computes the product t-norm u∧v=uvu \wedge v = uv, the probabilistic sum u∨v=u+v−uvu \vee v = u + v - uv and the negation ¬u=1−u\neg u = 1 - u, then adds the three together. The sum reduces to 1+v1 + v, so uu drops out and the W_prop branch that produces it receives no signal.
Skew-projected momentum
Unitary Muon keeps a buffer updated as b←0.99 b+skew(g)b \leftarrow 0.99\, b + \mathrm{skew}(g) for square gradients gg, so momentum stays in the space of skew-symmetric matrices. The default learning rate in the model configuration is 0.05.
Cayley retraction for square weights
For a square weight, the optimizer first takes the polar factor Q=polar(W)Q = \mathrm{polar}(W). It then sets W←(I+η2b)−1(I−η2b) QW \leftarrow (I + \tfrac{\eta}{2} b)^{-1}(I - \tfrac{\eta}{2} b)\, Q, which keeps W⊤W=IW^{\top} W = I.
Polar update for rectangular weights
For a rectangular weight, the update is W←polar(W−η polar(b))W \leftarrow \mathrm{polar}(W - \eta\, \mathrm{polar}(b)). Here the inner polar factor plays the role of Muon's orthogonalised update but is computed by exact SVD instead of Newton-Schulz iteration.
Fiber normalisation GPU kernel
An optional Triton kernel is described as computing Lie algebra matrix exponentials for parallel transport. The code only L2-normalises each fiber vector at each sequence position.
Byte-level generation
The research generator encodes a prompt as raw bytes taken modulo the vocabulary size, samples tokens from a temperature-scaled softmax, stops when it emits token 0, and decodes the result as bytes.
Next-token training step
The training step computes causal next-token cross-entropy with ignored positions marked by index -100. It backpropagates and applies one Unitary Muon step.
Hybrid optimizer partition
The verification trainer sends square 2D weights to Unitary Muon at three times the base learning rate and all other parameters to AdamW with weight decay 0.01. Both follow a shared cosine schedule down to 1e-4, with global gradient clipping at 1.0.
Perturbation causality check
For each position tt of a 12-token sequence, the verification suite shifts token tt by 500 modulo the vocabulary size. It asserts that logits at every earlier position change by less than 10−410^{-4}.
Orthogonality error metric
The verification trainer tracks how far Unitary Muon's square weights drift from orthogonality, the deviation of W⊤WW^{\top} W from II. The suite checks this property at initialisation.
TinyStories data stream
The verification data loader takes a slice of TinyStories, or falls back to a short synthetic story list. It tokenises with GPT-2, joins documents with EOS into one flat int32 stream and cuts that stream into fixed-length chunks whose labels equal their inputs.

Results

From the lab's own experiments and records. They have not been independently replicated.

  1. All unit test suites pass

    The technical reference records 5 test suites, covering transport attention, kernel attention, the logic block, the optimizer and the end-to-end pipeline, passing in 3.45s.

  2. Verification model of about 13.8M parameters

    The verification records give the scaled-down V4 about 13.8M parameters. Its suite checks a parameter count above 1M, causal isolation, optimizer orthogonality at initialisation, a fall in validation loss over 40 steps and non-empty generation. No loss or perplexity values from these runs are recorded.

  3. Logic block gate sum cancels to a constant

    The lab's audit of the code found that the AND, OR and NOT gates sum to 1+v1 + v. As a result, the branch that produces uu receives no signal and has no effect on the output.

  4. GPU kernel does only L2 normalisation

    The lab's audit found that the optional Triton kernel described as computing Lie algebra exponentials for parallel transport only L2-normalises each fiber vector.

  5. Retraction method differs between records and code

    The verification records describe a Newton-Schulz retraction for Unitary Muon. The optimizer code computes polar factors by exact SVD.

  6. Small model dimensions differ between records and code

    The verification records list fiber size 64, gauge group size 32 and 32 quantum operators for the small model. The configuration code sets 16 for all three, alongside hidden size 256, 4 layers, 4 heads of size 32 and context 512.

  7. Causality is verified to a tolerance, not exactly

    The verification records claim an exact 0.0 change at earlier positions under perturbation. The test asserts a change below 10−410^{-4} on a 12-token sequence.

  8. Activation module present but unused

    V4's gauge activation, based on the SiTU-GLU activation from the Kimi Team's technical report, is identical to the one in Verace V3. The V4 backbone does not call it.

Concepts

Fiber bundle
A geometric structure in which a space of vectors, the fiber, is attached to each point of a base space. In V4 each token position carries a fiber vector, and moving information between positions means mapping one fiber to another.
Parallel transport
The rule for moving a vector from one fiber to another along a connection. In V4 it is realised as an orthogonal rotation RijR_{ij} applied to a value vector before it is aggregated at position ii.
Skew-symmetric generator
A matrix with A⊤=−AA^{\top} = -A. Such matrices form the Lie algebra of the orthogonal group, and mapping one to the group yields a rotation.
Cayley transform
The map A↦(I−12A)−1(I+12A)A \mapsto (I - \tfrac{1}{2}A)^{-1}(I + \tfrac{1}{2}A). It sends a skew-symmetric matrix to an orthogonal one using a matrix inverse instead of a matrix exponential.
Orthogonality constraint
The condition W⊤W=IW^{\top} W = I, under which a matrix preserves lengths and angles. Unitary Muon keeps square weights on this set after every step.
Polar decomposition
The factorisation of a matrix into an orthogonal factor and a symmetric positive factor. Its orthogonal part is the nearest orthogonal matrix, and V4 computes it by exact SVD.
Muon optimizer
An optimizer by other authors that replaces each matrix update with an orthogonalised version, usually computed by Newton-Schulz iteration. Unitary Muon is the lab's variant: it keeps the weights themselves orthogonal, not only the updates.
Newton-Schulz iteration
An iterative matrix polynomial that approximates the orthogonal polar factor without an SVD. The verification records describe V4's retraction this way, but the code uses exact SVD.
Reproducing kernel Hilbert space
A function space defined by a positive definite kernel, in which inner products are evaluated through the kernel. V4 names its kernel attention after this idea and uses a Gaussian kernel.
Gaussian RBF kernel
The similarity K(x,y)=exp⁡(−γ∥x−y∥2)K(x, y) = \exp(-\gamma \lVert x - y \rVert^2), which is near 1 for nearby points and decays with distance. V4 uses it as an attention weight in place of a dot product.
Commutator
For matrices AA and BB, [A,B]=AB−BA[A, B] = AB - BA, which is nonzero when the order of application matters. The design specification presents this non-commutativity as a logic algebra.
Fuzzy logic gates
Continuous versions of AND, OR and NOT on values in [0,1][0, 1]: the product uvuv, the probabilistic sum u+v−uvu + v - uv and the complement 1−u1 - u. In V4 the three are summed, which removes their dependence on uu.
Causal masking
The constraint that the output at a position depends only on that position and earlier ones. V4 enforces it with a mask [j≤i][j \le i], and the test suite checks it by perturbing inputs.
Tied embeddings
The same matrix serves as the input token embedding and as the output projection to vocabulary logits. V4 uses this arrangement.
RMSNorm
A normalisation that divides activations by their root mean square, with no mean subtraction. V4 applies it to each operator's residual branch and before the LM head.
Nucleus sampling
A sampling rule that draws the next token from the smallest set of tokens whose probabilities sum to a threshold pp. The verification generator combines it with top-k filtering.
TinyStories
A dataset of short, simple English stories by other authors, commonly used to train and check small language models. V4's verification model trains on it.

About this page

Written from the lab's own documents and source code. Figures and results are the lab's measurements as it recorded them at the time, and have not been independently replicated.

The Verace V series is the lab's line of language model architectures. It started from the lab's own code for the architecture described in a technical report by the Kimi Team (arXiv:2607.24653), listed here as the V0 baseline. Later versions replace the baseline's main parts with the lab's own designs and keep some of the report's components, which each page credits to the report.

Published under the PolyForm Noncommercial License 1.0.0: free for noncommercial use.