# Poster 29058

- Kind: Poster
- Talk page and recording: https://iclr.cc/virtual/2025/poster/29058

> Transcript of the talk's recording (session_asr), made by speech recognition or taken from the host's captions. It may contain errors. The words are the speakers'; listen to the recording on the talk's page before quoting it.

Hi everyone, my name is Nadav Timor. I'm excited to share our joint work with collaborators at the Weizmann Institute, Internet Labs, and Texas A&M.
Our research focuses on distributed speculative inference or speculative decoding. Let's explore how speculative inference looks on a timeline. At the top we see autoregressive inference, that is non speculative or abbreviated as no take. It runs a single target model sequentially. Each forward pass generates one token. At time t_ one it generates two tokens, at time t_ two it generates four tokens since it completes four forward passes. For si the yellow squares show when the drafter generates draft tokens. After each draft token is generated, we form a batch of size two.
You the current prompt and the prompt with the draft token. We then run the target model over this patch.
In the best case all draft tokens are accepted. At time t one s i has already generated k tokens and currently runs the second iteration. By time t two it completes four iterations and generates eight tokens. However, in the worst case all draft tokens are rejected. At time t one s i generates only one token, making it slower than non s i. This happens because the drafter adds latency without contributing valid tokens. The take away here is that s i might slow down inference when the drafter is too slow or inaccurate. To understand when slowdowns happen, we use simulations. The x axis of the graph
Shows the drafter's latency, relative to the target model. A value of one means that it takes the same time to run the drafter and the target model, while a value close to zero means the drafter is very fast. The y axis shows the acceptance rate, which is the probability that the drafter's tokens are accepted. A value of one means all tokens are accepted, while zero means all are rejected. The colors represent the speed up. The speed up is defined to be the latency of non si divided by the latency of si. Pink areas indicate slow downs, where si is slower than non si.
Speedups only happen when the drafter is both fast and accurate. The problem is that such drafters often do not exist off the shelf. Practitioners typically use the smallest model from a model family like LAMA as a drafter. But sometimes these small models are too slow or there is no family at all. In these practical cases you'd need to train a drafter from scratch, which is often challenging and resource intensive. Our proposed algorithm solves this problem: it works with any drafter.
In the worst case it is as fast as non si, and in the best case it offers significant speedups. Before introducing our Distributed Variational Spectrum Dim Inference, let me share a field's observation about a fundamental imitation of si: while it's true that si leverages GPU batching, a type of data parallelism, this timeline reveals that si is still quite sequential.
It won't start an iteration of drafting and verification until the verification of the previous iteration has completed. This sequential dependency eliminates further speedups, which brings us to our distributed approach. Let me now introduce Distributed Speculative Inference, or d s i This is a new algorithm we propose to extend speculative inference by introducing a novel parallelization technique called Speculation Parallelism. Speculation parallelism allows us to view different gpus as independent threads or servers that can overlap. We've mathematically proven that d s i is faster than non s i, and in expectation...
faster than a site when using drafters with a non-zero acceptance rate. We also prove that dsi preserves the target distribution. Importantly, dsi works on any hardware setup with at least two GPUs by adjusting the lookahead hyperparameter that controls the number of draft tokens per iteration. At a high level, dsi works as follows. It always runs all models in parallel. When you give it a prompt, both the target and the drafter start immediately. Whenever a new token is computed, dsi uses that information to immediately run all models again. In this example, once the drafter generates a draft token, we take the initial point plus the new draft.
The draft output can run both models on this updated input. A key principle of D_S_I_ is that it terminates threads if they rely on invalidated tokens. Specifically, when a target is given a valid code and generates a new token, we use the standard verification method of speculative decoding to compare the draft token and the target token; if the draft token is rejected, all threads relying on that token are terminated. And we continue from the last valid sequence.
If the draft token is accepted, the process continues as normal. Here's why this is efficient: We don't wait for verification to complete before running the next iteration. In this example, three new tokens were generated using only one target forward, and two draft forwards. So if the drafter's latency is less than half, then the overall latency of generating these three new tokens is less than two target forwards.
This makes d s i significantly faster than both s i and the null s i. To evaluate the extent to which d s i is faster than s i and null s i, we conducted simulations of all three algorithms. In our simulations, the overall latency of an algorithm is dominated by two factors: the latency of the modules and the acceptance rate, namely the average likelihood that the drafter's tokens are accepted. The simulations allow us to visualize continuous heat maps showing the expected speed up of d s i given any drafter. The colors represent the speed ups of d s i compared to the alternative.
The left heat map shows the speedups compared to s i, the middle heat map we compared to non s i, and the right heat map shows how this i is faster than the fastest baseline. In all three heat maps, d s i is always as fast as the baseline and often significantly faster. We also conducted another experiment using the popular Stock order benchmark of quadrature machines. We measured the forward latency of the Stock order fifteen billion parameter model and the one hundred sixty eight million parameter model as a drafter. We also estimated the acceptance rate between these two models.
These measurements show that the draught or latency is after a third of the target latency, and the acceptance rate is around ninety per cent. Based on these measurements, our simulations suggest that this site provides significant speedups compared to a site on different data sets. Thank you for your attention. I'd be happy to discuss this work further, answer any questions, or explore potential collaborations. Feel free to reach out to me during the conference.
