Glossary

Speculative Decoding

A way to make a large language model answer faster without changing what it says: a small draft model guesses the next few tokens, and the big model checks them all at once.

General definition

Speculative Decoding is an optimisation for autoregressive inference. A standard LLM produces one token per forward pass, and each pass is dominated by the time it takes to move the model’s weights through GPU memory rather than by arithmetic. Speculative decoding fills that idle compute: a small draft model (or a cheap heuristic) proposes a short run of candidate tokens, and the large target model scores all of them in one pass. Accepted tokens are kept, the first rejected token is replaced by the target model’s own choice, and the loop continues.

The method was described in 2023 by Leviathan, Kalman and Matias at Google and independently by Chen and colleagues at DeepMind. Its key property is that the acceptance rule is a form of rejection sampling, so the distribution of the final text is exactly the distribution the target model would have produced on its own. It is a speed gain, not a quality trade.

  • Draft sources: a smaller model from the same family, extra prediction heads attached to the target model (Medusa, EAGLE), or n-gram lookup in the prompt itself
  • Typical gain: roughly two to three times faster token generation when the draft model agrees with the target most of the time
  • Where it fails: if the draft is a poor match, most proposals are rejected and the overhead of drafting can make generation slower
  • Serving support: vLLM, TensorRT-LLM, llama.cpp and other inference servers expose it as a configuration option

Speculative decoding complements rather than replaces other inference optimisations. It sits alongside the KV cache, batching and quantization, and it helps most when a server is handling a few long generations rather than saturating the GPU with many parallel requests, where the spare compute it exploits no longer exists.

Need this on your own servers? See how Ethora runs a self-hosted LLM and AI agent on your infrastructure, so your data stays in your network.

In the Ethora ecosystem

In the Ethora AI SDK each agent is pointed at a model of your choice, including self-hosted models served through OpenAI-compatible endpoints such as Ollama or vLLM. Speculative decoding is enabled on that serving layer, not inside Ethora, so the agent code does not change: the room simply sees replies arrive faster.

That matters in chat because response latency is felt directly. A support agent answering inside a group room, or an assistant replying in the embeddable widget, is judged on how quickly the first words land. Teams that must keep model traffic on their own hardware for compliance reasons can use speculative decoding on a single GPU server to close much of the speed gap with hosted model APIs, without giving up data residency.

Get started

Run AI agents on your own infrastructure

Private models, RAG over your documents and full data ownership, on your AWS, Azure or on-premises servers.

See self-hosted AI
Free tier available Enterprise SLA No vendor lock-in