Paper: 2DSD: Two-Dimensional Speculative Decoding for Looped Language Models
Code: SqueezeAILab/2DSD
Target model: TML-d24-varloop-research, the variable-loop counterpart of Inkling 2 Mini, run with R = 3 loops and per-loop KV, thinkingmachines/TML-d24-varloop-research.
Run it with the depth-conditioned drafting implemented in the 2DSD repository;
--model inkling-2-mini-varloop loads the target and --drafter this drafter:
python scripts/generate.py --model inkling-2-mini-varloop \
--drafter minseo25/2dsd-inkling-2-mini-varloop-dspark-drafter \
--prompt "What is the sum of the first 100 positive integers?"
Decoding is greedy by default. Add --temperature 0.6 --top-p 0.95 to sample. 2DSD verifies with the last
loop, so it keeps the target's greedy outputs and sampling distribution.
Decode throughput in output tok/s (speedup vs. autoregressive), with repetitive responses filtered out. Concurrency 1, greedy decoding, R = 3, H100 NVL.
| Task | Autoregressive | MTP | 2DSD |
|---|---|---|---|
| GSM8K | 93.1 | 225.1 (2.42×) | 292.0 (3.14×) |
| MATH-500 | 92.8 | 243.7 (2.63×) | 339.0 (3.65×) |
| HumanEval+ | 93.0 | 298.5 (3.21×) | 368.1 (3.96×) |
| MBPP+ | 93.0 | 284.5 (3.06×) | 323.2 (3.47×) |
| AIME24/25 | 91.8 | 257.9 (2.81×) | 313.9 (3.42×) |
| GPQA-Diamond | 91.8 | 240.2 (2.62×) | 264.2 (2.88×) |
| OlympiadBench | 91.5 | 250.4 (2.74×) | 294.6 (3.22×) |
| Average | 92.5 | 257.2 (2.77×) | 313.6 (3.37×) |
Autoregressive and MTP (the drafter bundled with the checkpoint) run on the official vLLM engine; 2DSD uses r1 = 1 and r2 = 2.
The same drafter, trained at R = 3, also drafts for the target run with R = 4 and R = 5 loops, without retraining:
| Task | Autoregressive (R = 4) | 2DSD (R = 4) | Autoregressive (R = 5) | 2DSD (R = 5) |
|---|---|---|---|---|
| GSM8K | 73.6 | 267.7 (3.64×) | 60.7 | 218.5 (3.60×) |
| MATH-500 | 73.3 | 322.1 (4.39×) | 60.5 | 258.8 (4.28×) |
| HumanEval+ | 73.4 | 334.1 (4.55×) | 60.5 | 244.4 (4.04×) |
| MBPP+ | 73.4 | 300.7 (4.09×) | 60.6 | 245.4 (4.05×) |
| AIME24/25 | 72.6 | 299.6 (4.13×) | 60.0 | 249.3 (4.16×) |
| GPQA-Diamond | 72.6 | 252.9 (3.48×) | 59.9 | 198.0 (3.31×) |
| OlympiadBench | 72.4 | 283.3 (3.91×) | 59.7 | 226.6 (3.80×) |
| Average | 73.0 | 294.3 (4.01×) | 60.3 | 234.4 (3.88×) |
2DSD uses r1 = 2 at R = 4, and r1 = 2 and r2 = 4 at R = 5. The bundled MTP drafter supports R = 3 only.
Average accuracy (%) over the seven tasks, greedy decoding.
| Loops | Autoregressive | MTP | 2DSD |
|---|---|---|---|
| R = 3 | 79.2 | 79.7 | 78.2 |
| R = 4 | 79.9 | – | 80.0 |
| R = 5 | 79.0 | – | 80.1 |
2DSD produces the same outputs as autoregressive decoding on its own runner; the differences from the official engine reflect numerical differences between the two engines.
Apache License 2.0, as for TML-d24-varloop-research (thinkingmachines/TML-d24-varloop-research), on whose outputs it is trained. It ships no weights of the target. The license text is in LICENSE.
@misc{kim2026twodsd,
title = {2DSD: Two-Dimensional Speculative Decoding for Looped Language Models},
author = {Kim, Minseo and Chavan, Arnav and Seo, Minhyuk and Hu, Yuezhou and Lee, Minjae and
Kang, Wonjun and Mahoney, Michael W. and Keutzer, Kurt and Hooper, Coleman and Gholami, Amir},
year = {2026},
url = {https://github.com/SqueezeAILab/2DSD}
}
model.safetensors 1.1 GBmask_embedding.pt 6.3 kB