K2-L8-CODE at rank 6 (K2-L8-R6-CODE): matched to GPT-2 outside the embeddings, two more directions per well gain 2.2% (Gen 3)
The question of this collection: on Python code, the conservative model trails the matched GPT-2 by 21% at two layers. Does depth help? Each layer advances the token states by one step Δt of a damped second-order flow in a learned potential; the collection holds the total integration time T = L · Δt = 8 fixed and splits it into more, shorter steps.
This model (K2-L8-R6-CODE): K2-L8-CODE, eight layers with two wells in the V_θ bank, with each well's precision update at rank 6 instead of 4; nothing else changes. With it the model has 14.5M parameters outside the embeddings, 2.3% more than the matched GPT-2. Verdict: rank 6 helps. It settles at 5.54, −2.2% against rank 4 (5.67), and recovers 41% of what eight wells are worth at eight layers with a ninth of their parameters. It trails the matched GPT-2 by 11.8%. The depth-on-code collection holds the same model at two, four and eight layers, and three variants: two wells, two wells at rank 6 (this one), and one trained at several step counts.
Result
| model | layers | wells | rank | parameters | settled perplexity | against K2-L8-CODE |
|---|---|---|---|---|---|---|
| SO-CODE | 2 | 8 | 4 | 76,572,109 | 6.00 | +5.8% |
| L4-CODE | 4 | 8 | 4 | 76,625,361 | 5.48 | −3.2% |
| L8-CODE | 8 | 8 | 4 | 76,731,865 | 5.35 | −5.5% |
| K2-L8-CODE | 8 | 2 | 4 | 50,164,435 | 5.67 | — |
| K2-L8-R6-CODE (this model) | 8 | 2 | 6 | 53,115,091 | 5.54 | −2.2% |
| matched GPT-2 (not on the Hub) | 8 | — | — | 4.96 | −12.5% |
- This model: settled 5.54 (the mean of the log perplexities of the evals at steps 18,000, 18,500 and 19,000: 5.44, 5.55, 5.64); best 5.44 at step 18,000. Validation perplexity at block 512, on the first 2M tokens of CodeParrot's validation files (a file-level split, so no file is in both).
- Trained on exactly 315,392,000 tokens (19,250 steps × 32 × 512): the ladder's WSD schedule over 16,250 steps, then 3,000 steps at its floor learning rate, from step 0 at seed 0 on the same batches as SO-CODE, L4-CODE, L8-CODE and K2-L8-CODE, so the evaluations are paired step by step.
- 53,115,091 parameters, 2,950,656 more than K2-L8-CODE (two more directions in each of the two wells' precision updates) and 23,616,774 fewer than L8-CODE. Outside the embeddings 14.5M, against the matched GPT-2's 14.2M.
- Run health: 19,250 steps in 19.5 h in one session from step 0 (3.65 s per step with the V_φ-force checkpoint and no layer checkpointing); peak memory 37.1 GB in training, 55.4 GB in evaluation; no non-finite gradient norm at any of the 385 logged steps; gradient norm median 0.38 after step 2,000, maximum 1.40 (step 100, warmup); largest rise between logged training losses 0.070 (step 13,050, as in K2-L8-CODE, L8-CODE and SO-CODE); 0 watchdog triggers; SCAF leak monitor CLEAN at all 4 audits.
Pre-registered calls
Proposed 2026-11-04 before the launch and not confirmed by the author; scored as proposed. Paired against K2-L8-CODE over steps 16,000–19,000.
| call | prediction | called | result | outcome |
|---|---|---|---|---|
| R6-1 | rank 6 helps: paired difference ≤ −0.010 nats | 40% | −0.023 (SD 0.0016) | hit |
| R6-2 | no effect: paired difference within ±0.010 nats | 45% | −0.023 | miss |
| R6-3 | settled perplexity ≤ 5.45 (within 10% of the matched GPT-2) | 10% | 5.54 (the single eval at step 18,000 reads 5.44) | miss |
| R6-4 | all six directions in use: Cell 6b-4 participation ratio median ≥ 4.5 of 6 | 50% | 4.87 | hit |
| R6-5 | stable: no non-finite gradient norm at any logged step | 85% | none in 385 logged steps | hit |
The calls favoured "no effect": rank 4's spectrum showed the Frobenius cap on each well's precision binding, so rank 6 could only spread the same budget over more directions. It did spread it, and that helped.
Paired by step
The mean difference in log perplexity (nats, K2-L8-R6-CODE minus the other model) over a span of evaluations, with the standard deviation of the per-evaluation differences.
| steps | against K2-L8-CODE | against L8-CODE | against L4-CODE | against SO-CODE |
|---|---|---|---|---|
| 2,000–4,000 (5 evals) | −0.016 (SD 0.006) | −0.356 (SD 0.071) | +0.006 (SD 0.010) | −0.287 (SD 0.063) |
| 8,000–13,000 (11 evals) | −0.020 (SD 0.004) | +0.008 (SD 0.015) | +0.009 (SD 0.005) | −0.090 (SD 0.009) |
| 16,000–19,000 (7 evals) | −0.023 (SD 0.002) | +0.033 (SD 0.002) | +0.009 (SD 0.002) | −0.079 (SD 0.003) |
- Rank 6 leads rank 4 from the first evaluation: −0.014 nats at step 500, between −0.005 and −0.026 at every evaluation after, and −0.023 with an SD of 0.0016 over the last 3,000 steps.
- It recovers 41% of what six more wells are worth at eight layers (K2-L8-CODE trails L8-CODE by 0.056 nats), with 2.95M parameters against the six wells' 26.6M.
- Against four layers with eight wells it is level over steps 3,500–9,000 (−0.005 to +0.003 nats) and 0.005–0.017 behind after, with 23.5M fewer parameters.
Through training
| step | SO-CODE | L8-CODE | K2-L8-CODE | K2-L8-R6-CODE | against K2-L8-CODE |
|---|---|---|---|---|---|
| 500 | 44.02 | 50.93 | 52.38 | 51.67 | −1.4% |
| 1,000 | 25.13 | 28.10 | 28.29 | 27.77 | −1.8% |
| 1,500 | 20.33 | 19.94 | 18.35 | 17.89 | −2.5% |
| 2,000 | 17.67 | 18.05 | 13.41 | 13.15 | −1.9% |
| 2,500 | 15.80 | 16.29 | 10.98 | 10.79 | −1.7% |
| 3,000 | 12.96 | 14.72 | 9.67 | 9.63 | −0.4% |
| 4,000 | 10.62 | 11.02 | 8.69 | 8.56 | −1.5% |
| 5,000 | 9.27 | 8.86 | 8.08 | 7.91 | −2.1% |
| 8,000 | 7.96 | 7.27 | 7.28 | 7.15 | −1.8% |
| 10,000 | 7.45 | 6.73 | 6.91 | 6.80 | −1.6% |
| 13,000 | 6.38 | 5.75 | 6.02 | 5.90 | −2.0% |
| 16,000 | 6.12 | 5.48 | 5.79 | 5.66 | −2.2% |
| 18,000 | 5.87 | 5.26 | 5.56 | 5.44 | −2.2% |
| 19,000 | 6.10 | 5.45 | 5.76 | 5.64 | −2.1% |
Diagnostics
Refinement (Cell 6b-7). The trained layers are applied N times with the step changed, the loss read on 12 fixed validation batches. Gate 2 keeps Δt = 1 and lets T grow; Gate 3 keeps T = 8 and refines Δt = 8/N, the test of whether the layers approximate a continuous flow (the loss levels off as Δt shrinks) or are maps tied to the trained step.
| N | Gate 2, perplexity | Gate 3, perplexity | Gate 3 penalty, nats | K2-L8-CODE's penalty | L8-CODE's penalty |
|---|---|---|---|---|---|
| 1 | 67.92 | 650.04 | 4.921 | 4.418 | |
| 2 | 60.64 | 258.23 | 3.998 | 3.748 | |
| 3 | 45.43 | 117.63 | 3.211 | 3.423 | |
| 4 | 29.98 | 188.53 | 3.683 | 2.960 | |
| 6 | 8.60 | 9.45 | 0.690 | 0.549 | 0.206 |
| 8 (trained) | 4.74 | 4.74 | 0.000 | 0.000 | |
| 12 | 6.09 | 0.251 | 0.466 | 0.416 | |
| 16 | 7.80 | 0.499 | 1.074 | 0.783 | |
| 24 | 17.03 | 1.279 | 2.169 | ||
| 32 | 26.65 | 1.726 | 2.705 | 2.604 |
- Still a map, not a flow: the loss is lowest at the trained step and rises on both sides. But finer steps cost about half of what they cost at rank 4 (N = 16: 0.50 nats against 1.07), and less than in L8-CODE at every N above 8; coarser steps cost more (N = 4: 3.68 against 2.96). One model of each kind.
- Resetting the velocity multiplies perplexity by 2.28 (Gate 1: 4.74 carried, 10.81 reset; K2-L8-CODE × 3.71, L8-CODE × 2.72).
- Stiffness (Cell 6b-13): ω·Δt median 1.33 at Δt = 1 (K2-L8-CODE 1.50, L8-CODE 1.75); by layer 3.07, 1.29, 0.88, 1.69, 1.66, 1.46, 0.98, 0.59; 16.1% of readings past 2 (K2-L8-CODE 25.5%). Layer 0 is as stiff as at rank 4; layers 1–7 are softer. The integrator treats the stiff modes exactly, so this is a reading of stiffness, not of instability.
- The wells' rank (Cell 6b-4): participation ratio median 4.87 of 6 (p05 3.30, p95 5.38); singular-value ratios 1.000, 0.824, 0.716, 0.626, 0.562, 0.482. The Frobenius cap still binds, and the largest direction's σ² falls from 0.463 at rank 4 to 0.309: directions 5 and 6 take 17.5% of the budget, and the spectrum decays more slowly than at rank 4 (about 0.86 per direction against 0.78). The same curvature spread over more directions puts less on each, which fits the softer layers. (The cell's printed verdict is written for rank 4 and does not apply.)
- Registers (Cell 7): removing all registers changes nothing (5.03 → 5.03); the reverse channel is off by design (
norc).
The per-layer flow (FLOW-R). Each trained layer's share of T is integrated with k = N/8 substeps, the layer's context and wells' quadratic frozen at its first substep and one LayerNorm projection at its end; the force, including the pair potential's top-k source selection, is recomputed at every substep (debug/refinement_flow_confirmation.py, 12 × 4 × 512 tokens). Penalty ln(PPL_N / PPL_8) in nats:
| k = N / L | 1.5 | 2 | 3 | 4 | 6 | 8 | whole stack at k = 4 |
|---|---|---|---|---|---|---|---|
| K2-L8-R6-CODE (L = 8, two wells, rank 6; trained ppl 5.33 on these batches) | 0.442 | 0.061 | 0.057 | 0.058 | 0.058 | 0.059 | 1.772 |
| K2-L8-CODE (L = 8, two wells; trained ppl 5.47 on these batches) | 0.557 | 0.089 | 0.096 | 0.097 | 0.097 | 0.098 | 2.798 |
| L8-CODE (L = 8, eight wells) | 0.186 | 0.029 | 0.034 | 0.035 | 0.035 | 0.035 | 2.695 |
| L4-CODE (L = 4) | 0.429 | 0.520 | 0.282 | 0.320 | 0.309 | 0.306 | 2.960 |
| SO-CODE (L = 2) | 0.970 | 0.526 | 0.300 | 0.384 | 0.376 | 0.369 | 2.858 |
- The per-layer flow settles 0.059 nats from the trained step (within 0.004 from k = 2 to k = 8), between L8-CODE's 0.035 and rank 4's 0.098: rank 6 closes 62% of the gap in the limit between two wells and eight. The whole stack still fails refinement, but at k = 4 by 1.77 nats, about one nat less than the other eight-layer models (2.70–2.80).
- Kick share (the part of a layer's position update owed to the explicit kick, median by layer): 0.11, 0.18, 0.12, 0.18, 0.17, 0.23, 0.29, 0.50 (K2-L8-CODE 0.14, 0.14, 0.12, 0.19, 0.19, 0.26, 0.32, 0.44).
A reading
At eight layers with two wells, two more directions per well buy 0.023 nats for 2.95M parameters, where six more wells bought 0.056 for 26.6M. The cap on each well's precision did not change, so the gain comes from spreading the same curvature over more directions, not from more of it; the layers come out softer and lose less at steps finer than the trained one. Whether rank 8 would carry on, and how much of the gain survives a second seed, is open. One seed per model.
Reproduction
colab_fock_cfc_baoab_lowrank_depth_ladder_openwebtext_d384.ipynb, Cell 0 changed from the defaults:
REVERSE_CHANNEL=False, VPHI_GRAD_PATH='live', XI_GRAD_PATH='live',
LOWRANK_DAMPED_FLOW=True, # SR2
VPHI_ANALYTIC_FORCE=True, LAYER_CHECKPOINT=False, # speed switches, same arithmetic
CORPUS='code', LADDER_STEPS=16_250, EXTRA_FLOOR_STEPS=3_000 # Python code, then 3,000 steps at the floor
LADDER_L=8 # eight layers; dt = T / L = 1, T = 8
V_THETA_WELLS_PER_HEAD=2 # two wells in the joint V_theta bank instead of eight
VPHI_FORCE_CHECKPOINT=True # memory switch, same arithmetic
SNAPSHOT_STEPS=[1_000, 1_500, 2_000, 2_500, 3_000] # weights-only snapshots for the well probe
ANISO_RANK=6 # rank of each well's precision update (default 4); tag part ar6
Run Cells 0, 1, 1b, 1c, 1d, 2, 3, 4, 5, 5b and 6, then 7, 6b-7, 6b-4 and 6b-13 (one A100 80 GB; 37.1 GB peak in training, 3.65 s per step, about 19.5 h). The per-layer flow is debug/refinement_flow_confirmation.py … code seed=20261009 on the downloaded run folder (CPU).
Training artefacts were written to semsimula_fock_cfc_baoab_code_xi5long_topk16_dt32da16_mh4_aniso_dcvt5x2_ar6_vtjoint_cgqk_norc_vplive_xilive_sr2_st16250_L8probe_ob_untied_wsd_e5c_plgate_rep0.05_fockreg0.005_g0.1_baoab_cfc_lowrank_lr0p0012_noattn/.
Glossary
| term | meaning |
|---|---|
| settled PPL | validation perplexity at block 512, the mean of the last three evals (on this corpus, steps 18,000–19,000). Best is the lowest single eval |
| Gen 1 / Gen 2 / Gen 3 | the model generations. Gen 1: explicit integrators. Gen 2: the CfC/BAOAB ladder with the sources of Vφ and ξ (and of an exchange field) detached, which keeps every force causal, but no loss gradient ever reaches an earlier token through them. Gen 3: the same forward pass with those gradients live |
| live / detached gradients | whether the loss gradient flows into the earlier tokens that act as sources of a force. Detaching changes no forward value; it only cuts that backward path |
| Vθ | the learned scalar potential on a token's state h, given its context ξ: a bank of anisotropic Gaussian wells. Its negative gradient is the conservative force on the token |
| Vφ | a pair potential between a token and a few selected earlier tokens (sparse top-k) |
| ξ | the causal context channels: exponential moving averages of earlier states at several horizons, which condition Vθ |
| Fock mechanism, registers, reverse channel | a pool of register particles, created and destroyed from the token context. The reverse channel is the register-to-token force; it is not the gradient of any potential on the tokens, so it is the model's non-conservative part |
| exchange field | an attention-like token-to-token interaction added to the conservative core. Each token is pushed by earlier tokens through learned query, key and value projections, as in attention. The ladder tests it in two forms, attention and attention_potential |
attention (non-conservative exchange field) | the exchange term enters as a force directly. It is not the gradient of anything, so the step stops being a geodesic step |
attention_potential (attention as a potential) | the same interaction written as a scalar potential whose gradient is the force. The routing weights are computed from the hidden states and held fixed with respect to the state being moved, so the force stays an exact gradient and the model stays conservative |
no-exchange (LADDER_MECHANISM = 'none') | the arm with no exchange field at all: Vθ, Vφ and ξ, plus the Fock register mechanism unless the arm is conservative-only |
live exchange field (RELAX_GRAD_PATH = 'live') | attention_potential with the identical forward force written out over live tensors, so the loss gradient reaches the field's sources and routing. In Gen 2 these were detached, and the field sent no gradient into any hidden state |
| Gen 2 probe | a Gen 2 arm retrained with one gradient path changed, to test a hypothesis before the full Gen 3 ladder. The live-exchange-field probe (attention_potential with RELAX_GRAD_PATH = 'live', the full 32,500 steps) is the one that found the gradient starvation |
| gpt2-matched | the reference transformer: GPT-2 architecture, d = 384, L = 8, tied embeddings (33.7M parameters), trained on the same tokenizer, corpus, batches and token budget. Shared by Gen 2 and Gen 3 |
tag components (vplive, xilive, rglive, norc, L4probe, idt…) | pieces of the run's variant tag, so that every configuration gets its own Drive folder: live Vφ sources, live ξ, live exchange field, no reverse channel, the depth L, and the integrator step Δt |
| conservative-only | a model in which every force is a gradient: no reverse channel and no non-conservative exchange field |
| CfC/BAOAB low-rank propagator | the integrator. Each layer step is split into position (A), force kick (B) and friction (O) substeps, and the stiff harmonic modes of Vθ are integrated exactly in closed form |
| ω·Δt, θ | a stiff mode's frequency times the step size. Past 2, an explicit integrator would be unstable (the wall); the closed-form propagator is not. θ/sin θ is the factor by which a split step's dissipation depends on the mode's phase, largest near θ = π |
| geodesic step, R(geo), share | the step a damped particle would take under Vθ alone; R(geo) is the distance of the real step from it, relative to the step's length. A component's share is how much it moves that distance (6b-9 attribution) |
| Gates 1–3, FLOW / MAPS | see Terms in the geometry section |
| CG1–CG7, 6b-N | the CfC-geometry experiments, and the ladder-notebook cells that run them |
| SCAF, Tier A, Tier B | the in-flight causal-leak monitor. Its core test changes future tokens and requires the logits at earlier positions to stay bit-identical. Tier A asks the same of the hidden states, as 1 − cos between the clean and perturbed state at each earlier position and layer. Tier B asks whether the perturbation moves any earlier state into a different dominant Vθ well (the basin-crossing rate). All three read 0 for a causal model |
| leak tax, prefix-only | the loss difference between scoring a position with only its prefix and with the full sequence; about 0 for a causal model |
| clip-hit | the share of logged steps whose gradient norm exceeded the clipping threshold (1.0) |
| pre-registered | a prediction recorded, with its threshold, before the run |
Files
| path | what |
|---|---|
README.md | this card |
config.json | architecture, training, result and diagnostics |
checkpoints/fock_cfc_*noattn_step18000_best.pt | weights at the best eval (step 18,000), optimizer state stripped |
results/ | the training log, the diagnostic cells' outputs (Cells 6b-4, 6b-7, 6b-13 and 7), the resonance and leak records and the per-layer flow (refinement_flow_confirmation_k2-l8-r6-code_*) |
code/ | the notebook and the model code (it also carries later, default-off switches) |
Companion notes
| note | what it covers |
|---|---|
Code_Depth_Runs.md | the run records: entries p-k2-l8-r6-setup and p-k2-l8-r6-result |
Minimum_Well_Count_for_Conservative_Models.md | how many wells each layer needs, from the trained models and from fits |
Caveats
- One seed per model. The pairing removes the evaluation noise, not the training-seed spread, which has not been measured; a 0.023-nat gain is small against what a seed could move.
- The calls were never confirmed before the run; they are scored as proposed.
- Not settled by the letter of the settling rule, like every code model; the paired gap to K2-L8-CODE is flat over the last 3,000 steps.
- Code only, without the register path. Perplexities on code are not comparable with other corpora's.
Citation
@misc{Gueorguiev2026SemSim,
author = {Gueorguiev, Dimitar P.},
title = {Semantic Simulation: A Prescriptive Lagrangian Framework
for Semantic Inference --- Conservative Potentials,
Conservative and Non-Conservative Memory, and Competing Mechanisms},
year = {2026},
publisher = {Zenodo},
doi = {10.5281/zenodo.19712427},
url = {https://doi.org/10.5281/zenodo.19712427},
note = {Version v25 (Nov 9, 2026).
Companion code repository (DOI 10.5281/zenodo.24066016):
\url{https://github.com/dimitarpg13/semsimula-paper}}
}
Card generated from _ladder/ladder.json on 2026-11-17.