Run this model with HF Jobs
Run JordiHugging/spark-ds41f-loop-adapter on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/JordiHugging/spark-ds41f-loop-adapter. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/JordiHugging/spark-ds41f-loop-adapter on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use JordiHugging/spark-ds41f-loop-adapter with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use JordiHugging/spark-ds41f-loop-adapter with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download JordiHugging/spark-ds41f-loop-adapter --local-dir spark-ds41f-loop-adapter
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
spark-ds41f-loop-adapter (MIT Β· 5-Target Fused-Friendly Β· Readout-Protected)
Clean-room, 100% MIT-licensed recurrent-depth loop adapters for stock lossless deepseek-ai/DeepSeek-V4.1-Flash-1017 (MXFP4/MXFP8, KLD = 0.000), trained on an Apple M3 Ultra 512 GB with Jason Titus's MIT-licensed jasontitus/mlx-stq-trainer and formatted in standard sushi-dsv41-loop-v1 layout for both:
christopherowen/spark-ds41f(PR #1357 β clean-room CUDA/TileLang runtime + fused 5-target MXFP8 fast path), andbeamivalice/sushi(--loop <dir>).
Credits & Attribution
- Jason Titus (
@jasontitus): Inventor of the DeepSeek-V4.1 recurrent-depth loop architecture (WorkspaceEntry, boundary-20 detached stem SFT, freeT=1KL anchor,LoopCD-Hidden,sushi-dsv41-loop-v1format) and author ofjasontitus/mlx-stq-trainer(MIT) andjasontitus/dsv41-loop-eval. Our readout-layer freeze (--coda-lora-layers 2, freezingL38β39beneathlm_head) directly ports his Qwen3.8-Flash-NextSFT-v2breakthrough onto DeepSeek-V4.1-Flash. - Christopher Owen (
@christopherowen): Author ofchristopherowen/spark-ds41f(Apache-2.0), whose fused kernels motivated our 5-target fused-friendly LoRA layout (wq_a, wkv, wq_b, wo_b, shexp_w2). - DeepSeek: Base weights
deepseek-ai/DeepSeek-V4.1-Flash-1017(MIT). - Dataset & Decontamination: 100% license-clean (MIT / Apache-2.0 / CC-BY-4.0 β zero ShareAlike / zero NonCommercial), dual 13-gram decontaminated, with full training datasets, receipts,
log.jsonl, and evaluation scripts inJordiPosthumus/spark-ds41f-loop-data.
Available Checkpoints
| Checkpoint | Architecture | Dataset | 48-Row Val NLL (T=1 β T=2 / T=3 / T=4) |
T=2 Loop Gain |
T=3 Loop Gain |
T=2 State Gain |
Size |
|---|---|---|---|---|---|---|---|
checkpoints/v2-super-coda2-step000600 (β Recommended) |
Core L24β35, Coda L36β37 (L38β39 βοΈ frozen), 5 fused targets, rank=32, passes=4 (T={2,3,4}) |
loopdata_v2 (1,690 verified MIT/Apache/CC-BY rows, 1.89M tok, 0 contamination) |
0.48193 β 0.38165 / 0.38317 / 0.38478 (0.38001 w/ LoopCD Ο=0.25) |
+0.00639 (+0.00802 w/ LoopCD) |
+0.00486 |
+0.00260 |
126 MB |
checkpoints/v1b-coda2-step000300 (earlier v1 baseline) |
Core L24β35, Coda L36β37 (L38β39 βοΈ frozen), 5 fused targets, rank=32, passes=3 |
loopdata_v1 (2,109 rows MIT/Apache/CC-BY) |
0.38058 β 0.30895 / 0.31061 (-0.07163) |
+0.00233 |
+0.00067 |
+0.00070 |
122 MB |
v2-super-coda2-step000600 Validation & Offline LoopCD-Hidden (Ο) Sweep
1. Full 600-Step 48-Row Held-Out Validation Progression
Trained with core=24-35, --coda-lora-layers 2 (L38β39 frozen), --max-train-passes 4, --t2-prob 0.55, --ret-frac 0.25, --lora-rank 32, --entry-rank 64, --targets wq_a,wkv,wq_b,wo_b,w2, --lam-kl 0.2, --lam-stop 0.1, --stop-ce-mask-below 250 (33.0M trainable params). Full log.jsonl & run.json published in JordiPosthumus/spark-ds41f-loop-data/receipts/v2_super_coda2/.
| Step | T=1 Stock |
Gates=0 |
T=2 Loop |
T=3 Loop |
T=4 Loop |
T=2 Loop Gain |
T=3 Loop Gain |
T=4 Loop Gain |
T=2 State Gain |
|---|---|---|---|---|---|---|---|---|---|
0 |
0.48193 |
0.48193 |
0.48193 |
0.48193 |
0.48193 |
0.00000 |
0.00000 |
0.00000 |
0.00000 |
100 |
0.48193 |
0.41017 |
0.40599 |
0.40881 |
0.40874 |
+0.00418 |
+0.00136 |
+0.00143 |
+0.00193 |
200 |
0.48193 |
0.39157 |
0.38679 |
0.38962 |
0.38959 |
+0.00478 |
+0.00195 |
+0.00199 |
+0.00235 |
300 |
0.48193 |
0.39108 |
0.38577 |
0.38819 |
0.38938 |
+0.00532 |
+0.00289 |
+0.00170 |
+0.00208 |
400 |
0.48193 |
0.38743 |
0.38262 |
0.38356 |
0.38459 |
+0.00481 |
+0.00388 |
+0.00284 |
+0.00137 |
500 |
0.48193 |
0.38896 |
0.38228 |
0.38419 |
0.38552 |
+0.00668 |
+0.00476 |
+0.00344 |
+0.00292 |
600 |
0.48193 |
0.38803 |
0.38165 |
0.38317 |
0.38478 |
+0.00639 |
+0.00486 |
+0.00326 |
+0.00260 |
2. Offline LoopCD-Hidden (Ο) Sweep (mlx-stq-trainer/tools/loop_eval.py, 48 Held-Out Rows)
Scored across all 48 exact held-out validation rows (16 direct/zero-CoT rows + 29 long-CoT traces + 3 multi-turn run_python agent trajectories; paired permutation tests vs T2_w0.00).
| Arm | All-48 Row NLL | All-48 Tok NLL | 16 Direct Rows | 29 Long Traces | 3 Agent Rows | reasoning |
toolcall |
content |
|---|---|---|---|---|---|---|---|---|
base (T=1 Stock) |
0.48193 |
0.31075 |
0.75900 |
0.35741 |
0.20789 |
0.33191 |
0.03902 |
0.24096 |
T1_adapter (T=1) |
0.48193 |
0.31075 |
0.75900 |
0.35741 |
0.20789 |
0.33191 |
0.03902 |
0.24096 |
T2_gates0 (LoRA only) |
0.38803 |
0.26620 |
0.55367 |
0.31819 |
0.17983 |
0.28212 |
0.03729 |
0.22352 |
T2_w0.00 (T=2) |
0.38165 |
0.26562 |
0.53371 |
0.31866 |
0.17952 |
0.28290 |
0.03737 |
0.22388 |
T2_w0.15 (LoopCD) |
0.38002 |
0.26441 |
0.53045 |
0.31786 |
0.17858 |
0.28113 |
0.03764 |
0.22451 |
T2_w0.25 (LoopCD) |
0.38001 |
0.26430 |
0.53091 |
0.31759 |
0.17851 |
0.28099 |
0.03811 |
0.22444 |
T2_w0.35 (LoopCD) |
0.38019 |
0.26473 |
0.53044 |
0.31816 |
0.17846 |
0.28147 |
0.03828 |
0.22508 |
T3_w0.00 (T=3) |
0.38317 |
0.26547 |
0.54001 |
0.31773 |
0.17929 |
0.28181 |
0.03776 |
0.22367 |
T3_w0.20 (LoopCD) |
0.38388 |
0.26558 |
0.54226 |
0.31765 |
0.17942 |
0.28188 |
0.03797 |
0.22327 |
T4_w0.00 (T=4) |
0.38478 |
0.26556 |
0.54534 |
0.31731 |
0.18066 |
0.28240 |
0.03755 |
0.22244 |
T4_w0.20 (LoopCD) |
0.38536 |
0.26573 |
0.54702 |
0.31733 |
0.18088 |
0.28275 |
0.03763 |
0.22233 |
Key Takeaways:
- Exact stem identity at
T=1:T1_adaptermatchesbasebit-for-bit to 5 decimals across every segment. - Recommended default:
T=2+LoopCD-HiddenΟ = 0.20β0.25(ref=prev): Hits the #1 overall Row NLL (0.38001,+0.00802total loop gain overgates=0), #1 Token NLL (0.26430), #1reasoningNLL (0.28099), and statistically significant reasoning gains vsT2_w0.00(Ο=0.15:16/20improved,p = 0.0097) β with zero extra compute! - Deeper loops (
T=3, T=4atΟ = 0.0): Monotonically improve long-CoT traces (tr29:0.31866 β 0.31773 β 0.31731;T3vsT2reasoning15/20,p = 0.025) and final-answercontent(0.22388 β 0.22367 β 0.22244), while trading off slightly on short/direct rows (dir16). - Zero tool-calling regression:
toolcallNLL improves over stockbase(0.03902 β 0.03737β0.03811) across every depth andΟ.
Earlier v1b-coda2@300 Baseline & Readout-Freeze A/B Receipt
Controlled Readout-Freeze A/B (v1 vs v1b_coda2 at Step 100, Identical 48 Held-Out Rows)
| Metric (Step 100 Β· 48 Val Rows) | v1 (All Coda L36β39, 36.3M) |
v1b_coda2 (L38β39 βοΈ Frozen, 32.0M) |
Delta |
|---|---|---|---|
T=1 Stock |
0.38058 |
0.38058 |
exact match |
Gates=0 (LoRA Shortcut) |
0.32679 |
0.32979 |
less coda stealing |
T=2 Loop Gain (gates0 - T=2) |
+0.00193 |
+0.00263 |
1.37Γ |
T=3 Loop Gain (gates0 - T=3) |
-0.00028 |
+0.00089 |
flipped neg β pos |
T=2 True State Gain (anchor - T=2) |
+0.00039 |
+0.00176 |
4.52Γ bigger! |
State Share (state / loop_gain) |
20.2% |
67.0% |
3.3Γ jump |
Exploratory Single-Boot Smoke Test (v1b-coda2@300, Drained TP3 Ring Two Β· 10 + 6 = 16 Problems + 113K Needle)
Methodology note: Single-boot exploratory runs on a drained 3Γ DGX Spark TP3 ring (
candidate-78, CED2560,temperature=0.0, default DS chat template thinking) β not an interleaved A/B/Aservebenchqualification. Live multi-effort benchmarks forv2-super-coda2@600(includingjasontitus/dsv41-loop-evalLCBv6) are running next.
| Model / Adapter | 10-Prob Reasoning | 10-Prob Tokens (Ξ vs Stock) |
10-Prob Time / Avg tok/s |
6-Prob Hard AIME | 6-Prob Tokens / Avg tok/s |
Total (16p) Tokens / Time / tok/s |
113K Needle (recalled) / DSpark Accept |
|---|---|---|---|---|---|---|---|
Stock (T=1, inert) |
9/10 (1 cap) |
6,966t (β) |
52.6s / 132.6 |
6/6 |
6,792t / 97.3 |
13,758t / 122.4s / 112.4 |
True (15.4s) / 68.6% |
Jason R5-A@300 (T=2) (8T, all coda) |
10/10 |
6,189t (-11.2%) |
100.3s / 61.7 |
6/6 |
5,672t / 57.8 |
11,861t (-13.8%) / 198.3s / 59.8 |
True (16.3s) / 65.4% |
Jason R5-A@300 (T=3) (8T, all coda) |
10/10 |
5,283t (-24.2%) |
108.8s / 48.6 |
6/6 |
8,323t / 41.7 |
13,606t (-1.1%) / 308.6s / 44.1 |
True* (17.1s) / 68.5% |
MIT v1b-coda2@300 (T=2) (5T, L38β39 βοΈ) |
10/10 |
5,232t (-24.9%) |
72.5s / 72.2 |
6/6 |
7,158t / 64.8 |
12,390t (-9.9%) / 182.9s / 67.7 |
True (16.0s) / 74.5% |
Quick Start
hf download JordiHugging/spark-ds41f-loop-adapter \
--include "checkpoints/v2-super-coda2-step000600/*" \
--local-dir ./loop-adapter
- With
spark-ds41f(PR #1357 β recommended starting config):
(For maximum long-CoT depth, testVLLM_DS41_LOOP_DIR=/path/to/loop-adapter/checkpoints/v2-super-coda2-step000600 \ VLLM_DS41_LOOP_DEPTH=2 \ VLLM_DS41_LOOP_CD_OMEGA=0.20 \ VLLM_DS41_LOOP_CD_REF=prevVLLM_DS41_LOOP_DEPTH=3 VLLM_DS41_LOOP_CD_OMEGA=0.0.) - With
sushi:sushi ... --loop /path/to/loop-adapter/checkpoints/v2-super-coda2-step000600 --loop-depth 2 - Verify integrity:
shasum -a 256 -c SHA256SUMS
License
Released under the MIT License (see LICENSE). Base model weights remain subject to DeepSeek's MIT License.
Quantized
Model tree for JordiHugging/spark-ds41f-loop-adapter
Base model
deepseek-ai/DeepSeek-V4.1-Flash-1017