cd /news/ai-agents/why-2x-faster-decoding-only-saved-16… · home › topics › ai-agents › article
[ARTICLE · art-182085] src=l8w8.github.io ↗ pub= topic=ai-agents verified=true sentiment=· neutral

Why 2x faster decoding only saved 16% on 512K local coding agents (M5 Ultra)

Doubling warm decode speed with Native Multi-Token Prediction on a Mac Studio M5 Ultra 512 GB cut matched multi-turn coding-agent session wall time by only 16.0% on DeepSeek V4.1 Flash and 7.4% on GLM 5.3 Flash, the author's own benchmark of Pi 1.6.1, OpenCode 2.0.25 and DeepSeek Harness 0.2.2-rc.5 across eight multi-file Python and TypeScript tasks found. Decode rose from 45.2 to 98.9 tok/s for DeepSeek V4.1 Flash on oMLX 0.8.4 and from 23.0 to 47.1 tok/s for GLM 5.3 Flash on llama.cpp b12774 at 512K context, but cold prefill dominated: 512K time-to-first-token was 5m 56s on DeepSeek and 19m 52s on GLM, falling to 7.5s and 9.6s once the prefix cache warmed. Disabling OpenCode 2.0.25's background session-title request in opencode.json removed 280.4s of summed duplicate prefill across 4 DeepSeek tasks and 995.7s across 4 GLM tasks.

recommendation

Size SSD prefix cache to 128 GiB for 256K contexts and 192 GiB for 384K-512K, and disable OpenCode's background title agent, which re-prefilled 100.5K-155.5K-token prompts and added 280.4s-995.7s per four tasks.

more in playbook: Inference and self-hosting
read3 min views2 publishedDec 4, 2026

Single-prompt tok/s benchmarks make local coding-agent performance look deceptively simple. Turn on Native Multi-Token Prediction (MTP) on a Mac Studio M5 Ultra 512 GB and warm decode roughly doubles even at 512K context: DeepSeek V4.1 Flash jumps from 45.2 to 98.9 tok/s on oMLX 0.8.4, and GLM 5.3 Flash jumps from 23.0 to 47.1 tok/s on llama.cpp b12774.

Yet when I ran real multi-turn terminal coding agents (Pi 1.6.1, OpenCode 2.0.25, and DeepSeek Harness 0.2.2-rc.5) on eight multi-file Python and TypeScript tasks inside a network-isolated Linux sandbox, doubling decode speed cut matched total session wall time by only 16.0% on DeepSeek (7.7% at 512K) and 7.4% on GLM (2.4% at 512K).

1. Past 128K Context, Cold Prefill and Cache Reuse Dominate #

Real coding agents read repositories, run tests, inspect tracebacks, and edit multiple files over 8 to 16 turns. Every turn re-sends the growing conversation history. To measure the ceiling honestly, I ran 15 controlled six-turn ladders and 64 graded Pi coding sessions starting at exact native prompt sizes of 393,216 (384K) and 524,288 (512K) tokens with zero cached tokens at start.

Model in Pi 384K solves / med 512K solves / med 512K cold TTFT 512K cached TTFT 512K warm tok/s
DeepSeek V4.1 Flash (oMLX 0.8.4 + MTP) 8/8 · 6m 33s 8/8 · 8m 30s 5m 56s 7.5s 98.9
GLM 5.3 Flash (llama.cpp b12774 + MTP) 7/8 · 16m 54s 6/8 · 21m 51s 19m 52s 9.6s 47.1
Muse Spark Open 816B (oMLX 0.8.4 ) 6/8 · 28m 14s 7/8 · 39m 15s 21m 27s 21.0s 12.3

Once the prefix cache warmed (>99% token reuse on follow-ups), a 512K follow-up dropped from 5m 56s to 7.5s on DeepSeek and from 19m 52s to 9.6s on GLM. Across all 64 Pi sessions, prompts grew as high as 582,983 tokens with zero automatic compactions and 100% Normal macOS memory pressure (9,002 samples, zero swap growth; median session-average package power 136 W DeepSeek, 113 W GLM, 156 W Muse).

2. The 1-Line OpenCode Setting That Saved 2 to 4 Minutes Per Task #

Comparing three coding-agent harnesses on the exact same DeepSeek V4.1 Flash setup (~100K-165K starting prompts) turned up an immediate, fixable local-LLM trap. By default, OpenCode 2.0.25 fires a background session-title request carrying the entire initial 100.5K-155.5K prompt just to generate at most 15 tokens of title text.

That single duplicate prefill added 280.4s of summed API prefill across 4 DeepSeek tasks and 995.7s across 4 GLM tasks. Turning background titles off in opencode.json fixed it immediately:

{
  "agents": {
    "title": {
      "disabled": true
    }
  }
}

3. Three Real Operational Limits I Hit Along the Way #

  1. Manual compaction is expensive when it fires: Triggering Pi compaction on GLM at301,640 estimated tokens took10m 6s (606.3s ) for the summary call, followed by an uncached39,067 -token continuation that took another81s to first token before recovering prefix caching and passing all checks.
  2. SSD prefix-cache sizing breaks silently if too small: On Muse Spark 816B, each serialized 2,048-token boundary page on disk carried~496 MiB of rotating-window state. A64 GiB SSD cache budget evicted the shared prefix chain around ~270K tokens and forced full473-504s cold re-prefills. Raising the SSD cache to128 GiB (256K) and192 GiB (384K-512K) restored98.4-99.3% hit rates cleanly.
  3. Parallel agents and reasoning effort: On original contexts (aggressive memory guard), DeepSeek + Pi solved8/8 across three seeds (42/43/44 ) and across Low (2.1m ), High (3.4m ), and Max (4.6m ) effort. Two staggered agents solved2/2 cleanly in5m 9s (vs5m 31s sequential), while 3- and 4-agent groups each missed one task (2/3 ,3/4 ).

Reproduce Everything Yourself (MIT Fixture + CC BY 4.0 Data):

• Full Episode 003 dataset, Waypoint MIT fixture, held-out grading suite & 38 evidence files:

github.com/l8w8/videos/tree/main/2026/003-m5-ultra-coding-agents-512k

• 9-minute visual walkthrough on YouTube:

youtu.be/Mr9sj51ccoE

• Earlier episodes:

Part 1 (22 Setups)·

Part 2 (+63% Native MTP)

── more in #ai-agents 4 stories · sorted by recency
── more on @mac studio m5 ultra 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/why-2x-faster-decodi…] indexed:0 read:3min 2026-12-04 · —