Z.ai (Zhipu AI) · usage rank #11 · released 2026-06-16
GLM-5.2
What GLM-5.2’s own documents say it is built from — every method with the sentence that describes it.
Curator’s note~744-753B MoE, 1M context, MIT. No dedicated GLM-5.2 arXiv report; arXiv 2602.15763 is the GLM-5 report, and 5.2's own architecture delta (IndexShare over DeepSeek Sparse Attention) is described in the z.ai blog post.
Rank by open-weight tokens on OpenRouter, week of 2026-09-21.
Against the consensus recipe
Its documents state 9 of the 15 methods the field agrees on.
The recipe from the overview: the methods the most labs adopt, per stage. A missing one is something the documents do not say, not something the model lacks.
Data curation
Training objective
- Multi-Token Predictionnot in its documents
- KL alignment lossnot in its documents
Model architecture
- Mixture of Expertscore
- Hybrid Attentionnot in its documents
- Multi-Token Predictionused
Optimization
- Muonused
- Expert Parallelismused
- Cosine decayused
Post-training
- Group Relative Policy Optimizationused
- Supervised fine-tuningnot in its documents
- Multi-Teacher On-Policy Distillationnot in its documents
Inference & serving
- Configurable reasoning effortdefault
- Speculative decodingused
- FP8 KV-cache quantizationnot in its documents
Checked in its code
Its code shows 7 of the 19 architecture features checked — 4 of them are not stated in its documents.
Documents say what a lab chose to describe; the modeling code says what the checkpoint runs. Each feature below was put to a code verifier, and only the config values and source lines it cited that were found in the files are shown, linked to the line.
Read from Hugging Face Transformers (modeling_glm_moe_dsa.py, configuration_glm_moe_dsa.py) and config.json at revision cf457fa734, by anthropic/claude-sonnet-5 on 2026-09-25.
| Feature | Code | Its documents | Evidence |
|---|---|---|---|
| Grouped-query attention | not in its code | not stated | num_attention_heads equals num_key_value_heads (64/64) and the attention is MLA, so there is no key/value head sharing group beyond the single latent projection. num_attention_heads = 64num_key_value_heads = 64 |
| Multi-head latent attention | in its code | core | Keys/values are compressed into a shared kv_lora_rank latent via kv_a_proj_with_mqa/kv_a_layernorm and up-projected per head by kv_b_proj, with a decoupled RoPE key, DeepSeek-V2/V3-style MLA. kv_lora_rank = 512q_lora_rank = 2048qk_rope_head_dim = 64 |
| Sliding-window attention | not in its code | evaluated | There is no sliding_window config key or windowed masking logic anywhere in the attention code; masking is a single causal mask ('indexed_attention') applied uniformly. |
| Interleaved sliding-window and global attention | not in its code | not stated | All layers use the single 'indexed_attention' layer type with the same causal (plus sparse-index) mask; there is no interleaving of sliding-window and global attention layers. |
| Indexer-selected sparse attention (DeepSeek Sparse Attention) | in its code | core | GlmMoeDsaIndexer scores past tokens per head and each query attends only to the index_topk selected tokens via an additive sparse mask (DeepSeek Sparse Attention). index_topk = 2048index_n_heads = 32index_head_dim = 128 |
| Linear-attention or state-space layers alongside full attention | not in its code | not stated | No linear-attention, Mamba, or state-space mixer layers exist in the code; every layer uses GlmMoeDsaAttention (MLA + indexer sparse attention). |
| Gated DeltaNet layers | not in its code | evaluated | No delta-rule recurrent state or decay gate mechanism is implemented anywhere in the modeling file. |
| Mamba-2 layers | not in its code | not stated | No SSD/Mamba-2 selective state-space block or associated config keys (mamba_num_heads, ssm_state_size) exist in this model. |
| Learnable attention sink | not in its code | not stated | The attention softmax in eager_attention_forward has no extra learned sink logit column added to the denominator. |
| Gated attention output | not in its code | not stated | The attention output is reshaped and passed directly to o_proj with no sigmoid gate multiplication anywhere in the forward pass. |
| QK normalization | not in its code | not stated | Only the indexer's key projection is normalized (LayerNorm on wk output); the main attention's query/key states used for the softmax dot product (q_states/key_states) are not normalized before the attention computation. |
| Partial RoPE code only | in its code | not stated | Query/key heads split into a nope part (qk_nope_head_dim=192) with no rotation and a rope part (qk_rope_head_dim=64) that gets RoPE, MLA's decoupled RoPE key style. qk_rope_head_dim = 64qk_nope_head_dim = 192 |
| YaRN RoPE scaling | not in its code | not stated | rope_parameters.rope_type is 'default' (not 'yarn'), so although the code has yarn_apply_mscale/yarn_get_mscale helpers, this config does not enable YaRN scaling. rope_parameters = {"rope_theta": 8000000, "rope_type": "default"} |
| Layers without positional encoding (NoPE) | not in its code | not stated | Every attention layer uses the same qk_nope/qk_rope split within MLA (partial RoPE per head), rather than some full-attention layers entirely lacking positional encoding while others have it; there is no no_rope_layers/nope_layer_interval config or logic. |
| Mixture of experts | in its code | core | MoE decoder layers route each token via GlmMoeDsaTopkRouter to 8 of 256 routed experts (GlmMoeDsaExperts) on layers marked 'sparse'. n_routed_experts = 256num_experts_per_tok = 8 |
| Shared expert code only | in its code | not stated | GlmMoeDsaMoE includes a shared_experts GlmMoeDsaMLP with intermediate size scaled by n_shared_experts=1, applied to every token in addition to routed experts. n_shared_experts = 1 |
| Auxiliary-loss-free load balancing (selection bias) code only | in its code | not stated | GlmMoeDsaTopkRouter adds e_score_correction_bias to sigmoid scores only to select the top-k/top-group experts (topk_method 'noaux_tc'), not to weight outputs, which are gathered from the un-biased scores. topk_method = "noaux_tc" |
| Multi-token prediction layers | code unclear | used | num_nextn_predict_layers=1 is set in config and there's a reference to skipping model.layers.78* on load, but no MTP module class or building logic is present in the given modeling file. num_nextn_predict_layers = 1 |
| SwiGLU feed-forward code only | in its code | not stated | Both the dense MLP and routed experts compute silu(gate_proj(x)) * up_proj(x), a SwiGLU feed-forward, with hidden_act set to silu. hidden_act = "silu" |
model architecture 13
token mixer 10
softmax attention 3
sliding window attention 1
grouped-query attention 1
multi-head latent attention 1
sparse attention 4
linear attention & state space 2
hybrid layer stacking 1
channel mixer 2
prediction head 1
optimization 9
optimizer 2
learning-rate schedule 2
training precision 1
quantization-aware training 1
training stability 1
training parallelism 1
training runtime 1
data curation 3
data sourcing 1
data filtering 1
synthetic data 1
post-training 14
supervised fine-tuning 1
reinforcement learning algorithm 4
reward modelling 2
policy distillation 1
inference & serving 18
decoding strategy 2
reasoning control 3
KV cache management 2
inference quantization 4
serving parallelism 2
inference scheduling 1
inference kernel 1
context management 3
software implementation 9
inference engine 6
training framework 1
agent product 2
evaluation 2
unfiled 4
Further reading
Picked by hand, not extracted: where to read more, not evidence for anything on this page.
- GLM-5.2 architecture card — LLM Architecture Gallery explainer sebastianraschka.com
Sources
The curated document list for this model. "not fetched" means the URL is recorded but its text was not read in the current run.
| Document | Kind | Publisher | Status |
|---|---|---|---|
| z.ai/blog/glm-5.2 | official blog | Z.ai | not fetched |
| arxiv.org/abs/2602.15763 | technical report | GLM-5 Team | read |
| github.com/zai-org/GLM-5 | code repo | Z.ai | read |
| huggingface.co/zai-org/GLM-5.2 | model card | Z.ai | read |
| docs.z.ai/guides/llm/glm-5.2 | vendor docs | Z.ai | read |
| interconnects.ai/p/glm-52-is-the-step-change-for-open | third party analysis | Interconnects (Nathan Lambert) | read |
| tech-now.io/en/blogs/glm-5-2 | third party analysis | TechNow | read |