Research Preview / Experimental Release Β· 60 layers of compute in 48 layers of VRAM Β· 0% KV-cache growth Β· ~$48.50 end-to-end training
Preview Highlights Β· Architecture Β· Training Β· Serving Stack Β· Benchmarks Β· Quick Start Β· Repo Layout
Preview / Experimental Release Notice
Inkling-2-Small-Looped (
loop_r3) is an early research preview and experimental serving build.
loop_r3is our first end-to-end supervised recurrent-depth checkpoint (~$48.50total compute) and captures an estimated60β70%of the adapter ceiling; higher-rank SFT and RL-on-the-loop iterations are still ahead.- Validation NLL improves by
-13.66%(0.23498 β 0.20288), GSM8K greedy matches stock (96.0%,288/300,p=1.000), andT=1is bit-exact stock (0.000000drift). Note that further testing is needed, but lack of compute has prevented more downstream evaluations (such as LiveCodeBench and broader agentic suites) so far.- The 4Γ DGX Spark serving stack runs on a development SGLang image (
experimental-1.10). See aidenle.com/research for the full interactive research console and honest limits.
Preview Status & Highlights
Inkling-2-Small-Looped (aidendle94/Inkling-2-Small-Looped-DGX-Spark, formerly aidendle94/Inkling-2-Small-DGX-Spark) brings test-time recurrent depth (T = 2) to thinkingmachines/Inkling-2-Small without modifying a single frozen base weightβpaired with a pre-sharded, hardened 4Γ NVIDIA DGX Spark (GB10, 4Γ 128 GB unified RAM) SGLang serving stack.
Everything needed to run either the Looped (T = 2) preview or the Stock (T = 1) variant lives in one repository: per-node pre-sharded base weights (rank0/βrank3/), the byte-for-byte unmodified official checkpoint (full/), the universal 95.6 MB recurrent-depth adapter (loop-adapter/), a 0.00 ms load-folded aligned 5-layer MTP drafter, a calibrated speculative confidence head, and a zero-precision-loss SGLang serving overlay.
- 60 effective layers from a
95.6 MBadapter: Loops the 12-layer Core block (L30βL41) twice over 48 frozen physical layers using23.90Mtrainable FP32 parameters (0.004%of the594Bbackbone), cutting held-out validation NLL by-13.66%(0.23498 β 0.20288, peak-13.75%at step 900) while remaining bit-exact stock atT = 1(0.000000drift across all 48 layers). - Zero KV-cache growth (
Last-Loop KV): Pass 1 overwrites physical KV slots[30..41]in-place while isolating tiny per-pass short-convolution states across60layersβpreserving a1,050,000-token NVFP4 KV pool across524,288context with0%extra KV memory. - Near-stock decode speed on 4Γ DGX Spark: Pre-merged Coda (
0 MB,0 ms), 12-bit packed Pass-1 CoreLoRA (0runtime LoRA kernels), 7 fused Triton seam kernels (2.96Γfaster), a0.00 msload-folded Aligned 5-Layer MTP v2 drafter, and a calibrated confidence head deliver52.1β56.0 tok/sgreedy (60.1β64.0 ms/step, peaking at57.2 tok/satΟ=0.50),80β100.9 tok/sat BS=4, and35β67.2 tok/slive at394Kactive context. - Trained for
~$48.50total:$9.46for 3,790 verified on-policy traces +~$39for 1,000-step looped SFT (loop_r3) on8Γ RTX 4090+$0local 4Γ DGX Spark MTP v2 alignment and gate-head calibration. - Drop-in API naming: Serves under
inkling-2-small-loopedwithinkling-2-smallaliased by default (SPARK_SERVED_ALIASES), so existing OpenAI/Ollama clients work without changes.
Architecture: How Recurrent Depth Works
Inkling-2-Small's 48 physical MoE layers (8 AttnRes blocks of 6 layers) are partitioned into three zones with zero base-weight modifications:
| Zone | Physical Layers | Role in Inkling-2-Small-Looped (T = 2) |
Serving Cost |
|---|---|---|---|
Frozen Prelude (B0βB4) |
L0 β L29 (30 layers) |
Runs once at stock NVFP4/MXFP8 speed; caches the prelude anchor state and AttnRes block summary. |
0 extra FLOPs, 0 extra weights |
Recurrent Core (B5βB6) |
L30 β L41 (12 layers Γ 2 passes) |
Pass 0 runs unmodified frozen base weights (KV[30..41]). Pass 1 enters via fused Triton WorkspaceEntry + AttnRes Rewind, applies pre-merged 12-bit CoreLoRA (rank 32 attn, rank 16 router) + mid-core CrossPassMixer@L36 (rank 128), and overwrites KV[30..41] in-place (Last-Loop KV). |
0% KV growth Β· 0 runtime LoRA kernels |
LoopCD + Folded Coda (B7) |
L42 β L47 (6 layers) |
Fused Triton LoopCD-Hidden (Ο = 0.3) contrasts Pass 1 against Pass 0 before entering the Coda; CodaLoRA (rank 32) is folded directly into base weights at load time. |
0 MB extra Β· 0 ms LoRA cost |
| Aligned MTP v2 + Gate | 5-layer DSpark drafter | Rank-64 alignment LoRA + fuse_weight/markov_head folded into BF16 mtp.safetensors inside load_weights before int8 quantization, paired with a calibrated 256-unit confidence MLP. |
0.00 ms runtime overhead |
Key Architectural Design Choices
- Last-Loop KV Caching (
--kv-mode last_loop): Standard recurrent transformers double KV-cache memory across core layers. By training and serving withLast-Loop KV, Pass 1 overwrites physical slots[30..41]in-place while keeping tiny linear-attentionsconvstates isolated across60logical layers (0..47plus48..59for Pass 1). On held-out validation,T=2 last_loopachieves0.20298NLLβmatching or beatingper_passKV on 6 of 11 checkpoints while keeping100%of our1.05M-token NVFP4 KV pool. - LoopCD-Hidden (
Ο = 0.3): Contrasting Pass 1's refined hidden state against Pass 0's unlooped hidden state right beforeL42(h = h_1 + Ο Β· (h_1 - h_0), RMS-preserved) amplifies depth-gained reasoning signal and eliminates premature</think>collapse (max_Ξstop = -4.21). - Universal TP-Agnostic Adapter (
95.6 MB, 155 tensors):loop-adapter/adapter_model.safetensorsstores all23.90MFP32 parameters in standard unsharded Hugging Face layout and auto-shards cleanly at boot for any tensor-parallel degree (TP = 1, 2, 4, 8,0.000e+00round-trip error).
Training Pipeline (~$48.50 End-to-End)
Because the Prelude (L0βL29) is completely frozen, we pre-compute and cache its hidden-state anchors once on disk (288 GB in 63 min)βeliminating 62.5% of base-model forward compute during looped SFT and bringing the entire end-to-end training budget down to ~$48.50:
| Stage | Compute & Cost | Dataset & Method | Verified Outcome |
|---|---|---|---|
| 1. Verified Trace Generation | Tinker API Β· $9.46 |
5,157 on-policy rollouts β 3,790 verified traces (73.5%, unit-tested code, exact-match math & JSON schema) |
Clean, zero-noise reasoning supervision (5.20M train tokens) |
2. Looped SFT (loop_r3) |
Vast 8Γ RTX 4090 (7.5h) Β· ~$39 |
1h prelude cache + 6h 1,000-step recurrent SFT (23.90M FP32 params: CoreLoRA, CodaLoRA, WorkspaceEntry, CrossPassMixer@L36, Last-Loop KV, LoopCD Ο=0.3, CE + sparse top-128 teacher KL + stop guard) |
Val NLL 0.23498 β 0.20288 (-13.66%); peak -13.75% @ step 900; T=3 scales cleanly (0.20309) |
| 3. Aligned 5-Layer MTP v2 | Local 4Γ DGX Spark Β· $0 |
500 train + 32 val rows of live loop_r3 teacher logits; rank-64 LoRA + fuse_weight/markov_head folded at load time |
Held-out val_kl -59.9%; val accept length +0.523 (5.22 β 5.74); 0.00 ms runtime overhead |
| 4. Calibrated Gate Head | Local 4Γ DGX Spark Β· $0 |
Warm-started from gate-head-mlp-reg.pt on 2,990 live loop_r3 + Aligned MTP steps (gate-head-loop-r3-mtp.pt) |
Brier score -10.23%; +1.84% BS=1 / +2.15% BS=4 throughput |
All training scripts, configs, and evaluation harnesses are bundled in
loop-adapter/README.mdunder the MIT license.
Serving Stack: 4Γ DGX Spark (Zero Precision Loss)
Running a 60-effective-layer multimodal MoE with a 1.05M-token KV pool on four 128 GB unified-memory GB10 nodes requires tight co-design across kernel fusion, speculative decoding, and unified-RAM management. Every optimization in loop-adapter/serving/loop_depth.py is strictly lossless:
Three Engineering Pillars
- Zero-Overhead Loop Fusion
- Pre-merged weights:
CodaLoRA(L42βL47) is folded in-place (0 MB,0 ms), and Pass-1CoreLoRA(L30βL41) is pre-merged and packed into exact 12-bit_p12weights (0runtime LoRA kernels). - Full megakernel + Triton seams:
58 / 60effective layers stay fused throughmegakernel layer_glue, bridged by 7 custom Triton seam kernels replacing 66 unfused PyTorch ops (2.96Γseam speedup acrossWorkspaceEntry,CrossPassMixer@L36, andLoopCD-Hidden), withspark_gateand 200 GbEroce_liveactive.
- Pre-merged weights:
- Aligned Speculative Decoding
- Unaligned stock MTP drops acceptance under recurrent depth because Pass 1 shifts next-token distributions. Folding our rank-64 Aligned MTP v2 weights into
mtp.safetensorsinsideload_weights(beforedense_i8/markov_i8quantize) restores high speculative acceptance (4.8β5.9tokens/step) at0.00 msextra latency.
- Unaligned stock MTP drops acceptance under recurrent depth because Pass 1 shifts next-token distributions. Folding our rank-64 Aligned MTP v2 weights into
- Unified-RAM & Multimodal Stability Hardening
- Zero-quality-loss memory reclamation (
~1.66 GB/rankfreed): Retains native BF16 attention on all 48 base layers (SPARK_DENSE_P12=attn,head) without duplicating BF16 Core LoRA copies (-541 MB/rank), frees redundant BF16lm_head.weight(-463 MB/rank), and frees deadvisualencoder weights on ranks 1β3 (-655 MB/rank). - Eliminated
6.43 GBmultimodal CPU RSS spikes (384Γsmaller payload): In SGLang's multi-nodebroadcast_pyobj, rawIMAGEpixel tensors were previously pickled and broadcast to ranks 1β3 with3ΓCPU copies even thoughinkling2.pyonly encodes vision on rank 0. Our zero-copybroadcast_pyobj+ rank 1β3 deadIMAGEfeature strip shrinks per-request rank 1β3 broadcasts from38.4 MB β 0.1 MBwhile preserving exact multi-image visual outputs. - Predictable long-context behavior: Sparse decode CUDA graph tiers (
1 2 4 8,1.15 GBtotal), single outer-forward allocator trim (>= 512 MB), and boot-time Triton warmup for odd-remainder prefill chunks (rows=16 & 17) keep all 4 nodes at6.76β9.57 GBsteadyMemAvailableeven after162Kcold prefills and4Γ 1600Γ1000images.
- Zero-quality-loss memory reclamation (
Benchmarks
Preview Looped (loop_r3, T = 2) vs. Stock (T = 1) Summary
| Metric | Stock Inkling-2-Small (T = 1) |
Inkling-2-Small-Looped (T = 2, Preview) |
Notes |
|---|---|---|---|
| Effective Depth | 48 layers | 60 layers (L30βL41 Γ 2) |
Same 48 physical base layers (T=1 bit-exact) |
| Held-Out Val NLL | 0.23498 |
0.20288 (-13.66%) |
Peak -13.75% @ step 900; Last-Loop KV 0.20298 |
| GSM8K Greedy Gate (300q) | 96.0% |
96.0% (288/300, p=1.000) |
Zero regression; zero </think> collapse |
| BS=1 Decode (coding, greedy / T=1.0) | 63.3 / 55β56 tok/s |
52.1β56.0 / 49.1 tok/s (57.2 @ Ο=0.50) |
60.1β64.0 ms/step with Aligned MTP v2 |
| BS=4 Decode (batch) | 92β111.7 tok/s |
80β97.6 tok/s (peaks 100.9) |
100.9 tok/s on GSM8K at 4.84 accept len |
| Live Long-Context Decode | 47.6 (FP8) / 52.2 (NVFP4) @ 500K |
35β67.2 tok/s @ 394K |
98.2% prefix cache hit, accept up to 5.9 |
| Cold Prefill Throughput | 3,110 (30K) / 2,786 (120K) tok/s |
2,115 (81K, chunk=4096) / 2,416 (39K, chunk=8192) |
0% KV growth across loop passes |
| Context / NVFP4 KV Pool | 524,288 / 1,409,000 tokens |
524,288 / 1,050,000 tokens |
Steady MemAvailable: 6.76 / 9.11 / 9.55 / 9.57 GB |
All looped preview numbers measured 2026-12-04 on the 4Γ DGX Spark GB10 test fleet with the current stable zero-precision-loss recipe below; stock numbers measured 2026-11-16 to 2026-11-23 (full methodology in sparkrun-recipes docs/results.md). Note that further testing is needed, but lack of compute has prevented running more evals.
Quick Start
Container image:
aidendle94/sparkrun-sglang-inkling2-gb10:experimental-1.10on Docker Hub (public; stock recipe also runs onexperimental-1.5). Recipes & research console: github.com/aidendle94/sparkrun-recipes (recipes/inkling-2-small/sglang) Β· Interactive research page at aidenle.com/research Β· Serving write-up.
Option A: Launch Inkling-2-Small-Looped (T = 2 Preview β Current Stable Recipe)
1. Download per-node pre-sharded weights on each of the four DGX Spark nodes (R = 0, 1, 2, 3, ~93 GB per node):
# Cap download page cache on GB10 unified memory so it never competes with active workloads
systemd-run --user --wait --pipe -p MemoryMax=4G hf download aidendle94/Inkling-2-Small-Looped-DGX-Spark \
--include "rank<R>/*" --local-dir ~/inkling2-weights
2. On Rank 0, clone sparkrun-recipes, download the loop-adapter/ bundle (~587 MB), and launch the verified stable recipe (the launcher syncs the isolated patch overlay and adapter to all 4 nodes automatically without modifying sparkrun-recipes):
# 1. Clone sparkrun-recipes (for base patches/ and launch/fleet.env)
git clone https://github.com/aidendle94/sparkrun-recipes ~/sparkrun-recipes
cp ~/sparkrun-recipes/recipes/inkling-2-small/sglang/launch/fleet.env.example \
~/sparkrun-recipes/recipes/inkling-2-small/sglang/launch/fleet.env
# Edit fleet.env with your 4 node IPs, SSH users, homes, RDMA HCAs, and fabric subnet.
# 2. Download the loop-adapter bundle onto rank 0
hf download aidendle94/Inkling-2-Small-Looped-DGX-Spark \
--include "loop-adapter/*" --local-dir ~/inkling2-weights
# 3. Launch the stable zero-precision-loss recipe
chmod +x ~/inkling2-weights/loop-adapter/serving/launch_loop_server.sh
INKLING_REPO_REL=inkling2-weights \
IMPL=~/sparkrun-recipes/recipes/inkling-2-small/sglang \
~/inkling2-weights/loop-adapter/serving/launch_loop_server.sh \
--arm loop_r3_stable \
--ckpt ~/inkling2-weights/loop-adapter \
--mtp-ckpt ~/inkling2-weights/loop-adapter/mtp/mtp_align_r3_v2_best \
--depth 2 --kv-mode last_loop --omega 0.3 --triton-seams 1 --gate 0.4 \
--gate-head ~/inkling2-weights/loop-adapter/serving/gate-head-loop-r3-mtp.pt \
--dense-p12 attn,head --chunk 4096 --pool 1050000 \
--cuda-graph-bs-decode "1 2 4 8" \
--prefill-glue-rows epilogue=256,stream=128,gate=256
Stop all 4 containers cleanly:
IMPL=~/sparkrun-recipes/recipes/inkling-2-small/sglang \
~/inkling2-weights/loop-adapter/serving/launch_loop_server.sh --stop
Important Flag Notes:
- API Model Name: Defaults to
--served-model-name inkling-2-small-loopedwithSPARK_SERVED_ALIASES=inkling-2-small, so/v1/modelsand/api/tagsadvertiseinkling-2-small-loopedwhile staying drop-in compatible with clients requestinginkling-2-small. Override with--served-model-name/--served-aliases "". - Universal vs. Pre-sharded Adapter:
--ckpt ~/inkling2-weights/loop-adapterloads the universal95.6 MBadapter_model.safetensorsand auto-shards per rank (or pass--ckpt ~/inkling2-weights/loop-adapter/adapters/loop_r3/step-001000for pre-sharded TP=4.ptfiles). - Prefill Chunk Tuning:
--chunk 4096 --pool 1050000is the recommended stable configuration for heavy350Kβ470Kmultimodal agentic workloads on hosts runningearlyoom -m 2. Ifearlyoomis disabled/relaxed on all 4 nodes,--chunk 8192adds~14β16%cold prefill speed on8Kβ64Kprompts (2,416 tok/sat39K).
Option B: Launch Stock Inkling-2-Small (T = 1)
One-script NVFP4 KV quickstart (downloads each node's rank<R>/ folder, launches, and verifies):
git clone https://github.com/aidendle94/sparkrun-recipes
cd sparkrun-recipes/recipes/inkling-2-small/sglang-nvfp4-kv
./quickstart.sh <fabric address of node 0> <node 1> <node 2> <node 3>
Manual FP8 KV launch (after downloading rank<R>/* on each node):
git clone https://github.com/aidendle94/sparkrun-recipes
cd sparkrun-recipes/recipes/inkling-2-small/sglang
cp launch/fleet.env.example launch/fleet.env # then edit it
export PRESHARDED=1 INKLING_REPO_REL=inkling2-weights
launch/launch-inkling2.sh --dry-run
launch/relaunch-inkling2.sh
Note:
rank0/βrank3/are built for 4 nodes and the recipe's default expert-width layout (each node checksum-verifies every parameter at boot against the official checkpoint). For other node counts or layouts, download--include "full/*"(394 GB) and launch withINKLING_SNAP=full(withoutPRESHARDED).
Repository Layout
| Path | Contents | Size |
|---|---|---|
rank0/ β¦ rank3/ |
Per-node byte-for-byte pre-sharded slices of the official NVFP4 checkpoint (PRESHARDED=1), plus config, tokenizer & chat template |
~93 GB each |
full/ |
Official thinkingmachines/Inkling-2-Small checkpoint at revision b0e7afb8892a07897c78ce1c5b801a0d9cbd5e7b, byte-for-byte |
394 GB |
loop-adapter/ |
Complete loop_r3 preview release: universal 95.6 MB adapter_model.safetensors (23.90M params), TP=4 shards, Aligned 5-Layer MTP v2 (mtp_align_r3_v2_best), calibrated gate head (gate-head-loop-r3-mtp.pt), hardened loop_depth.py plugin, portable launch_loop_server.sh, and training code |
587 MB |
spark/gate-head-mlp-reg.pt |
Confidence head for the stock T=1 serving variant (256-unit MLP, sha256 0bc7b3d52da6c1bd...) |
4.7 MB |
assets/ |
Model Console launch graphics (hero-banner.svg, loop-forward.gif, training-pipeline.svg, serving-stack.svg, decode-progression.svg) |
~1.9 MB |
See loop-adapter/README.md for the complete adapter file inventory, architecture specification, and reproducible training commands.
Licence & Attribution
- Base Model Weights (
full/,rank0/βrank3/): Created by Thinking Machines Lab, released under the Apache License 2.0 (LICENSE), and subject to the publisher's Acceptable Use Policy.full/is redistributed unmodified;rank0/βrank3/contain byte-for-byte slices of it. - Looped Adapter, Aligned MTP v2, Calibrated Gate Heads, Serving Plugin, Launch Graphics & Training Code (
loop-adapter/,spark/gate-head-mlp-reg.pt,assets/): Released under the MIT License, matching sparkrun-recipes on GitHub. SeeNOTICE.
Acknowledgments
A huge thank you to Looped DeepSeek-V4.1: Making a 552B Frontier Model Smarter and Faster (and Rescuing 1.75-Bit Local Macs) | Jason Titus (sliderforthewin/Looped-DeepSeek-V4.1-Flash) for inspiring this work and pioneering practical recurrent-depth loop adapters on frozen frontier MoE models.
Model tree for aidendle94/Inkling-2-Small-Looped-DGX-Spark
Base model
thinkingmachines/Inkling-2-Small