DeepSeek · 2024-01 · Sparse MoE

DeepSeekMoE 16B

DeepSeekMoE 16B is a multi-head attention (MHA) transformer released by DeepSeek in 2024-01, with 28 layers, hidden size 2048 and a context window of 4,096 tokens.

Layer stack

Attention ×28 · Layers 28

Key facts

FamilyDeepSeek
Released2024-01
Params16.2 B
Active2.6 B
Context4,096 tokens
AttentionMHA (16:16)
Layers28
Hidden2,048
Heads16
Vocab102,400
PositionRoPE
NormRMSNorm
Activationsilu
Dtypebf16
Architecture classDeepseekForCausalLM

Architecture overview

t₁ t₂ t₃ t₄ input tokens Embedding · Vocab 102,400 → Hidden 2,048 Q1 Q2 Q3 Qn KV1 KV2 KV3 KVn Heads 16 KV heads 16 head dim 128 · RoPE Router E1 E2 E3 E4 E5 E6 E7 E8 +56… Shared expert ×2 top-6 of 64 experts · ≈ 2.6B params active per token × 28 transformer block Attention Feed-forward / MoE RMSNorm pre-norm Final norm · RMSNorm LM head → Vocab 102,400 p p p → next token Position RoPE Dtype BF16 Context 4K tok
Drawn from the shipped config.json · 28 layers / width 2,048 / context 4,096. Original diagram by this atlas.

Attention

multi-head attention (MHA) — 16 q-heads / 16 kv-heads. RoPE θ=10,000.

Feed-forward / MoE

It is a sparse mixture-of-experts with 64 routed experts and top-6 routing; about 2.6B parameters are active per token.

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 LLM 7B
ModelDeepSeekMoE 16BDeepSeek LLM 7BRatio
model_typedeepseekllama
architecturesDeepseekForCausalLMLlamaForCausalLM
hidden_size20484096×0.500
num_hidden_layers2830×0.933
num_attention_heads1632×0.500
num_key_value_heads1632×0.500
intermediate_size1094411008×0.994
hidden_actsilusilu
n_routed_experts64
num_experts_per_tok6
n_shared_experts2
moe_intermediate_size1408
rope_theta1000010000≈1
max_position_embeddings40964096≈1
rms_norm_eps0.0000010.000001≈1
vocab_size102400102400≈1
torch_dtypebfloat16bfloat16
attention_biasfalse
attention_dropout0
bos_token_id1000001×100000.00
eos_token_id1000012×50000.50
first_k_dense_replace1
initializer_range0.020.02≈1
moe_layer_freq1
norm_topk_probfalse
pretraining_tp11≈1

Most similar architectures

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

Raw config fields

30 fields
architecturesDeepseekForCausalLM
attention_biasfalse
attention_dropout0
bos_token_id100000
eos_token_id100001
first_k_dense_replace1
hidden_actsilu
hidden_size2048
initializer_range0.02
intermediate_size10944
max_position_embeddings4096
model_typedeepseek
moe_intermediate_size1408
moe_layer_freq1
n_routed_experts64
n_shared_experts2
norm_topk_probfalse
num_attention_heads16
num_experts_per_tok6
num_hidden_layers28
num_key_value_heads16
pretraining_tp1
rms_norm_eps0.000001
rope_theta10000
scoring_funcsoftmax
tie_word_embeddingsfalse
torch_dtypebfloat16
transformers_version4.36.0
use_cachetrue
vocab_size102400