More compute.
Same weights.
A 95.6 MB loop adapter gives Inkling-2-Small, a frozen 594B-parameter MoE, 60 layers of compute in 48 layers of memory. Switched off, it is bit-exact stock. Switched on, it decodes 10–12% slower, and validation loss is 13.66% lower after fine-tuning.
Turn the depth up. The weights stay put.
One 95.6 MB adapter lets Inkling-2-Small run its 12-layer core once, twice or three times per token. Compute grows with every pass; memory doesn’t move. Pick a depth to see what changes.
Looped twice
The 12-layer core runs a second pass, steered by the adapter. This is the released configuration. Most of the lower loss comes from fine-tuning; how much the second pass adds is still untested.
- Layers of compute
- 60
- Layers in memory
- 48
- Validation NLL
- 0.20288
- vs stock, after fine-tuning
- -13.66%
- KV memory per token
- same as stock
- Decode, batch 1
- 56.0 tok/s
Three moves. Zero backbone changes.
The 594B backbone is never touched. Small trained modules sit at the seams between passes, and they are initialised to do nothing, so training starts from the exact stock model.
Freeze the backbone
All 594B parameters stay frozen and quantized: NVFP4 on L0–41, MXFP8 on L42–47. At T=1 the model is bit-exact stock, verified to 0.000000 drift on every layer.
Loop the core
The 12-layer core (L30–41) runs T times with pass-conditioned LoRA slots, a WorkspaceEntry and a CrossPassMixer at L36: 60 layers of compute in 48 layers of VRAM.
Keep the KV cache
Last-loop KV caching shares the core’s KV slots across passes, so KV memory per token stays at stock’s; training was aligned to the serving path to a 0.00010 NLL gap.
13.66% lower loss. Next: isolating the loop.
Validation NLL ends 13.66% below stock. The earliest signal came from the loop alone: at step 30, with only the loop gates trained, it was already 5.9% lower. Measuring how much of the final gain the loop earns needs a matched control, more seeds and wider evals, which limited compute has held back so far.
From 36 to 57 tokens a second. Still behind stock.
The first looped server was slow, mostly from integration bugs. Seven rounds of optimisation in SGLang, each measured on the same four DGX Sparks, brought it to 10–12% below the stock model’s last measurement.
- First loop bootUnfused Python LoRAs; the forward override bypassed three fast paths36.1489.63 ms/step
- LoRA fused into weightsCoda folded in place, pass-1 core pre-merged: zero LoRA kernels34.4484.54 ms/step
- Megakernel glue58 of 60 layers on fused post-attention and post-MoE glue39.7584.82 ms/step
- TurboDraft-verify masking and live RoCE restored: −19.5 ms per step48.6365.28 ms/step
- Triton seamsloop_r3 weights plus three fused seam kernels50.0667.15 ms/step
- Gate τ = 0.45Speculative accept length 3.44 → 3.7554.6268.56 ms/step
- Gate τ = 0.50Accept length 4.04: longer steps, more tokens per step57.2070.59 ms/step
Extra passes. No extra cache.
Every pass through the core would normally need its own key/value cache. Instead the final pass writes over the first, so a 2- or 3-pass model needs no more KV memory per token than stock.
- Tokens in the same memory
1,127,2001,409,000- KV growth at T=2 or T=3
- 0%
- Per-pass short-conv state
- ~12 MB, kept separate
Trained on its own checked answers.
All training data was sampled from Inkling-2-Small itself and kept only when a unit test, exact-match math check or JSON-schema validator passed it.
- 5,157prompts sampled from the model itself
- 3,790answers that passed a deterministic check
- 3,679training rows (74 held out for validation)
- 5.20Mtraining tokens
- Math (MATH L3–5)1,668
- Coding, medium968
- Retention (GSM8K train)525
- Coding, hard361
- Coding, stdin152
- Tool calls (JSON schema)116
What’s frozen, what’s trained.
The adapter is 0.004% of the model’s size and ships as one file that loads at any tensor-parallel width.
Base model frozen
- Model
- Inkling-2-Small
- Parameters
- 594B, all frozen
- Layers
- 48, as 8 AttnRes blocks of 6
- Hidden size
- 4,608
- Attention
- 48 query heads, 8 KV heads (GQA 6:1)
- Attention span
- Sliding 1,024 on 40 layers, global on 8
- Experts
- 384 routed, top-8
- Precision
- NVFP4 on L0–41, MXFP8 on L42–47
- Vocabulary
- 201,024
Loop adapter trained
- Trainable
- 23.90M parameters (0.004% of the model)
- WorkspaceEntry
- Rank 256, 3.58M: re-anchors each pass to the prelude
- CrossPassMixer
- Rank 128, 1.79M: blends the previous pass in at L36
- CoreLoRA
- L30–41, rank 32 on attention, rank 16 on the router
- CodaLoRA
- L42–47, rank 32, active only when T ≥ 2
- LoopCD-Hidden
- ω = 0.3, RMS-preserving contrast against pass 0
- File
- 95.6 MB safetensors, 155 tensors
- Tensor parallel
- TP 1, 2, 4 or 8 from one file, 0.000e+00 round-trip error
Three commands to serve it.
Base weights and the adapter bundle are public on Hugging Face, pre-sharded for four DGX Sparks. This is the current stable recipe.
# Rank-sharded base weights, on each node R = 0..3 (~93 GB per node)
hf download aidendle94/Inkling-2-Small-Looped-DGX-Spark \
--include "rank<R>/*" --local-dir ~/inkling2-weights
# The loop adapter bundle, on rank 0 (~587 MB)
hf download aidendle94/Inkling-2-Small-Looped-DGX-Spark \
--include "loop-adapter/*" --local-dir ~/inkling2-weights
# Serve: depth 2, last-loop KV, fused seams, aligned MTP drafter
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
- Hugging Face ↗aidendle94/Inkling-2-Small-Looped-DGX-Spark
- ~93 GBbase weights per node
- ~587 MBadapter bundle, with the aligned drafter
- 88 / 88tool-call checks across chat, streaming, Anthropic and Responses APIs
- 452Klive KV tokens in the long-context stress test
Shipped, and next.
loop_r3 captures an estimated 60–70% of what a supervised adapter can reach. The next steps go after the rest.
- Fused Triton seamsShipped
66 PyTorch ops become 7 kernels; seams run 2.96× faster.
- Gate threshold sweepShipped
τ = 0.50 reached 57.2 tok/s at batch 1, on a 4-prompt sweep.
- Prefill boostersShipped
Bit-exact: +37.7% at 195 tokens, 2,527 tok/s at 16K.
- Aligned MTP drafterShipped
Draft KL −59.9%; accepted length 5.22 → 5.74 tokens.
- Matched control and wider evalsNext
A same-size non-looped LoRA on the same data and split, several seeds, LiveCodeBench and agentic suites. This decides whether the loop earns its keep. Limited compute has held it back.
- Pro SFTNext
Rank 64 LoRAs, a small dense MLP per core layer, 15–20K hard traces. Target: ~85% of the adapter ceiling.
- RL on the loopNext
Best-of-8 rollouts on the Sparks, GRPO updates on rented GPUs, KL-anchored to stock. Target: 92–95%.
- Sparse first passNext
Top-4 experts on pass 0, top-8 on pass 1: an expected 4–5 ms off every step.
Every number, every bug.
Loop Adapters for Inkling-2-Small
An experimental 95.6 MB adapter loops the 12-layer core of a 594B-parameter MoE: 60 layers of compute in 48 layers of memory, bit-exact when switched off. Validation NLL is 13.66% below stock after fine-tuning; whether the loop itself earns that is still untested.
Read the full write-up