Speculative Decoding & Inference Optimisation
Language models generate text one token at a time, and each token requires a full pass through the model. This sequential process is the primary bottleneck for response speed, and it can't be parallelised in the way training can. Speculative decoding is an ingenious workaround: a small, fast "draft" model generates several tokens quickly, and the large model then verifies them all at once (verification can be parallelised). When the draft model guesses correctly - which it often does for predictable text - you get the large model's quality at closer to the small model's speed. Other inference optimisations include KV-cache management (storing intermediate calculations so they don't need repeating), batching (processing multiple requests together to use hardware more efficiently) and continuous batching (dynamically grouping requests to maximise throughput). Model compilation - converting models into optimised formats for specific hardware - can also yield significant speed improvements. For businesses, inference optimisation directly affects user experience and costs. Faster inference means lower latency for your users and lower per-query costs for you. When evaluating AI providers, their inference infrastructure and optimisation capabilities matter as much as the underlying model quality - a great model served on poorly optimised infrastructure is both slow and expensive.