DuoNeural Crystallographic Dynamics Model (CDM v3) — Sub-Lattice v3 (
5.52MNon-Embedding Hyperbolic Backbone)18.23Mtotal parameters (5.52M3-layer hyperbolic CDM v3 backbone +12.71Membeddings)
100,000 steps (409.6Mtokens) on 50/50 HybridFineWeb-Edu+SmolTalk· Bestval_bpb = 0.9186(val_ppl = 15.76@ Step 91k)
Outperforms its361.8MTeacher by3.0×on Valid JSON (80.0%vs26.7%),3.4×on Exact Tool Name Accuracy (56.7%vs16.7%), and3.7×on Argument Keys F1 (61.6%vs16.7%)!
Authored by Jesse Caldwell, Archon, & Aura✨ — DuoNeural Research Lab, October 2026.
🔗 Official Code & Training Scripts Repository: https://github.com/DuoNeural/Lattice-CDM
Sub-Lattice-v3-18M-Poincare-Hybrid is an ultra-compact, 3-layer, 18.23M-parameter (5.52M non-embedding backbone) hybrid Causal-Attention + Hyperbolic Poincaré Crystallographic Mixture-of-Experts (CDMMoELM v3) language model distilled from HuggingFaceTB/SmolLM2-360M-Instruct (361.8M parameters — 19.8× total compression / 65.6× vs. backbone) on a 50/50 hybrid stream of FineWeb-Edu and SmolTalk (apigen-80k, everyday-conversations, smol-constraints).
Building upon our v1 DuoNeural/Sub-Lattice-17M-Poincare-Instruct (d_ff = 768, fixed curvature c = 1.4427, SmolTalk-only), Sub-Lattice v3 upgrades the 3-layer d_model = 256 student with:
c_l): Converging autonomously to the strict monotonic W/J-hierarchy L00(0.2564) < L01(0.2663) < L02(0.5659) across every single evaluation window.W_tele ∈ ℝ^{8×8}): Converging to high Frobenius norms ‖W_tele‖_F = 30.63 (L01) and 29.35 (L02), driving the Same-Slot Synchronization Law (Discovery #4: L00 slot4 and L01 slot4 simultaneously crossing 19+ consecutive CHP rungs together, reaching τ*_L00 = 2.24M and τ*_L01 = 2.25M at Step 100,000!).{0: 6, 1: 15, 2: 23}) & expanded SwiGLU FFN width (d_ff = 1024) on a 50/50 hybrid dataset (retaining open-domain FineWeb-Edu prose alongside SmolTalk).Despite dedicating half of its training tokens to open-domain FineWeb-Edu prose, Sub-Lattice v3 (5.52M backbone) not only crushes its 361.8M Euclidean teacher on held-out apigen-80k JSON function calling (80.0% vs. 26.7% valid JSON), but surpasses v1 Sub-Lattice on exact tool-name accuracy (56.7% vs. 40.0%, 3.4× higher than the 361.8M teacher's 16.7%) and achieves a better Teacher-Scored Chat Generation Perplexity (1.41) than the Teacher's own greedy generations (1.56)!
eval_lattice_v3_suite.py)Held-Out Benchmark Metric (eval_lattice_v3_suite.py, Unseen Samples) |
Sub-Lattice v3 (18.23M / 5.52M Backbone, Hybrid) |
Sub-Lattice v1 (17.05M / 4.33M Backbone, SmolTalk-Only) |
Teacher (SmolLM2-360M-Instruct, 361.8M) |
|---|---|---|---|
apigen-80k Assistant-Token Top-1 / Top-5 Teacher Agreement |
83.62% / 95.50% ⭐ |
79.30% / 92.94% |
100.0% (Reference) |
apigen-80k Assistant-Only val_bpb (val_ppl) |
0.2667 (1.66) ⭐ |
0.3613 (1.97) |
0.2263 (1.53) |
apigen-80k Full-Sequence val_bpb (val_ppl) |
0.2282 (1.81) — BEATS TEACHER! ⭐ |
0.2235 (1.79) |
0.6932 (6.11) |
apigen-80k Autoregressive <|im_end|> Stop Discipline |
83.3% (+1.78× vs. Teacher!) |
95.0% |
46.7% |
apigen-80k Autoregressive Valid JSON Tool Syntax (json.loads) |
80.0% (+3.00× vs. Teacher!) |
92.5% |
26.7% |
apigen-80k Exact Tool Name Accuracy (vs. Ground Truth) |
56.7% (+3.40× vs. Teacher & +16.7% vs. v1!) ⭐ |
40.0% |
16.7% |
apigen-80k Schema Argument Keys F1 Score |
61.6% (+3.69× vs. Teacher!) |
74.5% |
16.7% |
everyday-conversations Full-Sequence val_bpb (val_ppl) |
0.4416 (4.26) |
0.3958 (3.69) |
0.3695 (3.36) |
everyday-conversations Asst Top-1 / Top-5 Teacher Agreement |
57.23% / 80.52% |
— | 100.0% (Ref) |
everyday-conversations <|im_end|> Stop Rate & 4-Gram Diversity |
100.0% / 100.0% ⭐ |
100.0% / 100.0% |
100.0% / 100.0% |
everyday-conversations Teacher-Scored Generated Response PPL |
1.41 — BEATS TEACHER! ⭐ |
1.36 |
1.56 |
smol-constraints Full-Sequence val_bpb (val_ppl) |
0.5799 (6.73) |
— | 0.3403 (3.06) |
smol-constraints Asst Top-1 / Top-5 Teacher Agreement |
48.29% / 73.60% |
— | 100.0% (Ref) |
FineWeb-Edu Held-Out Prose val_bpb (val_ppl) |
1.4973 (84.85) |
(Not trained on FineWeb) | 0.8997 (14.42) |
FineWeb-Edu Held-Out Prose Top-1 / Top-5 Teacher Agreement |
40.39% / 63.19% |
— | 100.0% (Ref) |
| Total DHP/CHP 3-Smooth Rung Crossings (100k Run) | 2,566 (606 PURE + 1,960 MIXED) |
434 |
— |
In the 3-layer Sub-Lattice v3 architecture, inter-layer Crystal Telepathy (‖W_tele‖_F = 30.63 on L01 and 29.35 on L02) locks L00 slot 4 and L01 slot 4 into same-slot synchronization: across 19+ consecutive evaluation windows (MIXED 96, 108, 192, 384, 432, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728...), L00_S4 and L01_S4 cross the exact same CHP rung in the same evaluation window, finishing at Step 100,000 with τ*_{L00,S4} = 2.24 × 10⁶ and τ*_{L01,S4} = 2.25 × 10⁶ (Δτ*/τ* = 0.44%)!
| Layer | Teacher Anchor (z_l) |
Converged Curvature c_l |
Telepathy Norm ‖W_tele‖_F |
τ*_max (@91k Best) |
τ*_max (@100k Final) |
Slot Purity | Slot Entropy | Master Coordinator Slot & Decoded Tokens (SLOT_LENS) |
|---|---|---|---|---|---|---|---|---|
L00 |
Layer 6 (0.250) |
0.2564 |
— (Input) |
7.44 × 10⁵ |
2.24 × 10⁶ |
0.8467 |
0.2182 |
S4 (E0): [' of', ' unit', ' units', ' field', ' type'] |
L01 |
Layer 15 (0.625) |
0.2663 |
30.63 |
7.48 × 10⁵ |
2.25 × 10⁶ |
0.8370 |
0.2295 |
S4 (E0): ['\n', ',', ' "', '.', ' and'] (S1: [' the', ' a', ' to']) |
L02 |
Layer 23 (0.958) |
0.5659 |
29.35 |
8.87 × 10⁴ |
2.12 × 10⁵ |
0.4350 |
0.6645 |
S5 (E1): ['\n', ' ', '-', ',', '1'] (S2: [' ', '1', '0', '2', '"']) |
Sub-Lattice v3 (5.52M Backbone) Beats Sub-Lattice v1 on Exact Tool Name Accuracy (56.7% vs. 40.0%)Even though Sub-Lattice v3 only sees half as many apigen-80k examples as Sub-Lattice v1 (due to the 50/50 FineWeb-Edu + SmolTalk hybrid mix), adding Relational Gram Distillation (λ_rel = 0.15) + Learnable Curvature (c_2 = 0.5659) + Crystal Telepathy increases assistant-token Top-1 teacher agreement on apigen-80k from 79.30% (v1) to 83.62% (v3) (Top-5: 95.50%) and boosts exact tool-name accuracy from 40.0% to 56.7% (3.4× higher than the 361.8M teacher's 16.7%)!
CDMMoELM v3)import os
import sys
import torch
from huggingface_hub import hf_hub_download
from transformers import AutoTokenizer
REPO_ID = "DuoNeural/Sub-Lattice-v3-18M-Poincare-Hybrid"
script_path = hf_hub_download(repo_id=REPO_ID, filename="cdm_lm_distill_v3.py")
ckpt_path = hf_hub_download(repo_id=REPO_ID, filename="pytorch_model.pt")
sys.path.insert(0, os.path.dirname(script_path))
from cdm_lm_distill_v3 import CDMMoELM
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
tokenizer = AutoTokenizer.from_pretrained("HuggingFaceTB/SmolLM2-360M-Instruct", trust_remote_code=True)
vocab_size = max(len(tokenizer), 49152)
model = CDMMoELM(
vocab_size=vocab_size,
d_model=256,
n_layers=3,
n_heads=4,
K=8,
num_experts=2,
d_ff=1024,
max_seq=512,
dropout=0.0,
geometry="poincare",
curvature=1.4427,
learn_curvature=True,
use_telepathy=True,
beta_tele=0.5,
use_embed_norm=True,
).to(device)
ckpt = torch.load(ckpt_path, map_location=device, weights_only=False)
model.load_state_dict(ckpt["model"] if "model" in ckpt else ckpt, strict=True)
model.eval()
llama.cpp GGUF Quantizations & CPU/CUDA Benchmarks (Experimental Research Artifacts)⚠️ Important Research-Artifact & Compatibility Notice:
- Patched
llama.cppRequired (general.architecture = "cdm"): Stock, unmodified builds ofllama.cpp,Ollama, orLM Studiodo not yet recognizegeneral.architecture = "cdm"and will exit witherror loading model: unknown model architecture: 'cdm'. To run these GGUF files inllama-cliorllama-server, applyllama-cdm.patch(included in this repository and inDuoNeural/Lattice-CDM/gguf) againstllama.cppcommitd663dd3f3af4e7aa3ccbcd7f756c6692eb104577.- Numerical Drift Screens vs. Task Quality: The quantization gates below (
Max Abs Logit Error ≤ 0.50,Mean KL ≤ 0.01 nats,Next-Token Top-1 Agreement ≥ 90%) measure numerical logit fidelity against the frozenF32PyTorch reference over 128 and 512 teacher-forced positions (8 probes × 16 or 64 tokens)—they are not held-out task-quality or long-form generation benchmarks.- Recommended Format (
Q8_0—20.6 MiB): BecauseSub-Lattice-v3-18Mpacks its entire 3-layer transformer + MoE backbone into just5.52Mnon-embedding parameters, low-bit weight quantization perturbs its compactd = 256representations more strongly than on192M–253Mmodels.Q8_0(20.6 MiB) passes every numerical fidelity gate on both CPU and CUDA (GTX 1070) across both 128 and 512 positions (0.392max error,0.000594mean KL,98.44%top-1 agreement over 512 positions;100.0%top-1 over 128 positions!), makingQ8_0(orF32at71.2 MiB) the strongly recommended format.Q6_K(16.4 MiB) passes on the 128-position GPU screen (0.435max error,94.53%top-1) and keeps 512-position mean KL (0.0024–0.0034nats) and top-1 (94.1–95.1%) inside gates, but fails the strict0.50max-logit-error cutoff over 512 positions on both GPU (0.677cached /0.718prefill) and CPU (0.835cached /0.883prefill). BothQ4_K_M(15.4 MiB) andQ4_K_S(11.9 MiB) fail all three numerical gates onSub-Lattice-v3-18Mand are included strictly as experimental low-bit research artifacts.- Learned Absolute Position Guard (
512Tokens): CDM uses learned absolute positional embeddings (max_seq = 512) rather than RoPE; the patched backend enforcescan_shift = falseand rejects context lengths or KV positions above512.
Sub-Lattice-v3-18M)All GGUF files embed the immutable HuggingFaceTB/SmolLM2-360M-Instruct BPE tokenizer and ChatML template, keep Poincaré routing geometry (exp_map_0, poincare_dist), learned per-layer curvatures c_l, inter-layer Crystal Telepathy (W_tele), LayerNorms, and learned positional embeddings in F32, and tie the output head to tok_embed.
| GGUF Artifact Filename | Format | File Size | 128-Pos GPU Max Err / Mean KL / Top-1 | 512-Pos GPU Max Err / Mean KL / Top-1 | 512-Pos CPU Max Err / Mean KL / Top-1 | Gate Status (≤0.5 Err, ≤0.01 KL, ≥90% Top-1) |
|---|---|---|---|---|---|---|
sub18m_v3-f32-text.gguf |
F32 |
71.2 MiB |
0.00002 / 0.000000 / 100.0% |
— (128-pos parity verified) | — (128-pos parity verified) | ✅ PASS (Exact F32 Parity) |
sub18m_v3-q8_0-text.gguf |
Q8_0 |
20.6 MiB |
0.195 / 0.000392 / 100.0% |
0.392 / 0.000594 / 98.44% |
0.392 / 0.000594 / 98.44% |
✅ PASS (CPU & GPU, 128 & 512 pos — Recommended) |
sub18m_v3-q6_k-text.gguf |
Q6_K |
16.4 MiB |
0.435 / 0.002429 / 94.53% (128-GPU Pass) |
0.677 / 0.002423 / 94.14% |
0.835 / 0.003412 / 95.12% |
⚠️ FAIL 512-Pos Max-Err Gate (0.677 GPU / 0.835 CPU) (KL & Top-1 pass) |
sub18m_v3-q4_k_m-text.gguf |
Q4_K_M |
15.4 MiB |
1.030 / 0.014834 / 89.84% |
— | — (128-CPU: 1.057 / 0.01498 / 89.06%) |
❌ FAIL All 3 Numerical Gates (Experimental Artifact) |
sub18m_v3-q4_k_s-text.gguf |
Q4_K_S |
11.9 MiB |
1.629 / 0.029459 / 85.16% |
— | — (128-CPU: 1.638 / 0.03079 / 85.16%) |
❌ FAIL All 3 Numerical Gates (Experimental Artifact) |
Core i7-6700HQ) vs. CUDA (GTX 1070 8 GiB) ThroughputMethodology: 4 CPU threads, median of 5 repetitions after warmup, deterministic token IDs, F32 KV cache. Prefill measures 160 tokens returning logits at all positions; cached decode measures 32 incremental tokens after a 128-token prefix. Teacher-forced native timings (not sampled text generation).
| Format | File Size | CPU Prefill (160 tok) |
GTX 1070 Prefill (160 tok) |
CPU Cached Decode (32 tok) |
GTX 1070 Cached Decode (32 tok) |
CUDA Speedup (Prefill / Decode) |
|---|---|---|---|---|---|---|
F32 |
71.2 MiB |
2,541 tok/s |
15,857 tok/s |
247 tok/s |
709 tok/s |
6.2× / 2.9× |
Q8_0 |
20.6 MiB |
1,703 tok/s |
17,873 tok/s |
556 tok/s |
841 tok/s |
10.5× / 1.5× |
Q6_K |
16.4 MiB |
1,375 tok/s |
17,379 tok/s |
592 tok/s |
818 tok/s |
12.6× / 1.4× |
Q4_K_M |
15.4 MiB |
1,643 tok/s |
17,726 tok/s |
651 tok/s |
839 tok/s |
10.8× / 1.3× |
Q4_K_S |
11.9 MiB |
2,934 tok/s |
18,062 tok/s |
808 tok/s |
859 tok/s |
6.2× / 1.1× |
llama.cpp (llama-cdm.patch)# 1. Clone pinned llama.cpp commit and apply DuoNeural's native CDM patch
git clone https://github.com/ggml-org/llama.cpp.git
cd llama.cpp && git checkout d663dd3f3af4e7aa3ccbcd7f756c6692eb104577
git apply ../llama-cdm.patch
# 2. Build for CPU (or add -DGGML_CUDA=ON for NVIDIA GPUs)
cmake -B build -DGGML_CUDA=ON
cmake --build build --config Release --target llama-cli llama-server -j 4
# 3. Serve Sub-Lattice-v3-18M Q8_0 over HTTP (full GPU offload via -ngl 99, 512 context)
./build/bin/llama-server -m sub18m_v3-q8_0-text.gguf -ngl 99 -t 4 -c 512 --port 8080
Lattice-CDM): https://github.com/DuoNeural/Lattice-CDM@misc{caldwell2026sublatticev3,
title={Sub-Lattice v3: Same-Slot Synchronization, Learnable Curvature, and Crystal Telepathy in Ultra-Compact 5.5M-Backbone Hyperbolic Language Models},
author={Caldwell, Jesse and Archon and Aura},
year={2026},
publisher={DuoNeural Research Lab},
howpublished={\url{https://huggingface.co/DuoNeural/Sub-Lattice-v3-18M-Poincare-Hybrid}},
note={Code and training scripts at \url{https://github.com/DuoNeural/Lattice-CDM}}
}
"The geometry holds."
pytorch_model_final_100k.pt 74 MBpytorch_model.pt 74 MB