Rúben GalvãoThe Rabbit Hole

The Rabbit Hole / AI / Model architectures

Zhipu AI (Z.ai) · Architecture map

GLM-4.7-Flash

A 30B-A3B GLM that uses DeepSeek-style latent attention and one dense layer before 46 expert layers, where the larger GLM-4.7 keeps grouped-query attention.

GLM-4.7-Flash, January 2026 · GLM release timeline

Inside GLM-4.7-Flash

Parameters
30B · 3B active
Layers
47
Width
2,048
Mixer
Latent
Select a component to explore it.
The complete GLM-4.7-Flash architectureInput IDs select embeddings. Each layer adds its updates along the residual stream. 20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads. A 512-value KV latent plus a 64-value rotary key per token per layer. Final normalisation and output weights produce vocabulary scores and the next-token distribution.Text becomes token IDs.Text → tokens → IDstheoldrabbitsleepsEmbedding lookup154,8802,048Input token vectorsCL2,048Transformer layer 1Transformer layer 1 · 1 repetitionsOne layer1RMSNorm before this operation.RMSNormLatent attention: Dense feed-forward network (intermediate size 10240).Latent attentionRotate query and key position components before attention scores; values are unchanged. Dense feed-forward network (intermediate size 10240).RoPEAdd the branch output to the original stream. +RMSNorm before this operation.RMSNormDense feed-forward: Dense feed-forward network (intermediate size 10240).Densefeed-forwardAdd the branch output to the original stream. +Transformer layers 2–47Transformer layers 2–47 · 46 repetitions46 layers · one layer shown46RMSNorm before this operation.RMSNormLatent attention: 64 routed experts (size 1536), 4 chosen per token, plus 1 shared expert. Sigmoid scores with a selection bias, weights renormalised, scaling factor 1.8, one group.Latent attentionRotate query and key position components before attention scores; values are unchanged. 64 routed experts (size 1536), 4 chosen per token, plus 1 shared expert. Sigmoid scores with a selection bias, weights renormalised, scaling factor 1.8, one group.RoPEAdd the branch output to the original stream. +RMSNorm before this operation.RMSNormMoE: 64 routed experts (size 1536), 4 chosen per token, plus 1 shared expert. Sigmoid scores with a selection bias, weights renormalised, scaling factor 1.8, one group.MoE4 of 64 routed experts selected per token. Highlighted boxes are schematic; boxes do not correspond one-to-one to experts. 1 shared experts run for every token.Add the branch output to the original stream. +4 of 64 experts + 1sharedResidual streamLast columnCL2,048Final RMSNormA separate learned vocabulary projection.Output weights2,048154,880Vocabulary scoresSoftmax154,880Next-token probabilities
Inside latent attention · Transformer layer 1
20 heads · 512 cached latent values + 64 rotary values.

Earlier context dimmed · current token bright · dashed regions contain cached entries.

GLM-4.7-Flash: Transformer layer 1 · latent attention20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads. A 512-value KV latent plus a 64-value rotary key per token per layer.1 shared latent cache; the front face shows one representative.1 shared latent cache20 attention heads; the front face shows one representative.20 attention headsAttention input. 20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads.Earlier context is dimmed; outlined columns are current.Current token computation.Attention input2,048CLWq↓. 20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads.Wq↓2,048768RMSNorm. 20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads.RMSNormWq↑. 20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads.Wq↑768256RoPE 64. 20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads.RoPE 64Wkv↓. 20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads.Wkv↓2,048512RMSNorm. 20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads.RMSNorm512Wkᴿ. 20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads.Wkᴿ2,04864RoPE 64. 20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads.RoPE 64cᴷⱽ ⊕ kᴿ. 20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads.cᴷⱽ ⊕ kᴿLatent cache. 20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.Latent cache576CLWk↑. 20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads.Wk↑512192Wv↑. 20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads.Wv↑512256kᶜ ⊕ kᴿ. 20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads.kᶜ ⊕ kᴿ256Q context. 20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads.Earlier context is dimmed; outlined columns are current.Current token computation.Q context256CLScaled query–key scores, masking and softmax. 20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads.CLCL×. 20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads.×Joined heads. 20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads.20Wo. 20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads.Wo5,1202,048Attention output. 20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads.Earlier context is dimmed; outlined columns are current.Current token computation.Attention output2,048CL
Model-specific details
Transformer layer 1 · 1 repetitions
Dense feed-forward network (intermediate size 10240).
Transformer layers 2–47 · 46 repetitions
64 routed experts (size 1536), 4 chosen per token, plus 1 shared expert. Sigmoid scores with a selection bias, weights renormalised, scaling factor 1.8, one group.
Attention and positions
20 heads; query rank 768, KV latent 512, key 192 content plus 64 rotary, value size 256. Keys and values are expanded from the latent for each of the 20 heads.
Memory
A 512-value KV latent plus a 64-value rotary key per token per layer.

Latent attention in the smaller GLM

This is the January 2026 30B-A3B Flash checkpoint.

How it scores

AA Intelligence Index

Version 4.3.2 · higher is better · checked 2026-11-01. Separate from Epoch ECI.

Checkpoint / sizeResultEvaluation
GLM-4.7-Flash15AA Index 4.3.2Best evaluated setting
AA Index distributionBest checkpoint per model variant among 97 scored variants in this atlas. GLM-4.7-Flash scores 15; its bin is highlighted. Known estimates are excluded.Model variants0.0–3.0: 0 variants3.0–6.0: 15 variants6.0–9.0: 21 variants9.0–12.0: 13 variants12.0–15.0: 9 variants15.0–18.0: 5 variants18.0–21.0: 5 variants21.0–24.0: 6 variants24.0–27.0: 4 variants27.0–30.0: 2 variants30.0–33.0: 2 variants33.0–36.0: 2 variants36.0–39.0: 2 variants39.0–42.0: 3 variants42.0–45.0: 4 variants45.0–48.0: 3 variants48.0–51.0: 0 variants51.0–54.0: 0 variants54.0–57.0: 1 variants57.0–60.0: 0 variants21003060AA Index 4.3.2 →
GLM-4.7-Flash: 15. Distribution of 97 scored variants in this atlas, using each variant’s best checkpoint. Known estimates excluded.

Explore the components

Sources for this map