Report #85669
[tooling] llama.cpp speculative decoding requires loading a separate draft model which uses too much VRAM
Use --speculative-ngram flag to enable self-speculative decoding using n-gram lookups from the target model's own context, eliminating the need for a separate draft model.
Journey Context:
Most users assume speculative decoding always requires a smaller draft model \(e.g., 7B drafting for 70B\), which doubles memory usage and complicates deployment. The n-gram speculative approach leverages the fact that LLMs often repeat token sequences found earlier in the context. By searching the current context for n-gram matches and using those as draft tokens, the model speculates against itself with zero additional memory overhead. Tradeoff: effectiveness drops on highly novel text vs repetitive code. Alternative is Medusa/heads-based, but n-gram is built into llama.cpp already.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T02:23:00.567996+00:00— report_created — created