archdb

LLM architectures and pretraining recipes, with sources.

DeepSeek-V3.2

DeepSeek · reasoning checkpoint

Post-trained release; the card names deepseek-ai/DeepSeek-V3.2-Exp-Base as its base. Recipe facts cover the DSA continued pre-training from a DeepSeek-V3.1-Terminus base checkpoint (already extended to 128K).

Open in the comparison table Hugging Face ↗ Paper ↗

KV calculations use one sequence at 131,072 tokens and 16-bit cache elements. They include bounded sliding-window caches. This is retained cache payload, not peak prefill memory. The comparison table also offers sourced mixed-precision layouts, including quantization scales.

Release

Released

2025-12-01

Source: paper · p.2; General Information
Release date December 1, 2025

Date the weights (or, if earlier, the technical report) were first made public, YYYY-MM-DD, as dated by the publisher. A Hugging Face repository creation date is used only when no dated publisher page exists, with a note.

License

mit

Source: model-card · README.md; YAML front matter
license: mit

License of the released weights as declared by the publisher (model card metadata or license file), e.g. apache-2.0, mit, or the name of a custom license.

Input modalities

text

Source: paper · Model card PDF; Modalities
Both input and output are in Text format

Input modalities of the released checkpoint as the publisher states them, from: text, image, video, audio, joined with ' + ' in that order ("text", "text + image + video").

Parameters

Total params

671B parameters

Source: paper · p.3; Model properties; Total model size
671B parameters, of which 37B are activated for each token

Total parameter count as reported by the publisher. See params.note for whether embeddings, MTP heads or vision towers are included.

Active params

37B parameters

Source: paper · p.3; Model properties; Total model size
671B parameters, of which 37B are activated for each token

Parameters used per token in the forward pass, as reported by the publisher.

Active non-embedding (stated)

Not disclosed

Active parameters excluding the input embedding and the output head (unembedding). Stated by the publisher, or computed from params.active by subtracting vocab × d_model for each of the embedding and output head that params.active is stated to include (basis inferred, note with the arithmetic). Not disclosed when the scope of params.active is not stated.

Counted total params

671.9B parameters

Calculated: embedding + output head + all experts + other weights, deepseek-ai/DeepSeek-V3.2@a7e62ac safetensors headers; reproduces stated total (backbone) and active (non-embedding)

Parameters of the text backbone counted from the released checkpoint's safetensors headers (embedding, output head, all experts and other weights; excluding MTP modules, vision/audio towers and n-gram lookup tables). Shown only when the counts reproduce the publisher's stated total and active parameters within 5% under some scope.

Counted embedding + head

1.853B parameters

Calculated: input embedding + output head, deepseek-ai/DeepSeek-V3.2@a7e62ac safetensors headers

Input embedding plus output head (once if tied), counted from the checkpoint.

Non-emb. params (counted)

670B parameters

Calculated: dense + routed backbone weights; excludes input embedding, output head, lookup tables, MTP and other modalities, deepseek-ai/DeepSeek-V3.2@a7e62ac safetensors headers; reproduces stated total (backbone) and active (non-embedding)

Language backbone weights excluding input embeddings, output head, lookup/Engram tables, MTP modules and vision/audio towers. Equals params.counted_total minus params.counted_embedding. Same validation as params.counted_total.

Largest layer (counted)

11.52B parameters

Calculated: max(sum of dense and routed weights sharing a full layers.<index> tensor path), all experts included, deepseek-ai/DeepSeek-V3.2@a7e62ac safetensors headers

Largest group of language-backbone weights sharing a full layers.<index> tensor path, including every routed expert. Excludes lookup/Engram tables, embeddings, output head, MTP and other modalities. Hybrid checkpoints may store mixers and FFNs as separate layers. All-gather volume also depends on wrapping, sharding and dtype.

Active non-emb. (counted)

36.55B parameters

Calculated: non-expert weights + routed experts × 8/256, excluding embedding and output head, deepseek-ai/DeepSeek-V3.2@a7e62ac safetensors headers; reproduces stated total (backbone) and active (non-embedding)

Active parameters per token excluding the input embedding and output head, counted from the checkpoint as all non-expert weights plus routed-expert weights × top_k / experts. Same validation as params.counted_total.

Shape

Layers

61

Source: config · /num_hidden_layers

Number of transformer blocks in the main backbone (attention or token mixer plus FFN), excluding MTP modules.

d_model

7,168

Source: config · /hidden_size

Residual stream width.

Vocab

129,280

Source: config · /vocab_size

Embedding table rows (vocab_size in config, may include padding).

Tied embeddings

No

Source: config · /tie_word_embeddings

Input embedding and output head share weights.

d_model / layers

117.508

Calculated: d_model / layers

Width-to-depth ratio, d_model divided by the number of blocks.

Attention

Token mixers

MLA, DSA

Source: paper · p.3 §2.1
we instantiate DSA based on MLA (DeepSeek-AI, 2024) for DeepSeek-V3.2.

Token-mixing layer types in the backbone, e.g. GQA, MLA, SWA, Gated DeltaNet, Mamba-2, DSA (DeepSeek sparse attention).

Layer layout

61 DSA

Source: code · inference/model.py lines 498–545; MLA.__init__
self.indexer = Indexer(args)

Every MLA layer builds a lightning indexer; 61 layers per /num_hidden_layers.

Token-mixer order, summarized as a pattern or layer positions. The fact's optional sequence lists each mixer in order; a ratio alone does not establish the order. Auxiliary prediction modules and standalone FFNs are excluded.

Global-attention layers

61

Source: config · /num_hidden_layers

Layers whose KV cache grows with full context (dense or sparse global attention, MLA). Excludes sliding-window and linear/recurrent layers.

Query heads

128

Source: config · /num_attention_heads

Query heads in the global-attention layers.

Heads × head dim

24,576

Calculated: heads × head_dim

attn.heads × attn.head_dim, the query projection width of global layers.

QK head dim

192

Source: config · /qk_nope_head_dim + /qk_rope_head_dim

Query/key dimension per head in global-attention layers (for MLA, nope + rope dims).

V head dim

128

Source: config · /v_head_dim

Value dimension per head in global layers (MLA v_head_dim; stated for MLA even when equal to the QK head dim).

MLA KV latent

512

Source: config · /kv_lora_rank

Width of the compressed KV latent that MLA caches per token per layer.

MLA Q latent

1,536

Source: config · /q_lora_rank

Width of the low-rank query projection in MLA; 0 when queries use a full-rank projection.

Decoupled RoPE dim

64

Source: config · /qk_rope_head_dim

Width of the shared positional key that MLA caches next to the latent.

Positional encoding

partial RoPE (decoupled 64-dim RoPE key shared across heads + 128 NoPE dims per head)

Source: code · inference/model.py line 568; MLA.forward
k_pe = apply_rotary_emb(k_pe.unsqueeze(2), freqs_cis)

Positional scheme in global layers: RoPE, partial RoPE, NoPE, or mixed per layer type.

RoPE base

10,000

Source: config · /rope_theta

YaRN on the rope dims: /rope_scaling type yarn, factor 40, beta_fast 32, beta_slow 1, mscale 1, mscale_all_dim 1, original_max_position_embeddings 4096.

RoPE base frequency of the global layers at release.

QK norm

No

Source: code · inference/model.py; MLA.forward
q = q.view(bsz, seqlen, self.n_local_heads, self.qk_head_dim)

q_norm and kv_norm act on the Q and KV latents before up-projection; per-head Q/K are not normalized.

Queries and keys are normalized per head before the dot product.

Sparse attention

DSA: lightning indexer (64 heads × 128, ReLU, FP8), top-2048 KV tokens per query

Source: paper · p.4 §2.1.1
select 2048 key-value tokens for each query token

Indexer heads and dim from config /index_n_heads, /index_head_dim; ReLU and FP8 from p.3 §2.1.

Token-selection mechanism inside global layers, e.g. DSA lightning indexer with top-k.

Attention scaling

1/sqrt(192) × (0.1·ln 40 + 1)² (YaRN mscale, s = 40)

Source: code · inference/model.py lines 533–537; MLA.__init__
self.softmax_scale = self.softmax_scale * mscale * mscale

Applied when the configured max_seq_len exceeds original_seq_len 4096 (default max_seq_len 16384); mscale = 0.1·ln(rope_factor 40) + 1.

Query-key scaling when it is not 1/sqrt(head_dim), e.g. query_pre_attn_scalar, length-dependent (SSMax-style) scaling, or value scaling.

QKV bias

No

Source: config · /attention_bias

Query/key/value projections have bias terms.

Indexer key dim

128

Source: config · /index_head_dim

One indexer key per token per layer (Indexer.wk projects dim to index_head_dim; k_cache stored FP8 with per-128 scales); /index_n_heads 64 query heads, /index_topk 2048.

Width of the sparse-attention indexer key cached per token in each global layer (DSA lightning indexer), counted in the KV cache.

KV cache groups
  • MLA latent

    Layers
    61
    Elements
    512
    Source: code · inference/model.py; MLA.__init__ lines 541–542 and Indexer.__init__ lines 453–454
    self.register_buffer("kv_cache", torch.zeros(args.max_batch_size, args.max_seq_len, self.kv_lora_rank), persistent=False)
  • RoPE key

    Layers
    61
    Elements
    64
    Source: code · inference/model.py; MLA.__init__ lines 541–542 and Indexer.__init__ lines 453–454
    self.register_buffer("pe_cache", torch.zeros(args.max_batch_size, args.max_seq_len, self.qk_rope_head_dim), persistent=False)
  • DSA indexer key

    Layers
    61
    Elements
    128
    Source: code · inference/model.py; MLA.__init__ lines 541–542 and Indexer.__init__ lines 453–454
    self.register_buffer("k_cache", torch.zeros(args.max_batch_size, args.max_seq_len, self.head_dim, dtype=torch.float8_e4m3fn), persistent=False)
Source: code · inference/model.py; MLA.__init__ lines 541–542 and Indexer.__init__ lines 453–454

Cache owners and entry shapes for compressed or shared attention. Each item specifies layers owning the cache, scalar elements per entry (K and V together), tokens_per_entry (compression ratio, default 1), and optionally window (maximum entries retained). Completed compressed entries are floor(context / tokens_per_entry); incomplete compressor state is excluded. KV sizes use these groups when present.

KV storage formats
  • MLA latent

    Group
    MLA latent
    Elements
    512
    Bits
    8
    Format
    FP8 E4M3; FP32 scales per 128 channels
    Scale count
    4
    Scale bits
    32
    At
    README.md; V3.2 layout: 512 quantized latent bytes + 16 scale bytes
    Source: code · README.md; V3.2 layout: 512 quantized latent bytes + 16 scale bytes
    Next 16 bytes: Scale factors, containing 4 `float32` values.

    Serving layout: each layer retains 656 bytes of main MLA KV and 132 bytes of indexer K per token. 61 × (656 + 132) = 48,068 bytes/token, matching DeepSeek-V4.1 report p.1 Figure 1(b). The reference model simulates main-latent FP8 then retains BF16 buffers; this fact describes the packed FlashMLA serving layout.

  • RoPE key

    Group
    RoPE key
    Elements
    64
    Bits
    16
    Format
    BF16
    At
    README.md; V3.2 unquantized RoPE key
    Source: code · README.md; V3.2 unquantized RoPE key
    Last 128 bytes: The "RoPE" part, containing 64 `bfloat16` values.

    Serving layout: each layer retains 656 bytes of main MLA KV and 132 bytes of indexer K per token. 61 × (656 + 132) = 48,068 bytes/token, matching DeepSeek-V4.1 report p.1 Figure 1(b). The reference model simulates main-latent FP8 then retains BF16 buffers; this fact describes the packed FlashMLA serving layout.

  • DSA indexer key

    Group
    DSA indexer key
    Elements
    128
    Bits
    8
    Format
    FP8 E4M3; one FP32 scale
    Scale count
    1
    Scale bits
    32
    At
    inference/model.py lines 15, 453–454; block_size 128
    Source: code · inference/model.py lines 15, 453–454; block_size 128
    self.register_buffer("k_scale_cache", torch.zeros(args.max_batch_size, args.max_seq_len, self.head_dim // block_size, dtype=torch.float32), persistent=False)

    Serving layout: each layer retains 656 bytes of main MLA KV and 132 bytes of indexer K per token. 61 × (656 + 132) = 48,068 bytes/token, matching DeepSeek-V4.1 report p.1 Figure 1(b). The reference model simulates main-latent FP8 then retains BF16 buffers; this fact describes the packed FlashMLA serving layout.

Source: code · README.md; MLA Decoding / FP8 KV Cache; per-entry storage layouts

Serving layout: each layer retains 656 bytes of main MLA KV and 132 bytes of indexer K per token. 61 × (656 + 132) = 48,068 bytes/token, matching DeepSeek-V4.1 report p.1 Figure 1(b). The reference model simulates main-latent FP8 then retains BF16 buffers; this fact describes the packed FlashMLA serving layout.

Sourced storage components of attn.kv_groups. Each component names its group and gives elements, bits per element, format, scale_count, scale_bits and padding_bytes per entry. Different parts of one entry can have different formats. Sourced-storage sizes are available only when every group's elements are covered. These are inference-cache formats; they do not establish pretraining precision.

Feed-forward

Activation

SwiGLU

Source: code · inference/model.py line 643 (MLP.forward); same in Expert.forward
return self.w2((F.silu(self.w1(x).float()) * self.w3(x).float()).type_as(x))

config /hidden_act silu.

FFN activation (SwiGLU, GeGLU, ...).

Dense FFN dim

18,432

Source: config · /intermediate_size

Intermediate width of the dense FFN layers that are actually executed.

FFN bias

No

Source: code · inference/model.py lines 620–631 (MLP.__init__) and 721–733 (Expert.__init__)
self.w1 = ColumnParallelLinear(dim, inter_dim)

Linear and its parallel subclasses default to bias=False.

FFN projections have bias terms.

Dense FFN / d_model

2.57143

Calculated: ffn.dim / d_model

ffn.dim divided by shape.d_model.

Mixture of experts

Routed experts

256

Source: config · /n_routed_experts

Routed experts per MoE layer.

Experts per token

8

Source: config · /num_experts_per_tok

Routed experts selected per token.

Shared experts

1

Source: config · /n_shared_experts

Always-on experts per MoE layer.

Expert dim

2,048

Source: config · /moe_intermediate_size

Intermediate width of one routed expert.

Shared expert dim

2,048

Source: config · /moe_intermediate_size

1 shared expert (/n_shared_experts) of the routed-expert width.

Total intermediate width of the shared expert(s).

Leading dense layers

3

Source: config · /first_k_dense_replace

All later layers are MoE (/moe_layer_freq 1).

Number of initial blocks that use a dense FFN instead of MoE.

Router score

sigmoid

Source: config · /scoring_func

Gating function over expert logits (softmax, sigmoid).

Load balancing

auxiliary-loss-free expert bias (added to scores for top-k selection only); coefficients not stated

Source: code · inference/model.py; Gate.forward
scores = scores + self.bias

config /topk_method noaux_tc; gating weights come from the unbiased scores.

Load-balancing method, with coefficients where disclosed.

Routed scaling factor

2.5

Source: config · /routed_scaling_factor

Multiplier applied to the combined routed-expert output (routed_scaling_factor).

Renormalize top-k

Yes

Source: config · /norm_topk_prob

Selected expert weights are renormalized to sum to 1.

Group-limited routing

8 expert groups, top-4 groups per token (group score: sum of its top-2 biased expert scores)

Source: config · inference/config_671B_v3.2.json; /n_expert_groups, /n_limited_groups
"n_expert_groups": 8, "n_limited_groups": 4

Applied in Gate.forward of inference/model.py; config /n_group 8, /topk_group 4.

Expert groups and groups selected per token, or node-limited routing, when used.

Expert dim / d_model

0.285714

Calculated: moe.expert_dim / d_model

moe.expert_dim divided by shape.d_model.

Sparsity (experts / top-k)

32

Calculated: experts / top_k

Routed experts divided by experts selected per token.

Active / total

0.0551416

Calculated: params.active / params.total

params.active divided by params.total.

Multi-token prediction

MTP depth

Not disclosed

Additional future tokens predicted during pretraining (0 when the model was trained without MTP).

MTP weights released

Yes

Source: config · model.safetensors.index.json; /weight_map
"model.layers.61.eh_proj.weight"

1 MTP layer (/num_nextn_predict_layers) with MLA+DSA and MoE; the V3.2 report does not describe MTP training.

The released checkpoint contains the MTP module weights.

Normalization and stability

Norm

RMSNorm

Source: code · inference/model.py lines 828–829 (Block.__init__) and 884 (Transformer.__init__)
self.norm = RMSNorm(args.dim)

Quote is the final norm; Block.__init__ builds attn_norm and ffn_norm with the same RMSNorm(args.dim).

Normalization layer type in the blocks.

Norm placement

pre

Source: code · inference/model.py lines 831–851; Block.forward
x, residual = self.attn_norm(x), x

Pre-norm, post-norm, or sandwich (pre and post).

Norm epsilon

1e-06

Source: config · /rms_norm_eps

Epsilon of the block normalization layers.

Context length

Pretraining context

Not disclosed

Sequence length of the main pretraining stage.

Trained context

131.1K tokens

Source: paper · p.4 §2.1.1
with each step consisting of 480 sequences of 128K tokens, resulting in a total of 943.7B tokens.

Longest sequence length trained on after context extension.

Advertised context

131.1K tokens

Source: paper · p.3; Model properties
Context length 128K

config /max_position_embeddings 163840 is 4096 × YaRN factor 40.

Longest context the publisher says the model supports, possibly beyond trained length via RoPE scaling.

Pretraining recipe

Pretraining tokens

Not disclosed

Tokens seen in pretraining including annealing and context extension, as reported.

Optimizer

Not disclosed

Optimizer used for the bulk of parameters.

Peak LR

Not disclosed

Peak learning rate of the main pretraining stage.

Final LR

Not disclosed

Learning rate at the end of the decay.

LR schedule

Not disclosed

Learning-rate schedule shape with phase boundaries.

Warmup

Not disclosed

Warmup length in steps or tokens.

Batch size

Not disclosed

Global batch size, including any batch-size ramp: sequences × sequence length (token total), or the token total alone when only that is stated.

Weight decay

Not disclosed

Decoupled weight decay coefficient.

Adam betas

Not disclosed

(beta1, beta2) of the Adam-family optimizer or its AdamW fallback.

Grad clip

Not disclosed

Global gradient-norm clipping threshold.

Training precision

Not disclosed

Matmul precision of pretraining (BF16, FP8 recipe, NVFP4 recipe) with the scaling granularity where disclosed. Never inferred from the released checkpoint dtype.

Extra objectives

lightning-indexer KL loss to the head-summed main attention distribution; indexer input detached from the LM loss

Source: paper · p.4 §2.1.1
we set a KL-divergence loss as the training objective of the indexer

Objectives beyond next-token prediction and MTP (fill-in-the-middle rate, distillation, multimodal tokens from the start).

Data mix

same distribution as the DeepSeek-V3.1-Terminus 128K long-context extension data

Source: paper · p.3 §2.1.1
the distribution of training data is totally aligned with the 128K long context extension data used for DeepSeek-V3.1-Terminus.

Pretraining data composition as disclosed (domain shares, synthetic fraction, repetition).

Stages
  • dense warm-up (indexer only)

    Tokens
    2100000000
    Seq len
    131072
    Lr
    0.001
    Steps
    1000
    Batch sequences
    16
    Source: paper · p.4 §2.1.1
    We train the indexer for only 1000 steps, with each step consisting of 16 sequences of 128K tokens, resulting in a total of 2.1B tokens.

    Dense attention; all parameters frozen except the indexer, trained with a KL loss to the main attention distribution.

  • sparse training

    Tokens
    943700000000
    Seq len
    131072
    Lr
    7.3e-06
    Steps
    15000
    Batch sequences
    480
    Source: paper · p.4 §2.1.1
    We train both the main model and the indexer for 15000 steps, with each step consisting of 480 sequences of 128K tokens, resulting in a total of 943.7B tokens.

    Top-2048 selection; all parameters trained; indexer input detached and trained only by the indexer KL loss.

Source: paper · p.4 §2.1.1

Ordered pretraining stages. Each item: name, tokens, seq_len, lr, batch_tokens, batch_sequences, steps, note, quote, and source when it differs from the fact's source.

KV cache

KV bytes / token

85,888 bytes

Calculated: kv.bytes_at_context / 131072 tokens; uniform BF16, payload only; quantization overhead excluded. MLA latent: 61 × (512 × 16/8) B/entry; RoPE key: 61 × (64 × 16/8) B/entry; DSA indexer key: 61 × (128 × 16/8) B/entry

Retained KV cache divided by context length, including bounded SWA caches and indexer keys. Exports use uniform BF16 at 131,072 tokens. The website can select uniform payload precision (no quantization overhead) or sourced component formats (including scales and documented padding). This is cache payload, not peak prefill memory or persistent prefix storage.

Global KV bytes / token

85,888 bytes

Calculated: 62464 B / 1 tokens (MLA latent) + 7808 B / 1 tokens (RoPE key) + 15616 B / 1 tokens (DSA indexer key); uniform BF16, payload only; quantization overhead excluded. MLA latent: 61 × (512 × 16/8) B/entry; RoPE key: 61 × (64 × 16/8) B/entry; DSA indexer key: 61 × (128 × 16/8) B/entry

Long-context global KV bytes per token, including indexer keys; excludes bounded SWA caches. Compression rates and cross-layer cache reuse are included. Exports use uniform BF16; the website's storage selector also applies here. This is the field to compare with global-KV figures in reports, using the matching storage recipe.

KV bytes / token / B active

2,321 bytes

Calculated: kv.bytes_per_token (131072 tokens) / (params.active / 1e9); uniform BF16, payload only; quantization overhead excluded. MLA latent: 61 × (512 × 16/8) B/entry; RoPE key: 61 × (64 × 16/8) B/entry; DSA indexer key: 61 × (128 × 16/8) B/entry

kv.bytes_per_token divided by active parameters in billions (131,072 tokens in exports).

KV at context / B active

304,257,079 bytes

Calculated: kv.bytes_at_context (131072 tokens) / (params.active / 1e9); uniform BF16, payload only; quantization overhead excluded. MLA latent: 61 × (512 × 16/8) B/entry; RoPE key: 61 × (64 × 16/8) B/entry; DSA indexer key: 61 × (128 × 16/8) B/entry

kv.bytes_at_context divided by active parameters in billions (131,072 tokens in exports).

KV at context

11,257,511,936 bytes

Calculated: 62464 B × 131072 (MLA latent) + 7808 B × 131072 (RoPE key) + 15616 B × 131072 (DSA indexer key); uniform BF16, payload only; quantization overhead excluded. MLA latent: 61 × (512 × 16/8) B/entry; RoPE key: 61 × (64 × 16/8) B/entry; DSA indexer key: 61 × (128 × 16/8) B/entry

Retained KV cache for one sequence at the selected context, including SWA windows and indexer keys. Exports use uniform BF16 at 131,072 tokens. Excludes recurrent state, compressor tail state, draft/MTP caches, temporary prefill tensors, allocator metadata and persistent prefix snapshots. Does not estimate peak prefill or total serving memory.

Evaluations

AA Intelligence Index

21

Source: leaderboard · Artificial Analysis model page /models/deepseek-v3-2-reasoning, Wayback snapshot 2026-10-19
DeepSeek V3.2 (Reasoning) scores 21 on the Artificial Analysis Intelligence Index

Variant: DeepSeek V3.2 (Reasoning). Index v4.3.2.

Artificial Analysis Intelligence Index v4.3.2 of the post-trained model, from a dated Wayback snapshot of its Artificial Analysis page. The note names the variant (reasoning setting).

All models · Link to this model