Speculative generation in voice agents
/AI/4 min read
Start writing the reply when the user merely seems to have finished, and throw it away if they keep talking. Starting at 150 ms of silence instead of 500 saves 350 ms on every turn it guesses right — at the cost of about half again as many generated tokens.
A cascaded voice agent normally works in sequence: wait until it is confident the user has finished, then send the transcript to the language model, then speak. The waiting is the problem. To avoid cutting people off, endpointing has to hold out for a fairly long silence — and the model does nothing during it.
Speculative generation uses that time. As soon as the user might have finished, the agent starts generating a reply from the transcript so far. If the user really has finished, the reply is already under way. If they carry on, the draft is thrown away and the agent tries again at the next pause.
The saving
Suppose the agent's endpointing commits after 500 ms of silence, and the language model needs about 410 ms — first token plus the first sentence — before there is anything to speak.
| reply ready after the user stops | |
|---|---|
| wait, then generate | 500 + 410 = 910 ms |
| start speculatively at 150 ms of silence | 150 + 410 = 560 ms |
350 ms earlier, on every turn where the guess was right — which is a large share of a voice agent's entire budget. The audio is not played until endpointing actually commits, so the user is never interrupted; the reply is simply ready the moment it is allowed to start.
The expected saving depends on how often the early guess holds:
| early guess correct | average saving per turn |
|---|---|
| 60% | 210 ms |
| 80% | 280 ms |
| 90% | 315 ms |
The cost: discarded work
Every wrong guess is generation that gets thrown away. If a typical turn contains two pauses that look like endings but are not, and each speculative run gets about 20 tokens in before being cancelled, that is 40 discarded tokens per turn — against a reply of around 78. Roughly half again as much generation.
How much that matters depends on where the cost lands:
- Prefill is mostly cached. Each speculative run shares the long prefix — system prompt and conversation so far — with the previous one. With prompt caching, only the new words of the transcript are processed again.
- Decode stops early. A cancelled run is stopped the moment the user speaks again, so it rarely produces more than a sentence.
- Capacity is the real cost. Under heavy load, speculative runs compete with real ones for GPU time. Systems often speculate less, or not at all, when servers are busy.
When the transcript changes
The subtle case is a user who stops, the agent speculates, and the final transcript differs slightly from the partial one used — a word corrected by the recogniser, a last word that arrived late. Two options:
- Discard and regenerate whenever the final transcript differs at all. Safe, and gives up the saving on those turns.
- Keep the draft if the difference is immaterial — punctuation, casing, a filler word. Requires a judgement about what "immaterial" means, which is easy to get wrong for numbers and names.
Most systems take option 1 for anything beyond trivial differences.
Making the guesses better
The value of speculation rises with the accuracy of the early guess, so it pairs naturally with better turn detection:
- A turn-detection model that reads the partial transcript can tell "I'd like to book a table for" (clearly unfinished — do not speculate) from "that's all, thanks" (clearly finished — speculate immediately).
- Speculate only above a confidence threshold, trading a little saving for much less waste.
- Allow more than one speculative run at once only when capacity is plentiful.
Speculation beyond the reply
The same idea applies to other slow steps. If the user's intent is clear early — "what's my balance" — the agent can start the account lookup before they finish speaking. If they say something else, the result is discarded. Tool calls with no side effects are ideal for this; anything that changes state must never be started speculatively.
What to take away
Speculative generation starts the language model when the user seems to have stopped, and discards the draft if they continue. Starting at 150 ms of silence instead of 500 ms has the reply ready 350 ms sooner on every correct guess — about 280 ms on average at 80% accuracy.
The price is discarded generation, roughly half again as many tokens, softened by prompt caching and early cancellation. Use a turn-detection model to decide when to speculate, never speculate actions with side effects, and scale speculation back when the servers are busy.