DeepSeek · 2025-08 · Sparse MoE

DeepSeek-V3.1

DeepSeek-V3.1 is a multi-head latent attention (MLA) transformer released by DeepSeek in 2025-08, with 61 layers, hidden size 7168 and a context window of 163,840 tokens.

Layer stack

Attention ×61 · Layers 61

Key facts

FamilyDeepSeek
Released2025-08
Params671 B
Active37 B
Context163,840 tokens
AttentionMLA · kv_lora_rank 512
Layers61
Hidden7,168
Heads128
Vocab129,280
PositionRoPE
NormRMSNorm
Activationsilu
Dtypefp8
Architecture classDeepseekV3ForCausalLM

Architecture overview

t₁ t₂ t₃ t₄ input tokens Embedding · Vocab 129,280 → Hidden 7,168 Q · 128 Wᴰᴷⱽ ↓ c_KV · 512 kᴿ · RoPE 64 Wᵁᴷ/Wᵁⱽ ↑ ⊕kᴿ Attention KV cache/token ≈ 512+64 vs dense 2·7,168 → ≈ 1/24.9 Router E1 E2 E3 E4 E5 E6 E7 E8 +248… Shared expert ×1 top-8 of 256 experts · ≈ 37B params active per token × 61 transformer block Attention Feed-forward / MoE RMSNorm pre-norm Final norm · RMSNorm LM head → Vocab 129,280 p p p → next token MTP ×1 → +1 future tokens Position RoPE Dtype FP8 Context 160K tok
Drawn from the shipped config.json · 61 layers / width 7,168 / context 163,840. Original diagram by this atlas.

Attention

multi-head latent attention (MLA). kv_lora_rank=512. RoPE θ=10,000.

Feed-forward / MoE

It is a sparse mixture-of-experts with 256 routed experts and top-8 routing; about 37B parameters are active per token.

The configuration ships 1 extra multi-token-prediction (MTP) layers used to accelerate decoding.

Field-level comparison

Compared against the previous model of the same lab; where none exists, against the structurally closest model. The ratio column is this model divided by the comparison model.

Full-field comparison vs predecessor DeepSeek-R1
ModelDeepSeek-V3.1DeepSeek-R1Ratio
model_typedeepseek_v3deepseek_v3
architecturesDeepseekV3ForCausalLMDeepseekV3ForCausalLM
hidden_size71687168≈1
num_hidden_layers6161≈1
num_attention_heads128128≈1
num_key_value_heads128128≈1
intermediate_size1843218432≈1
hidden_actsilusilu
n_routed_experts256256≈1
num_experts_per_tok88≈1
n_shared_experts11≈1
moe_intermediate_size20482048≈1
kv_lora_rank512512≈1
qk_rope_head_dim6464≈1
q_lora_rank15361536≈1
rope_theta1000010000≈1
max_position_embeddings163840163840≈1
rms_norm_eps0.0000010.000001≈1
vocab_size129280129280≈1
torch_dtypebfloat16bfloat16
num_nextn_predict_layers11≈1
attention_biasfalsefalse
attention_dropout00
bos_token_id00
eos_token_id11≈1
ep_size11≈1

Most similar architectures

Similarity values range from 0 (no shared categorical features) to 1 (identical profiles).

Raw config fields

40 fields
architecturesDeepseekV3ForCausalLM
attention_biasfalse
attention_dropout0
bos_token_id0
eos_token_id1
ep_size1
first_k_dense_replace3
hidden_actsilu
hidden_size7168
initializer_range0.02
intermediate_size18432
kv_lora_rank512
max_position_embeddings163840
model_typedeepseek_v3
moe_intermediate_size2048
moe_layer_freq1
n_group8
n_routed_experts256
n_shared_experts1
norm_topk_probtrue
num_attention_heads128
num_experts_per_tok8
num_hidden_layers61
num_key_value_heads128
num_nextn_predict_layers1
q_lora_rank1536
qk_nope_head_dim128
qk_rope_head_dim64
rms_norm_eps0.000001
rope_theta10000
routed_scaling_factor2.5
scoring_funcsigmoid
tie_word_embeddingsfalse
topk_group4
topk_methodnoaux_tc
torch_dtypebfloat16
transformers_version4.44.2
use_cachetrue
v_head_dim128
vocab_size129280