Verace Topos: core and v2 code
A symplectic activation steering engine, a 24-subsystem v2 suite with Z3 verification gates, and VFM-1 reversible model benchmarks.
- Last-token activation: A position with a momentum; depth plays the role of time
- Basin centroid: The quadratic potential pulls activations toward it
- Störmer-Verlet leapfrog: Half kick, full drift, half kick; inverted by time reversal
- Volume-preserving step: Checked by finite differences; a failure passes q through
Overview
The core and v2 code of Verace Topos holds three bodies of Python: the steering engine package verace_steering (version 0.1.0), the v2 suite verace_v2 that layers 24 subsystems on that engine, and the benchmarks and demos of VFM-1, a reversible foundation model. The steering engine addresses one question: how to push a language model's hidden states toward a target behaviour so that every intervention is volume-preserving, exactly invertible, logged, and passed through unchanged when an invariant check fails.
The engine treats depth as time. A layer's last-token activation is a position with a momentum , and steering is a Hamiltonian flow under a quadratic potential, integrated by a Störmer-Verlet leapfrog. Contrastive prompts define a behaviour direction and a set of basins; a 5D routing frame and an instanton-action score select the basin; a whitening metric and a matrix-free natural gradient shape the target. Each step returns a result with an invariant report and is written to an append-only ledger that holds the parameters needed to run it backwards. The v2 suite adds collapse detection by logic volume, a Z3 verification gateway, a subprocess sandbox, a monotonic distillation loop and a keyword constitutional gate.
The v2 implementation records 83 passing tests and 93% coverage. In the lab's experiments, VFM-1's reversible coupling reduced the activation memory slope from 76.1 to 38.4 MB/layer, but on a 600-step run with content-disjoint validation VFM-1 reached a perplexity of 357.78 against 232.16 for a parameter-matched baseline. Reversibility held to at 48 layers in Float32 and drifted to in BF16. On GPT-2, the self-improvement pipeline is recorded as raising native reasoning accuracy from 0% to 10 to 15% after baking.
The steering engine, the 24 v2 subsystems and the VFM-1 benchmark models are implemented. The engine is demonstrated on GPT-2, a pre-trained model from another organisation; Z3 is an outside SMT solver, and numba, vLLM and HuggingFace Transformers are outside software the code calls. The invariants are checked by a differential fuzzer. Several parts are reference stubs: the v2 Soliton Wave Memory propagation is an identity function, the structure predictor returns deterministic helix coordinates, and the served model is untrained with a 500-token vocabulary. The VFM-1 specification describes a codon engine, and a codon quantization codec and a DNA soliton model are implemented in the v3 code; the specification's 65,536-token multimodal vocabulary and 3.0T-token training corpus exist as design only. No full-scale VFM-1 training run is recorded, and its perplexity trails the baseline.
Status
Experiments. The steering engine and the VFM-1 benchmark scripts are implemented, the 24 v2 subsystems are implemented with 83 passing tests and 93% coverage, and the lab recorded GPU memory, perplexity, precision and GPT-2 reasoning measurements, while the 65,536-token multimodal vocabulary and the 3.0T-token training corpus exist only in the VFM-1 specification.
Simulator
A pendulum moves through its phase space: angle across, momentum up. Step it with a method that can be run backwards and with one that cannot, and drag its start.
- across: angle · up: momentum
- Energy at the start
- 0.368
- Energy at the end
- 0.368
- Change in energy
- 0.000
- Returns to its start run backwards
- Yes
Switch to Euler with the same step: the trajectory spirals off its curve and cannot be run back. Drag the ring, or tap the plane, to start elsewhere.
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
Symplectic steering engine
The
verace_steeringpackage exposesdiscover_profile,steerandSteerSession. It hooks transformer layers and applies reversible Hamiltonian steps to the residual stream.Model adapters
HFAdapterhooks HuggingFace decoder blocks, a vLLM adapter hooks the inner module that vLLM runs, andMockAdapterreplays fixture or seeded activations for tests.Steering profiles and store
A profile holds per-layer directions, basin centroids, metrics and a routing frame in SafeTensors with a JSON sidecar. It is content-addressed, optionally Ed25519-signed, and kept in a write-once store.
Invariant and fuzzing layer
Checkers for invariants I1 to I5, a finite-difference Jacobian, an
InvariantReportdataclass, and a reference and a fast differential fuzzer; the reference fuzzer is the correctness gate of continuous integration.Reversibility ledger
An append-only JSONL log, one file per session, recording layer, token, dt, substeps, mode and a reversible flag for every soft intervention.
Dynamic Symplectic Steering (DSS)
A v2 subsystem that measures the logic volume of hidden states and injects a PI-controlled symplectic counter-flow when volume falls below a floor.
Formal Verification Gateway
A fail-closed gate built on the Z3 SMT solver that proves goals by showing the negation is unsatisfiable and issues hashed certificates.
Execution sandbox (AES)
A userspace subprocess sandbox with resource limits, a timeout and a scrubbed environment, plus C++ compilation and an ASan/UBSan differential fuzzer.
Distillation Loop and baking pipelines
A monotonic promotion loop and the
nightly_distill.pyandstruggle_extract_bake.pypipelines that verify reasoning paths and bake steering directions into GPT-2 biases.Constitutional gate (BCI, I0)
A keyword-based check over six prohibited domains that runs before consequential actions in the v2 subsystems and fails closed.
VFM-1 benchmark models
Python implementations of a two-stream reversible transformer with decay-biased attention, parameter-matched against vanilla baselines for memory, latency and perplexity.
Serving gateway
A FastAPI server with OpenAI-style chat completion and health endpoints, SSE streaming and an embedding prompt filter, serving an untrained VFM-1 instance.
Implementation
Mechanisms as they are implemented in the source code, with the constants the code uses.
- Störmer-Verlet leapfrog stepper
- Each step is a half momentum kick, a full position drift and a half kick: for the harmonic case , , . The map has , and stepping from returns . An optional numba fast path falls back to plain numpy when numba is absent.
- Quadratic steering potential
PhaseStateuses , with and by default. The first term pulls activations to the basin centroid , and the second penalises the component along the configured direction .- Leapfrog stability clamp
- Leapfrog on a harmonic potential is stable for .
stability.pycaps the substep at , a 10% margin. - Time-reversal inversion and fail-safe envelope
- A soft step is inverted by running leapfrog from with the recorded dt and substeps, then flipping . Every intervention returns a
StepResult; non-finite values or a failed check give status failsafe and pass the original through instead of raising. - Finite-difference symplecticity check
- Each Jacobian column is over the concatenated , and is the violation. The invariant suite also checks inverse recovery, integer winding, zero curvature and wave-norm drift, with default eps 1e-6 and a finite-difference floor of 1e-4.
- Whitening metric and natural gradient
- The metric is with , so low-variance directions weigh more. The natural gradient solves by conjugate gradient (tol 1e-8) from metric-vector products; the target solve iterates for 25 iterations.
- Instanton-action basin routing
- The mean activation is projected into a 5D frame spanned by the principal directions of the centred basin centroids, and each basin is scored by a bounce action . Soft mode weights basins by ; hard mode switches only when , which prevents flapping.
- Sheaf gluing with conflict damping
- Per-source sections are fused as . Conflict is the largest pairwise angle; above
max_angle(default 1.2 rad) the mean is multiplied by , so opposed sections are damped toward zero. - Staged reversible barrier tunnelling
- When the barrier exceeds a threshold, the state moves along 6 straight waypoints, each applied as a harmonic well with leapfrog substeps (dt 0.05, 4 substeps). The winding count is incremented by one on completion.
- Split-step Fourier NLS wave memory
- The engine's wave buffer holds a complex field of 64 points per layer; each token write injects a sech packet of width 4 and evolves the focusing equation by Strang splitting with dt 0.1. Both factors are unitary, and a write whose norm drift exceeds 1e-6 is rejected and the previous snapshot kept.
- Logic volume and PI counter-flow
- DSS computes over unit-norm rows, with floor . Below it sets with , uses up to 12 substeps, and takes a symplectic step with dt 0.3 toward a cosine-modulated target.
- Randomized range-finder SVD
- Directions are extracted with for Gaussian of width , two power iterations , , , and truncated to . The default seed 0 makes it deterministic.
- Two-stream RevNet coupling
- The forward pass computes and under no_grad. Backward reconstructs and and backpropagates locally, so stored activations do not grow with depth.
- Decay-biased softmax attention
- Scores are for and -1e4 otherwise. In the multi-scale version each head starts at , clamped to [0.05, 0.998]; output projections use depth-scaled initialisation .
- Reversible Hamiltonian block
- The VFM-1 demo uses and steps , with dt 0.05 and hidden width 256. Because the force is the gradient of a scalar, the step is volume-preserving and exactly invertible.
- KdV soliton kernel convolution
- The demo kernel is , normalised to sum 1, with learnable and . It is applied as a causal convolution through zero-padded rFFT and gated by a sigmoid of .
- Proof by UNSAT of negation
- A goal is proved when Z3 finds unsatisfiable. Certificates hash goal, backend, proof and counterexample with SHA-256, truncated to 32 hex characters.
- Z3 and sanitizer dual filter
- A reasoning branch survives only if Z3 proves its deduction and its binary built with address and undefined-behaviour sanitizers matches the reference on all fuzz inputs. The fuzzer catches memory errors such as out-of-bounds reads that Z3 does not see.
- Monotonic promotion loop
run_loopdefaults to 20 generations, and a plateau of 3. The incumbent is replaced only when a candidate scores above incumbent plus ; a gate-blocked candidate scores and counts as stale.- Fréchet-direction bias baking
- A per-layer direction from
discover_profileis added permanently totransformer.h.{l}.attn.c_proj.biasas . The strength is chosen by the Distillation Loop against the unbaked model on a held-out split. - GRPO soft-reward baseline
- A critic-free group policy gradient uses advantage . Partial-credit rewards let an all-wrong group still learn the least-bad sample; it serves as a baseline against hard verification.
- Content-addressed sharded blob store
- HTFS addresses blobs by 'sha256:' plus the hex digest, stores them zstd-compressed in shard with default , deduplicates by reference count, verifies on read and garbage-collects at zero references.
Results
From the lab's own experiments and records. They have not been independently replicated.
Activation memory slope roughly halved
In the lab's parameter-matched benchmark, the reversible two-stream coupling reduced the activation memory slope from 76.1 MB/layer for the baseline to 38.4 MB/layer for VFM-1 in Float32.
VFM-1 generalises worse than a matched baseline
On a 600-step run with content-disjoint validation (10.68M versus 10.72M parameters), the evaluation records report perplexity 357.78 for VFM-1 against 232.16 for the baseline. VFM-1 had lower training loss, 0.0427 against 0.0893 nats, which the lab reads as fitting training trajectories without generalising.
Reversibility holds in Float32 only
The lab's precision tests measured reconstruction drift across 48 layers in Float32 and in BF16. The records conclude that low-precision use needs checkpoint anchors or Float32 master layers.
v2 suite passes its test suite
The implementation record lists 24 of 24 subsystems implemented, 83 tests passing with none failing, and 93% coverage.
Baking raised GPT-2 reasoning accuracy
The lab's records report native reasoning accuracy rising from 0% to 10 to 15% after baking, with no steering applied at inference, on GPT-2 running on CPU.
Overdriven steering degrades text, invariants still pass
The calibrated GPT-2 demo includes an overdriven case, recorded as risk R-2, in which generated text degrades while all geometric invariants still hold. Invariant checks therefore do not certify output quality.
Dedekind eta invariance checked off the fixed point
The lab checked modular invariance at , avoiding the trivial fixed point , and recorded a relative error of 2.39e-16.
Prompt filter code differs from the design
The design specification describes projecting hidden states onto a harm subspace and blocking above 3.8. The serving code projects the mean prompt embedding onto 3 random unit vectors with seed 1337, so its directions are not learned harm directions.
Wave memory propagation is a stub
The v2 Soliton Wave Memory stores position-independent signatures, but its propagate function is an identity, and the record lists a full KdV integrator as future work. The engine's own wave buffer does evolve a focusing NLS field.
Concepts
- Symplectic map
- A map on positions and momenta that preserves phase-space volume, so its Jacobian has . The design specification adds that volume preservation alone is insufficient: forces must be gradients of a scalar potential so the Hessian is symmetric and holds.
- Depth as flow time
- The engine parametrises layer depth as and treats steering as a Hamiltonian flow integrated over it, with samples kept for nearest-neighbour queries at any depth.
- Steering profile
- A per-layer behaviour direction found from the difference between activations on positive and negative prompts, with per-layer separability scores, basin centroids and a metric. It is the object
steerinjects into a hooked session. - Basin and vacuum
- Target regions of activation space, each with a centroid . The router picks among them by an action score, borrowing the language of tunnelling between vacua.
- Natural gradient
- A gradient preconditioned by the inverse of a metric , so steps follow the geometry of the activation distribution instead of raw Euclidean distance.
- Logic volume
- The mean singular value of centred, unit-normalised hidden states. The code's docstring reports about 4x separation between fluent and collapsed GPT-2 text, and DSS uses it as a collapse detector.
- Soliton
- A wave packet that keeps its shape while it travels. The memory design uses soliton-like packets so that a stored chunk has a signature (amplitude, width, energy, profile) independent of its position.
- Lost in the middle
- The tendency of long-context models to attend less to information in the middle of the context. A probe in the code places needles at decile positions and reports a dip when middle-third attention falls more than 5% below the edges.
- Invariants I0 to I22
- The VFM-1 specification's master table of invariants, some checked at runtime and some theoretical, with I0 as the constitutional floor. It is separate from the geometric checks I1 to I5 that the steering engine runs per step.
- Runtime versus theoretical invariants
- The VFM-1 specification separates conditions checked at runtime, such as I1, I2, I7 and I9, from theoretical motivations such as a Casimir 40 Hz term and Wilson-loop safety.
- Fail-safe and fail-closed
- Steering steps that violate an invariant leave the activation unchanged (fail-safe), while governance and verification gates deny the action when they cannot confirm it (fail-closed).
- RevNet
- A reversible residual network whose inputs can be recomputed from its outputs, so backpropagation reconstructs activations instead of storing them.
- Decay attention
- Softmax attention with an additive recency bias . The specification states it trains in parallel at and can decode with an matrix state.
- Topological PonderNet
- In the design specification, a GRU-based loop that decides how many reasoning steps to take via a halting probability, followed by a Z3 gate that checks the negated claim is unsatisfiable.
- SMT verification
- Checking logical statements with a satisfiability-modulo-theories solver, here Z3. A claim counts as proved when its negation has no satisfying assignment.
- Constitutional gate
- The v2 BCI check. In code it matches lowercased action and intent text against keyword lists for six prohibited domains; its 'undetermined' branch is unreachable because the classifier never returns that value.
- Distillation Loop
- A self-improvement procedure that promotes a candidate only on strict improvement over the incumbent, so the tracked score never regresses.
- Zero-human-data training
- Improving reasoning without labelled data: steered paths are explored, kept only if Z3 and the sanitizer fuzzer accept them, and baked into the weights.
- Algorithmic entropy versus dissipation
- The specification distinguishes the zero information-entropy change of a symplectic flow from the physical power a GPU dissipates, which a separate thermal governor handles.
- Precision reversibility
- Exact invertibility is limited by floating-point roundoff. The lab's tests show it holds in Float32 but accumulates drift in BF16 and FP16.
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.
Published under the PolyForm Noncommercial License 1.0.0: free for noncommercial use.