Notizie IA Logo

AITalk

News and analysis on Artificial Intelligence

DSpark: DeepSeek's bet on speed that doesn't betray quality

ResearchGenerative AIApplications

dspark.jpg

DeepSeek has not only presented a new approach to speculative decoding; with DeepSpec, it is trying to transform it into a reproducible industrial pipeline. The paper is called DSpark, the acronym is yet another in a long series that the Chinese lab churns out almost quarterly, and the temptation to scroll through it distractedly is strong. That would be a mistake, because behind the acronym hides a very concrete question: how much can the inference of a language model really accelerate if the model that generates the draft responses stops being naive, and if the system that checks them learns not to waste time on those destined for the bin.

To understand why the question is relevant, it's worth starting from an uncomfortable fact that anyone who has used a chatbot has experienced without knowing it. Every word a language model produces is born from an entire calculation pass through billions of parameters, one at a time, in sequence. It's a bit as if a novelist had to re-read the entire manuscript from the beginning before writing every single subsequent word. It works, but it's slow, and in a system that must respond to hundreds of requests simultaneously, that slowness translates into queues, electricity costs, and users staring at a flashing cursor.

The inference bottleneck

Speculative decoding is the idea, now no longer brand new, that tried to break this pattern: instead of making only the large and expensive model work, a small and fast model, called a draft model, is placed alongside it to venture a sequence of future tokens. The large model, which we'll call the target, checks them all together in a single pass, accepting the longest prefix compatible with what it would have generated itself and discarding the rest. If the draft guesses well, the target collects more words for each calculation pass, and generation accelerates without losing a gram of quality, because the acceptance rule is built not to alter the large model's statistical distribution.

The problem is that the draft model design determines an uncomfortable compromise. The first drafts were autoregressive, i.e., they generated one token at a time conditioning each on the previous ones: good at maintaining internal consistency, but with a generation cost that grows linearly with the proposed block of words, which forces them to stay small and propose short blocks. Parallel architectures, like works such as DFlash, have solved the opposite problem: they produce all the words in the block in a single pass, making generation time almost independent of block length, and this allows for much longer blocks. But parallelization comes at a price, because each position is predicted in isolation from the others, without knowing what the neighboring positions have "decided."

It's the same paradox as the surrealist exquisite corpse, the game dear to André Breton in which several people write a sentence in turn, seeing only the last word left by the previous person: the result can be surprising, but often collapses into a jumble of fragments that make sense individually and are incoherent together. When a parallel draft has to choose between "certainly" and "no problem" as a response to a greeting, it can easily produce an unreadable mix of the two, because neither choice knows about the other's existence. The paper's authors call this phenomenon multimodal collision, and it's the reason why parallel drafts, despite starting strong, rapidly lose steam as the block gets longer.

The second bottleneck, less told but equally concrete, concerns verification. Even assuming the draft produces a very long block of plausible words, checking them all costs target model calculation, and that calculation is the scarcest resource in a production system with hundreds of requests in queue. Verifying a token that has a very high probability of being rejected is like sending a clearly unsuitable candidate to an interview that could be assigned to someone with more chance: it's not free, it subtracts capacity from those who would derive real benefit. The paper notes, with data in hand, that acceptance varies greatly depending on the domain: a math problem or a code fragment have rigid structures that the draft guesses better, an open chat is much more unpredictable. A fixed verification length, the same for every request, ignores this difference and systematically wastes resources.

A drafter that learns to doubt itself

The first move of DSpark is architectural, and the name given to the approach, semi-autoregressive generation, describes the idea of mediation well. The bulk of the draft work remains parallel: a hard core, what the paper calls the backbone, produces in a single pass the basic predictions for all positions in the block, maintaining the speed advantage of parallel drafts. On top of this core, however, a very light sequential module is grafted, whose only task is to correct the basic predictions by introducing dependency between one token and the next, without redoing the heavy work from scratch.

The image that best renders the idea comes from the freest jazz, the kind that circulated in Sun Ra's orbit: an entire rhythm section can play simultaneously reading the same basic score, but it is the soloist who, listening in real time to what the others have just played, adjusts the next phrase so that it sounds coherent with the rest. The parallel backbone is the common score, the sequential module is the soloist's ear. In the paper, this module exists in two variants: a minimal version, which looks only at the immediately preceding word and uses a small low-rank table to suggest which words are coherent with it, and a richer version, with recurrent memory, which accumulates information on the entire prefix generated up to that moment in the block. The first is cheaper, the second captures longer dependencies, and the two designs offer a different compromise between calculation cost and quality.

The most counterintuitive result of the paper concerns precisely the comparison between this architecture and purely autoregressive drafts like Eagle3. One would expect that generating word by word, with full sequential dependency, would always produce better results than a partly parallel approach. The authors show that this is not the case, analyzing acceptance position by position: at the very first word of the block, a parallel draft can afford a much deeper architecture precisely because its cost doesn't depend on the block length, and this initial capacity advantage translates into a net margin, for example almost twenty percentage points more acceptance on open conversation tasks compared to an autoregressive drafter bound to stay light. Since the first word of the block is the one with the most leverage, a rejection of it invalidates everything else, so this initial advantage affects the entire chain. The price is paid further on in the block, where the purely parallel draft loses steam rapidly while the autoregressive holds the line better. DSpark is designed exactly to sum the two advantages, the initial power of the parallel and the tail endurance of the sequential, without inheriting their respective weaknesses. immagine1.jpg Image from the paper

Verifying only what matters

The second half of the proposal is perhaps the most original one, and concerns not how the draft is generated but how it is verified. DSpark places a confidence head alongside the generation backbone, a small module that for each position of the block estimates the probability that that token survives the target model's check, conditioned on the fact that all previous words in the same block have been accepted. It is a risk estimate, calculated even before the target opens its mouth.

Here, however, a problem typical of every system that relies on confidence estimates produced by a neural network emerges: they tend to be overconfident, a well-documented phenomenon in the literature on model calibration. If the scheduler blindly trusted the raw scores, it would end up systematically overestimating how many words will survive, throwing off the calculations. DSpark therefore introduces a posterior calibration phase, called sequential temperature scaling, which corrects these scores one at a time proceeding from left to right in the block, using a small validation set to find the right correction factor without altering the order of merit among tokens, only their absolute magnitude.

With reliable scores in hand, the real scheduler comes into play, which the paper names Hardware-Aware Prefix Scheduler. The idea is elegant in its simplicity: collect all active requests at a given instant, order all possible verification extensions of all requests based on the estimated survival probability, and admit them one at a time in descending order as long as the overall throughput gain continues to grow. The moment adding another token worsens the expected throughput, it stops. It is a mechanism that closely resembles the logic of worker placement board games, those in which every turn one carefully chooses where to invest a scarce resource and the decision, once made, cannot be undone: here the scarce resource is the target model's calculation capacity, and every extra verified token on one request is a slice of that capacity taken away from another.

There is a delicate theoretical constraint that the authors address with almost obsessive care in the appendix: the decision of how many tokens to verify cannot depend on the content of the token itself, otherwise a selection bias is introduced that breaks the fundamental guarantee of speculative decoding, namely that the final result is statistically identical to what the target model alone would have produced. The authors demonstrate with a numerical counterexample that a completely retrospective search, which evaluates every possible cut of the block before deciding, violates this causality property and silently distorts the output distribution. The solution adopted in the theoretical scheduler is to stop as soon as the expected gain begins to fall, a sort of early stopping that prevents "peeking" at information that should not yet be available.

In production, however, theory clashes with real hardware. The capacity curve of an inference engine is not a smooth curve like in mathematical models; it is full of sharp steps dictated by the physical constraints of GPUs, and pretending to recalculate scheduling at each step synchronously would slow down the entire pipeline. DeepSeek solved the conflict by making the scheduler asynchronous: reference capacity is estimated using the confidence predictions from two steps before, not the instantaneous ones, which introduces a slight delay but preserves the required causality property, because the decision never depends on the realization of the current token. It is a pragmatic engineering compromise more than an elegant one, but it is exactly the type of detail that separates an academic paper from a system that really runs on millions of requests a day.

The numbers, put to the test

On the offline benchmark front, DSpark is compared with Eagle3, representing the autoregressive school, and with DFlash, representing the parallel school, on four target models of different sizes: the Qwen3 family in versions with 4, 8, and 14 billion parameters, plus Gemma4 with 12 billion. On all four, measuring how many words are accepted on average at each verification cycle, DSpark systematically outperforms both competitors. The margin compared to Eagle3 fluctuates between 27% and 31% depending on the model size, while that compared to DFlash remains more contained but still robust, between 16% and 18%. The advantage is confirmed across math, code generation, and conversation, although with different intensities: as expected, more structured tasks like code tolerate longer verification blocks, conversational ones much less.

The most interesting test, however, is not the offline one, but the production deployment within the DeepSeek-V4 serving engine, in both the Flash and Pro variants, compared with the previous internal production standard called MTP-1, a single-token drafter that had remained in use precisely because more aggressive multi-fixed-token variants degraded aggregate throughput under high load. Here DeepSeek introduces the concept of the serving Pareto frontier: the observable compromise between how much aggregate capacity the system manages to serve and how fast each individual user sees their response scroll. At the same service level, i.e., fixing a minimum threshold of speed perceived by the user, DSpark brings a speed increase per user ranging from 60% to 85% on Flash and from 57% to 78% on Pro. Under very strict interactivity constraints, those in which the old single-token system almost completely collapsed to stay within time, the relative gains become huge numbers, exceeding 600% in one case: the authors themselves, with an honesty worth highlighting, warn not to read these peaks as realistic multipliers, but as proof that DSpark manages to maintain a decent service exactly where before the system practically stopped working.

The mechanism that produces this result is visible in live telemetry data: under moderate load the scheduler extends the verification budget per request, passing from MTP-1's two fixed tokens to a dynamic range between four and six, while when the number of concurrent requests rises and the target's capacity saturates, the budget automatically tightens, protecting residual calculation capacity instead of wasting it on tokens with low survival probability. It is exactly the load-aware behavior that the theory promised, observed on real traffic and not on simulations.

It must be said, for completeness and without triumphasm, that the authors themselves report a non-trivial limit: even when the scheduler avoids waste on the verification side, the cost of generating the initial draft block via the parallel backbone remains fixed and is still paid, even for the most difficult requests where the final acceptance rate will still be low. It is a cost that is not currently recovered, and the paper explicitly points to it as a direction for future work, hypothesizing early exit mechanisms sensitive to request difficulty. immagine2.jpg Image from the paper

Opening the drawers: DeepSpec and its hidden costs

DeepSeek didn't just publish a paper; it also opened the DeepSpec repository, a complete codebase for training and evaluating draft models of this type, with both DSpark and the reference implementations of DFlash and Eagle3 used for comparisons inside. Alongside the code, ready-to-use checkpoints were also released for the preview versions of DeepSeek-V4-Pro with DSpark on Hugging Face, a detail that counts a lot for those who want to experiment without having to retrain everything from scratch.

The repository structure follows a linear and readable flow: first data preparation, which includes downloading prompts, regenerating responses via the target model, and building what is called the target cache; then the actual training phase launched with a script that distributes the work across all visible GPUs; finally, evaluation on a benchmark suite that includes, among others, GSM8K, MATH500, HumanEval, and Arena-Hard-v2. It is a flow designed for those already familiar with distributed training, not for those who want to try DSpark on a single laptop, and the documentation itself assumes a node with eight GPUs as the default configuration.

There is a warning, buried in the data preparation phase documentation, that deserves more attention than it usually receives: building the target cache for the default setting based on Qwen3-4B can take up about 38 terabytes of storage. It's not a typo; it's the direct consequence of the fact that training requires saving the target model's hidden states for an enormous number of positions, to avoid having to re-run the large model at each training epoch of the draft. For those reading this piece thinking of replicating the experiment on home hardware or even on a small corporate cluster, this single detail significantly resizes the practical accessibility of the project: the code is open, but the infrastructural cost to use it to its full extent remains that of a lab with significant resources.

On the license front, DeepSpec is released under the MIT license, the most permissive among those common in open source, which allows commercial reuse, modification, and redistribution with very few conditions. The repository's NOTICE file, however, reminds that not all code is DeepSeek's own: substantial parts of the implementation, in particular that of Eagle3, are adapted from the SpecForge framework distributed under the Apache 2.0 license, while the DFlash design and training recipe derive from a third-party repository also under the MIT license. It is a correct and transparent attribution practice, increasingly rare to see documented with this care in a landscape—that of the open source releases of large labs—in which people often limit themselves to citing academic papers without precisely tracing the origin of the code.

Who wins, who is still waiting

Looking at the work as a whole, the most immediate beneficiaries are the operators of serving infrastructures who manage high-concurrency traffic: if the declared production numbers hold up outside DeepSeek labs as well, the possibility of offering levels of interactivity previously unreachable without having to double the GPU fleet is an economic argument difficult to ignore, and it wouldn't be surprising to see similar ideas appear rapidly in the most widespread open source inference engines, from SGLang to vLLM. Indirectly, the end users of conversational and agentic applications also benefit, for whom perceived latency counts as much as response quality.

Those who stay further behind, at least in the short term, are the portion of the community who would like to experiment independently starting from scratch: between the hardware requirements for training and the storage space needed for the target cache, DeepSpec speaks primarily a language of industrial labs, not of hobbyists with a single graphics card. There also remain some open questions that the paper itself does not fully close: how robust the asynchronous scheduler is when real traffic is even more irregular than that observed in DeepSeek tests, and if the fixed cost of the parallel backbone—the one the authors themselves point out as a limit—becomes a serious problem precisely in the most demanding use cases, the agentic ones with very low latency tolerance, where every millisecond of initial draft generation weighs proportionally more. These are the questions that the next iteration, almost certainly arriving before someone has finished pronouncing the current acronym correctly, will try to answer.