Summary
Table with columns: Property, Original (zai-org/GLM-5.3-Flash), This model (REAP-50)| Property | Original (zai-org/GLM-5.3-Flash) | This model (REAP-50) |
|---|
| Total parameters | ~301 B | ~157 B |
| Active parameters / token | ~12.5 B | ~12.5 B (unchanged) |
| Layers | 78 (3 dense + 75 MoE) | 78 (3 dense + 75 MoE) |
| Routed experts / MoE layer | 256 | 128 (50% pruned) |
Active experts / token (num_experts_per_tok) | 8 | 8 |
| Shared expert / MoE layer | 1 | 1 (untouched) |
| Attention | MLA + DSA (deepseek_v32, kv_lora_rank=512, q_lora_rank=2048, index_topk=2048) | Untouched |
| Context length | 202,752 | 202,752 |
| Size | 296 GiB (FP8) | 157.0 GiB (FP8) |
| License | MIT | MIT |
Pruning methodology
Each MoE layer l in [3..77] has 256 routed SwiGLU experts (gate_proj, up_proj, down_proj, intermediate size 1536) routed by a sigmoid gate (routed_scaling_factor = 2.5, norm_topk_prob = true, e_score_correction_bias).
- Calibration corpus: 320 sequences x 2048 tokens (655,360 tokens) drawn from fineweb-edu, Wikipedia, Python/C++/Rust code, GSM8K/math, reasoning traces, and Chinese/English prompts (
calibration_tokens.pt, SHA-256 recorded in reap_plan.json).
- Exact teacher forward: Layers 0..77 were executed sequentially on GPU in native
bfloat16 using the exact deepseek_v32 MLA + rotary + lightning-indexer attention implementation and exact block-scale FP8 (F8_E4M3 x F8_E8M0 UE8M0) dequantization (saliency_pass.py).
- REAP saliency metric (Equation 6 of arXiv:2510.13999):
For each routed expert
j in layer l, over the set T_j of calibration tokens where expert j is in the router's top-8:
S_j = (1 / |T_j|) * sum_{t in T_j} g_{t,j} * || down_proj_j( silu(gate_proj_j(h_t)) * up_proj_j(h_t) ) ||_2
where g_{t,j} is the normalized top-8 routing weight (prior to routed_scaling_factor, which is a constant multiplier across experts).
- Bit-exact expert selection & weight remapping:
In each MoE layer, the 128 experts with highest
S_j are retained in ascending original-index order kept = [k_0 < k_1 < ... < k_127]:
mlp.gate.weight ([256, 5120] -> [128, 5120]) and mlp.gate.e_score_correction_bias ([256] -> [128]) are sliced to kept.
- Routed experts
mlp.experts.{kept[new_idx]}.* are renamed to mlp.experts.{new_idx}.* (0..127) with zero modification to their F8_E4M3 weights or F8_E8M0 weight_scale_inv blocks.
- All attention projections, DSA indexer weights, dense layers (0..2), shared experts, norms, embeddings, and
lm_head are copied bit-for-bit from zai-org/GLM-5.3-Flash.
- The training-only MTP head (
model.layers.78, num_nextn_predict_layers) is omitted (num_nextn_predict_layers = 0).
Full per-layer keep/prune metadata and first-moment gains are included in ./reap_metadata.json and ./adapters/first_moment_gains.json, with the full pipeline source in patrickbdevaney/glm-5.3-reap.
Identical to zai-org/GLM-5.3-Flash: fine-grained FP8 (fp8 block [1, 128] with F8_E4M3 weights and F8_E8M0 weight_scale_inv), ready for drop-in serving with vLLM or SGLang (deepseek_v32 / GlmMoeDsaForCausalLM).
Usage (vLLM / SGLang)
# vLLM (2x 80GB+ GPUs, or 1x 192GB B200)vllm serve patrickbdevaney/GLM-5.3-Flash-REAP50-FP8 \ --tensor-parallel-size 2 \ --trust-remote-code \ --max-model-len 65536 # SGLangpython3 -m sglang.launch_server \ --model-path patrickbdevaney/GLM-5.3-Flash-REAP50-FP8 \ --tp 2 \ --trust-remote-code
🔎 Provenance & Verification Ledger
Attribution & License