Guessing Whole Phrases Instead of Word Pieces Makes AI Text Up to 2.4x Faster (Phrase-Level Speculative Decoding)

4 min read

The trick behind fast LLM serving (running large language models for many users) is simple to state and hard to do well. A small model drafts a few tokens (chunks of text), the big model checks them all at once, and you keep the ones the big model agrees with. It is called speculative decoding, and it works because checking is cheap while generating one token at a time is slow.

New to these terms? Every word is explained in the series glossary.

Every version of this I knew about drafts in the same unit: single tokens from the target model's own vocabulary (its fixed list of known tokens). Medusa, EAGLE-3, DFlash, DSpark, they all do it that way. A paper this week made me stop and ask why, because the tokenizer, the program that chops text into tokens, itself makes that unit a bad fit for whole phrases.

The problem is how BPE tokenizers are built (byte pair encoding, which builds tokens by merging frequent pairs of pieces). The pretokenizer splits text on whitespace before any merges are learned, so no multi-word string can ever become a single token. In Qwen3-4B, a 4-billion-parameter model, "United States of America" is four tokens, and no adjacent pair of them exists as one entry in the vocabulary. A phrase is simply out of reach for any method that drafts in the target model's vocabulary. The drafter can never propose the phrase as one thing.

The fix in this paper changes the unit. A small MLP head (a small add-on network) reads the frozen (unchanged) target model's hidden state (its internal numbers) and predicts a one- to three-word phrase as a single entry in a separate draft vocabulary. Greedy longest-match expansion then maps that phrase back into the target model's own tokens, and N candidates get verified in one forward pass (one run of the model) behind a prefix-tree mask. The change sits alongside tree depth and width, it does not replace them. The target model and its tokenizer stay frozen, and a candidate is accepted only while it matches the target's own argmax (its single top choice), so the output served is identical to greedy decoding, apart from floating-point tie-breaking.

sequenceDiagram
    autonumber
    participant T as Target model (frozen)
    participant H as Phrase head (MLP)
    participant X as Longest match expander
    participant O as Output
    T->>H: Hidden state
    H->>H: Predict 1 to 3 word phrases
    Note over H: One entry each in a draft vocabulary
    H->>X: N phrase candidates
    X->>T: Candidates mapped to target tokens
    T->>T: Verify all N in one forward pass
    Note over T: Prefix tree mask
    T->>O: Keep tokens while they match its argmax
    Note over T,O: Output identical to greedy decoding

Diagram: A small head drafts whole phrases, which are mapped back to target tokens and verified in one pass.

The numbers are what sold me. They ran it on a single A5000 graphics card, batch size 1 (one request at a time), against plain HuggingFace generate, with Qwen3-4B as the target. The head has 21.94M parameters (learned numbers), about half a percent of the target model. It ran GSM8K (school maths problems) 2.391 times faster, MATH-500 (harder maths) 2.444 times, and MT-Bench (multi-turn chat) 1.544 times. The size is the point. Every entry in the draft vocabulary costs one row of 257 parameters in the head's output layer, so how many phrases you can draft is set by how much size you are willing to spend. A smaller head with 8,000 entries needs only 3.434M parameters, less than a tenth of a percent of the target, 64 times smaller than the drafter EAGLE-3 uses. Even that small one holds on to 92.3% of the bigger head's per-pass token count on GSM8K.

Speedup over HuggingFace generate(), Qwen3-4B on one A5000
GSM8K2.4xMATH-5002.4xMT-Bench1.5x
Data from the sources listed below.

Against EAGLE-3 run on the same prompts and baseline, the 21.94M head is ahead of tree-16 on both maths sets and behind tree-60 on every set. So it is not a clean win over the strongest setup. It is a much cheaper way to get most of the gain, and the gain is biggest where the model is doing maths, where the phrases are most predictable. MT-Bench, open chat, only gets 1.544x, which tells you the phrase trick helps most when the next words are forced by the problem rather than by style.

There is a cost the abstract does not hide. The head is small but it is trained, one per target model, and it only drafts phrases of one to three words. For free-form chat, the win shrinks. But for maths, code, and anything with repeated phrasing, drafting in phrases instead of tokens feels like the right unit, and I expect to see this idea show up inside serving engines soon.

Try this

These commands fetch the paper from arXiv with curl and install the Transformers library.

bash
curl -s https://arxiv.org/abs/2611.12464
pip install transformers
python -c "import transformers; print(transformers.__version__)"

Sources