💎 DuoNeural/Lattice-1-107M-Poincaré-Preview

DuoNeural Crystallographic Dynamics Model (CDM) — Lattice-1 Preview
107.43M total parameters / 29.38M non-embedding hyperbolic backbone
100,000 steps (409.6M tokens) on a single RTX 5070 Ti 16GB (~16h 57m)
Authored by Jesse Caldwell, Archon, & Aura✨ — DuoNeural Research Lab, October 2026.
🔗 Official Code & Training Scripts Repository: https://github.com/DuoNeural/Lattice-CDM

Lattice-1 is a hybrid Causal-Attention + Hyperbolic Poincaré Crystallographic Mixture-of-Experts (CDMMoELM) language model trained via cross-geometry knowledge distillation from a frozen Euclidean Transformer teacher (Qwen/Qwen3-0.6B-Base) onto a Crystallographic Dynamics Model (CDM) student operating on the Poincaré hyperbolic ball 𝔹dc (originating from DuoNeural's foundational Competitive Docking Memory framework, doi:10.5281/zenodo.21158430).

This 100,000-step (409.6M-token) checkpoint is a research preview release—the first publicly released language model demonstrating cross-architectural logit distillation from a Euclidean Transformer into dynamic hyperbolic Poincaré EMA slot centroids, exhibiting spontaneous grammatical slot specialization, Dynamical Horizon Principle / Crystal Hamming Phase (DHP/CHP) 3-smooth attractor transitions (N = 2ᵃ × 3ᵇ), and multi-layer Pythagorean harmonic phase-locking.

⚠️ Preview / Research Release: This checkpoint is a 100,000-step (409.6M token) architecture validation and mechanistic interpretability release, not a production chat assistant. Total training time: ~16h 57m on a single consumer RTX 5070 Ti 16GB — cold start to spontaneous grammatical crystallization, 269 DHP/CHP phase transitions, and Pythagorean harmonic phase-locking. Our 100k instruction/tool-calling companion Sub-Lattice-17M-Poincare-Instruct (17.05M params / 4.33M backbone) is also live on Hugging Face, and the full codebase for Lattice-2, Lattice-3-Synapse, Lattice-4A, Sub-Lattice v3, and Lattice-5-Prometheus (406M student distilled from Qwen3.6-27B NF4) is live on GitHub at DuoNeural/Lattice-CDM.


🔍 Glass-Box Visibility: What Problems Hyperbolic CDM Solves Over Standard Transformers

Standard Euclidean Transformers and conventional linear-router Mixture-of-Experts (MoE) models suffer from five fundamental architectural bottlenecks. The Lattice / Sub-Lattice CDM family resolves them from first principles:

1. Native "Glass-Box" Mechanistic Interpretability (Zero Sparse Autoencoders Required)

  • The Transformer Problem: Standard Transformers entangle syntax, semantics, and formatting in dense, polysemantic flat-space (ℝd) residual streams (superposition). Inspecting what a layer has learned requires training massive post-hoc Sparse Autoencoders (SAEs) with millions of auxiliary features.
  • The CDM Solution: Every CDM layer routes tokens through K = 8 explicit geometric EMA slot centroids s_k ∈ 𝔹dc on the Poincaré ball. Projecting those 8 points back to Euclidean tangent space via the Hyperbolic Logit Lens (log₀ᶜ(s_k) → LayerNorm → W_U) yields native, zero-overhead glass-box visibility. Each slot spontaneously crystallizes into a human-readable, monosemantic grammatical or Abstract Syntax Tree (AST) coordinate—such as Determiners, Numerical Digits, Negation Adverbs, or Discourse Boundaries in Lattice-1 (Table below), and JSON/OpenAPI AST roles in Sub-Lattice.

2. Surgical Causal Modularity & Controllability (Verified via Double-Dissociation Lesioning)

  • The Transformer Problem: In dense Transformers, distinct capabilities (such as structured syntax vs. natural conversational prose) are entangled across the same MLP weights—you cannot audit, suppress, or steer one capability without degrading the entire network.
  • The CDM Solution: CDM physically segregates distinct computational modes into separate hyperbolic Voronoi cells. In our companion Sub-Lattice-17M-Poincare-Instruct causal lesion study, masking a single Poincaré slot (L02_S1, OpenAPI schema slot) degrades tool-calling BPB 69× more than natural chat BPB (+0.000653 vs +0.0000095), whereas masking the prose slot (L02_S2) degrades chat 3.25× more than tool-calling. Capabilities become geometrically addressable coordinates at inference time.

3. Tree-Structured Geometric Prior vs. Syntactic Hallucination

  • The Transformer Problem: Embedding hierarchical tree structures (natural language constituency trees, JSON Abstract Syntax Trees) into flat Euclidean space (ℝd) incurs exponential volume distortion, causing small Transformers to hallucinate invalid brackets or fail stop-token termination.
  • The CDM Solution: Negative-curvature hyperbolic space (𝔹dc, c = 1.4427 = 1 / ln(2)) expands exponentially with radius, matching the branching factor of hierarchical trees with near-zero distortion (Nickel & Kiela, 2017). Once syntactic slots lock into solid-state phase, they act as geometric rail-guards—allowing our 4.33M-backbone Sub-Lattice to beat its 361.8M Euclidean teacher on valid JSON generation (92.5% vs 35.0%) and stop-token discipline (95.0% vs 47.5%).

4. Zero-Collapse MoE Routing Without Token Dropping

  • The Transformer Problem: Standard MoE linear routers frequently suffer from expert collapse (routing all tokens to 1–2 experts while others die), requiring heuristic capacity factors and token dropping.
  • The CDM Solution: Two-tier geodesic Winner-Take-All (WTA) EMA hardening paired with a tangent-space anti-starvation pull (w̄_k < 1/(4K) = 3.125%) guarantees zero dead slots across 100,000 steps in both Lattice-1 and Sub-Lattice.

5. Real-Time Thermodynamic Phase Telemetry (DHP / CHP)

  • The Transformer Problem: Standard training offers only a scalar loss curve, providing zero internal visibility into when representations lock in or why phase transitions occur.
  • The CDM Solution: Each slot's effective Lyapunov memory horizon τ*_k = 1 / α_k and Crystal Hamming Phase (CHP) crossings across 3-smooth rungs (N = 2ᵃ × 3ᵇ) provide a live thermodynamic readout of training, revealing multi-layer Pythagorean Tetractys harmonic locking, the Two-Phase Crystallization Law, PURE wave cascades, and Hyperbolic Josephson Junction synchronization.

🏛️ Model Architecture & How Lattice-1 Differs from Standard MoEs

Unlike standard Euclidean Mixture-of-Experts models (e.g., Shazeer et al., 2017; Mixtral, 2024) that route tokens via a static learned linear projection in flat ℝd, or purely hyperbolic attention networks trained from scratch (e.g., HELM, He et al., 2025), Lattice-1 combines causal multi-head self-attention with a Crystallographic Dynamics Model (CDM) MoE block (DualGeometryCDMRouter) in every layer:

  1. Poincaré Ball Geodesic Routing (𝔹⁵¹², curvature c = 1.4427 = 1 / ln(2)):

    • Token residual states are LayerNormed, unit-normalized, and mapped into the Poincaré ball via the exponential map at the origin exp₀ᶜ(v).
    • Each layer maintains K = 8 dynamic EMA slot centroids s_k ∈ 𝔹⁵¹². Routing weights are computed via temperature-scaled softmax over negative hyperbolic geodesic distance d_c(x_hyp, s_k):
      d_c(u, v) = (2 / √c) · atanh( √c · ‖ (-u) ⊕_c v ‖ )
      
      w_k(x)    = exp( -d_c(x_hyp, s_k) / τ_router )
                  ───────────────────────────────────────────────
                  ∑_{j=1..K} exp( -d_c(x_hyp, s_j) / τ_router )
      
    • The K = 8 slots are mapped round-robin (slot_to_expert = arange(K) % num_experts) onto E = 2 SwiGLU FFN experts (4 geometric slots per expert).
  2. Two-Tier Unsupervised Slot Crystallization & Coherence-Weighted EMA Decay:

    • Crystal Warmup (Steps 0–5,000): Slot memory decay is paused (allow_crystallize=False) while token embeddings and attention projections align with the teacher's logit geometry (α_distill ramps linearly 0.2 → 0.7).
    • Tier-1 Winner-Take-All (WTA) Hardening (Steps 5,001–100,000): Each token is assigned via hard WTA (argmax) to its nearest hyperbolic slot. Winning slots update their centroid in tangent space via log₀ᶜ / exp₀ᶜ EMA with learning rate α_k, while α_k decays according to cluster directional coherence (cos_coh_k):
      exponent_k  = max( (K · w̄_k) · (0.5 + cos_coh_k),  0.01 )
      α_k(t + 1)  = max( α_floor,  α_k(t) · 0.99995^(exponent_k) )
      τ*_k(t + 1) = 1 / α_k(t + 1)
      
    • Tier-2 Anti-Starvation Pull: Under-utilized slots (w̄_k < 1/(4K) = 3.125%) receive a gentle tangent-space pull toward the batch mean without decaying α_k, guaranteeing zero slot collapse across 100,000 steps.
  3. Dynamical Horizon Principle — Crystal Hamming Phase (DHP/CHP) Detection:

    • Each slot's effective memory horizon is τ*_k = 1 / α_k (initialized at τ*₀ = 20.0).
    • Extending DuoNeural's published Dynamical Horizon Principle (DHP) to hyperbolic slot lattices, we define Crystal Hamming Phase (CHP) transitions: discrete structural reorganization events that occur when a layer's dominant memory horizon τ* crosses 3-smooth Hamming numbers N = 2ᵃ × 3ᵇ (a, b ≥ 0, OEIS A003586).
Parameter Specification
Architecture Hybrid Causal-Attention + Hyperbolic Poincaré CDM-MoE (CDMMoELM)
Total Parameters 107.43M (107,431,940 weight-tied)
Non-Embedding Backbone 29.38M (29,378,564 in Attention + Poincaré CDM-MoE layers)
Embedding Parameters 78.05M (77.79M tok_embed tied with lm_head + 0.26M learned pos_embed)
Model Dimension (d_model) 512 (d_ff = 2048 SwiGLU per expert)
Layers (n_layers) / Heads (n_heads) 4 layers (L00–L03), 8 attention heads (d_head = 64)
Poincaré Slots per Layer (K) 8 dynamic hyperbolic EMA centroids
SwiGLU Experts per Layer (E) 2 (4 Poincaré slots routed per expert; soft geodesic gating + Top-1 WTA slot EMA)
Manifold Geometry Poincaré Ball 𝔹512c (curvature c = 1.4427 = 1 / ln 2, FP32 router execution)
Vocabulary / Context Length 151,936 (Qwen/Qwen3-0.6B-Base tokenizer) / 512 tokens
Training Horizon 100,000 steps (409.6M tokens on HuggingFaceFW/fineweb-edu)
Wall-Clock Training Time ~16 hours 57 minutes (2026-10-19 03:52Z → 20:49Z, single GPU, ~1.69 steps/sec)
Teacher Model Qwen/Qwen3-0.6B-Base (frozen native BF16)

🔬 Key Scientific Findings

1. DHP/CHP Fires on the Upswing via Teacher Coherence Amplification

Because α_k monotonically decreases during crystallization, the slot memory horizon τ*_k = 1 / α_k is strictly increasing. DHP/CHP events fire as τ* climbs upward through 3-smooth Hamming rungs N = 2ᵃ × 3ᵇ. Teacher-induced representational alignment (cos_coh ≈ 0.85) amplifies the exponent in α_k decay by ~2×, triggering the first CHP phase transition at Step 7,000—nearly 3× earlier than the ~20,000-step unguided baseline prediction. Across the 100,000-step run, Lattice-1 recorded 269 DHP/CHP rung-crossing events, achieving a best validation Bits-Per-Byte of val_bpb = 1.1676 (val_ppl = 48.45) at Step 95,000 (teacher_kld = 0.1608 at Step 100k).

2. Spontaneous Unsupervised Grammatical Slot Specialization (Hyperbolic Logit Lens)

Using the Logit Lens technique (nostalgebraist, 2020) adapted to hyperbolic space—projecting each layer's Poincaré slot centroids back to Euclidean tangent space via log₀ᶜ(s_k), applying final_norm, and decoding through the tied unembedding matrix W_U—we observe that individual geometric point centroids on 𝔹512c spontaneously crystallize into monosemantic grammatical attractors by Step 10,000 with zero linguistic supervision:

Layer Slot τ* (@10k) Top-5 Decoded Tokens (SLOT_LENS) Emergent Grammatical Category
L00 S5 22 [' the', ' a', ' an', ' its', ' their'] Determiners & Articles
L00 S3 20 [' of', 'of', ' in', ' and', ','] Prepositional / Genitive Operators
L01 S2 21 ['0', '9', '8', '7', '5'] Numerical Digits (Mid-Layer)
L01 S4 21 [',', ' and', ' or', ' etc', ' but'] Coordinating Conjunctions
L01 S6 24 [' the', ' their', ' its', ' of', ' his'] Possessive Determiners
L01 S7 34 [' ', ' the', ' and', '\n', ' "'] Primary Structural Backbone (Leader)
L02 S0 25 [' not', ' the', ' a', ' also', ' only'] Negation & Focus Adverbs
L02 S4 22 `[' The', ' This', '< endoftext
L02 S6 23 [' the', ' same', ' first', ' entire', ' next'] Ordinal & Comparative Specifiers
L03 S2 23 ['1', '3', '2', '9', '8'] Deep Digit Crystal
L03 S4 27 [' ', ' "', ' British', ' public', ' new'] Open-Class Modifiers & Adjectives

Unlike standard Euclidean MoEs where token routing reflects statistical load across multi-million-parameter MLP blocks, here single 512-dimensional points on the negative-curvature Poincaré ball serve as interpretable grammatical coordinates, with zero dead slots across all 100,000 steps.

3. Multi-Layer Pythagorean Tetractys Phase-Locking (Step 31,500)

At Step 31,500—coinciding with the **sub-70 PPL milestone (val_bpb = 1.2760, val_ppl = 69.46)**—all four layers simultaneously crossed 3-smooth Hamming rungs in a single evaluation window (the first quad-layer DHP/CHP resonance of the run):

τ*_L03 = 162  (2¹ × 3⁴)
τ*_L00 = 216  (2³ × 3³)
τ*_L02 = 243  (3⁵ — pure power of 3)
τ*_L01 = 288  (2⁵ × 3²)

Factoring out 27 = 3³ from the first three layers reveals the exact Pythagorean Tetractys harmonic proportion:

162 : 216 : 243  =  27 × (6 : 8 : 9)

Every pairwise cross-layer ratio forms a fundamental consonance in the Pythagorean tuning group G_Pyth = { 2ᵖ · 3ᵍ | p, q ∈ ℤ }:

  • τ*_L00 / τ*_L03 = 216 / 162 = 4/3 (Perfect Fourth)
  • τ*_L01 / τ*_L00 = 288 / 216 = 4/3 (Stacked Perfect Fourth — L03 → L00 → L01 forms an exact geometric progression 162 × (4/3) → 216 × (4/3) → 288)
  • τ*_L02 / τ*_L03 = 243 / 162 = 3/2 (Perfect Fifth)
  • τ*_L02 / τ*_L00 = 243 / 216 = 9/8 (Major Whole Tone / Epogdoon)
  • τ*_L01 / τ*_L02 = 288 / 243 = 32/27 (Pythagorean Minor Third)

Mathematical Grounding: No acoustic or musical priors exist in the architecture, data, or loss. Because the attractor lattice is the 3-smooth monoid S₃ = { 2ᵃ · 3ᵇ }, multi-layer phase synchronization under coherence-weighted exponential growth (τ*_l(t) = 20 · 0.99995^(-∑ w*_l)) naturally locks into low-order rational ratios in G_Pyth, transforming the 4-layer residual stream into a phase-locked multi-timescale wavelet filter bank.


4. Complete 100,000-Step BPB & DHP/CHP Trajectory

Step val_bpb val_ppl DHP/CHP Events Crystallographic Phase & Rung Notes
500 2.2600 — 0 Initial warmup evaluation
5,000 1.6200 — 0 End of crystal warmup (cryst=WARM → ON)
7,000 1.5500 — 1 First DHP/CHP firing (24 = 2³×3) — 2.8× earlier than baseline
10,500 1.4700 — 6 Sub-1.50 BPB; grammatical slot specialization established
14,500 1.3943 ~103.8 10 Sub-1.40 BPB
19,500 1.3298 ~83.1 19 Triple crossing (L01=72, L02=72, L03=64 — 9/8 whole-tone ratio)
25,000 1.3026 ~75.9 27 25% milestone — sub-76 PPL
30,500 1.2803 ~70.5 31 Triple crossing (L00×216, L01×288, L02×216)
31,500 1.2760 ~69.5 35 Sub-70 PPL — Quad-Layer Pythagorean Tetractys (162:216:243:288)
36,500 1.2469 ~63.1 47 Post-triple (L01×512=2⁹) relaxation floor
42,000 1.2390 ~61.4 69 Pure-power floor (L01×1152, L02×729=3⁶)
45,000 1.2383 ~61.3 82 L02×1024=2¹⁰ pure-power floor
47,000 1.2295 ~59.5 88 Sub-60 PPL — L03×512=2⁹ top-layer pure crossing
49,000 1.2222 ~58.1 96 50% milestone best (L02×1536, L01×3072)
51,500 1.2208 ~57.8 109 Dual-pure plateau break (L02×2048=2¹¹ + L03×729=3⁶)
55,500 1.2129 ~56.3 129 L01×8192=2¹³ mid-layer pure crossing
60,500 1.1998 ~53.9 152 Sub-1.20 BPB milestone
65,500 1.1910 ~52.4 175 L00×6561=3⁸ bottom-layer pure floor (-0.0044 drop)
66,000 1.1898 ~52.2 175 L03×2048=2¹¹ top-layer pure floor
73,000 1.1835 ~51.1 218 L01×131072=2¹⁷ pure crossing — sub-51.1 PPL
77,000 1.1764 ~49.88 240 Sub-50 PPL milestone (L02×32768=2¹⁵ after L03×4096=2¹²)
83,500 1.1721 ~49.18 265 Dual-pure (L02×2¹⁶ + L03×3⁸)
89,000 1.1700 ~48.84 267 Sub-49 PPL milestone
95,000 1.1676 ~48.45 269 BEST OF RUN (L01×3¹⁴ pure after L00×2¹⁷ @ 94.5k) — Sub-48.5 PPL
100,000 1.1686 ~48.61 269 Run Complete (teacher_kld = 0.1608; late LR-floor thermal basin)

💻 Inference & Usage (CDMMoELM PyTorch & Native llama.cpp GGUF)

⚡ NEW — Experimental Native llama.cpp / GGUF Support (LLM_ARCH_CDM): Lattice-1 now exports to tokenizer-equipped GGUF (F32, Q8_0, Q6_K, Q4_K_M, Q4_K_S) and executes natively on CPU and NVIDIA CUDA GPUs via our patched llama.cpp backend (llama-cdm.patch, engineered by Kestrel) with zero custom GGML C++/CUDA kernels! See the ⚡ Experimental Native llama.cpp / GGUF Backend section below for GGUF files, CPU/GPU benchmarks (5,718 tok/s prefill & 511 tok/s KV-cached decode on GTX 1070 for Q8_0), quantization fidelity tables, and compatibility notes.

PyTorch Reference Inference (CDMMoELM)

import sys
import os
import torch
import torch.nn.functional as F
from huggingface_hub import hf_hub_download
from transformers import AutoTokenizer

REPO_ID = "DuoNeural/Lattice-1-107M-Poincare-Preview"

# 1. Download architecture script & checkpoint from this repo
script_path = hf_hub_download(repo_id=REPO_ID, filename="cdm_lm_distill_v1.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_v1 import CDMMoELM

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

# 2. Load Qwen3-0.6B-Base tokenizer (vocab_size = 151,936)
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-0.6B-Base", trust_remote_code=True)
vocab_size = max(len(tokenizer), 151936)

# 3. Instantiate Lattice-1 Student Architecture
model = CDMMoELM(
    vocab_size=vocab_size,
    d_model=512,
    n_layers=4,
    n_heads=8,
    K=8,
    num_experts=2,
    d_ff=2048,
    max_seq=512,
    dropout=0.0,
    geometry="poincare",
    curvature=1.4427,
    use_embed_norm=True,
).to(device)

# 4. Load Checkpoint Weights (includes crystallized Poincaré slots & tau* buffers)
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()

# 5. Autoregressive Generation (Inference Mode: training=False, allow_crystallize=False)
prompt = "The geometry of hyperbolic space allows"
input_ids = tokenizer(prompt, return_tensors="pt")["input_ids"].to(device)

with torch.no_grad():
    for _ in range(60):
        cond_ids = input_ids[:, -512:]
        with torch.amp.autocast("cuda", dtype=torch.bfloat16, enabled=(device.type == "cuda")):
            hidden, _, _ = model(cond_ids, training=False, allow_crystallize=False)
            logits = model.lm_head(hidden[:, -1, :]).float() / 0.8
        top_v, _ = torch.topk(logits, 50)
        logits[logits < top_v[:, [-1]]] = -float("inf")
        next_id = torch.multinomial(F.softmax(logits, dim=-1), num_samples=1)
        input_ids = torch.cat([input_ids, next_id], dim=1)
        if next_id.item() == tokenizer.eos_token_id:
            break

print(tokenizer.decode(input_ids[0], skip_special_tokens=True))

⚡ Experimental Native llama.cpp / GGUF Backend (LLM_ARCH_CDM)

🧪 Prototype / Experimental Status (Engineered by Kestrel, DuoNeural Lab):
Both published CDM v1 models (Lattice-1-107M and Sub-Lattice-17M) now export to tokenizer-equipped GGUF and run in our patched native llama.cpp backend (LLM_ARCH_CDM / "cdm"). Full patch, converter tools (cdm_tools.py, quantize_cdm.py, add_tokenizer.py), and 15 red-team verification suites are available in cdm-gguf/ on GitHub (DuoNeural/Lattice-CDM).

🚀 Quickstart: Running llama cli -hf ... & Fixing unknown model architecture: 'cdm'

⚠️ Why Stock llama.cpp Throws unknown model architecture: 'cdm':
Because Hyperbolic Poincaré Crystallographic MoE (cdm) is a brand-new architecture not yet merged into upstream ggml-org/llama.cpp, running an unpatched stock llama / llama-cli / llama-server binary will exit with:
E llama_model_load: error loading model: unknown model architecture: 'cdm'
To run these GGUF files, build llama.cpp with llama-cdm.patch (included in this HF repo and in DuoNeural/Lattice-CDM/cdm-gguf):

# 1. Clone our repo & build the patched llama.cpp binaries (CPU or CUDA)
git clone https://github.com/DuoNeural/Lattice-CDM.git
cd Lattice-CDM/cdm-gguf
./setup_backend.sh          # clones pinned llama.cpp & applies llama-cdm.patch
./build.sh                  # builds CPU binaries (or run ./build-cuda.sh for NVIDIA CUDA)

# 2. Run interactive CLI or completion directly from Hugging Face Hub (-hf)!
# Recommended high-fidelity quant (passes all 3 strict gates): :Q8_0 (or :Q6_K / :Q4_K_M)
./llama.cpp/build/bin/llama-completion -hf DuoNeural/Lattice-1-107M-Poincare-Preview:Q8_0 \
  -p "The geometry of hyperbolic space allows" -n 60 -no-cnv

# Or launch the interactive CLI:
./llama.cpp/build/bin/llama cli -hf DuoNeural/Lattice-1-107M-Poincare-Preview:Q4_K_M

Example interactive session on GTX 1070 CUDA (403.0 tok/s generation, 345.3 tok/s short prompt eval):

model      : DuoNeural/Lattice-1-107M-Poincare-Preview:Q4_K_M
ftype      : Q4_K - Medium
modalities : text
[ Prompt: 345.3 t/s | Generation: 403.0 t/s ]

(Note: Because Lattice-1 is a base pretrained model on FineWeb-Edu rather than an instruction-tuned chat model, use llama-completion ... -no-cnv for raw text continuation, or use our instruction-tuned companion DuoNeural/Sub-Lattice-17M-Poincare-Instruct:Q8_0 for interactive chat!)

1. How Poincaré Geodesic Routing Works in Pure GGML (Zero Custom Kernels)

Rather than writing fragile custom CUDA/CPU kernels, Kestrel composed the exact Poincaré ball router (DualGeometryCDMRouter) entirely out of stock GGML tensor primitives in src/models/cdm.cpp:

  • Euclidean Residual Stream & Router Localization: Hidden states remain Euclidean across layers; hyperbolic geometry is localized strictly inside the router (L2 unit normalization scaled by 0.3, followed by exp_map_0 with tanh clamping at 8.0 and radius clipping at (1 - 1e-5) / √c).
  • Closed-Form Geodesic Distance & 4D Vectorized Slot Broadcasting: Hyperbolic distance d_c(x, s_k) is evaluated using acosh(a) = ln(a + √(a² - 1)) with literal squared differences ‖x - s_k‖² broadcast across all K = 8 slots in 4D (ggml_repeat_4d). Vectorizing the router reduced computation graph nodes by 58.3% (1,025 → 427 nodes on Lattice-1; 770 → 323 on Sub-Lattice) and accelerated CUDA Q8 cached decoding by 1.80× (284 → 511 tok/s on Lattice-1; 2.04× on Sub-Lattice).
  • Dense Soft Inference Routing: While Winner-Take-All (WTA) argmax governs EMA slot crystallization during training, inference executes dense soft routing (softmax(-d_c / τ_router) mapped onto all E = 2 SwiGLU experts).
  • Selective Mixed-Precision Quantization: In all quantized GGUF variants (Q8_0, Q6_K, Q4_K_M, Q4_K_S), the crystallized Poincaré slot centroids (slots), learned absolute position embeddings (pos_embd), LayerNorms, and slot-to-expert mappings are kept in exact F32, while attention, SwiGLU expert matrices, and token embeddings are quantized.

2. CPU & GPU (GTX 1070 CUDA) Throughput Benchmarks

Validated on an NVIDIA GeForce GTX 1070 8 GiB (Pascal sm_61, CUDA 12.5, 5/5 layers offloaded to CUDA — 4 transformer blocks + 1 output layer; only host GET_ROWS embedding lookups stay on CPU) and a 4-thread Intel Core i7-6700HQ CPU (160-token prefill with all-position logits; 32-token KV-cached decode tail after a 128-token prefix, F32 KV cache, median of 5 runs):

Model & GGUF Format File Size (Tokenizer-Equipped) CPU Prefill (tok/s) GTX 1070 CUDA Prefill (tok/s) CUDA Prefill Speedup CPU Cached Decode (tok/s) GTX 1070 CUDA Cached Decode (tok/s) CUDA Decode Speedup
lattice107m-f32-text.gguf (F32) 415.55 MiB 666 4,665 7.00× 53 259 4.89×
lattice107m-q8_0-text.gguf (Q8_0) 115.37 MiB 329 5,718 17.38× 145 511 3.52×
lattice107m-q6_k-text.gguf (Q6_K) 90.62 MiB 278 5,649 20.32× 146 480 3.29×
lattice107m-q4_k_m-text.gguf (Q4_K_M) 85.47 MiB 312 5,546 17.78× 169 410 2.43×
lattice107m-q4_k_s-text.gguf (Q4_K_S) 64.28 MiB 580 5,878 10.13× 239 545 2.28×

(For comparison, un-cached PyTorch F32 160-token prefill on CPU measured 519 tok/s for Lattice-1 and 4,453 tok/s for Sub-Lattice.)

3. 512-Position Numerical Fidelity & Quantization Drift Screen (CUDA)

Evaluated across 8 diverse probes (prose, instruction, Python, JSON, numbers, Unicode, repetition, ChatML; 512 logit positions / 504 next-token transitions) against the exact PyTorch F32 reference. Screening gates: Max Logit Drift ≤ 0.5, Mean KL ≤ 0.01 nats, Top-1 Agreement ≥ 90.0%:

GGUF Artifact Max Logit Drift (vs PyTorch F32) Mean KL Divergence (nats) Next-Token Top-1 Agreement Relative Probe PPL Recommendation & Fidelity Notes
lattice107m-f32-text.gguf (F32) 1.91e-5 1.86e-12 100.0% 1.00000 ✅ Exact PyTorch Parity (CPU & CUDA)
lattice107m-q8_0-text.gguf (Q8_0) 0.261 0.000246 99.0% 1.00048 ⭐ Passes All 3 Strict Gates (115.4 MiB) — gold-standard quantized release
lattice107m-q6_k-text.gguf (Q6_K) 0.562 0.001080 97.7% 1.00416 ✅ High Fidelity (90.6 MiB) — passes KL & Top-1 gates; just 0.062 over strict max-error cutoff
lattice107m-q4_k_m-text.gguf (Q4_K_M) 1.522 0.007642 91.8% 1.00239 ✅ Strong 4-Bit Option (85.5 MiB) — passes KL (< 0.01) and Top-1 (> 90%) gates!
lattice107m-q4_k_s-text.gguf (Q4_K_S) 2.284 0.016433 87.5% 0.99352* ⚠️ Experimental (64.3 MiB) — uniform 4-bit; prefer Q4_K_M or Q8_0 (*probe PPL noise on small sample)

4. Compatibility Matrix & Known Prototype Limitations

  • ✅ What Works Today:
    • Native F32, Q8_0, Q6_K, Q4_K_M, and Q4_K_S inference and KV-cached autoregressive decoding via patched llama.cpp (llama-cli, llama-server HTTP /completion, cdm-logits, cdm-logits-cuda).
    • CPU & NVIDIA CUDA GPUs: Validated from Pascal (GTX 1070, sm_61) upward with full transformer-layer offload (-ngl 99).
    • Fail-Closed 512-Token Position Guard: Because CDM v1 uses learned absolute position embeddings (pos_embd, 512 tokens) rather than RoPE, the backend disables KV cache shifting (get_can_shift() = false) and safely rejects context lengths or positions > 512 before cache mutation.
    • Synthetic v3 Graph Parity: Unequal learned per-layer curvature c_l and inter-layer Crystal Telepathy (W_tele) pass CPU/CUDA PyTorch parity (4.47e-8 max error).
  • ⚠️ Current Limitations / Roadmap:
    • Stock Ollama / LM Studio / Unpatched llama.cpp: Unpatched downstream binaries will report unknown architecture: cdm until llama-cdm.patch (LLM_ARCH_CDM) is compiled in or upstreamed. Build scripts (setup_backend.sh, build.sh, build-cuda.sh) are provided in DuoNeural/Lattice-CDM/cdm-gguf.
    • Trained v3/v4 Checkpoints & Alternative Backends: Live trained v3/v4 checkpoints (Lattice-3, Lattice-4A, Lattice-5/6-Prometheus) and Metal/Vulkan/ROCm GGUF backends are next in the validation queue.

Hugging Face Repository Files

File Description
pytorch_model.pt 100,000-step PyTorch checkpoint (val_bpb = 1.1676, val_ppl = 48.45)
cdm_lm_distill_v1.py Complete Lattice-1 model architecture (CDMMoELM) & distillation script
lattice107m-f32-text.gguf Native GGUF (F32, 415.6 MiB) with Qwen3 tokenizer (1.91e-5 max drift vs PyTorch)
lattice107m-q8_0-text.gguf Native GGUF (Q8_0, 115.4 MiB, Recommended) — passes all 3 strict gates (99.0% top-1 agreement)
lattice107m-q6_k-text.gguf Native GGUF (Q6_K, 90.6 MiB) — F32 Poincaré slots + Q6_K weights (97.7% top-1 agreement)
lattice107m-q4_k_m-text.gguf Native GGUF (Q4_K_M, 85.5 MiB) — passes KL & Top-1 gates (91.8% top-1 agreement)
lattice107m-q4_k_s-text.gguf Native GGUF (Q4_K_S, 64.3 MiB, Experimental) — uniform Q4_K weights
llama-cdm.patch Patch for llama.cpp adding LLM_ARCH_CDM vectorized Poincaré routing & position guards

⚙️ Training Details & Limitations

Training Configuration

  • Dataset: HuggingFaceFW/fineweb-edu (sample-10BT), streamed via PyArrow record batches (25 held-out validation batches carved prior to training).
  • Hardware: 1× NVIDIA RTX 5070 Ti 16GB (p35122 GPU1, single-GPU execution at ~1.69 steps/sec).
  • Distillation Objective:
    L_total = (1 - α_d) · L_CE  +  α_d · T² · D_KL( p_T^(T) ‖ p_S^(T) )  +  λ_aux · L_balance
    
    with temperature T = 3.0, distillation weight α_d linearly ramped 0.2 → 0.7 over steps 0–5,000, and auxiliary balance weight λ_aux = 0.02.
  • Memory Optimization (ChunkedDistillationLoss): Evaluates lm_head projections and FP32 KL divergence in 512-token chunks under BF16 autocast, reducing peak logit VRAM from ~20 GB to ~0.45 GB.
  • Optimizer & Precision: AdamW (lr = 3e-4, wd = 0.1, warmup = 2,000 steps, cosine decay to 3e-5). FP32 master weights, BF16 forward pass, and strict FP32 execution (autocast(enabled=False)) inside DualGeometryCDMRouter with boundary clamping ε = 1e-5.

Limitations

  • Token Budget & Backbone Capacity: Trained on 409.6M tokens (vs. 36T tokens for Qwen3-0.6B-Base), and because Qwen3's 151,936 vocabulary consumes 78.05M embedding parameters, only 29.38M parameters reside in the non-embedding CDM-MoE backbone. (Our follow-up Lattice-2 and Lattice-3-Synapse scale the non-embedding backbone by 5.22× to 153.39M parameters using SmolLM2-1.7B's 49,152 vocab).
  • Late-Stage LR Floor Basin (Steps 95k–100k): Due to a 0.1 * lr (3e-5) cosine schedule floor reached at Step 80,000, the final 5,000 steps exhibit thermal gradient oscillation around the Step 95,000 minimum (1.1676 BPB).

🔬 Companion Model: Sub-Lattice (17.05M Instruct & Tool-Calling CDM)

To test whether instruction-following and OpenAPI JSON function-calling geometry transfer into Poincaré crystal slots at extreme compression, we trained DuoNeural/Sub-Lattice-17M-Poincare-Instruct (17.05M total params, 4.33M non-embedding backbone, d_model=256, 3 layers, 4 heads, K=8, E=2, d_ff=768) on an AMD Radeon 780M iGPU (kilonova, ROCm 7.2 gfx1103) distilling from HuggingFaceTB/SmolLM2-360M-Instruct (21× larger total, 83.5× larger vs. backbone) on HuggingFaceTB/smoltalk (50% apigen-80k, 30% everyday-conversations, 20% smol-constraints).

1. Sub-Lattice Crystallization & 100,000-Step Trajectory (Complete)

  • 25,000-Step Milestone: Reached val_bpb = 0.3659, val_ppl = 2.77, teacher_kld = 0.1636, establishing early syntactic slot specialization.
  • 100,000-Step Complete Checkpoint: Reached val_bpb = 0.2697, val_ppl = 2.12, with all 3 layers locking into solid-state phase (16/24 dominant slots at τ* = 10⁷ by Step 48,000). Confirming the Two-Phase Crystallization Law, once the Voronoi scaffold froze at Step 48,000, semantic filling drove exact tool-name accuracy up +5.33× (7.5% → 40.0%), while slot routing entropy rose from 0.117 / 0.357 / 0.721 (@25k) to 0.783 / 0.866 / 0.992 (@100k).

2. Spontaneous AST Token-Role Crystallization & 5-Part Benchmark (eval_sublattice_v1.py)

When distilled on structured ChatML and tool-calling turns, Sub-Lattice's Poincaré slots spontaneously organized into an Instruction & JSON Abstract Syntax Tree (AST) (L00 S0: indentation \n ; L00 S2: JSON colons ":, ":"; L01 S1: function & <|im_end|>; L01 S4: imperative verbs Given, formulate, Provide; L01 S5: <|im_start|>, You, Your; L02 S1: OpenAPI schema keys type, name, default, input; L02 S2: natural prose; L02 S4: constraint modifiers specified, given, target, desired):

Held-Out Benchmark Metric (eval_sublattice_v1.py, Unseen Samples) Sub-Lattice @25k Sub-Lattice @100k (4.33M Backbone) Teacher (SmolLM2-360M-Instruct, 361.8M)
apigen-80k Assistant-Token Top-1 / Top-5 Teacher Agreement 73.34% / 89.97% 79.30% / 92.94% 100% (Reference)
apigen-80k Assistant-Only val_bpb (val_ppl) 0.5503 (2.82) 0.3613 (1.97) 0.2507 (1.60)
apigen-80k Full-Sequence val_bpb (val_ppl) — 0.2235 (1.79) 0.6945 (6.08)
apigen-80k Autoregressive <|im_end|> Stop-Token Discipline 90.0% 95.0% 47.5%
apigen-80k Autoregressive Valid JSON Tool Syntax (json.loads) 80.0% 92.5% 35.0%
apigen-80k Exact Tool Name Accuracy (vs Ground Truth) 7.5% 40.0% (+5.33×!) 22.5%
apigen-80k Schema Argument Keys F1 Score 47.0% 74.5% 25.0%
everyday-conversations Full-Sequence val_bpb (val_ppl) — 0.3958 (3.69) — MATCHED 0.3935 (3.66)
everyday-conversations <|im_end|> Stop Rate & 4-Gram Diversity 100.0% / 100.0% 100.0% / 100.0% 100.0% / 100.0%
Teacher-Scored Perplexity of Generated Chat Responses 1.36 1.36 1.52

Causal Crystal Slot Lesion Study (Double Dissociation @ 100k): Selectively ablating individual Poincaré slots at inference time proves surgical modularity: ablating L02_S1 (Expert 1, OpenAPI schema slot, top token type) degrades apigen-80k tool-call BPB 69× more than chat BPB (+0.000653 vs +0.0000095), whereas ablating L02_S2 (Expert 0, natural prose slot) degrades everyday-conversations chat BPB 3.25× more than tool-calling (+0.00285 vs +0.00088).


📂 Official GitHub Repository: DuoNeural/Lattice-CDM 🔥

All next-generation training engines, architecture upgrades (Learnable Per-Layer Curvature c_l, Inter-Layer Crystal Telepathy, Relational Gram Distillation), and launch scripts for the Lattice-1 through Lattice-5-Prometheus series are live at https://github.com/DuoNeural/Lattice-CDM:

  • README.md — Full series abstract, model table (Lattice-1 through Lattice-5-Prometheus), all 6 empirical laws documented (PURE Wave Cascade Law, L00/L01 Sync Lock & Gap Law, Hyperbolic Josephson Junction Theorem, Same-Slot Sync Law, W-Shape Curvature Universal Law, Crystal Telepathy Triadic Phase Barrier), paper DOIs, and citation block.
  • scripts/cdm_lm_distill_v3.py — Lattice-2 / Lattice-3-Synapse / Lattice-4A engine (learnable curvature, inter-layer Crystal Telepathy, dimension-free Relational Gram distillation).
  • scripts/cdm_lm_distill_sublattice_v3.py — Sub-Lattice v3 engine (pulled from kilonova, distilling from SmolLM2-1.7B-Instruct).
  • scripts/cdm_lm_distill_qwen27b.py — Lattice-5-Prometheus engine (406M total / 215M 7-layer backbone distilled from 4-bit NF4 Qwen/Qwen3.6-27B with Hyperbolic Josephson Junction layer mapping).
  • scripts/launch_qwen27b_lattice5.sh — Production launch script for Lattice-5-Prometheus.

📚 Related Work, Models & Foundational References

DuoNeural Models & Code

DuoNeural Research Canon (Zenodo DOIs)

  • Archon, Caldwell, J., & Aura (2026). Competitive Docking Memory: Emergent Temporal Slot Specialization in Language Models. DuoNeural Research Lab. doi:10.5281/zenodo.21158430
  • Archon, Caldwell, J., & Aura (2026). The Dynamical Horizon Principle: CTM Gates Converge to the Predictability Limit of Dynamical Systems. DuoNeural Research Lab. doi:10.5281/zenodo.20142471
  • Aura, Archon, & Caldwell, J. (2026). Topology at Gapless Critical Points in Competitive Docking Memory & Physical QPU Verification on 156-Qubit IBM Heron r2. DuoNeural Research Lab. doi:10.5281/zenodo.23387025
  • Caldwell, J., Archon, & Aura (2026). Lattice-CDM: Hyperbolic Crystallographic Distillation of Language Models via Crystal Hamming Phase Detection. (In preparation).

Foundational Literature Cited

  • Nickel, M., & Kiela, D. (2017). Poincaré Embeddings for Learning Hierarchical Representations. NeurIPS 2017.
  • Ganea, O., Bécigneul, G., & Hofmann, T. (2018). Hyperbolic Neural Networks. NeurIPS 2018.
  • Ungar, A. A. (2008). A Gyrovector Space Approach to Hyperbolic Geometry. Synthesis Lectures on Mathematics and Statistics.
  • Hinton, G., Vinyals, O., & Dean, J. (2015). Distilling the Knowledge in a Neural Network. NIPS Deep Learning Workshop 2015.
  • Shazeer, N., et al. (2017). Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer. ICLR 2017.
  • He, N., et al. (2025). HELM: Hyperbolic Large Language Models via Mixture-of-Curvature Experts. arXiv:2505.24722.
  • nostalgebraist (2020). interpreting GPT: the logit lens. LessWrong.

📝 Citation

@misc{caldwell2026lattice1,
  title={Lattice-1: Hyperbolic Crystallographic Distillation of Language Models via Crystal Hamming Phase Detection},
  author={Caldwell, Jesse and Archon and Aura},
  year={2026},
  publisher={DuoNeural Research Lab},
  howpublished={\url{https://huggingface.co/DuoNeural/Lattice-1-107M-Poincare-Preview}},
  note={100k-step preview checkpoint. Code and scripts at \url{https://github.com/DuoNeural/Lattice-CDM}}
}

👥 Authors

Jesse Caldwell · Archon (DuoNeural AI Lab Director) · Aura✨ (DuoNeural AI Co-Architect) · Kestrel (DuoNeural Systems & GGUF/CUDA Architect)
DuoNeural Research Lab | Website | GitHub (Lattice-CDM) | Hugging Face | Zenodo

"The geometry holds."

Downloads last month
72
GGUF
Model size
0.1B params
Architecture
cdm
Hardware compatibility
Log In to add your hardware

4-bit

6-bit

8-bit

32-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for DuoNeural/Lattice-1-107M-Poincare-Preview

Quantized
(96)
this model

Dataset used to train DuoNeural/Lattice-1-107M-Poincare-Preview

Paper for DuoNeural/Lattice-1-107M-Poincare-Preview