Paper: 2DSD: Two-Dimensional Speculative Decoding for Looped Language Models
Code: SqueezeAILab/2DSD
Target model: Nanbeige4.2-3B with last-loop KV sharing (W = 64), minseo25/2dsd-nanbeige4.2-3b-shared-kv.
Run it with the depth-conditioned drafting implemented in the 2DSD repository;
--model nanbeige4.2-3b loads this drafter with its shared-KV target:
python scripts/generate.py --model nanbeige4.2-3b --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 = 2, H100 NVL.
| Task | Autoregressive | 2DSD |
|---|---|---|
| GSM8K | 157.8 | 368.1 (2.33×) |
| MATH-500 | 156.0 | 412.0 (2.64×) |
| HumanEval+ | 159.1 | 415.1 (2.61×) |
| MBPP+ | 159.3 | 353.7 (2.22×) |
| AIME24/25 | 146.8 | 362.1 (2.47×) |
| GPQA-Diamond | 148.6 | 283.9 (1.91×) |
| OlympiadBench | 145.5 | 350.6 (2.41×) |
| Average | 153.3 | 363.6 (2.36×) |
Autoregressive is the base model (Nanbeige4.2-3B, per-loop KV) on vLLM; 2DSD runs the shared-KV target with r1 = 1.
Apache License 2.0, as for Nanbeige4.2-3B (Nanbeige/Nanbeige4.2-3B), from which it is derived: it is trained on the target's outputs and ships a copy of the target's LM head. 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 2.5 GBmask_embedding.pt 7.8 kB