Skip to content

Skip MTP probes while drafts go unused#385

Open
pandysp wants to merge 1 commit into
antirez:mainfrom
pandysp:mtp-probe-skip
Open

Skip MTP probes while drafts go unused#385
pandysp wants to merge 1 commit into
antirez:mainfrom
pandysp:mtp-probe-skip

Conversation

@pandysp

@pandysp pandysp commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Loading --mtp makes every plain (non-speculative) eval run the MTP drafter, and when the next call is also a plain eval the draft is invalidated unused. Sampled decoding does this on every token, so any temp>0 span pays a full drafter pass per token with no way to use the result. Measured on an M4 Max (q2-q4-imatrix base, Q4K/Q8 MTP head), paired and interleaved: generating at temp 0.7 with --mtp loaded runs 6.5% slower [6.3, 6.7] than without it. The tax is easy to miss because any baseline with --mtp loaded pays it too, including DS4_MTP_SPEC_DISABLE runs.

The fix is one session counter: when a pending draft is invalidated unused, skip the next 15 probes; a consumed draft resets it. Greedy decoding never arms the skip, since its drafts are always consumed, so the speculative path is untouched: greedy output is byte-identical with and without the patch on copy and prose prompts, and --mtp-verify-depth passes.

With the patch, sampled generation with --mtp loaded is back to within 0.4% [0.1, 0.8] of not loading it. Under a live pi coding-agent task against ds4-server (mixed greedy tool-call spans and sampled spans, 250k ctx), token-weighted decode improves +2.7% to +7.6% over three paired rounds (mean +5.4%), with the task succeeding in every run.

Not addressed, measured for scope: low-acceptance greedy content (free-flowing prose at temp 0) still pays the probe for drafts that are consumed but rejected; that is the -5.4% draft-2 row in the #369 table, a different effect from this tax. A rate-based gate prototype recovers about half of it; glad to send that separately if you want it, kept out of here so this stays one mechanism.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant