How did the original paper for speculative decoding for LLMs implement it? 1. Draft…
Private research annotation
Sign in to add a private research label or note.
- User
How did the original paper for speculative decoding for LLMs implement it? 1. Draft model should have made the same exact greedy decoded token to be accepted. 2. The draft token may also be accepted if it is above an acceptable predefined logprob. The first approach will always output the same text regardless of speculation, while the second approach will differ.
Assistant
The original paper on speculative decoding for Large Language Models (LLMs) implemented the technique using the first approach you mentioned: Original Implementation The original speculative decoding method, as proposed in the ICML 2023 paper, used a strict acceptance criterion: The draft model generates speculative tokens. The target LLM verifies these tokens. A drafted token is accepted only if it matches the exact greedy decoded token that the target LLM would have produced.aclanthology+1 This implementation ensures that the final output remains identical to what would have been generated through standard autoregressive decoding, regardless of speculation.openreview Key Aspects Draft Model: A smaller, faster model (e.g., LLaMA-7B) generates speculative tokens.developer.nvidia Target Model: A larger, slower model (e.g., LLaMA-70B) verifies the drafted tokens.developer.nvidia Verification Process: The target LLM computes accurate probabilities for the drafted tokens in one pass.openreview Acceptance Criterion: Each token is evaluated sequentially, with an acceptance probability of min(1, p'_t/p_t), where p'_t is the draft model's probability and p_t is the target model's probability.openreview Implications This strict implementation guarantees: Consistency: The output is always identical to standard greedy decoding. Quality Preservation: It maintains the generation quality of the target LLM. Results: The process yields the same text output regardless of speculation. The second approach you mentioned, using a predefined logprob threshold, was not part of the original implementation but has been explored in subsequent research to potentially improve acceptance rates and overall efficiency.arxiv