Verace Sheaf
A cortical-column language model that replaces softmax attention with Dirichlet-energy diffusion on a learned cellular sheaf.
- Sheaf Dirichlet energy: How far neighbouring tokens disagree on each edge
- K-step Dirichlet descent: Three gradient steps over a causal window of 32 tokens
- Residual energy as precision: Energy left after the final step sets per-token precision
Overview
Verace Sheaf, whose research name is Sheaf-NCT, is a cortical-column language model in which attention is replaced by diffusion on a learned cellular sheaf. A cellular sheaf attaches a vector space to each node of a graph and a learned linear restriction map to each edge. Its Dirichlet energy measures how far neighbouring nodes disagree once both are mapped into the edge's space. The work asks whether a stack of columns with no attention, whose learning signals all derive from such energies, can model language as well as a transformer of equal compute. It is the production rebuild of the column design of Verace Lamina.
Each token is a sheaf vertex, linked to earlier tokens inside a causal window of . The L2/3 layer of each column runs gradient steps on the weighted Dirichlet energy over that window. The energy left after the final step serves as the per-token precision signal . Around this sits the column pipeline: thalamic input L4, inhibitory interneurons, top-down L1, L2/3, optional working memory, output L5 and feedback L6. The design specification frames this as three stratified sheaves: inner over tokens, outer over the column stack, horizontal across columns. Training minimises cross-entropy plus local predictive-coding, sheaf and lateral energy terms.
The implementation includes the model, a Hebbian L2/3 baseline ported from Verace Lamina, a matched transformer baseline, an equal-compute comparison harness, three hard verification gates and coherence and recall benchmarks. All three gates passed. An 8,000-step character-level run reported a best validation bits per character of 3.12, against the 4.41 plateau of Verace Lamina. A causality perturbation test then showed that the sheaf forward pass leaks future tokens, so that figure is an artifact. In the Phase 1 head-to-head at 6M parameters and 10,000 steps, the sheaf model reached a word validity of 0.728 and the transformer 0.785. Both fell below the 90% bar, and the transformer trained 12.8x faster.
Status: the full model, its baselines, the verification gates and the evaluation pipeline are implemented and have been run. The geometry extensions are implemented but disabled by default: the holonomy gauge loss, the Betti-number diagnostic and the Padé implicit-flow solver with constant-memory backprop. The lab's own audit found the headline Phase 0.5 result invalid because of the non-causal leak. A fix that trains with a causal left-to-right Gauss-Seidel sweep is proposed but not yet adopted. No valid result shows the sheaf model matching the transformer. The coherence benchmark has moved to TinyStories, and the in-context recall test exists with no recorded sheaf result.
Status
Experiments. The model and its baselines are implemented and were trained and evaluated, but the lab's audit found the main result contaminated by a future-token leak, and the head-to-head coherence run failed for both models.
Simulator
A point rolls downhill on a made-up energy surface with one deep valley and two shallower ones. Set the step size and the momentum, and drag the start.
- rings: lines of equal energy · dots: the floors of the three valleys
- Comes to rest in
- The deepest valley
- Energy at the start
- 0.04
- Energy at the end
- -1.01
- Overshot on the way
- No
Drag the ring, or tap the surface, to move the start. Raise the step size until the point overshoots, or the momentum until it rolls through a shallow valley.
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
CorticalLM column stack
Token embeddings feed a stack of cortical columns with optional lateral coupling and a tied output head. The stack also computes the auxiliary losses and triggers the Hebbian, homeostatic and step-size safety updates.
Sheaf-diffusion L2/3 mixer
The core replacement for attention. It runs K gradient steps on the Dirichlet energy of a learned sheaf over a causal token window and emits the residual energy as precision. Its output passes through a projection, RMSNorm, dropout and k-winners-take-all sparsification.
Cortical layer backbone
Contains L4 thalamic input, L1 top-down input with a neurogliaform filter, VIP, SST, PV and chandelier interneurons, an L5 SwiGLU output with dendritic gating and short-term depression, and L6 feedback.
Decoupled Hebbian L2/3 baseline
A port of the Hebbian L2/3 from Verace Lamina, kept for parity testing. It uses windowed exponential-kernel recall through buffer weights updated by a BCM-Oja rule outside autograd, with homeostatic synaptic scaling.
Lateral coupling
Cross-column coupling built from a shared sender projection, per-column receivers and sigmoid gates. It can also read out a horizontal-sheaf Dirichlet energy across columns.
Working-memory stack
Five summed mechanisms: NMDA slots, silent trace, phonological loop, prospective memory and chunk memory. An ablation switch selects all, NMDA only or off.
Phase 4 geometry extensions
Three add-ons, disabled by default: a holonomy gauge regulariser, a persistent sheaf cohomology diagnostic, and a Padé implicit-flow solver for the infinite-step diffusion limit.
Verification gates and diagnostics
Gate 1 checks autograd gradients against finite differences. Gate 2 checks Hebbian parity with Verace Lamina from training logs. A diagnostic trainer records restriction-map spectra, step sizes, k-WTA churn and gradient ratios per column.
Transformer baseline and comparison harness
A minimal decoder-only transformer with pre-RMSNorm, causal attention, a SwiGLU feed-forward block and learned positions. The harness tunes both models to an equal FLOPs-per-forward budget and trains each over several seeds by wall-clock time.
Coherence and recall benchmarks
The coherence benchmark generates samples and scores them against five criteria. A forced-choice test measures in-context attribute binding on TinyStories.
Implementation
Mechanisms as they are implemented in the source code, with the constants the code uses.
- K-step sheaf Dirichlet descent
- The energy is over edges in a causal window of , minimised by gradient steps with step size , initialised at 0.25. Restriction maps start at for Gaussian noise , and edge weights start at . The diagnostic trainer's variant uses softplus edge weights and a capped sigmoid step size.
- Dirichlet energy density as precision
- After the final descent step, each token's precision is , where is the coboundary residual at offset . This replaces the learned L5
W_sigmahead of the Hebbian design. - Step-size safety clamp
- A runtime power iteration estimates the largest eigenvalue of the sheaf Laplacian. The model enforces , below the limit of 2, so that each descent step stays contractive.
- Composite training loss
- The objective is , with weights
local_pc_weight,sheaf_reg_weightandlateral_dirichlet_weight. The lateral term applies only when lateral coupling is enabled, and any term a forward pass returns as None counts as zero. - Local inter-column predictive coding
- The
W_predictoutput of column is trained by mean squared error to match the detached L2/3 input of column , averaged over columns. The predictions are also cached as the next step's top-down context. - Horizontal sheaf lateral energy
- Columns are treated as sheaf vertices, with the shared
W_sendas source restriction and the transpose of eachW_recv_ias target restriction, so the term adds no parameters. The energy is averaged over the column pairs. - Stochastic holonomy gauge loss
- A sheaf is flat when transport around every cycle returns the identity. The code composes transports forward and backward around length-4 square cycles in the window, and penalises the sample mean of over 10000 sampled cycles.
- Padé diffusion with implicit gradients
- For the infinite-step limit, uses a diagonal Padé approximant of default order , solved by conjugate gradients with 50 iterations. Gradients use with a deflated CG pseudo-inverse, so the K descent steps need not be stored.
- Sheaf Betti number diagnostic
- Using , the diagnostic computes as the dimension of global sections and as the dimension of the cokernel of , because the window complex has no 2-cells. The dense rank computation costs , so it is off by default.
- BCM-Oja Hebbian baseline rule
- The baseline update is with and , followed by capping row norms at 4.0. The sliding threshold is an exponential moving average of with decay 0.999.
- Interneuron gating and short-term depression
- VIP activity inhibits SST through , which opens an apical gate , while PV and chandelier cells multiplicatively suppress L5. A per-channel resource recovers with tokens and depletes with , where is the layer's activity, and the output is scaled by .
- NMDA slot memory
- A softmax attention read over a bank of memory slots. Tokens whose sigmoid salience exceeds 0.5 are written to the oldest slot by a non-differentiable least-recently-used rule, and slot ages are multiplied by 0.99 each step. Token mixing in the column has no attention, since it is done by sheaf diffusion; this softmax read belongs only to the optional working memory, which can be switched off.
- Scalar oscillatory gain
- A scalar time-dependent gain is built from theta, alpha and delta rhythms with periods of 8, 20 and 64 tokens. The gain is kept scalar because a scalar commutes with every restriction map and so acts as a sheaf automorphism.
- Finite-difference autograd gate
- Central differences with are taken at 64 random input coordinates of the sum of , entirely in fp64. The gate passes if the maximum relative error is at most 1e-4 or the maximum absolute error is at most 5e-4.
Results
From the lab's own experiments and records. They have not been independently replicated.
All three hard verification gates passed
In the lab's records, the autograd check passed with a maximum absolute error of about 2.7e-4 against a tolerance of 5e-4. The Hebbian module matched Verace Lamina at an absolute tolerance of 1e-6, while the run instructions specify a tolerance of 1e-5 for this parity gate. Mean fell steadily from 2.29 to 0.28 over the three descent steps.
Phase 0.5 score later found contaminated
The 8,000-step character-level run recorded a best validation bits per character of 3.12, against the 4.41 plateau of Verace Lamina. The lab later found this figure to be produced by the future-token leak.
Sheaf forward pass leaks future tokens
In the causality perturbation test, altering future tokens changed earlier logits by 0.0 for the transformer and by 6.18, 1.15 and 21.9 for the sheaf model. The lab traced the leak to the source-side scatter in the descent step.
Both models failed Phase 1 coherence
At 6M parameters and 10,000 steps, the sheaf model reached a word validity of 0.728 and the transformer 0.785, both below the 90% criterion. The transformer trained 12.8x faster.
Transformer baseline passes on TinyStories
After the coherence benchmark moved to TinyStories, the 8.46M-parameter transformer baseline passed all five criteria. No passing sheaf result is recorded.
Hebbian rule failed while Hebbian memory worked
The lab's earlier column models in Verace Lamina plateaued at a validation score of 4.41 and scored 0/20 on recall. A second run with a Hebbian associative-recall memory reached 70%. The lab drew the lesson that the weight-update rule failed while the memory structure was useful.
Early compute estimates were far off
The design specification records that the FLOPs estimates in its first version were 16 to 20 times off and were corrected. It also records that the implicit-flow solver saves memory but not compute, since its CG iterations cost about 3 to 5 times a ten-step unroll.
Concepts
- Cellular sheaf
- A graph with a vector space, the stalk, on each node and linear restriction maps from each node into its edges' spaces. In this model, tokens are nodes and the restriction maps are learned.
- Sheaf Dirichlet energy
- The weighted sum of squared disagreements between neighbouring stalks once each is mapped into the edge space. Gradient descent on it diffuses information across the token window in place of attention.
- Precision signal sigma squared
- A per-token measure of how unresolved the local context remains. Here it is the residual Dirichlet energy density after diffusion rather than a separately learned head.
- Stratified sheaf construction
- The design specification's view of the full system as three linked sheaves: an inner sheaf over tokens within a column, an outer sheaf over the column stack, and a horizontal sheaf across columns.
- Non-causal sheaf leak
- The lab's audit found that the source-side scatter in the descent step lets information from future tokens reach earlier positions. This makes validation scores from the affected runs an artifact.
- Causality perturbation test
- Future tokens are changed and the change in earlier logits is measured. A causal model must show zero change.
- Causal Gauss-Seidel sweep
- A left-to-right update order in which each token's state is updated using already-updated earlier tokens, as the design specification prescribes. The lab proposed adopting it in place of the simultaneous Jacobi update that the leaking code uses.
- Predictive coding
- Inference and learning by minimising local prediction errors summed into a free energy, with credit travelling by relaxation. Credit moves one layer per relaxation sweep, so distant dependencies need many inference iterations.
- Whittington-Bogacz hinge
- The lab's notes record the result that predictive coding equals backpropagation only when a supervised label is clamped. Free-running or self-supervised predictive coding minimises a different objective.
- Hebbian rule versus Hebbian memory
- The lab's position paper separates two things. Hebbian learning as a weight-update rule lacks any loss or error signal. Hebbian outer-product memory is a useful associative store and already appears inside attention and linear transformers.
- Associative recall gap
- The lab's survey cites the Zoology study by other researchers, which attributes about 82% of the perplexity gap of attention-free models to associative recall. Because the column forbids attention, it must recover content-addressed recall through sheaf diffusion or working memory.
- Five replacement criteria
- The lab's bar for any transformer replacement: match loss at scale, offer a unique capability, show scaling laws over two orders of magnitude, have competitive inference cost, and be reproducible.
- Equal-compute comparison
- The sheaf model and the transformer are sized to the same FLOPs per forward pass within 5% and trained for the same wall-clock time. The design specification notes that matching both parameters and compute is infeasible at and .
- Phase 1 coherence criteria
- Five gates on generated text: word validity of at least 90%, local grammar, topic continuity, low 3-gram repetition, and at least three distinct first words across 10 samples. Grammar and topic are judged by hand.
- k-winners-take-all bottleneck
- Keeping only the top fraction of units active. The default ratio of 0.05 leaves about 6 of 128 dimensions active, which the lab hypothesised starves an 8192-way BPE readout, so a flag can disable it.
- Disease-map ablations
- Named lesions, each paired with an expected deficit, such as zeroing or switching off lateral coupling. Each lesion is retrained from scratch on a counter task and compared with the intact model.
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.