vllm - 💡(How to fix) Fix [Feature Request] SLEM (String-Level Exact Match) speculative decoding for heterogeneous vocabularies [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Implement SLEM (String-Level Exact Match) speculative decoding as a complement to TLI (#38173 / #38174). While TLI restricts the draft model to the vocabulary intersection, SLEM lets the draft use its full vocabulary and verifies at the text level — achieving higher acceptance rates when vocabulary overlap is low (cross-family pairs).

Both algorithms are from the same ICML 2025 oral paper:

Accelerating LLM Inference with Lossless Speculative Decoding Algorithms for Heterogeneous Vocabularies Timor et al., https://arxiv.org/abs/2502.05202

Root Cause

Implement SLEM (String-Level Exact Match) speculative decoding as a complement to TLI (#38173 / #38174). While TLI restricts the draft model to the vocabulary intersection, SLEM lets the draft use its full vocabulary and verifies at the text level — achieving higher acceptance rates when vocabulary overlap is low (cross-family pairs).

Both algorithms are from the same ICML 2025 oral paper:

Accelerating LLM Inference with Lossless Speculative Decoding Algorithms for Heterogeneous Vocabularies Timor et al., https://arxiv.org/abs/2502.05202

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Summary

Implement SLEM (String-Level Exact Match) speculative decoding as a complement to TLI (#38173 / #38174). While TLI restricts the draft model to the vocabulary intersection, SLEM lets the draft use its full vocabulary and verifies at the text level — achieving higher acceptance rates when vocabulary overlap is low (cross-family pairs).

Both algorithms are from the same ICML 2025 oral paper:

Accelerating LLM Inference with Lossless Speculative Decoding Algorithms for Heterogeneous Vocabularies Timor et al., https://arxiv.org/abs/2502.05202

Motivation

TLI (PR #38174) works well for same-family pairs with 95%+ vocabulary overlap (e.g., Qwen2.5-0.5B → Qwen2.5-1.5B). But for cross-family pairs — which are the most common real-world scenario — the intersection shrinks significantly:

Draft → TargetOverlap
Qwen2.5-0.5B → Qwen2.5-1.5B99.8%
SmolLM2-135M → Qwen2.5-1.5B~72%
Llama-3.2-1B → Qwen2.5-7B~75%

When TLI constrains draft logits to a 72% intersection, the draft model's quality degrades — it can't express ~28% of its vocabulary, leading to lower acceptance rates and reduced speedup.

SLEM solves this by operating at the string level: the draft generates freely, its output is decoded to text and re-tokenized for the target, and verification uses exact matching. The draft's full expressiveness is preserved.

Algorithm (from the paper)

  1. Draft model generates K tokens using its full vocabulary (no logit masking).
  2. Decode draft tokens to text, re-tokenize with target tokenizer → m target tokens.
  3. Single batched forward pass on target model over the m candidate tokens.
  4. Sample from target logits at each position: t'_1, ..., t'_{m+1}.
  5. Find first mismatch: j = argmin_j { t'_j != t_j }.
  6. Accept t_1, ..., t_{j-1}, t'_j (matched prefix + bonus token from target).

Key properties:

  • Provably lossless (Theorem 2.1 in the paper)
  • Draft uses full vocabulary → higher quality proposals
  • Up to 2.8x speedup reported in the paper (vs. 1.7x for TLI)

References

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING