Paper: 2DSD: Two-Dimensional Speculative Decoding for Looped Language Models
Code: SqueezeAILab/2DSD
Target model: Dory1.0-4B run with R = 4 loops, nvidia/NVIDIA-Nemotron-Labs-Dory1.0-4B-BF16, either with last-loop KV sharing (W = 64, applied without adaptation) or with per-loop KV; one drafter serves both.
Run it with the depth-conditioned drafting implemented in the 2DSD repository;
--model dory1.0-4b loads this drafter with Dory1.0-4B and last-loop KV sharing:
python scripts/generate.py --model dory1.0-4b --prompt "What is the sum of the first 100 positive integers?"
Add --target original to run the per-loop KV target.
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 = 4, H100 NVL.
| Task | Autoregressive | 2DSD |
|---|---|---|
| GSM8K | 87.4 | 442.8 (5.07×) |
| MATH-500 | 87.2 | 432.8 (4.96×) |
| HumanEval+ | 88.5 | 512.5 (5.79×) |
| MBPP+ | 88.7 | 390.8 (4.41×) |
| AIME24/25 | 85.2 | 343.9 (4.04×) |
| GPQA-Diamond | 85.5 | 314.1 (3.67×) |
| OlympiadBench | 85.5 | 337.0 (3.94×) |
| Average | 86.9 | 396.3 (4.50×) |
Autoregressive is the base model with per-loop KV on vLLM; 2DSD runs with last-loop KV sharing,
r1 = 1 and r2 = 2. With per-loop KV (--target original) its average is 370.8 tok/s (4.22×).
This drafter is trained on outputs of NVIDIA-Nemotron-Labs-Dory1.0-4B and ships a copy of Dory's LM head (lm_head.weight in model.safetensors) and of its per-vocabulary-entry logit scale (target_head_scale.pt). It is released under the OpenMDW License 1.1, the license of Dory1.0-4B; a copy of the agreement is in LICENSE.
Notice of origin: lm_head.weight in model.safetensors and logit_scale in target_head_scale.pt are unmodified copies of lm_head.weight and lm_head.logit_scale from nvidia/NVIDIA-Nemotron-Labs-Dory1.0-4B-BF16 (NVIDIA), and initializer_range is the value in that checkpoint's config.json.
@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.5 GBtarget_head_scale.pt 263.9 kBmask_embedding.pt 6.8 kB