Fock-PARFLM v2.1 (Fock-Augmented Property-Attractive-Repulsive Force Language Model)

The Fock-PARFLM v2.1 is the best-performing purely conservative language model in the Semantic Simulation family. It extends the PARFLM with a Fock-space latent register pool -- M=16 virtual register particles with Q/K/V-structured creation gates, LIFO stack discipline, and an optional non-conservative reverse channel -- achieving 9.30 PPL on TinyStories. This surpasses the direct-exchange Fock Attention variant (9.42 PPL) at O(1)O(1) inference memory per layer.

The v2.1 routing fix (B1: per-register temperature, B2: per-register key subspaces, B3: orthogonal initialisation) eliminates the routing-collapse pathology of v2.0, turning a routing deficit into a routing surplus.

Part of the Semantic Simulation framework.

Table of Contents

Model Details

Model Description

The Fock-PARFLM extends the Multi-Xi PARFLM with a Fock-space mechanism that adds persistent virtual register particles to the token dynamics. These registers:

  • Are created by a Q/K/V-structured gate (v2): query-key matching determines which register absorbs information from which token position.
  • Persist across integration steps with LIFO (last-in, first-out) stack discipline.
  • Are destroyed when their salience drops below a threshold.
  • Exert forces on tokens via the existing PARF VϕV_\phi pair potential.
  • Optionally inject a non-conservative reverse-channel force Q_i controlled by tanh(sreverse)\tanh(s_{\text{reverse}}).

This design is the Semantic Simulation framework's structural answer to the Conservative Obstruction Theorem: attention-based transformers cannot host a shared scalar potential (six decoder features each independently obstruct conservativity), and Fock registers are the minimal auxiliary degrees of freedom that overcome this obstruction.

  • Developed by: Dimitar P. Gueorguiev (Independent Researcher)
  • Model type: Conservative autoregressive language model with Fock-space registers
  • Language: English
  • License: CC-BY-4.0

Model Sources

Architecture

Input tokens x_1, ..., x_T
       |
   Embedding E[x] + positional encoding
       |
   For each of L=8 integration steps:
       |
       +-- K-EMA channels: xi^(k)_t = causal_ema(h, alpha_k)   [K=4 channels]
       |
       +-- Single-body: V_theta([xi_1..xi_K, h]) -> R           [3-layer MLP]
       |
       +-- Sparse PARF: V_phi(h_t, h_s)                         [top-k=8 routing]
       |
       +-- Fock creation gate (v2.1):                            [Q/K/V structured]
       |     q_j = W_Q^(j) * h_t   (per-register query)
       |     k_j = W_K^(j) * mean(h)
       |     score = q_j . k_j / sqrt(d_k) / tau_j              [per-register temperature]
       |     v_j = W_V * h_t
       |     register_j += softmax(score) * v_j
       |
       +-- Register destruction: sigma_j *= decay; destroy if sigma < threshold
       |
       +-- Register forces: V_phi(h_t, register_j)              [same pair potential]
       |
       +-- Reverse channel (non-conservative):
       |     Q_i = tanh(s_ex) * sum_j alpha_ij * v_j            [controlled non-conservatism]
       |
       +-- Force composition: f = -grad_h(V_theta + V_phi) + Q
       |
       +-- Damped Euler step: v += dt*f/m; v /= (1+dt*gamma); h += dt*v
       |
       +-- LayerNorm(h)
       |
   Logits = h @ E^T                                            [tied embeddings]
Parameter Value
Hidden dim (d) 256
Layers (L) 8
VθV_\theta hidden / depth 1024 / 3
Xi channels (K) 4
VϕV_\phi kind structural_competitive
VϕV_\phi hidden (H) 128
Sparse routing top_k 8
Fock registers (M) 16
Fock gate version v2.1 (B1+B2+B3)
Register d_k 64
Register tau_create_init 8.0
Register salience decay 0.5
Stack discipline LIFO
Reverse channel enabled
Learned exchange scale tanh(sex)=0.227\tanh(s_{\text{ex}}) = -0.227
Mass model logfreq
Damping γ\gamma 0.30 (fixed)
Total parameters 17,407,980

Controlled Conservativity

The Fock-PARFLM v2.1 has been empirically verified to exhibit controlled conservativity through a 5-arm diagnostic battery (CONS1--5):

Arm Test Result
CONS1 Jacobian symmetry (grad VθV_\theta is exact gradient) PASS
CONS2 Energy conservation under zero damping PASS: ΔE<104\Delta E < 10^{-4}
CONS3 Damping-rate proportionality (energy loss γ\sim \gamma) PASS: R2>0.99R^2 > 0.99
CONS4 PPL sensitivity to reverse-channel scale PASS (monotonic)
CONS5 Non-conservative fraction measurement tanh(sex)=0.227\tanh(s_{\text{ex}}) = -0.227 (3.3% of total force)

The reverse channel is the only source of non-conservatism, and its magnitude is learned and small. The conservative core Vθ+VϕV_\theta + V_\phi dominates the dynamics. Full results: companion_notes/Fock_PARFLM_Conservativity_Diagnostic.md.

Why Not a Transformer?

The Fock-PARFLM is not based on the Transformer architecture. There are no attention layers, no key-value cache, and no feed-forward network towers. The entire model dynamics are driven by two small scalar-potential MLPs — VθV_\theta (3.4M params) and VϕV_\phi (19K params) — plus a Fock register pool (~824K params for creation/destruction gates). The total active computation is a fraction of a Transformer's parameter budget.

Key structural differences from Transformers:

Property Transformer (GPT-2 small) Fock-PARFLM v2.1 (this model)
Architecture Self-attention + FFN blocks Scalar-potential gradient flow + Fock registers
Core computation 50.3M (MLP) + 28.3M (attention) 3.4M VθV_\theta + 19K VϕV_\phi + 824K (Fock)
Runtime state per token O(T)O(T) — KV-cache grows linearly O(1)O(1) — fixed-size h,v,ξh, v, \xi + M registers
Total parameters 124M 17.4M
Pairwise token interaction O(T2)O(T^2) dense attention O(Tk)O(Tk) sparse routing (k=8)

Because the model carries only a fixed-size state per position — with no KV-cache — and the Fock registers are a fixed pool of M=16, its inference memory is O(1)O(1) in sequence length. The figure below illustrates the widening memorization gap between the Transformer's linearly-growing KV-cache and the SPLM's constant-size dynamic state:

Runtime information capacity vs sequence length

Geometric Capabilities of Conservative Architectures

This model is fully attention-free and conservative by construction. Because all forces derive from the gradient of a scalar potential VθV_\theta, the hidden-state manifold is endowed with a natural damped Riemannian geometry — the layer-dependent Jacobi metric Ω2=2Tm\Omega^2_\ell = 2T_\ell \cdot m — which is categorically absent from Transformer architectures. This geometry opens the door to capabilities that cannot be replicated in attention-based models:

Capability Conservative SPLM Transformer
Riemannian metric on hidden states Layer-dependent Jacobi metric Ω2=2Tm\Omega^2_\ell = 2T_\ell \cdot m from VθV_\theta; confirmed positive at 100% of positions (diagnostic battery Arm 1) No metric structure
Geodesics between semantic states Damped geodesic equation with friction term γv-\gamma v; directional cosine similarity 0.52–0.75 (Arm 2). Geodesics are asymmetric: d(AB)d(BA)d(A \to B) \neq d(B \to A) Linear interpolation only
Controlled energy dissipation as inference signal ΔEanomaly(t)=ΔE(t)ΔEexpected(t)\Delta E_{\text{anomaly}}(t) = |\Delta E(t) - \Delta E_{\text{expected}}(t)|; monotonic damped decay with measurable anomaly signal (Arm 4) No conserved or tracked quantity
Curvature as uncertainty measure Kmax=λmax(2Vθ)/2T\mathcal{K}_{\max} = \lambda_{\max}(\nabla^2 V_\theta) / 2T_\ell; well-defined across all layers (Arm 3) None

These structural properties enable a set of native architectural features that are planned or under investigation (Section 18d and Section 23 of the paper):

  • Geodesic Analogical Reasoning: Analogy completion via parallel transport of directed geodesic arcs on the semantic manifold, respecting potential barriers that linear embedding arithmetic ignores. The damped geodesic equation yields 3–20% cosine-similarity improvement over undamped (diagnostic battery Arm 2). Because damped geodesics are asymmetric, analogy transport must use directed arcs.
  • Native Hallucination Detection: Energy dissipation anomalies ΔEanomaly(t)=ΔE(t)ΔEexpected(t)\Delta E_{\text{anomaly}}(t) = |\Delta E(t) - \Delta E_{\text{expected}}(t)| and curvature spikes Kmax(t)\mathcal{K}_{\max}(t) provide mechanistically grounded uncertainty signals computable at inference time without additional parameters. The smooth damping-induced energy decay is normal operation; deviation from the expected dissipation curve flags hallucination. For Fock models, the detector needs a per-model baseline that accounts for the known layer-1 exchange transient.
  • Geodesic Semantic Distance: A replacement for cosine similarity that encodes the model's learned energy landscape, expected to outperform cosine on polysemy and cross-basin semantic cases. The geodesic distance is inherently asymmetric: dgeo(A,B)dgeo(B,A)d_{\text{geo}}(A,B) \neq d_{\text{geo}}(B,A); a symmetrised variant [d(AB)+d(BA)]/2[d(A \to B) + d(B \to A)]/2 is available when symmetry is desired.
  • Native Chain-of-Thought (via Fock extension): The Fock-PARFLM v2.1 extends this model with register-based native CoT — reasoning steps as Fock register waypoints on damped geodesics, with zero extra token generation. The diagnostic confirms Fock register dynamics are predominantly linear — Rfull20.83R^2_{\text{full}} \approx 0.83 (Arm 5), supporting the geodesic-waypoint interpretation.

The conservative constraint imposes a PPL cost relative to attention, but the price buys geometric structure and interpretability that attention-based architectures are structurally incapable of providing.

How to Get Started

# Clone the companion repository for full source code
# git clone https://github.com/dimitarpg13/semsimula-paper.git
# cd semsimula-paper/notebooks/conservative_arch

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

from parf.model_fock_parf_multixi import FockMultiXiPARFLM, FockMultiXiPARFConfig

config = FockMultiXiPARFConfig(
    vocab_size=50257,
    d=256,
    n_layers=8,
    v_hidden=1024,
    v_depth=3,
    max_len=1024,
    block_size=512,
    gamma=0.30,
    xi_channels=4,
    v_phi_kind="structural_competitive",
    v_phi_hidden=128,
    top_k=8,
    fock_version="v2",
    n_registers=16,
    register_d_k=64,
    register_tau_create_init=8.0,
    register_salience_decay=0.5,
    register_stack_discipline="lifo",
    use_reverse_channel=True,
)

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

# Forward pass
x = torch.randint(0, 50257, (1, 64))
logits, loss = model(x, targets=x)

Available Checkpoint

A trained checkpoint (PPL 9.30, 16k steps) is included in this repository:

File Description
checkpoint/model.pt Full model state dict (67 MB)
training_log.jsonl Per-step training metrics
loss_curve.png Training/validation loss plot
training_summary.md Hyperparameters and final metrics
register_diagnostics.png Fock register utilisation analysis
register_diagnostics.json Register statistics (JSON)

To load the checkpoint:

from huggingface_hub import hf_hub_download
import torch

# Download checkpoint
ckpt_path = hf_hub_download(
    repo_id="dimitarpg13/semsimula-fock-parflm",
    filename="checkpoint/model.pt",
)

# Load into model (after creating model as above)
state = torch.load(ckpt_path, map_location="cpu")
model.load_state_dict(state["model_state_dict"])
model.eval()

Training Details

Training Data

TinyStories -- GPT-2 BPE tokenization. Training cap: 5M tokens.

Training Procedure

Hyperparameter Value
Optimizer AdamW
Learning rate 5e-4 (cosine decay)
Warmup steps 400
Weight decay 0.01
Gradient clipping 1.0
Batch size 16
Block size 512
Training steps 16,000
Memory optimisation Level-2 grad checkpoint + Stage-1.5b gathered VϕV_\phi
Hardware A100/H100 (Google Colab)

Training Script

notebooks/conservative_arch/scaleup/train_fock_multixi_scaleup.py

Colab Notebook

notebooks/conservative_arch/scaleup/colab_fock_v21_routing_fix.ipynb — 5-arm B1/B2/B3 routing-fix ablation with live progress display, saves results to Google Drive.

Training Results

notebooks/conservative_arch/scaleup/results/semsimula_fock_v21_routing_fix/ — training logs, loss curves, register diagnostics, and experiment report.

PPL Progression (routing fix)

Variant Steps PPL Notes
v2.0 (no fix) 8k 14.21 Routing collapse
v2.0 (no fix) 16k 12.00 Partial recovery
v2.1 B1 only 16k 11.18 Per-register temperature
v2.1 B1+B2+B3 16k 9.30 Full routing fix

Evaluation Results

TinyStories Validation Perplexity

Model PPL Params Gap vs Attention
Matched Attention (baseline) 7.81 19.5M --
Hybrid SPLM+Attn 8.50 ~19.0M +0.69
Fock-PARFLM v2.1 (this model) 9.30 17.4M +1.49
Fock Attention 9.42 16.7M +1.61
Multi-Xi PARFLM 12.06 17.6M +4.25
Multi-Xi SPLM 11.51 16.5M +3.70

The Fock-PARFLM v2.1 is the best attention-free model in the family, narrowing the gap to matched attention to just 1.49 PPL. The residual gap is attributable to the conservative constraint itself -- the Fock registers provide O(1)O(1) inference memory while attention pays O(T)O(T).

SPLM Family Overview

This model is part of the Semantic Simulation SPLM family:

Model Design Inference HuggingFace
Multi-Xi SPLM Pure scalar potential, K-EMA context O(1)O(1) semsimula-splm-multixi
Hybrid SPLM+Attn Attention front-end + SPLM refinement O(T)O(T) semsimula-hybrid-splm
Multi-Xi PARFLM Scalar potential + sparse pairwise forces O(1)O(1) semsimula-parflm-multixi
Fock-PARFLM v2.1 PARFLM + Fock register pool (mediated exchange) O(1)O(1) this model
Fock Attention PARFLM + direct token-to-token exchange O(T2)O(T^2) semsimula-fock-attention

Bias, Risks, and Limitations

  • Research checkpoint only. Proof-of-concept for the Fock-space conservative language model.
  • TinyStories only. Trained exclusively on synthetic children's stories (~5M tokens).
  • English only. No multilingual capability.
  • Small scale. 17.4M parameters, 256-dim hidden states.
  • No safety training. No RLHF, DPO, or safety filtering has been applied.

Citation

@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/H100 (Google Colab)
  • Training time: ~10 hours (16,000 steps with gradient checkpointing)
  • Carbon footprint: Estimated < 3 kg CO2
Downloads last month
243
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train dimitarpg13/semsimula-fock-parflm

Collection including dimitarpg13/semsimula-fock-parflm

Evaluation results