Accelerated Test-Time Scaling with Model-Free Speculative Sampling

1KAIST, 2Amazon AGI, 3AirSignal
†Work done during an internship at Amazon. ‡Work done at Amazon.
EMNLP 2025
Oral Presentation
Majority vote accuracy versus normalized total decoding time on AIME-2024 for Plain, ANPD, SAM, Recycle, and STAND.

AIME-2024

Majority vote accuracy versus normalized total decoding time on GPQA-Diamond for Plain, ANPD, SAM, Recycle, and STAND.

GPQA-Diamond

Pass@k versus normalized total decoding time on LiveCodeBench for Plain, ANPD, SAM, Recycle, and STAND.

LiveCodeBench

STAND reaches the same accuracy as plain decoding in less than 40% of the decoding time.

Accuracy vs. total decoding time (normalized to plain decoding) with DeepSeek-R1-Distill-Qwen-7B on a single A100 GPU. Reward-weighted majority voting accuracy for AIME-2024 and GPQA-Diamond, and pass@k for LiveCodeBench.

Abstract

Language models have demonstrated remarkable capabilities in reasoning tasks through test-time scaling techniques like best-of-N sampling and tree search. However, these approaches often demand substantial computational resources, creating a critical trade-off between performance and efficiency. We introduce STAND (STochastic Adaptive N-gram Drafting), a novel model-free speculative decoding approach that exploits the inherent redundancy in reasoning trajectories to achieve significant acceleration without compromising accuracy. Our analysis shows that reasoning paths frequently reuse similar reasoning patterns, enabling efficient model-free token prediction without requiring separate draft models. By introducing stochastic drafting and preserving probabilistic information through a memory-efficient logit-based N-gram module, combined with optimized Gumbel-Top-K sampling and data-driven tree construction, STAND significantly improves token acceptance rates. Extensive evaluations across multiple models and reasoning tasks (AIME-2024, GPQA-Diamond, and LiveCodeBench) demonstrate that STAND reduces inference latency by 60-65% compared to standard autoregressive decoding while maintaining accuracy. Furthermore, STAND consistently outperforms state-of-the-art speculative decoding methods across diverse inference patterns, including single-trajectory decoding, batch decoding, and test-time tree search. As a model-free approach, STAND can be applied to any existing language model without additional training, making it a powerful plug-and-play solution for accelerating language model reasoning.

Motivation

Reasoning trajectories reuse the same n-grams

We measured n-gram overlap across multiple solutions generated by DeepSeek-R1-Distill-Qwen-7B on AIME-2024. Up to 97% of bigrams and 80% of 4-grams recur across 16 reasoning trajectories, and even with only two trajectories, over 90% of bigrams are repeated.

Any n-gram the model is about to generate has likely appeared in an earlier trajectory, so previously generated n-grams can serve as draft sequences without a separate draft model.

Line chart of n-gram overlap rates for 2- to 5-grams across 2 to 16 reasoning trajectories on AIME-2024.

N-gram overlap across k reasoning trajectories (AIME-2024).

Stochastic drafting is accepted more often

Reasoning models are usually run with sampling. With deterministic drafting, a drafted token is accepted with probability p(xdraft), which can be low when the target model is uncertain. Sampling the draft from a distribution aligned with the target raises the acceptance probability.

Existing model-free drafters do not store a probability distribution with their n-gram lookups. In our measurements, stochastic drafting gives 5%, 7%, and 8% higher acceptance probabilities than deterministic drafting on AIME, GPQA, and LiveCodeBench.

Bar chart comparing token acceptance probability of deterministic and stochastic drafting on AIME, GPQA, and LiveCodeBench.

Acceptance probability with a depth-1, width-3 draft tree (DeepSeek-R1-Distill-Qwen-7B).

Method

Overview of STAND. Left: token-based n-gram drafting stores the sampled token, while the logit-based n-gram module stores the logit distribution and drafts stochastically. Right: data-driven draft tree optimization prepares a large tree, tracks per-node acceptance probability on real data, keeps the best nodes, and forms an optimized draft tree.

(Left) The N-gram module stores logits, which enables stochastic drafting. (Right) Data-driven draft tree optimization starts from a large draft tree, measures node-wise acceptance rates during speculative decoding on real data, and prunes it to retain the most successful paths.

Logit-based adaptive N-gram module

Instead of storing pairs of n-grams and their next tokens, STAND stores the distribution from which the next token was sampled. To keep memory constant, only the top-k token indices and their probabilities are kept. When an n-gram seen k times appears again, the stored distribution is averaged with the new one using weights k/(k+1) and 1/(k+1), and the result is truncated to the top-10 tokens. Like previous n-gram drafters, STAND keeps separate lookup tables from unigrams to 4-grams.

Stochastic tree drafting with Gumbel-Top-K

For each position in the draft tree, STAND looks up matching n-grams from 4-grams down to unigrams and uses the first match, which returns the top-10 candidate tokens with their probabilities. It then samples as many tokens as the node needs children, without replacement, and verifies them with standard speculative sampling.

Sampling is done in parallel with the Gumbel-Top-K trick. Gumbel noise is added to each candidate's log probability, φi' = φi − log(−log Ui) with Ui ~ Uniform(0, 1), and the top-k perturbed values are taken. The noise terms are pre-computed and cached, and refreshed when depleted, so sampling overhead is separated from drafting.

Data-driven draft tree optimization

Dynamic draft trees adapt to context but add overhead, while static trees are cheap but depend on how they are built. STAND builds its static tree from data. It starts from a large tree with 625 nodes, runs speculative decoding on 30 samples, tracks which nodes are frequently part of accepted paths, and keeps the top-80 nodes as a compact tree.

Results

We evaluate on AIME-2024 (math), GPQA-Diamond (STEM QA), and LiveCodeBench (coding) with DeepSeek-R1-Distill-Qwen-7B and 14B, sampling at temperature 0.6 on a single A100 GPU. Baselines are Prompt Lookup Decoding (PLD), Adaptive N-gram Parallel Decoding (ANPD), Token Recycle (Recycle), SAM-Decoding (SAM), SAM+Recycle, and Eagle-2 as a model-based baseline. All methods share the same codebase adapted from Spec-Bench and a draft length of 80 tokens. We report throughput (T, tokens per second, with speedup over plain decoding) and acceptance length (A, average tokens accepted per speculation step).

Multi-trajectory decoding

When multiple reasoning trajectories are generated sequentially for each problem, STAND has the highest throughput and acceptance length, and both improve as the number of trajectories grows. Token Recycle stays flat as trajectories increase, likely because its lookup table overwrites old entries with information from new trajectories.

Method4 traj.8 traj.16 traj.
DeepSeek-R1-Distill-Qwen-7B
PlainT28.5728.5728.57
Eagle-2T29.74 (×1.04)29.74 (×1.04)29.74 (×1.04)
A2.112.112.11
PLDT46.14 (×1.61)47.69 (×1.67)48.70 (×1.70)
A1.771.841.90
ANPDT49.74 (×1.74)51.08 (×1.79)52.04 (×1.82)
A1.911.952.01
SAMT47.73 (×1.67)49.45 (×1.73)51.36 (×1.80)
A1.841.911.98
RecycleT64.50 (×2.26)64.73 (×2.27)64.48 (×2.26)
A2.742.742.75
SAM+RecycleT64.58 (×2.26)64.68 (×2.26)64.62 (×2.26)
A2.712.712.69
STAND (Ours)T72.72 (×2.55)75.24 (×2.63)78.15 (×2.74)
A3.333.513.67
DeepSeek-R1-Distill-Qwen-14B
PlainT17.7817.7817.78
Eagle-2T24.04 (×1.35)24.04 (×1.35)24.04 (×1.35)
A2.562.562.56
PLDT24.78 (×1.39)25.59 (×1.44)26.58 (×1.49)
A1.771.851.93
ANPDT26.24 (×1.48)27.09 (×1.52)27.81 (×1.56)
A1.901.962.03
SAMT25.89 (×1.46)26.96 (×1.52)28.17 (×1.58)
A1.811.902.00
RecycleT36.00 (×2.02)35.98 (×2.02)36.03 (×2.03)
A2.742.742.74
SAM+RecycleT35.73 (×2.01)35.97 (×2.02)36.28 (×2.04)
A2.692.692.69
STAND (Ours)T39.99 (×2.25)42.13 (×2.37)44.20 (×2.49)
A3.293.463.64

Average throughput (T) and acceptance length (A) over AIME, GPQA, and LCB, with 4, 8, and 16 trajectories per problem. Per-task results are in the paper.

Single-trajectory decoding

STAND is designed to use information across trajectories, but it also reaches the highest acceptance length and throughput in most settings when only one long reasoning chain is generated.

MethodAIMEGPQALCBAvg.
DeepSeek-R1-Distill-Qwen-7B
PlainT26.6331.3427.7528.57
Eagle-2T29.91 (×1.12)31.69 (×1.01)27.61 (×0.99)29.74 (×1.04)
A2.211.992.132.11
PLDT44.34 (×1.67)42.84 (×1.37)43.40 (×1.56)43.53 (×1.52)
A1.721.641.591.65
ANPDT46.18 (×1.73)54.05 (×1.72)44.79 (×1.61)48.34 (×1.69)
A1.881.821.801.83
SAMT40.85 (×1.53)48.45 (×1.55)42.92 (×1.55)44.07 (×1.54)
A1.691.691.801.73
RecycleT60.61 (×2.28)71.00 (×2.27)60.12 (×2.17)63.91 (×2.24)
A2.732.712.732.72
SAM+RecycleT61.15 (×2.30)71.51 (×2.28)62.78 (×2.26)65.15 (×2.28)
A2.702.812.692.73
STAND (Ours)T61.79 (×2.32)75.39 (×2.41)66.41 (×2.39)67.86 (×2.38)
A3.073.053.013.04
DeepSeek-R1-Distill-Qwen-14B
PlainT17.7618.1617.4317.78
Eagle-2T25.38 (×1.43)24.86 (×1.37)21.89 (×1.26)24.04 (×1.35)
A2.722.442.512.56
PLDT21.82 (×1.23)24.97 (×1.38)21.76 (×1.25)22.85 (×1.28)
A1.611.641.581.61
ANPDT25.60 (×1.44)26.40 (×1.45)23.16 (×1.33)25.05 (×1.41)
A1.761.791.761.77
SAMT23.26 (×1.31)25.38 (×1.40)22.36 (×1.28)23.67 (×1.33)
A1.631.651.631.64
RecycleT33.71 (×1.90)38.91 (×2.14)33.85 (×1.94)35.49 (×2.00)
A2.772.732.712.74
SAM+RecycleT34.35 (×1.93)37.53 (×2.07)34.45 (×1.98)35.44 (×1.99)
A2.672.722.702.70
STAND (Ours)T34.52 (×1.94)38.71 (×2.13)34.86 (×2.00)36.03 (×2.03)
A2.913.002.932.95

Throughput (T) and acceptance length (A) for generating a single sequence.

Batch decoding and test-time tree search

In batch decoding, the n-gram drafter can only use content produced up to the current step. STAND still gives clear speedups at batch size 8, while Token Recycle gives marginal gains at batch size 4 and slows decoding at batch size 8. Within Diverse Verifier Tree Search (DVTS), STAND reaches an average speedup of 2.54×.

MethodAIMEGPQALCBAvg.
Batch Size 4
PlainT89.0488.3292.6490.00
RecycleT90.51 (×1.02)98.41 (×1.11)89.55 (×0.97)92.82 (×1.03)
A1.771.831.721.77
STAND (Ours)T127.58 (×1.43)134.64 (×1.52)122.09 (×1.32)128.10 (×1.42)
A2.572.742.572.63
Batch Size 8
PlainT111.62106.23114.73110.86
RecycleT99.18 (×0.89)105.69 (×0.99)99.2 (×0.86)101.36 (×0.91)
A1.661.751.631.68
STAND (Ours)T148.08 (×1.33)154.68 (×1.46)149.41 (×1.30)150.72 (×1.36)
A2.702.862.692.75

Batch decoding (DeepSeek-R1-Distill-Qwen-7B).

MethodAIMEGPQALCBAvg.
PlainT33.3533.1232.2232.90
RecycleT71.52 (×2.14)70.64 (×2.13)69.47 (×2.16)70.54 (×2.14)
A2.732.692.742.72
STAND (Ours)T82.62 (×2.48)86.93 (×2.62)80.97 (×2.51)83.51 (×2.54)
A3.553.713.513.59

Diverse Verifier Tree Search (DeepSeek-R1-Distill-Qwen-7B).

Both speculative decoding methods use trees optimized on OpenThoughts-114k.

Ablations

Stochastic drafting gives higher acceptance lengths than deterministic drafting on all tasks, and the Gumbel-Top-K implementation keeps a similar acceptance length while reducing latency, giving the highest throughput. A tree optimized on AIME-2024 outperforms the heuristic tree from Token Recycle on AIME-2024 and on out-of-domain GPQA-Diamond.

MethodAIMEGPQALCBAvg.
PlainT26.6331.3427.7528.57
DeterministicT62.13 (×2.33)73.67 (×2.35)63.44 (×2.29)66.41 (×2.32)
A2.942.982.902.94
StochasticT63.44 (×2.38)81.20 (×2.59)65.90 (×2.37)70.18 (×2.46)
A3.243.563.293.36
+ Gumbel-Top-KT64.99 (×2.44)83.47 (×2.66)69.70 (×2.51)72.72 (×2.55)
A3.213.483.303.33

Effect of stochastic drafting (4 sequences, DeepSeek-R1-Distill-Qwen-7B).

AIMEGPQA (OOD)
HeuristicOptimizedHeuristicOptimized
Throughput59.9664.9977.3283.47
Acc. Lens3.173.213.353.48

Effect of tree optimization (4 sequences, DeepSeek-R1-Distill-Qwen-7B, with trees optimized on AIME-2024).

Optimized tree structure

The tree optimized for STAND reaches 13 levels, compared to 7 levels for the tree optimized for Token Recycle under the same size budget. A higher acceptance rate favors deeper, narrower trees. The STAND tree also has a long tail of single nodes at depths 8 through 13, which suggests occasional long, deterministic sequences shared across reasoning trajectories.

Number of nodes at each depth for draft trees optimized for Token Recycle and STAND.

Number of nodes per depth in trees optimized on AIME-2024.

BibTeX

@inproceedings{song2025stand,
  author    = {Song, Woomin and Dingliwal, Saket and Jayanthi, Sai Muralidhar and Ganesh, Bhavana and Shin, Jinwoo and Galstyan, Aram and Bodapati, Sravan Babu},
  title     = {Accelerated Test-Time Scaling with Model-Free Speculative Sampling},
  booktitle = {Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing},
  year      = {2025},
}