Why does AI type one word at a time? Tencent's open DSpine drafts 16 at once

In speculative decoding a small drafter guesses ahead and the big model checks it all in one pass. We explain how Tencent YouTu Lab's open DSpine for Qwen3.8-27B improves the method, how it was trained and how to try it on your own server.

Paylaş
Why does AI type one word at a time? Tencent's open DSpine drafts 16 at once

When you watch a chatbot's answer appear word by word, you are watching how the model works. Language models produce text in pieces called tokens, and they run the whole model once for every piece. For a 27-billion-parameter model that means billions of calculations again for each token. Much of the GPU's time does not even go into the math; it goes into reading the model's parameters from memory over and over.

One of the most effective ways to cut that wait is speculative decoding. DSpine, built by researchers at Tencent YouTu Lab and Shanghai Jiao Tong University, is a new step in that line of work. On 7 November the team released its DSpine draft model for Qwen3.8-27B on Hugging Face under the Apache 2.0 license. A Qwen3-8B version came out in October; the method is described in the arXiv paper and the code is on GitHub. This article explains how the method works, what DSpine changes and how to try it on your own server.

Drafter and editor: how the method works

Think of speculative decoding as a newsroom desk. A fast assistant guesses how the sentence continues and writes a draft of several words. The experienced editor, the large model, checks the whole draft in one reading. The part of the draft that is correct from the start is kept as is; at the first wrong word the editor writes its own word and the rest of the draft is thrown away. The gain is that one run of the large model can move the text forward by five or six tokens instead of one.

The best part is that quality does not change at all. The verification rule mathematically preserves the large model's own probability distribution. The output is exactly what the large model would have written on its own, only faster. That is why the key number here is the acceptance length: how many tokens the large model advances per round on average.

The drafter itself also costs time. Older drafters such as EAGLE-3 still wrote the draft one token at a time, so a longer draft meant a longer queue. A method called DFlash changed this by predicting a whole 16-token block at once, in parallel. That brings speed and a new problem. Each position in the block guesses without knowing which word the position before it will pick. Individually sensible words can form an inconsistent sentence, and because verification stops at the first error, one inconsistency wastes the rest of the cheaply made draft.

DSpine's idea: every position hears its neighbor's guess

Earlier fixes (Domino, DSpark, DFlash2) tried to restore that link at the very end of the drafter with a small extra module. DSpine moves the link inside the network. After each of the drafter's five layers, every position receives what the position right before it is currently predicting. A small gate decides how much of that message to take in, because guesses in shallow layers may not have formed yet. All positions still update at the same time, while the chain of dependency builds up layer by layer through the depth of the network. That is where the name comes from: a spine that links the block together.

The team arrived at this design from two observations. Reading DFlash's layers one by one, they saw that early positions already form much of their prediction in the first layers. In a second test they measured what happens when only the neighboring word is swapped. Even with all earlier context correct, using the neighbor's draft guess instead of the correct word lowered the next word's accuracy by 31.8 points on average. When the same correct neighbor information was given in earlier layers, accuracy came out 14.8 points higher. The neighbor matters both for its content and for its timing.

A second step follows the last layer. Each position lists its 16 most likely candidates and words are picked from left to right; the chosen word is written into the next position through the same channel, updating its scores. Doing this in sequence would be slow, so DSpine uses a transition cache: it scores every candidate pair of two neighboring positions in advance, in parallel. During selection there is no matrix math left, only a table lookup.

How it was trained

During training the large model, the input word table and the output layer are frozen; only the drafter learns. The data was ShareGPT conversations, but the answers were rewritten by the large model itself with thinking mode off, so the drafter learned the real style of the model it imitates. Each training block has one fixed starting token and 15 positions to predict. In the paper's Qwen3-8B run the batch was 112 sequences with a maximum length of 3,072 tokens; training ran six epochs (3,655 steps), with the learning rate warming up over the first 146 steps and following a cosine curve down to zero.

The shared language the messages travel in comes from the large model's output layer. Each row of that layer stands for a word, so the team normalized the rows and reduced them to 1,024 dimensions with principal component analysis. In this unified transfer space a predicted word and a decided word take the same form. Predictions at every layer are pulled toward the correct word's direction in this space with a cosine loss. The main loss, following DSpark's design, mixes cross-entropy with a probability distance.

Early in training the drafter's guesses are too weak to learn from, so the team used a correct-neighbor curriculum. In the first three layers, for randomly chosen blocks, the correct word is given in place of the neighbor's guess. The rate stays at its highest for the first sixth of training and reaches zero by one third. Because the new channels start at zero, training begins exactly like an ordinary DFlash drafter. The whole addition is about 33 million parameters, roughly 3% of the backbone.

What was tried and did not work

The most instructive part of the paper is how to supervise the middle layers. The obvious route is to ask every layer to find the right word over the full vocabulary. That route fell below even the baseline: on MATH-500 the acceptance length was 3.75 without supervision and dropped to 3.67 with it. The team attributes this to forcing middle layers to classify early, which disturbs the context work of later layers. A cosine loss that supervises only the direction raised the same score to 3.85.

Removing components one at a time shows that the two parts complement each other. Without the final neighbor update, acceptance length fell by 6.6% to 7.1%; removing in-layer injection as well widened the drop to 8.8% to 10.7%. The team also used one-directional attention inside blocks instead of two-directional attention, so the correct information given during training cannot leak back to earlier positions.

What the numbers say

In the paper's comparison every drafter was retrained on the same data with the same settings. On Qwen3-8B the mean acceptance length across seven math, code and chat tests is 3.77 for DFlash, 4.39 for DFlash2 and 4.82 for DSpine. The cost of a draft round stayed almost the same, 7.14 milliseconds for DSpine against 7.19 for DFlash2. With more tokens accepted per round, the time per generated token fell by 10.9%. In SGLang serving tests the speedup over plain decoding reached up to 4.0x.

Results for the new Qwen3.8-27B drafter are on the model page. According to the page, acceptance length on the GSM8K math test is 5.69 for DFlash2 and 7.20 for DSpine. On agent work, measured by replaying recorded tool-use sessions, end-to-end throughput is 2.71x to 3.84x that of plain decoding. On τ²-bench in high-reasoning mode, for example, it goes from 340 to 978 tokens per second; on SWE-bench Pro acceptance length rises from 4.19 to 4.99.

How to try it

DSpine is not a standalone model; it runs as the drafter next to Qwen3.8-27B. You need Python 3.11 and a CUDA GPU, and the install also brings SGLang 0.5.22. With the settings on the model page, one GPU serves up to eight requests at a time with up to 128K tokens of context:

git clone https://github.com/Tencent/DSpine.git
cd DSpine
pip install -e .

sglang serve \
  --model-path Qwen/Qwen3.8-27B \
  --speculative-algorithm DSPINE \
  --speculative-draft-model-path tencent/Qwen3.8-27B-DSpine-b16 \
  --speculative-num-draft-tokens 16 \
  --dtype bfloat16 --attention-backend fa3 \
  --context-length 131072 --max-running-requests 8 \
  --reasoning-parser qwen3 --tool-call-parser qwen3_coder \
  --trust-remote-code

The team also provides a guide for tuning the verification budget to your own GPU and workload. Support for Apple-silicon Macs through mlx-lm and SGLang-MLX has been added. If you want to train a drafter for your own model, the training code is in SpecForge. The Apache 2.0 license allows free use, including commercial use.

The numbers shared are the team's own measurements, and the gain depends on how many requests run at once: in the paper the speedup drops to about 1.6x at 32 concurrent requests, because a busy server already keeps the GPU full. The biggest difference shows up when a single user or a small team is waiting.

Sources: Hugging Face model page, GitHub, arXiv paper, Project page, Qwen3-8B drafter, SpecForge training code