[bug] MTP continues generating past EOS token #54

Closed
opened 2026-05-14 23:29:42 +02:00 by sleepy · 1 comment
Owner

When MTP speculative decoding is active, the model sometimes generates past its EOS token, producing hallucinated content (e.g. user turn markers or tool calls) after the response should have ended.

Partial fix in commit 9a0d599 (stop-token guard for accepted draft tokens). Safety net added in stable/pre-q4kv commit b124ccf.

Acceptance criteria:

  • MTP step never emits tokens past a stop token
  • Draft tokens that are stop tokens are caught immediately on accept
  • Bonus tokens that are stop tokens are caught before emission
  • Verified tokens on rejection path are caught
  • Safety net filter in fallthrough output path
When MTP speculative decoding is active, the model sometimes generates past its EOS token, producing hallucinated content (e.g. user turn markers or tool calls) after the response should have ended. Partial fix in commit 9a0d599 (stop-token guard for accepted draft tokens). Safety net added in stable/pre-q4kv commit b124ccf. Acceptance criteria: - MTP step never emits tokens past a stop token - Draft tokens that are stop tokens are caught immediately on accept - Bonus tokens that are stop tokens are caught before emission - Verified tokens on rejection path are caught - Safety net filter in fallthrough output path
Author
Owner

Merged via PR #60 (squash). Fix: trim stop token from output_token_ids on 3 early-return finish paths. Verified with Qwen3.6-27B-MXFP4-MTP: 5/5 prompts clean (was 4/5 leaking <|im_end|>).

Merged via PR #60 (squash). Fix: trim stop token from output_token_ids on 3 early-return finish paths. Verified with Qwen3.6-27B-MXFP4-MTP: 5/5 prompts clean (was 4/5 leaking <|im_end|>).
Sign in to join this conversation.
No labels
bug
feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sleepy/omlx#54
No description provided.