Mistral Large 4
Map all 72 layers from the checkpoint, find where choosing positions starts to cost more than attending to them, and read the learned scales that stretch attention to a million positions.
Jump to a section
Why this matters
Mistral Large 4 is Mistral AI's largest model, nicknamed "Le Chonk". Its open weights were released on 29 October 2026, after an API preview earlier that month. It reads text and images, writes text, accepts 1,048,576 tokens of context, and reasons at a chosen effort: low, medium or high. Mistral says it was trained from scratch on 3,800 NVIDIA Grace Blackwell GPUs in its own European datacenters. A technical report has been announced but not yet published. This breakdown is therefore built from the checkpoint itself: its configuration, the shapes and some learned values in its weights, and the Transformers implementation.
The model is sparse in two ways. In 71 of its 72 layers, each token passes through 4 of 128 routed experts plus one shared expert. A token therefore uses 49.8B of the 1,051B stored parameters, or 52.3B counting embeddings and the output head. Separately, each attention layer reads at most 2,048 earlier positions, chosen by a small indexer, from a compressed cache. On top of both, layers reuse each other's work: some attend over another layer's cache, and others reuse another layer's choice of positions.
98% of the weights are routed experts, so a token uses under 5% of the model
1,029.18B
32.16B
8.04B
8.04B
7.96B
7.96B
1.15B
1.15B
0.45B
0.45B
0.06B
0.06B
2.52B
2.52B
1.70B
per image
Exact counts summed from the shapes in the checkpoint’s 54 safetensors headers. Mistral’s “49B active, 52B including embeddings and output layers” matches. The DSpark draft head ships alongside and adds 2.10B (BF16). The checkpoint is 1.06 TB: FP8 weights with 128 × 128 block scales, plus BF16 for the vision tower, output head, latent projections and parts of the indexer. Every expert must sit in memory even though each token reads four of 128, which is why serving starts at a full 8-GPU node.
Checkpoint · consolidated-*.safetensors headersBuild the mental model
Before it attends, an attention layer has two jobs: decide what to keep about each past position, and decide which positions to look at.
What to keep. Multi-head Latent Attention (MLA, from DeepSeek-V2) compresses each position into a 512-value latent, plus a 64-value rotary key shared by all 64 heads. Each head rebuilds its own keys and values from the latent through a learned up-projection. The cache therefore holds 576 values per position per layer rather than 64 heads × 256.
Where to look. DeepSeek Sparse Attention (DSA, introduced with DeepSeek-V3.2) adds an indexer: a cheap scorer with 32 small heads that rates every earlier position and keeps the best 2,048. All 64 attention heads then attend only to those positions.
Mistral builds on that recipe and changes several things:
- Queries come from a direct projection, without low-rank compression.
- Every fourth layer has no rotary position encoding at all (NoPE).
- From layer 39 onward, every fourth layer reuses layer 35's latent instead of computing its own.
- 28 layers reuse the selection made by the most recent layer that ran its indexer.
- Each head rescales its query by a learned amount that depends on position.
- The rotary frequencies get learned multipliers.
After attention, a router sends the token to 4 experts.
Inside one layer: two selections, then attention
Then residual add → RMSNorm → router: softmax over 128 expert scores, keep the top 4, renormalize their weights to sum to 1 → those 4 experts + the shared expert → residual add
Drawn from the Transformers implementation and the checkpoint’s weight shapes. Queries are a direct projection (no low-rank query compression). At decode time the up-projection is usually absorbed into the query, so scores are taken against the 512-value latent directly, which is what makes the small cache usable. In NoPE layers the 64 dimensions that would rotate become content dimensions instead, in both the attention and the indexer.
Transformers · modular_mistral_large4.pyThe three kinds of reuse are independent of each other. Every layer that shares a cache is a NoPE layer, and so is its source, layer 35. The implementation keeps separate shared slots for rotated and unrotated caches, so a layer never reads a cache built with a different positional scheme. Reuse saves memory and compute, but a reusing layer cannot choose for itself. Mistral has not published ablations, so the quality cost is unknown. The map below shows all 72 layers; select one to see what it computes and what it borrows.
Seventy-two layers: what each computes and what it reuses
- RoPE × 54
- NoPE × 18
- Own latent × 63
- Layer 35, also read by 9 others
- Reads layer 35’s × 9
- Runs indexer × 44
- Reuses a selection × 28
- Dense × 1
- MoE × 71
Every row comes from the checkpoint’s config.json: no_rope_layers, kv_source_layers, indexer_types and mlp_layer_types. Select a layer. The three reuse patterns are independent: layer 39 reads layer 35’s cache but runs its own indexer, while layer 50 caches its own latent but reuses layer 48’s selection.
Work through the math
Cache. A layer with its own latent stores for each position . A RoPE layer also stores a rotary key . Across the model, 54 RoPE layers and 9 NoPE layers own a latent:
Without sharing, the nine reusing layers would add 4,608 values. Full per-head keys and values would cost values per position, 33 times more. At BF16 and positions, the latent cache takes GB.
Sparse attention. For the query at position , the indexer scores every earlier position . It keeps the top 2,048, and attention normalizes over those alone:
The indexer's cost still grows with , but each scored position costs only 32 × 128 multiply-adds, against 64 × (512 + 64 + 512) for each position a head actually attends to. Across the model, one new token costs about multiply-adds per attended position and per scored position. Attention is capped at 2,048 positions, so the indexer becomes the larger cost beyond tokens. At tokens the sparse layer still does 26 times less work than dense MLA.
Past 56K tokens, choosing positions costs more than attending to them
- Dense MLA: every earlier position
- DSA: indexer + 2,048 positions
- of which the indexer
| Attention multiply-adds per new token · dense vs DSA | 5,179.7B vs 199.1B · 26.0× |
| Share of the DSA work spent in the indexer | 95% |
| Latent cache, BF16 · 35,712 values per position | 74.9 GB |
| Indexer keys, FP8 · 5,632 values per position | 5.9 GB |
| For scale: full per-head K and V in every layer, BF16 | 2.47 TB |
Our arithmetic from config.json, counting the absorbed form used in decoding: per attended position, 64 heads × (512 + 64) for scores and 64 × 512 for the value read (NoPE layers 512 + 512); per scored position, 32 indexer heads × 128 in the 44 layers that run an indexer. Below 2,048 tokens DSA attends to everything and the indexer is pure overhead. The latent is 35,712 values per position, 33× less than full per-head keys and values; sharing layer 35’s latent saves 11%. Mistral’s reference configuration stores both caches in FP8, which halves the latent. Weights, activations and kernel efficiency are excluded, and the indexer’s FP8 arithmetic is cheaper per operation than this count suggests.
params.json · dsa, kv_sharingQuery scaling. Each head multiplies its query by a learned function of position before the usual dot product:
Why this helps: suppose one key beats competitors by a logit gap . Its attention weight is , which shrinks as grows. If the logits are multiplied by , the competitors' total becomes , which stays bounded when . This is the idea of Scalable-Softmax, and the configuration names it ssmax. Here and are learned, so a head can also choose to flatten with distance.
Deeper layers sharpen attention as the context grows
Each cell is a layer, colored by its multiplier at 1M positions: orange below 1, purple above. Select one to highlight its line.
Each head multiplies its query by s · ln(t + 1) + b, with s and b learned. Lines are the mean over a layer’s 64 heads, from the BF16 values of ssmax_scaling in the checkpoint; because the formula is linear in ln(t + 1), each mean is a straight line on this axis. Individual heads range from −0.18 to 9.53 at 1M positions. The first layer flattens with distance, most later layers sharpen, and the 44 indexers have their own, milder scaling (mean 0.89 to 1.52 at 1M). Without such a term, a fixed logit gap buys less and less attention weight as the number of competing keys grows.
Positions. RoPE rotates dimension pair at angular frequency . YaRN is configured with an original window of 512 and a factor of 2,048 (). It keeps pairs that complete at least 32 turns within 512 positions, divides by 2,048 the pairs that complete less than one, and blends linearly in between. LeRoPE then multiplies each frequency by a learned :
Thirty-two rotary frequencies, stretched and then tuned
- Plain RoPE, θ = 10⁴
- After YaRN
- After LeRoPE (used)
Our calculation from the YaRN settings in config.json (θ = 10⁴, original window 512, factor 2,048, β = 32 and 1) and the 32 values of lerope.alpha in the checkpoint; frequency i is multiplied by eαi. YaRN leaves the four fastest frequencies alone, divides the slowest sixteen by 2,048, and blends in between, which opens a gap from about 6K to 1.3M positions per turn. LeRoPE barely touches the fast frequencies but speeds frequency 16 up 2.54× and 17 up 1.94×, so their wavelengths, about 506K and 887K positions, fall inside the 1M context. NoPE layers use none of this.
Read the implementation
This executable Python example rebuilds the layer schedule from the configuration rules and checks the cache and work arithmetic. It also implements the router and the YaRN frequencies.
1import math
2
3LAYERS = 72
4rope = [(l + 1) % 4 != 0 for l in range(LAYERS)] # no_rope_layers
5kv_source = [35 if l >= 39 and (l + 1) % 4 == 0 else l for l in range(LAYERS)]
6indexer = "F" * 17 + "SSFF" * 13 + "SSF" # F runs, S reuses
7assert len(indexer) == LAYERS and indexer.count("F") == 44
8
9# Cache per position: a 512-value latent, plus a 64-value rotary key in RoPE layers.
10latent = sum(512 + (64 if rope[l] else 0) for l in range(LAYERS) if kv_source[l] == l)
11full_kv = LAYERS * 64 * (128 + 128)
12assert latent == 35_712 and all(not rope[l] for l in range(LAYERS) if kv_source[l] != l)
13print(latent, "cached values per position,", round(full_kv / latent), "x fewer than full K/V")
14
15# Multiply-adds per new token: attend to at most 2,048 positions, but score all of them.
16attend = sum(64 * (512 + (64 if rope[l] else 0) + 512) for l in range(LAYERS))
17score = indexer.count("F") * 32 * 128
18def work(t):
19 return attend * t, attend * min(t, 2048) + score * t
20print("indexer outweighs attention beyond", round(attend * 2048 / score), "tokens")
21dense, sparse = work(2 ** 20)
22print(f"at 1M tokens: {dense / sparse:.0f}x fewer multiply-adds than dense MLA")
23
24# Router: softmax over 128 experts, keep the top 4, renormalize their weights.
25def route(logits, k=4):
26 top = max(logits)
27 p = [math.exp(x - top) for x in logits]
28 chosen = sorted(range(len(p)), key=p.__getitem__, reverse=True)[:k]
29 return {e: p[e] / sum(p[i] for i in chosen) for e in chosen}
30weights = route([math.sin(7 * e) for e in range(128)])
31assert len(weights) == 4 and abs(sum(weights.values()) - 1) < 1e-12
32
33# YaRN wavelengths: original window 512, factor 2,048, beta 32 and 1.
34def yarn_wavelengths(dims=64, theta=1e4, window=512, factor=2048, fast=32, slow=1):
35 corr = lambda r: dims * math.log(window / (r * 2 * math.pi)) / (2 * math.log(theta))
36 lo, hi = math.floor(corr(fast)), math.ceil(corr(slow))
37 waves = []
38 for i in range(dims // 2):
39 w = theta ** (-2 * i / dims)
40 keep = 1 - min(max((i - lo) / (hi - lo), 0), 1)
41 waves.append(2 * math.pi / (w * keep + w / factor * (1 - keep)))
42 return waves
43waves = yarn_wavelengths()
44assert waves[3] < 16 and waves[16] > 2 ** 20
45print(f"frequency 16: {waves[16]:,.0f} positions per turn, {waves[16] / math.exp(0.9336):,.0f} after LeRoPE")The weights explain the hardware bill. Every expert must be resident, even though each token reads only four of them. The checkpoint stores FP8 weights in 128 × 128 blocks with one scale each, and keeps the vision tower, output head, latent projections and parts of the indexer in BF16. The final logits are soft-capped at .
Questions and trade-offs
When does sparse attention pay? Not for short prompts. Below 2,048 tokens every position is attended anyway, and the indexer adds about 4% to the attention work. The gain grows with context: 3.5× at 8K tokens, 19× at 128K and 26× at 1M. Reusing selections in 28 layers removes 39% of the indexer's work, and that matters because beyond about 56K tokens the indexer is the dominant cost.
What does the drafter buy? The checkpoint ships a DSpark draft head for speculative decoding. The drafter proposes three tokens, and the full model verifies them in one pass, so the output is the same as without drafting. Generation speeds up when the drafts are accepted.
A built-in drafter proposes three tokens; the model checks them in one pass
- 1Read the target’s hidden statesLayers 1, 18, 36, 54, 71: 5 × 6,144 = 30,720 values per position, projected to 6,144 as context for the drafter
- 2Draft a block in parallelInputs: the last accepted token and two position-specific mask embeddings. 3 dense MLA layers run once over all three
last tokenmask₁mask₂
- 3Add dependence, left to rightA small recurrent head with a 512-value state adjusts each position’s logits using the token drafted before it, so d₂ can follow d₁
d₁d₂d₃
- 4Verify in one target passThe 72-layer model scores all three drafts at once, keeps the longest prefix it agrees with and adds one token of its own. Output is unchanged from plain decoding
Expected tokens per target pass: 2.18 (1 + a + a² + a³), at most 4.
Structure from params.json (mtp: 3 layers, depth 3, Markov rank 512, RNN head, position-specific draft inputs, target layers 1, 18, 36, 54, 71) and the draft tensors’ shapes; the sampling scheme follows vLLM’s DSpark speculator. The slider assumes each draft is accepted with the same probability once its predecessors are, and ignores the drafter’s own cost (2.10B parameters, dense), so it is an upper bound on speed-up. Mistral reports up to 1.9× throughput; Hugging Face measured about 65 tokens/s for one request on 8 H200s, and 120–138 on chat prompts where drafts are accepted.
How good is it? Mistral's own comparisons place it at or near the top of open-weight models on agentic coding. It uses far fewer tokens at high effort, refuses harmful cyber requests more often, and resists more attacks on Lakera's B3 benchmark. It trails the best listed open models on the Artificial Analysis Cyber and Intelligence indices, on finance (Finch) and on web browsing (BrowseComp). Reasoning effort is the main cost lever. Medium effort scores 13 points lower on the coding index but uses 32% fewer tokens.
Near the top of the coding index with about half the tokens
Artificial Analysis Coding Agent Index against tokens used per task, from the chart data embedded in Mistral’s release post. At high reasoning effort Mistral Large 4 scores 48% with 8.5M tokens per task; GLM-5.3 scores 49% with 15.9M, so Mistral Large 4 uses 47% fewer tokens, Mistral’s headline figure. Medium effort trades 13 points for a further 32% fewer tokens.
Mistral release post · chart data; model card · AA indicesWhat does it take to serve? The checkpoint is 1.06 TB. Eight H200s hold 1,128 GB, which leaves about 67 GB for cache and activations. That is enough for Hugging Face's 8 × H200 recipe of 131K context and 16 concurrent requests. An NVFP4 checkpoint targets Blackwell GPUs. Hugging Face reports that a 2-bit GGUF runs on one 512 GB Mac at about 15 tokens per second. The licence allows commercial use, but offering the model as a hosted service requires a separate licence from Mistral.
Check your understanding
You want to serve a single 1M-token session on eight 192 GB GPUs, 1,536 GB in total. Is memory the limit? Which part of the per-token cost grows with the context? What would you test before trusting answers that depend on text 900K tokens back?
Memory is not the limit. The weights take 1,060.5 GB, leaving about 475 GB. At 1M tokens the BF16 latent cache needs 74.9 GB and the FP8 indexer keys 5.9 GB, so the cache would fit several times over. The real ceiling is the positional range the model was configured for: 1,048,576 positions. Per new token, attention reads a fixed 2,048 positions per layer. The cost that grows is the indexer's scoring, which at 1M is 95% of attention-related work. Prefill is heavier still. Scoring a 1M-token prompt takes about multiply-adds, roughly twice the work of all the weight matrices over the same prompt.
For quality, a fact 900K tokens back helps only if it wins a place in the 2,048 positions chosen in the layers that need it. In 28 layers that choice is inherited from an earlier layer. Mistral has published no long-context results, so measure retrieval and multi-step use of distant facts at your own lengths before relying on them.
Source and scope
Sources:
- Mistral Large 4 model card, with its
config.jsonandparams.json. - Tensor shapes from all 54 safetensors headers, and the BF16 values of
lerope.alphaandssmax_scaling, read from the checkpoint on 29 October 2026. - The Transformers implementation and model documentation.
- vLLM's DSpark speculator.
- Mistral's release post. Its chart data was read from the page.
- Hugging Face's release post.
Mistral's technical report was not available when this was written. Parameter totals, cache sizes, multiply-add counts, wavelengths, the code and the scenario are LiminalML derivations. Benchmarks are as reported by Mistral and Artificial Analysis. We have not run the model.
Oliver Perrin
Machine Learning Engineer · Founder, LiminalML
LiminalML brings together concept explanations, mathematical examples, and working visuals. Find more writing by Oliver on the LiminalML Substack.
Keep exploring the idea.
Ask a follow-up in a guided session, work through the self-check, or open the visual in Studio to build on it.
Related concepts
Model breakdowns
DeepSeek-V4
Distinguish active experts from stored parameters, then separate compression from sparse attention.
LLMs
KV Cache
See which token projections caching saves, what attention must still read, and how memory use grows with context.
Deep Learning
Positional Encoding
Compare positional signals at different frequencies, then connect absolute encodings and RoPE to attention.