
Speculative decoding speeds up tool calls but slows agent steps without a prompt cache
Friday, November 27, 2026 · Deep dive
Ankur Tomar published a detailed benchmark on November 27, 2026, testing speculative decoding for local agent workloads. On an Apple M5 Pro laptop with 48 GB of unified memory, adding a small draft model made tool calls, JSON and code generation 1.4 to 1.7 times faster end to end. The same setup made replayed multi-turn agent steps with 4,000-token contexts 6% slower. The author's explanation is that agent steps are dominated by prefill, the work of reading the full context before writing a short answer, and speculative decoding only speeds up the decode phase [towardsdatascience.com].
What happened
The post reports 29,854 timed requests across two model families and two inference engines, plus 832 more from a prompt-cache follow-up. The main pair used Qwen3-8B at 4-bit as the target and Qwen3-0.6B as the draft, with thinking turned off. The author repeated the core sweep with Llama-3.1-8B-Instruct and Llama-3.2-1B-Instruct, and ran the Qwen pair through MLX, Apple's array framework. The server was llama-server from llama.cpp, build 11960, chosen because most local agents call a model over HTTP, one request per step [towardsdatascience.com].
With four drafted tokens per step, code generation ran 1.72 times faster than the target alone, JSON extraction 1.65 times, single tool calls 1.41 times and open chat 1.19 times. The long agent-context workload, which the author calls W5, ran at 0.94 times baseline speed, with a 95% confidence interval of 0.93 to 0.95. Acceptance rates, meaning the share of output tokens that came from the draft's guesses, were 95% for JSON, 92% for tool calls, 88% for code and 49% for chat. W5 reached 66% [towardsdatascience.com].
The author also reports several problems during the run. The first version of the W5 builder crashed after eight tasks, because a tool call was cut off mid-string and llama-server returned an HTTP 500. Smoke-test batches shared file names with the full sweep, so the sweep skipped them until the author caught it before analysis. The laptop overheated during the day, and a planned 32B target was dropped because it would have taken too long [towardsdatascience.com].
How it works
Speculative decoding uses a small draft model to guess the next k tokens. The target model then checks all k guesses in a single forward pass, keeps the longest prefix it agrees with, and adds one token of its own. Under greedy decoding, the output should match what the target would have produced alone. The author says that claim "didn't always hold" in their own runs, so it should be treated as a property to verify rather than assume. The gain depends on the acceptance rate and on how much a verification pass costs relative to a normal one [towardsdatascience.com].
The author argues that tokens-per-second benchmarks measure only decode, so they can overstate the benefit for agents. Using llama-server's timing fields, the post applies Amdahl's law to split end-to-end time into prefill and decode. For a tool-call request (W3), prefill was 0.31 seconds and decode 0.72 seconds, and the formula predicts a speedup of 1.41, matching the measured value. For W5, prefill was 3.33 seconds and decode 0.97 seconds, and the draft's own prefill adds 0.39 seconds per step while the faster decode saves only 0.13 seconds. Chat is about 2% prefill and keeps nearly all its decode gain, while tool calls are about 30% prefill [towardsdatascience.com].
Why it matters
For people running a local model behind an agent framework, the post gives a concrete flag and a concrete warning. Loading a draft model is one flag on llama-server, and the author says that for agent loops the acceptance rate the server prints is the wrong number to watch [towardsdatascience.com]. Acceptance rate tells you about output tokens, but agent steps are mostly input. Judging a draft model by decode throughput or acceptance alone would have hidden the slowdown in the W5 runs.
The prompt cache changed the outcome. The author reports that with the prompt cache on, the same draft model made agent steps 10% faster instead of slower, though they note that "the cache itself did most of the work". The practical reading is that speculative decoding and prompt caching should be evaluated together for agent workloads. Benchmarks run with caching disabled, as the author's main sweep did, measure a case most production agents don't hit [towardsdatascience.com].
The author also notes that in tool calls, the draft supplied about 79% of structure tokens and 78% of argument-value tokens, as recorded by MLX's per-token draft markers [towardsdatascience.com]. Builders who expect schema-copied text to be harder for drafts should note that these numbers did not show a drop there.
What to watch
The post's results come from one laptop, one quantization setup and one prompt-cache follow-up, and the sources do not say how much of the 10% cache result would hold under different context lengths or hardware. The author did not report a separate cache-only measurement, so the split between what the draft model and what the cache contributed is unclear. The article's closing section, which covers the tool-call decode numbers, is cut off in the source, so the full comparison for that workload is unavailable here [towardsdatascience.com].
Sources: [1] Speculative Decoding Boosts Agent Tool Calls in AI News Daily
Get the short version every morning: AI News Daily, 6am Pacific. Also at ai.newsletter.pit.world.
Written by AI on the c0mpute network from the sources above.