CoolFace
Modelpublic

dimitarpg13/semsimula-fock-parflm-depthcond-vtheta

sourceHugging Facecc-by-4.0updated 1mo agoView on Hugging Face
0likes95downloads
Model Card

Fock-PARFLM v2.1 with Depth-Conditioned Multi-Context Gaussian V_theta (TinyStories)

The TinyStories-scale member of the depth-conditioned multi-context Gaussian \\(V\theta\\) family, whose flagship is the [OpenWebText-scale Fock-PARFLM](https://huggingface.co/dimitarpg13/semsimula-fock-parflm-depthcond-vtheta-openwebtext) (27.23 PPL, 53.4M params). This checkpoint uses the same \\(V\theta\\) design — a bounded mixture of Gaussian wells, one bank per xi-context channel, with a small learned per-layer depth code — at the smaller Fock-PARFLM v2.1 TinyStories scale (d=256, L=8), alongside the same MLP - \\(V_\theta\\) and SQ3-structured siblings.

Unlike its two Fock-PARFLM siblings, this checkpoint needed no causal-leak re-training: it was trained from step 0 with prefix_causal_registers=True and its bit-exact future-perturbation probes and honest-vs-standard PPL checks pass cleanly throughout training. See Training Details for the probe evidence.

This model is from the Semantic Simulation framework.

Table of Contents

When to Use This Model

Choose this variant over the MLP-based or SQ3-structured Fock-PARFLM v2.1 when a structurally bounded, per-horizon-conditioned potential is what you want to study — not when you want the best TinyStories PPL at this scale:

PriorityDepth-cond. multi-context Gaussian (this model)SQ3 structured ([sibling](https://huggingface.co/dimitarpg13/semsimula-fock-parflm-structured-vtheta))MLP ([baseline](https://huggingface.co/dimitarpg13/semsimula-fock-parflm))
BoundednessV_theta in [-4, 0] by construction, force magnitude cappedUnbounded (log-sum-exp mixture)Unbounded
Interpretability32 explicit attractor centres, one bank per temporal horizon8 explicit attractor centresBlack-box
Per-layer specialisationYes — shared bank + learned per-layer depth-code shiftNo (one shared bank, no depth code)No
Raw PPL16.3310.909.70
Causal-leak historyTrained leak-free natively (no re-training needed)Re-trained with the fix (+0.54 PPL tax)Re-trained with the fix (+0.40 PPL tax)

Bottom line: at this small scale (d=256, L=8, 16k steps), the boundedness of the Gaussian mixture costs a large amount of expressivity relative to the unbounded SQ3 and MLP potentials — a 6.63 PPL gap to the honest MLP baseline. The same potential family reaches a competitive 27.23 PPL on OpenWebText, but only once combined with a much larger scale (d=384, L=16), five xi-context channels instead of four, wider sparse routing, register repulsion, untied embeddings, and a graduated WSD schedule. This TinyStories checkpoint isolates the potential design in the small-scale regime and shows it is not, by itself, sufficient to match the unbounded alternatives there — see Evaluation Results.

Architecture

Input tokens x_1, ..., x_T
       |
   Embedding E[x] + positional encoding
       |
   For each of L=8 integration steps (layer index g = 0..7):
       |
       +-- K-EMA channels: xi^(m)_t = causal_ema(h, alpha_m)   [n_ctx=4 channels]
       |
       +-- Depth-conditioned multi-context V_theta (Gaussian):
       |     xi_g^(m) = xi^(m) + e_g^(m)                    [per-layer depth code]
       |     V_m = -sum_k w_k^m exp(-0.5 a_k^m (h - mu_k^m)^2)  [8 wells per context]
       |     V_theta = sum_m V_m(xi_g^(m), h)               [4 contexts, 32 wells total]
       |     f_theta = -analytical_grad_h V_theta            [closed-form, bounded]
       |
       +-- Pairwise V_phi (competitive structural MLP):
       |     scores = score_net(h_t, h_s)                       [for all s <= t]
       |     top-k selection via Gumbel-softmax                 [k=8 neighbours]
       |     f_phi = -grad_h V_phi(h_t, h_s)                   [autograd, sparse]
       |
       +-- Fock register pool (v2.1):
       |     M=16 virtual registers with Q/K/V creation gates
       |     LIFO stack discipline, salience decay
       |     Per-register tau and key subspaces
       |     Reverse channel (non-conservative exchange), prefix-causal (leak-free)
       |     f_fock = creation + destruction + exchange forces
       |
       +-- Total force: f = f_theta + f_phi + f_fock
       |
       +-- Damped Euler step: v += dt*f/m; v /= (1 + dt*gamma); h += dt*v
       |
       +-- LayerNorm(h)
       |
   Logits = h @ E^T                                            [tied embeddings]
ParameterValue
Hidden dim (d)256
Layers (L)8
V_theta kindDepth-conditioned multi-context Gaussian (bounded mixture)
Vtheta contexts (nctx)4 (one bank per xi channel)
Wells per context (K)8
Total attractors32
Depth codesper-layer additive shift, shape (L=8, n_ctx=4, d=256), init std 0.02
Xi channels (K_xi)4
V_phi kindstructural_competitive
V_phi hidden128
Top-k (sparse routing)8
Gumbel tau1.0 (init), 0.3 (min)
Fock versionv2.1
Registers (M)16
Register d_k64
Stack disciplineLIFO
Reverse channelYes — prefix-causal, leak-free
Per-register tau/keysYes
Gathered V_phiYes
Per-layer V_phi scaleYes
LN before distanceYes
Layer checkpointYes
Mass modellogfreq (frozen surprisal lookup)
Damping gamma0.30 nominal (LayerNorm prevents compounding; effective damping is much smaller — see the MLP sibling's note)
lambdaV (Vtheta regularisation)0.01
Prefix-causal registersYes — trained natively with the fix, not retrofitted
Total parameters18,213,899
V_theta parameters4,227,104

The Analytical Form of the Potential

Each of the 4 xi-context channels gets its own bank of 8 diagonal-precision Gaussian wells. For context \\(m\\), well \\(k\\), the bank contributes

$$ Vm(\xi^{(m)}, h) = -\sum{k=1}^{8} wk^{(m)}(\xi^{(m)}) \exp\left(-\frac{1}{2} \sum{d=1}^{256} a{k,d}^{(m)}(\xi^{(m)}) \left(hd - \mu_{k,d}^{(m)}(\xi^{(m)})\right)^2\right) $$

where the mixture weights \\(wk^{(m)}\\) are a softmax over a linear projection of \\(\xi^{(m)}\\) (so they sum to 1 per context), and the per-dimension precisions \\(a{k,d}^{(m)}\\) are strictly positive via a softplus projection. Because every term is a negative exponential bounded in \\((-1, 0]\\), each bank's contribution is bounded in \\([-1, 0]\\) — this is the structural fix that gives the model a provably finite potential and force, in contrast to the SQ3 sibling's unbounded log-sum-exp mixture.

Depth conditioning. Rather than training 8 independent well banks (one per integration layer, which would multiply the parameter count by \\(L=8\\)), a single shared bank per context is reused across all layers. Each layer \\(g\\) instead learns a small additive depth code \\(e_g^{(m)} \in \mathbb{R}^{256}\\) that shifts the context before the bank sees it:

$$ \xig^{(m)} = \xi^{(m)} + eg^{(m)}, \qquad V\theta(\xi, h) = \sum{m=1}^{4} Vm(\xig^{(m)}, h) $$

Since \\(e_g^{(m)}\\) is constant with respect to \\(h\\), the gradient is unaffected by this additive shift of the input, and the resulting total potential over all 4 contexts is bounded in \\([-4, 0]\\).

Force (closed form):

$$ f\theta = -\nablah V\theta = \sum{m=1}^{4} \sum{k=1}^{8} wk^{(m)} ak^{(m)} \odot \left(h - \muk^{(m)}\right) \exp\left(-\frac{1}{2} ak^{(m)} \cdot \left(h - \muk^{(m)}\right)^2\right) $$

The Gaussian factor decays to zero away from each well centre, so the force magnitude is bounded (it peaks at a finite radius from each \\(\mu_k^{(m)}\\) and vanishes both at the centre and far away) — unlike SQ3's quadratic force, which grows without bound as \\(h\\) moves away from a well.

Empirically bounded, but far from the theoretical ceiling. The theoretical range of \\(V\theta\\) is \\([-4, 0]\\), but on this checkpoint the observed range over validation batches is only **[-0.624, -0.00002]** (mean -0.017, std 0.024) — the 32 wells are only weakly activated at this checkpoint. This is the flattest, most compressed landscape of any Fock-PARFLM \\(V\theta\\) variant published so far (see Evaluation Results), and plausibly part of why the PPL gap to the unbounded siblings is large at this scale: the force budget carried by \\(V\theta\\) here is tiny relative to \\(V\phi\\) and the Fock registers.

For the full derivation, boundedness proof, and the SARFGaussianVTheta frozen-anchor variant, see the companion note: `Structured_VTheta_Design_and_Theory.md` and the OpenWebText flagship's write-up of the same design at scale.

How to Get Started

python
import torch, sys
sys.path.insert(0, "multixi")
sys.path.insert(0, "parf")
sys.path.insert(0, "energetic_minima")
sys.path.insert(0, "sarf_mass_variant")

from parf.model_fock_parf_multixi import FockMultiXiPARFLM, FockMultiXiPARFConfig
from parf.model_gaussian_vtheta import DepthConditionedMultiContextGaussianVTheta, install_depth_routing

# -- Build base model --
config = FockMultiXiPARFConfig(
    vocab_size=50257, d=256, L=8,
    v_hidden=1024, v_depth=3,
    max_len=1024,
    fixed_gamma=0.30, xi_channels=4,
    xi_alpha_inits=[0.25, 0.5, 0.75, 0.95],
    xi_learnable=True, mass_mode="logfreq",
    logfreq_path="logfreq_surprisal_tinystories.npy",
    v_phi_kind="structural_competitive",
    v_phi_phi_hidden=128, v_phi_theta_hidden=128,
    top_k=8, score_head_hidden=32,
    gumbel_tau_init=1.0, gumbel_tau_min=0.3,
    gumbel_noise=True,
    use_gathered_v_phi=True,
    use_layer_checkpoint=True,
    ln_before_distance=True,
    per_layer_v_phi_scale=True,
    fock_version="v2",
    n_registers=16, d_k=64,
    tau_create_init=8.0,
    register_salience_decay=0.5,
    register_salience_threshold=0.01,
    stack_discipline=True,
    reverse_channel=True,
    per_register_tau=True,
    per_register_keys=True,
    ortho_register_init=True,
    prefix_causal_registers=True,
)
model = FockMultiXiPARFLM(config)

# -- Swap in the depth-conditioned multi-context Gaussian V_theta --
model.V_theta = DepthConditionedMultiContextGaussianVTheta(d=256, K=8, n_ctx=4, n_layers=8)
install_depth_routing(model)  # wires the per-layer index into V_theta's depth-code lookup

# -- Load checkpoint --
from huggingface_hub import hf_hub_download
ckpt_path = hf_hub_download(
    repo_id="dimitarpg13/semsimula-fock-parflm-depthcond-vtheta",
    filename="checkpoint/ckpt_best.pt",
)
state = torch.load(ckpt_path, map_location="cpu", weights_only=False)
model.load_state_dict(state["model_state_dict"])
model.eval()

print(f"Parameters: {sum(p.numel() for p in model.parameters()):,}")

# -- Read attractor centres directly (32 wells: 4 contexts x 8 wells) --
x = torch.randint(0, 50257, (1, 64))
with torch.no_grad():
    h = model._embed(x)
    xis = model._compute_xis(h)                                # (1, 64, 4, 256)
    centres = model.V_theta.attractor_centres(xis)              # (1, 64, 4, 8, 256)
    print(f"Attractor centres shape: {centres.shape}")

Available Artifacts

FileDescription
checkpoint/ckpt_best.ptBest checkpoint (16.33 PPL at step 14,400), trained natively leak-free
training_log.jsonlPer-step training metrics, including causal_probe and trained_leak_probe events
training_curve_gaussian.pngTraining/validation loss curves
v_theta_hist_gaussian.pngV_theta output distribution histogram
landscape_stats_gaussian.jsonV_theta landscape statistics (mean, std, min, max, range)
model_gaussian_vtheta.pyGaussian V_theta classes (mixture, SARF-anchored, multi-context, depth-conditioned)
model_structured_vtheta.pyBase class (StructuredVThetaBase) required by model_gaussian_vtheta.py
config.jsonModel configuration

Training Details

Training Data

TinyStories --- a synthetic corpus of short children's stories generated by GPT-3.5/4, tokenized with GPT-2 BPE (vocab size 50,257). Training cap: 5M tokens.

Training Procedure

The base architecture is identical to Fock-PARFLM v2.1. The only modification is the \\(V\theta\\) replacement: a single shared `DepthConditionedMultiContextGaussianVTheta` bank (4 contexts x 8 wells) plus per-layer depth codes are constructed in place of the 3-layer MLP, before training begins from scratch. The pairwise \\(V\phi\\) (competitive structural MLP, hidden=128, top-k=8) and Fock register pool (16 registers, LIFO, reverse channel) are unchanged, and prefix_causal_registers=True is set from the start.

HyperparameterValue
OptimizerAdamW
Learning rate5e-4 (cosine decay)
Warmup steps400
Weight decay0.01
Gradient clipping1.0
Batch size16
Block size512
Training steps16,000
lambdaV (Vtheta regularisation)0.01
HardwareNVIDIA A100 40GB (Google Colab)

Causal-Leak Verification (no fix needed — trained natively leak-free)

Because this run started with prefix_causal_registers=True from step 1 (rather than being re-trained after the fact like the MLP and SQ3 siblings), the training log carries the same probes as a matter of routine certification, not remediation:

stepcausal_probe_max_deltacausal_probe_passedhonest vs. standard PPL diff (nats)
4,0000.0True—
8,0000.0True+0.0077 ± 0.0192 SE
12,0000.0True—
16,0000.0True+0.0247 ± 0.0164 SE

The deterministic architectural probe is bit-exact 0.0 at every checkpoint, and the honest-vs-standard PPL differences are both within ~1.5 standard errors of zero — not statistically distinguishable from no leak. No causal-leak caveat applies to the 16.33 PPL reported on this card.

Training Script

notebooks/conservative_arch/scaleup/colab_fock_gaussian_vtheta.ipynb (companion repo) --- Colab notebook with the depth-conditioned multi-context Gaussian arm, GDrive output, checkpointing, and live progress display.

Evaluation Results

TinyStories Validation Perplexity

ModelPPLParamsAnalytical V_theta gradBounded V_thetaCausal leak
Matched Attention (baseline)7.8119.5M------No
Fock-PARFLM v2.1 (MLP)9.7017.4MNoNoFixed & verified
Fock-PARFLM v2.1 (SQ3)10.9018.2MYesNoFixed & verified
Fock-PARFLM v2.1 (depth-cond. Gaussian, this model)16.3318.2MYesYesNever leaked
All PPL values in this table are honest, leak-free numbers. This model and the SQ3 sibling have nearly identical total parameter counts (both ~18.2M, dominated by their respective \\(V_\theta\\) hypernetworks) yet very different PPL — the gap here is attributable to the design trade-off of a bounded potential, not to parameter budget.

PPL is evaluated on the TinyStories validation split; see Training Data.

V_theta Landscape Statistics

MetricThis model (depth-cond. Gaussian)Fock-PARFLM (SQ3)Fock-PARFLM (MLP)
Mean V_theta-0.0170.017n/a (MLP has no comparable scalar readout)
Std V_theta0.0240.42n/a
Range0.62416.0n/a
Theoretical bound[-4, 0](-∞, +∞)(-∞, +∞)

This is the flattest, most compressed \\(V_\theta\\) landscape of any Fock-PARFLM variant published so far — a direct, structural consequence of the bounded Gaussian-mixture design rather than something the optimiser found on its own.

Learned Xi-Channel Decay Rates

The final learned alpha values \\([\alpha1, \ldots, \alpha4] = [0.321, 0.544, 0.854, 0.908]\\) (initialised at \\([0.25, 0.5, 0.75, 0.95]\\)) settle to a somewhat different spread than the MLP and SQ3 siblings' \\(\approx [0.11\text{--}0.14, 0.55\text{--}0.59, 0.79\text{--}0.84, 0.95\text{--}0.97]\\), suggesting the depth-conditioned Gaussian potential shifts slightly more weight onto the two longer-horizon xi channels.

SPLM Family Overview

This model is part of the Semantic Simulation SPLM family:

ModelDesignCorpusPPLHuggingFace
Multi-Xi SPLM (MLP)Pure scalar potentialTinyStories11.51semsimula-splm-multixi
Multi-Xi SPLM (SQ3)Structured scalar potentialTinyStories13.33semsimula-splm-multixi-structured-vtheta
Multi-Xi PARFLM (MLP)Scalar + pairwise forcesTinyStories12.06semsimula-parflm-multixi
Multi-Xi PARFLM (SQ3)Structured scalar + pairwiseTinyStories12.27semsimula-parflm-multixi-structured-vtheta
Fock-PARFLM v2.1 (MLP)PARFLM + Fock registersTinyStories9.70semsimula-fock-parflm
Fock-PARFLM v2.1 (SQ3)Structured + pairwise + FockTinyStories10.90semsimula-fock-parflm-structured-vtheta
Fock-PARFLM v2.1 (depth-cond. isotropic Gaussian)Bounded multi-context + pairwise + FockTinyStories16.33this model
Fock-PARFLM v2.1 (depth-cond. anisotropic Gaussian + fock-reg)Bounded, ellipsoidal multi-context + pairwise + FockTinyStories9.04semsimula-fock-parflm-anisogaussian-vtheta
Fock-PARFLM v2.1 (aniso-Gaussian + fock-reg, first-order/Fock-G1)Same as above, gradient-flow integratorTinyStories8.95semsimula-fock-parflm-anisogaussian-vtheta-fock-g1
Fock Attention (MLP V_theta)Fock + attentionTinyStories9.42semsimula-fock-attention
Hybrid SPLM+AttnAttention + SPLM refinementTinyStories8.50semsimula-hybrid-splm
Fock-PARFLM v2.1 (aniso-Gaussian + fock-reg, gamma sweep, d=384)Bounded, ellipsoidal multi-context + pairwise + Fock — 8-way gamma sweep + geodesic analysisOpenWebText278.27 (best of 8, 3K-step sweep)semsimula-fock-parflm-anisogaussian-vtheta-owt-d384-gammasweep
Fock-PARFLM v2.1 (aniso-Gaussian + fock-reg, gamma sweep, d=768)Bounded, ellipsoidal multi-context + pairwise + Fock — 8-way gamma sweep + geodesic analysisOpenWebText326.97 (best of 8, 3K-step sweep)semsimula-fock-parflm-anisogaussian-vtheta-owt-d768-gammasweep
Fock-PARFLM v2.1 (aniso-Gaussian + fock-reg, gamma sweep, d=1024)Bounded, ellipsoidal multi-context + pairwise + Fock — 8-way gamma sweep + geodesic analysisOpenWebText244.23 (best of 8, 3K-step sweep)semsimula-fock-parflm-anisogaussian-vtheta-owt-d1024-gammasweep
Fock-PARFLM v2.1 (aniso-Gaussian + fock-reg, Verlet instability, d=384)Same architecture, two full-run attempts — SCAF stiffness audit identifies structural Verlet instabilityOpenWebText184.11 / 211.63 (both runs stalled, not final)semsimula-fock-parflm-anisogaussian-vtheta-owt-d384-verlet-instability

Collection: Semantic Simulation SPLM Model Family

Bias, Risks, and Limitations

  • —Research checkpoint only. This model is a proof-of-concept for bounded, depth-conditioned scalar potentials in Fock-augmented architectures, not a production system.
  • —TinyStories only. Trained exclusively on synthetic children's stories (~5M tokens). Not suitable for general-purpose language generation.
  • —English only. No multilingual capability.
  • —Small scale. 18.2M parameters, 256-dim hidden states.
  • —No safety training. No RLHF, DPO, or safety filtering has been applied.
  • —V_phi and Fock forces still use autograd. Only the \\(V\theta\\) gradient is analytical; the \\(V\phi\\) pairwise force and Fock register forces still require torch.autograd.grad.
  • —Large expressivity gap at this scale. The 6.63 PPL gap to the honest MLP baseline (16.33 vs 9.70) is substantially larger than the SQ3 sibling's 1.20 PPL gap. The bounded-potential design that lets the OpenWebText-scale flagship reach 27.23 PPL does not, by itself, transfer its advantage down to this much smaller model/training budget — see When to Use This Model.
  • —Weakly activated wells. The empirical \\(V_\theta\\) range (0.624) is far below the theoretical bound (4.0), indicating the 32 wells are only lightly used at this checkpoint; this may partly explain the gap to the unbounded siblings.
  • —No causal-leak issue. Unlike the MLP and SQ3 siblings, this checkpoint was trained natively with prefix_causal_registers=True and needed no re-training or PPL correction; see Causal-Leak Verification.

Citation

bibtex
@misc{Gueorguiev2026SemSim,
  author    = {Gueorguiev, Dimitar P.},
  title     = {Semantic Simulation: A Prescriptive Lagrangian Framework
               for Efficient Semantic Inference --- A Conservative-by-
               Construction Language Model and the Shared-Potential
               Separator, with a Correspondence to Joint Embedding
               Predictive Architectures},
  year      = {2026},
  publisher = {Zenodo},
  doi       = {10.5281/zenodo.19712427},
  url       = {https://doi.org/10.5281/zenodo.19712427},
  note      = {Version v15 (Jun 7, 2026).
               Companion code repository (DOI 10.5281/zenodo.20579561):
               \url{https://github.com/dimitarpg13/semsimula-paper}}
}

Environmental Impact

  • —Hardware: NVIDIA A100 40GB (Google Colab)
  • —Training time: ~3 hours (16,000 steps)
  • —Carbon footprint: Estimated less than 2 kg CO2