Reading GLM 5.3 Flash from config.json: 6.0 KB of KV Cache per Token

#55
by laxmimerit - opened

image

A header-level comparison of the GLM 5.3 and GLM 5.3 Flash checkpoints

This note documents what the published config.json files and safetensors headers of GLM 5.3 and GLM 5.3 Flash contain. All values were derived from 194,737 tensor shapes. No weight files were downloaded, and every parameter count and cache size below is arithmetic on those shapes.

GLM 5 to GLM 5.3

The base architecture carries over: 78 layers, identical hidden size, 256 routed experts and an identical vocabulary. The diff is limited to three entries.

figure-1-lightning-indexer

  • max_position_embeddings: 202,752 → 1,048,576
  • rope_theta: 1,000,000 → 8,000,000, extending RoPE to the longer window
  • index_topk_freq: 4: the indexer runs in 21 layers and 57 layers reuse the latest selection. Indexer tensors are present in exactly 22 layers, the 21 main layers and the MTP draft layer.

GLM 5.3 Flash

Flash is a distinct architecture.

figure-2-shared-indexer

  • Attention: 34 Kimi Delta Attention layers and 11 DeepSeek Sparse Attention layers, interleaved at 3:1.
  • Positional encoding: qk_rope_head_dim: 0 and mla_use_nope: true. kv_a_proj_with_mqa has shape [512, 4096], compared with [576, 6144] in GLM 5.3.
  • Indexer: index_kpool: 4, index_kpool_compress: true, index_kpool_always_select_tail: true.
  • Residual stream: hc_mult: 4 and hc_sinkhorn_iters: 20, 35M parameters in total.
  • Experts: 288 routed and 1 shared per layer, 25.17M parameters each.
  • Vision: 0.56B tower, 24 blocks, 448×448 input, 14×14 patches, temporal_patch_size: 2.

KV cache derivation

MLA caches a single latent per layer per token. With FP8 storage:

GLM 5.3   78 × (512 + 64) + 21 × 128      = 47,616 bytes/token
Flash     11 × 512        + 11 × 128 / 4  =  5,984 bytes/token

The ratio is 8.0x if key pooling applies to the stored indexer keys, and 6.8x if it applies only to the scan. The vendor reports approximately 4.4x, and the serving method behind that figure is not documented. For a 1,048,576-token sequence this corresponds to 49.9 GB for GLM 5.3, and 6.3 GB plus 0.07 GB of KDA state for Flash.


Full article: https://kgptalkie.com/tutorials/llm-benchmarking/glm-5-3-vs-glm-5-3-flash-architecture-teardown

Video: https://youtu.be/zWkc4iOi_c8

Sign up or log in to comment