GLM · 2026-02 · Sparse MoE

GLM-5

GLM-5 is a multi-head latent attention (MLA) transformer released by GLM in 2026-02, with 78 layers, hidden size 6144 and a context window of 202,752 tokens.

Layer stack

Attention ×78 · Layers 78

Key facts

FamilyGLM
Released2026-02
Params744 B
Active40 B
Context202,752 tokens
AttentionMLA · kv_lora_rank 512
Layers78
Hidden6,144
Heads64
Vocab154,880
Positionlearned/absolute
NormRMSNorm
Activationsilu
Dtypefp8
Architecture classGlmMoeDsaForCausalLM

Architecture overview

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

Attention

multi-head latent attention (MLA). kv_lora_rank=512.

Feed-forward / MoE

It is a sparse mixture-of-experts with 256 routed experts and top-8 routing; about 40B 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 GLM-4.7-Flash
ModelGLM-5GLM-4.7-FlashRatio
model_typeglm_moe_dsaglm4_moe_lite
architecturesGlmMoeDsaForCausalLMGlm4MoeLiteForCausalLM
hidden_size61442048×3.00
num_hidden_layers7847×1.66
num_attention_heads6420×3.20
num_key_value_heads6420×3.20
head_dim64
intermediate_size1228810240×1.20
hidden_actsilusilu
n_routed_experts25664×4.00
num_experts_per_tok84×2.00
n_shared_experts11≈1
moe_intermediate_size20481536×1.33
kv_lora_rank512512≈1
qk_rope_head_dim6464≈1
q_lora_rank2048768×2.67
rope_theta1000000
max_position_embeddings202752202752≈1
rms_norm_eps0.000010.00001≈1
vocab_size154880154880≈1
num_nextn_predict_layers11≈1
attention_biasfalsefalse
attention_dropout00
dtypebfloat16bfloat16
eos_token_id154820×1 + 154827×1 + 154829×1154820×1 + 154827×1 + 154829×1
ep_size1

Most similar architectures

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

Raw config fields

47 fields
architecturesGlmMoeDsaForCausalLM
attention_biasfalse
attention_dropout0
dtypebfloat16
eos_token_id154820×1 + 154827×1 + 154829×1
ep_size1
first_k_dense_replace3
hidden_actsilu
head_dim64
hidden_size6144
index_head_dim128
index_n_heads32
index_topk2048
indexer_rope_interleavetrue
initializer_range0.02
intermediate_size12288
kv_lora_rank512
max_position_embeddings202752
moe_intermediate_size2048
moe_layer_freq1
model_typeglm_moe_dsa
n_group1
n_routed_experts256
n_shared_experts1
norm_topk_probtrue
num_attention_heads64
num_experts_per_tok8
num_hidden_layers78
num_key_value_heads64
num_nextn_predict_layers1
pad_token_id154820
pretraining_tp1
q_lora_rank2048
qk_head_dim256
qk_nope_head_dim192
qk_rope_head_dim64
rms_norm_eps0.00001
rope_interleavetrue
routed_scaling_factor2.5
scoring_funcsigmoid
tie_word_embeddingsfalse
topk_group1
topk_methodnoaux_tc
transformers_version5.0.2.dev0
use_cachetrue
v_head_dim256
vocab_size154880