GLM · 2025-07 · Sparse MoE

GLM-4.5

GLM-4.5 is a grouped-query attention (GQA) transformer released by GLM in 2025-07, with 92 layers, hidden size 5120 and a context window of 131,072 tokens.

Layer stack

Attention ×92 · Layers 92

Key facts

FamilyGLM
Released2025-07
Params360.4 B
Active32.7 B
Context131,072 tokens
AttentionGQA (96:8)
Layers92
Hidden5,120
Heads96
Vocab151,552
PositionRoPE
NormRMSNorm
Activationsilu
Dtypebf16
Architecture classGlm4MoeForCausalLM

Architecture overview

t₁ t₂ t₃ t₄ input tokens Embedding · Vocab 151,552 → Hidden 5,120 Q1 Q2 Q3 Qn KV1 KV2 KV3 KVn Heads 96 KV heads 8 head dim 128 · RoPE Router E1 E2 E3 E4 E5 E6 E7 E8 +152… Shared expert ×1 top-8 of 160 experts · ≈ 32.7B params active per token × 92 transformer block Attention Feed-forward / MoE RMSNorm pre-norm Final norm · RMSNorm LM head → Vocab 151,552 p p p → next token MTP ×1 → +1 future tokens Position RoPE Dtype BF16 Context 128K tok
Drawn from the shipped config.json · 92 layers / width 5,120 / context 131,072. Original diagram by this atlas.

Attention

grouped-query attention (GQA) — 96 q-heads / 8 kv-heads. RoPE θ=1,000,000.

Feed-forward / MoE

It is a sparse mixture-of-experts with 160 routed experts and top-8 routing; about 32.7B 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 9B
ModelGLM-4.5GLM-4 9BRatio
model_typeglm4_moechatglm
architecturesGlm4MoeForCausalLMChatGLMModel
hidden_size51204096×1.25
num_hidden_layers92
num_attention_heads9632×3.00
num_key_value_heads8
head_dim128
intermediate_size12288
hidden_actsilu
n_routed_experts160
num_experts_per_tok8
n_shared_experts1
moe_intermediate_size1536
rope_theta1000000
max_position_embeddings131072
rms_norm_eps0.00001
vocab_size151552
torch_dtypebfloat16bfloat16
num_nextn_predict_layers1
attention_biastrue
attention_dropout00
pad_token_id151329151329≈1
eos_token_id151329×1 + 151336×1 + 151338×1151329×1 + 151336×1 + 151338×1
partial_rotary_factor0.5
initializer_range0.02
norm_topk_probtrue

Most similar architectures

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

Raw config fields

34 fields
architecturesGlm4MoeForCausalLM
attention_biastrue
attention_dropout0
pad_token_id151329
eos_token_id151329×1 + 151336×1 + 151338×1
head_dim128
hidden_actsilu
hidden_size5120
partial_rotary_factor0.5
initializer_range0.02
intermediate_size12288
max_position_embeddings131072
model_typeglm4_moe
moe_intermediate_size1536
norm_topk_probtrue
num_attention_heads96
n_group1
topk_group1
n_routed_experts160
n_shared_experts1
routed_scaling_factor2.5
num_experts_per_tok8
first_k_dense_replace3
num_hidden_layers92
num_key_value_heads8
rms_norm_eps0.00001
rope_theta1000000
num_nextn_predict_layers1
tie_word_embeddingsfalse
torch_dtypebfloat16
transformers_version4.54.0
use_cachetrue
use_qk_normtrue
vocab_size151552