Verace V4
A language model with Cayley parallel-transport attention, Gaussian kernel attention, commutator logic and an orthogonal optimizer.
- Norm-preserving rotations: Orthogonal matrices keep vector norms
- Fiber value vector: The value at position j before transport
- Cayley rotation: Moves the value before causal softmax aggregation
- Skew-symmetric generator: Built from a key and a value for each token pair
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 and , a skew-symmetric generator is built from a key and a value. The Cayley transform turns that generator into a rotation , which moves 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
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 and key position , the transport attention forms from the fiber key and value vectors. The antisymmetric construction makes 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 , and the output is . The result passes through
W_out, a residual connection and RMSNorm. - Cayley transform as shared primitive
- One routine maps a skew-symmetric to an orthogonal matrix, either 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 with , where
kernel_scaledefaults to 1.0. The output is . Distances are taken on unprojected hidden states, so no learned map shapes the kernel. - Commutator state update
- Two learned matrices and , each 64 by 64 and initialised as 0.02 times a standard normal draw, form . The block applies to a sigmoid state over 64 operator dimensions.
- Fuzzy gates that cancel
- The logic block computes the product t-norm , the probabilistic sum and the negation , then adds the three together. The sum reduces to , so drops out and the
W_propbranch that produces it receives no signal. - Skew-projected momentum
- Unitary Muon keeps a buffer updated as for square gradients , 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 . It then sets , which keeps .
- Polar update for rectangular weights
- For a rectangular weight, the update is . 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 of a 12-token sequence, the verification suite shifts token by 500 modulo the vocabulary size. It asserts that logits at every earlier position change by less than .
- Orthogonality error metric
- The verification trainer tracks how far Unitary Muon's square weights drift from orthogonality, the deviation of from . 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.
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.
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.
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 . As a result, the branch that produces receives no signal and has no effect on the output.
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.
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.
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.
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 on a 12-token sequence.
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 applied to a value vector before it is aggregated at position .
- Skew-symmetric generator
- A matrix with . Such matrices form the Lie algebra of the orthogonal group, and mapping one to the group yields a rotation.
- Cayley transform
- The map . It sends a skew-symmetric matrix to an orthogonal one using a matrix inverse instead of a matrix exponential.
- Orthogonality constraint
- The condition , 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 , 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 and , , 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 : the product , the probabilistic sum and the complement . In V4 the three are summed, which removes their dependence on .
- Causal masking
- The constraint that the output at a position depends only on that position and earlier ones. V4 enforces it with a mask , 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 . 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.