cd /news/large-language-models/what-i-gave-up-to-make-speculative-d… · home › topics › large-language-models › article
[ARTICLE · art-159153] src=dev.to ↗ pub= topic=large-language-models verified=true sentiment=· neutral

What I Gave Up to Make Speculative Decoding Faster

A developer implemented mentored decoding in mini-vllm-rs, a Rust inference engine for macOS, to test whether relaxing lossless speculative sampling speeds up generation. Using quantized Qwen2.5 7B as the target and 0.5B as the draft on an Apple M2, the developer found that at a TV budget of 1 — where every draft token is accepted — fixed-4 generation still took 24.4 seconds versus 21.0 seconds for target-only, because draft generation, target verification and cache updates remained. The work maps where speculation beats target-only latency and what distributional fidelity must be sacrificed to get there.

by read5 min views3 publishedOct 28, 2026

On a creative-writing prompt, my target LLM rejected most tokens proposed by the smaller draft model. Speculative decoding was slower than running the target alone. I wanted to recover that wasted work. How much faster could generation become if I let the draft have more influence over the output?

Lossless speculative sampling preserves the target model’s output distribution. Relaxing that requirement might improve acceptance, but the resulting text would need a closer look.

I explored this tradeoff with mentored decoding in mini-vllm-rs, my Rust inference engine for macOS. Using quantized Qwen2.5 7B as the target and 0.5B as the draft on an Apple M2, I eventually found a faster configuration. Deciding when I would use it turned out to be a different question.

In an earlier benchmark, a code-refactoring prompt worked well under greedy decoding. A policy that adaptively adjusted the draft token count usually selected 8-token proposals, achieved 98.5% acceptance, and raised decode throughput by 38.3% over target-only. However, on the creative-writing prompt, the same policy delivered 36.8% lower decode throughput than target-only, also under greedy decoding.

I then explored the creative-writing prompt with multinomial sampling at temperature 0.7 (sampling benchmark). Lossless speculative sampling with a fixed draft token count of 4 achieved only 28.6% acceptance.

Mentored decoding allows a bounded shift from the target distribution toward the draft. I implemented its linear-interpolation construction.

Let p be the target distribution and q the draft distribution, both after temperature and repetition penalties. Their total-variation distance is: Given a TV budget D , the interpolation weight is:

If d=0 , the distributions match exactly, and we take θ=1 . The resulting output distribution is: A draft token x sampled from q is accepted with probability:

After a rejection, the sampler draws a replacement from the normalized positive residual max(p−q,0) . Together, acceptance and correction produce the distribution π .

At TV budget 0, this preserves the target distribution. At TV budget 1, the budget covers every possible TV distance, so θ=1 and π=q . Every draft token is then accepted.

Intermediate budgets limit the per-step distributional deviation from the target. They do not measure how much semantic quality the output loses.

I first set the TV budget to 1, so every draft token was accepted. Even then, fixed-4 generation took 24.425 seconds, versus 20.971 seconds for target-only.

Rejection was gone, but execution cost remained. Each round still generated 4 draft tokens autoregressively, verified their positions with the target, sampled, and updated both models’ cache state. My implementation emits no extra target bonus token after a fully accepted proposal, so a successful round produced only 4 output tokens.

The draft-only control took 3.372 seconds. At TV=1, target verification was an expensive way to follow the draft distribution. That endpoint helped diagnose the remaining cost, but I wanted a speedup while retaining more of the target distribution.

To find where speculation could beat target-only E2E latency, I tested fixed draft token counts of 6 and 8 at full acceptance. I then lowered the TV budget to find the smallest tested value that still produced a clear speedup (benchmark report).

The prompt and temperature stayed fixed. Every request generated 256 tokens with EOS ignored. After warm-up, each setting had 3 independent untraced timing invocations, each covering 3 random seeds.

Configuration Acceptance Avg. rounds/request Median E2E latency
Target-only — — 20.971 s
Fixed-4, TV=1 100% 64 24.425 s
Fixed-6, TV=1 100% 43 20.587 s
Fixed-8, TV=1 100% 32 18.508 s
Fixed-8, TV=0.75 93.4% 34 18.820 s
Fixed-8, TV=0.5 63.5% 46 22.900 s

Fixed-6 was approximately equal to target-only within observed variability. Fixed-8 clearly crossed the baseline. At full acceptance, it needed 32 verification rounds per request instead of fixed-4’s 64, allowing more output to share each verification call.

Verification also crossed a kernel-dispatch boundary, as in my continuous-batching experiments. Here, 4-row verification used row-wise GEMV, while full 6- and 8-row proposals used regular quantized matmul. Proposal length and kernel dispatch changed together, so these measurements do not isolate their individual contributions.

For fixed-8, increasing the budget from 0.5 to 0.75 reduced average verification rounds from 46 to 34. Generation moved from 9.2% slower than target-only to 10.3% sooner. Each seed’s median improved by roughly 8–10% at TV=0.75. To judge what that speedup bought me, I inspected the creative-writing output. The prompt places Mara, a mechanic, and Ilyan, an archivist, in a lunar greenhouse abandoned for 20 years to investigate a distress signal. It specifies fresh condensation despite the lack of power, and patches of blue light reflected from Earth.

In one target-only sample, the characters treat the condensation as evidence that someone may have visited or something is changing. In the TV=0.75 output using the same seed, the roof reveals:

“a thin sliver of blue light streaming through—Earth’s infrared, indicating that it was not the end of this system but only an interruption in its normal operation.”

Infrared is not visible blue light. The passage also jumps from that light to a diagnosis of the system without explaining the connection.

At TV=1, the same seed produced an identity error. Immediately after Mara explained the greenhouse, the text continued:

“I'm Ilyan Sato, the archivist from the station,” she added.

Mara had taken the other character’s name and role.

The complete prompt and samples show different adherence or continuity problems across all 3 TV=0.75 outputs. These are qualitative observations from 1 prompt, and the 256-token cutoff limits judgments about plot development.

I started by trying to recover rejected draft work. Raising acceptance helped, but even 100% acceptance was insufficient with 4-token proposals. Longer proposals finally crossed the latency baseline, and reducing the TV budget showed that complete acceptance was unnecessary.

The faster setting also changed the output in ways that the timing table could not capture. The TV budget controlled a mathematical distance, while the text exposed physical inconsistencies and broken reasoning. What I gave up was the guarantee of preserving the target distribution. Whether the time saved justified that change required reading the result, not just measuring how quickly it arrived.

── more in #large-language-models 4 stories · sorted by recency
── more on @mini-vllm-rs 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/what-i-gave-up-to-ma…] indexed:0 read:5min 2026-10-28 · —