Highlights

Contents

Part I
01

The cost and the next few tokens

Attention cost and training objectives are separate concerns. Multi-token prediction changes what the model learns to forecast. Its future guesses require verification before they can become a valid continuation.

THE ARCHITECTURE INVESTIGATIONCost + future tokens01Sparse connections02Compressed history03Latent memory04Compare KV designs05Speculative decoding06Controlled experiment07Interpret + decide08

#Section 1Why modify standard attention

Double the input from 8 tokens to 16, and a full attention score grid grows from 64 entries to 256. A long-context decoder pays for those relationships even when most are unhelpful.

Quadratic attention cost

Dense attention lets each query compare with every allowed key. In a causal decoder, position tt sees only current and earlier positions, giving T(T+1)/2 pairs, while a naively materialized score tensor has T² entries per head.

Npairs=∑t=1Tt=T(T+1)2.N_{\mathrm{pairs}}=\sum_{t=1}^{T}t=\frac{T(T+1)}{2}.

Read this as the allowed causal pairs equal the sum of the visible prefix lengths. At 8 tokens there are 36; at 16 there are 136.

DOUBLING SEQUENCE LENGTH QUADRUPLES A FULL SCORE GRID8 x 8 = 64 grid entries36 causal pairs16 x 16 = 256 grid entries136 causal pairsa fused kernel changes storage, not the dense connection count
Figure 6.1Computed causal pair and full-grid counts for two illustrative sequence lengths. The square grid is a representation choice; an optimized kernel need not store it all.

KV-cache growth and long-context limitations

The KV cache retains past keys and values and grows with history. Fitting a longer context in memory does not establish useful long-range behavior; that needs training and evaluation.

Training efficiency

Training efficiency is the quality obtained for a compute and memory budget. FlashAttention cuts memory traffic and never materializes the score matrix, but it still computes exact dense attention, so the arithmetic stays quadratic. FlashAttention paper.

Sparse attention changes which relationships exist. Compressed and latent memory change what is stored. Multi-token prediction changes the loss. Keep them separate before comparing results.

#Section 2Multi-token prediction

At the prefix "the bolt is," ordinary training asks for the next token. An extra objective can also ask what comes after that, pushing the shared representation to support a longer continuation.

Standard next-token prediction and predicting several future tokens

Next-token prediction learns the distribution of the immediate next token. Multi-token prediction, abbreviated MTP, adds objectives for several future positions, for example through a shared decoder trunk with one prediction head per offset.

Multiple prediction heads and auxiliary objectives

A prediction head maps a shared representation to an output distribution. An auxiliary objective adds a target beyond the primary one. Heads need separate transformations: the same tied output matrix on the same hidden state gives the same logits.

A SHARED PREFIX CAN TEACH SEVERAL FUTURE TARGETStheboltisshared decoder trunkhead 1next: availablehead 2later: forhead 3later: pickupextra heads learn future tokens; they do not make them verified
Figure 6.2A schematic parallel MTP design gives one prefix several future targets. The words and head depths are illustrative; simultaneous independent samples are not an autoregressive continuation.

Gloeckle and colleagues proposed shared-trunk independent future heads in 2024. DeepSeek-V3 instead chains sequential prediction modules conditioned on shifted ground-truth token embeddings. MTP paper, DeepSeek-V3 report.

Loss weighting and training signal

With future offset jj and nonnegative weight λj\lambda_j, one possible sum is

LMTP=∑j=1KλjLj,Lj=−1Nj∑tlog⁡pj(xt+j∣x≤t).\mathcal L_{\mathrm{MTP}}=\sum_{j=1}^{K}\lambda_j\mathcal L_j, \qquad \mathcal L_j=-\frac{1}{N_j}\sum_t\log p_j(x_{t+j}\mid x_{\le t}).

Read this as the MTP loss sums weighted losses over KK future offsets. pjp_j is the offset-jj head's distribution and NjN_j counts positions that have an in-sequence target at that offset.

State whether the weighted loss is a sum or a normalized average; the convention changes the reported value.

EVERY PREDICTION DEPTH HAS A DIFFERENT TARGET SHIFTinputABCDEdepth 1BCDE-depth 2CDE--positions without a target at that depth are masked
Figure 6.3An illustrative sequence shows offset-specific target alignment. Future offsets lose valid positions near the end and need their own masks.

Inference implications

MTP may improve the shared representation even when inference uses only the next-token head. Extra heads can also propose drafts, but proposal cost, acceptance, and verification decide whether decoding gets faster.

#Section 3MTP and speculative decoding

A head predicts red after “the bolt is,” but the target model favors blue. Writing red directly would change the model being sampled, so future prediction needs a verification rule.

Drafting future tokens and verification

A draft is a proposed continuation that a target model checks. Verification evaluates the target’s probabilities or greedy choices at each draft position under the proper causal prefix.

Accept/reject behavior

For greedy verification, accept the draft prefix that agrees with the target’s greedy choices and replace the first mismatch with the target’s choice. Candidates after the mismatch were conditioned on a wrong prefix and are discarded. Exact stochastic sampling needs acceptance probabilities and a residual distribution, derived in Section 19.

A FUTURE HEAD PROPOSES; THE TARGET DISTRIBUTION VERIFIESdraftboltisredtodaytarget greedyboltisblue?accept this prefixreplace at first mismatch
Figure 6.4An illustrative greedy check accepts the first two proposed tokens, replaces the third, and discards the dependent suffix. The ? marks a target choice that must be recomputed under the corrected prefix.

Relationship between MTP and faster decoding

MTP is a training design; speculative decoding is an inference algorithm. Independent marginal forecasts are not the joint proposal that sequential drafting gives, so candidate construction and verification must be specified together.

A round may emit several verified tokens, but its speed depends on acceptance and the cost of proposing and checking them.