Verace V5
A multimodal language model architecture built from non-Abelian gauge attention, a p-adic ultrametric kernel and a Calabi-Yau projector.
- Value vector: a value at an earlier position, before transport
- Cayley transport: orthogonal, so the value keeps its norm
- Skew generator: built per token from its key and value
- Rotated value: carried to the query position, then mixed by softmax
Overview
Verace V5 is a multimodal causal language model architecture in the Verace V series. It replaces standard attention and feed-forward blocks with operators taken from gauge theory, p-adic analysis and complex geometry. It asks whether a model can mix tokens through norm-preserving transports between positions that do not commute, weight positions with an ultrametric distance, and pass hidden states through a small complex bottleneck, all trained with an optimizer that keeps weights orthogonal. It extends Verace V4. The design specification replaces V4's SO(N) vector parallel transport with a non-Abelian transport of nonzero curvature, and V4's Gaussian kernel with a p-adic one.
Each layer applies four operators in order: gauge transport attention, a p-adic ultrametric kernel mixer, a Calabi-Yau projector and a gated activation. The attention rotates every value vector by an orthogonal Cayley transport built from per-token skew-symmetric generators, then mixes the rotated values with a causal softmax over key-key similarity. The language model head is tied to the embeddings. Images enter through a vision encoder named after MoonViT, the encoder in the Kimi Team's technical report, here written as a standard transformer encoder. Training adds a curvature penalty to cross-entropy and uses S-Muon, an SVD-based variant of the Muon optimizer, which is by other authors.
The lab implemented the architecture in PyTorch: the model, optimizer, training step, tokenizer, chat template, generator and evaluator. The test suite covers gauge curvature and holonomy, exact p-adic valuation and the ultrametric inequality, the Calabi-Yau projector, the S-Muon superalgebra projection and retraction, and an end-to-end pipeline. The configuration specifies 256 layers, hidden width 65,536, gauge width 2048 and a vocabulary of 1,048,576. That is a specification only. The evaluator scores substring matches on two toy samples by default. The code differs from the design specification in two places: the module described as fused Triton kernels is plain PyTorch, and the Ricci-flat, SU(3) volume-preserving projector is implemented as RMS normalization with Gaussian damping.
Status: the full architecture, optimizer and training step are implemented and unit-tested at small scale. No training run, loss curve or benchmark result is recorded. The configured 256-layer model is a design target and has not been built at that size. No fused GPU kernel exists, despite the name of the serving module. Whether curvature-regularized gauge attention, the p-adic kernel or the Calabi-Yau bottleneck helps language modelling has not been measured. Verace V6 reuses the holographic thought template and the byte-level tokenizer, and Verace V7 cites the gauge attention and the projector.
Status
Prototype. The model, optimizer, training step and serving code are implemented with unit and end-to-end tests, but no training run or evaluation result is recorded.
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
Non-Abelian gauge attention
A token mixer that carries each value vector to the query position with a pairwise orthogonal transport before weighting it. It has no separate query projection and adds its output back through RMSNorm.
p-adic ultrametric kernel mixer
A second token mixer whose weights fall with feature distance, scaled by the 2-adic valuation of the position offset. It is causally masked, row-normalized and added as a residual.
Calabi-Yau holomorphic projector
A bottleneck that maps hidden states to three complex coordinates, projects them on 19 learned basis matrices and recombines them into the hidden space.
Gated soft-clamp activation
An activation that passes positive inputs almost unchanged and softly bounds negative inputs.
S-Muon optimizer
An orthogonalizing optimizer derived from Muon. It splits gradients into superalgebra sectors, steps by the polar factor of the momentum, and retracts weights onto the Stiefel manifold.
Vision encoder
A patch-14 convolutional embedding followed by standard transformer encoder layers and a linear projection to the hidden width, named after the MoonViT encoder of the Kimi Team's report. It uses no positional encoding.
Byte tokenizer and thought template
A byte-level tokenizer with reserved special ids, and a chat format that wraps model output in holographic thought blocks carrying gauge metadata. The format is a variant of the XTML chat template from the Kimi Team's report.
Curvature-regularized training step
One pretraining step that combines causal cross-entropy with a penalty on gauge curvature in every layer, followed by an S-Muon update.
Generator and evaluator
A sampling loop for text and image prompts, and an evaluator that scores the percentage of generations containing the ground-truth substring.
Implementation
Mechanisms as they are implemented in the source code, with the constants the code uses.
- Cayley non-Abelian holonomy transport
- Each token defines a skew generator . Pairwise curvature is . The transport is the Cayley map , which is orthogonal, so preserves norm.
- Holonomy-transported attention rule
- The layer computes under a causal mask, so keys play the role of queries. The output is . The layer can also return the mean squared curvature for the loss.
- Gauge curvature regularization loss
- The training objective is with . The penalty discourages large pairwise field strength in every layer's gauge attention.
- p-adic ultrametric kernel weights
- Mixing weights are with , causally masked, row-normalized and applied to . The valuation is computed exactly as with . Offsets divisible by a high power of 2 therefore count as closer.
- Hodge bottleneck projection
- Hidden states map linearly to (three real and three imaginary coordinates) and are projected on 19 learned 3x3 form matrices initialized at scale 0.02. A dual 19x3 weight contracts the result, which is RMS volume-normalized and damped by with learnable initialized at 0.5.
- Gated soft-clamp formula
- The activation is with and . Large negative inputs settle near -25.
- Lie superalgebra gradient projection
- A square gradient is split into 2x2 half-blocks. The diagonal (bosonic) blocks are replaced by their skew-symmetric parts and the off-diagonal (fermionic) blocks by a cross-symmetrized pair, matching the split , before momentum accumulates.
- Polar Stiefel retraction step
- With momentum 0.99 and learning rate 0.05, the update is the polar factor of the momentum buffer, computed by exact SVD rather than Newton-Schulz iteration. The weight is then reset to the polar factor of , which enforces .
- Byte-offset tokenization
- Each UTF-8 byte maps to , which reserves ids 0 to 99 for special tokens. Decoding uses . Special tokens use ids 0 to 7, and the media token is 1000.
- Media placeholder embedding splicing
- Embeddings at positions where
input_idsequals 1000 are overwritten in order with vision patch tokens, up to the smaller of the placeholder and patch counts. Labels stay aligned with the sequence. - Holographic thought block format
- Output is wrapped as an opening holographic_think tag with curvature, prime and chi attributes, the content, and a closing tag. A regular expression parses the blocks back.
- Unfused holonomy transport kernel
- The function
fused_non_abelian_holonomy_gpuintriton_kernels.pybuilds , and with batched PyTorch linear algebra. It contains no Triton code, although the design specification describes native fused Triton kernels. - Multimodal sampling loop
- The generator inserts placeholders sized to the actual vision patch count, samples at temperature 0.7 until the end token, and passes the images at every step. The evaluator generates up to 64 tokens per prompt.
Concepts
- Non-Abelian gauge field
- A connection whose generators are matrices that do not commute. Its field strength includes the commutator term , so transports between positions depend on the path taken.
- Holonomy
- The transformation a vector undergoes when transported between two points under a connection. Here it is the orthogonal matrix applied to value vectors, called a Wilson line holonomy in the design specification.
- Cayley transform
- The map from a skew-symmetric matrix to . It always yields an orthogonal matrix, so it preserves vector norms.
- p-adic valuation
- For a prime , is the number of times divides . The architecture uses on position offsets.
- Ultrametric distance
- A distance satisfying the strong triangle inequality . The test suite checks this inequality for the p-adic distance.
- Calabi-Yau 3-fold and h11
- A compact complex manifold of complex dimension 3 (real dimension 6). The Hodge number counts its independent (1,1)-forms. The projector uses 19 learned matrices as a stand-in for such a basis.
- Muon optimizer
- An optimizer by other authors that replaces the raw update of a matrix parameter with an orthogonalized version, usually computed by Newton-Schulz iteration. S-Muon computes the orthogonal factor exactly by SVD instead.
- Stiefel manifold
- The set of matrices with orthonormal columns, . Retracting onto it after each step keeps weights orthogonal.
- Polar factor
- For , the orthogonal matrix , which is the orthogonal matrix closest to .
- Lie superalgebra
- An algebra graded into an even (bosonic) part and an odd (fermionic) part . S-Muon uses this split to choose a different symmetry projection for each gradient block.
- Curvature regularization
- A loss term on the squared field strength of every gauge layer. It keeps the transports close to flat unless the data favours curvature.
- Holographic thought block
- A delimited segment of model output that records gauge metadata (curvature, prime, chi) alongside the content, for use in generation and parsing.
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.