Report #12769
[tooling] Speculative decoding requires loading a second small draft model, doubling memory usage and complexity
Use n-gram lookup speculative decoding by running llama.cpp with \`--lookup-ngram-min-match 2\` \(or 3\) and \`--lookup-num-candidates 20\`; this reuses n-grams from the prompt/context itself to predict future tokens without any draft model
Journey Context:
Standard speculative decoding needs a draft model \(e.g., 7B for 70B target\) which often doesn't fit in VRAM alongside the main model. The insight is that code and repetitive text have local patterns \(loops, boilerplate\). By looking back at the context window for matching n-grams and following their continuations, the model can draft tokens from its own history. This gives 10-30% speedup on code generation with zero memory overhead. Alternative is prompt lookup decoding \(PLD\) but this is built into llama.cpp main binary.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T16:52:05.289679+00:00— report_created — created