Loading…
Loading…
zai-org/GLM-5.3-FlashThis is a tiny version of zai-org/GLM-5.3-Flash created for testing and development.
Glm5NextForConditionalGeneration)This tiny model preserves the full architecture of the base model:
linear_attention) layers and DeepSeek sparse attention / MLA (deepseek_sparse_attention) layers with the token indexer.Glm5NextVisionModel) and multimodal projector.The model is a bf16 dense checkpoint (the base model's fp8 quantization_config was removed so the tiny model can be randomly initialized and fine-tuned).
The following parameters were reduced from the original model:
| Parameter | Original | Tiny |
|---|---|---|
text hidden_size |
4096 | 256 |
text num_hidden_layers |
45 | 5 |
text intermediate_size (dense) |
12288 | 256 |
text moe_intermediate_size |
2048 | 128 |
n_routed_experts |
288 | 8 |
num_experts_per_tok |
8 | 4 |
n_shared_experts |
1 | 1 |
num_attention_heads / num_key_value_heads |
64 | 4 |
q_lora_rank |
1536 | 128 |
kv_lora_rank |
512 | 64 |
qk_nope_head_dim / v_head_dim |
256 | 64 |
index_n_heads |
32 | 4 |
index_head_dim |
128 | 64 |
index_topk |
2048 | 64 |
index_kpool |
4 | 4 |
linear attn num_heads |
64 | 4 |
vision depth |
24 | 2 |
vision hidden_size |
1024 | 128 |
vision out_hidden_size |
4096 | 256 |
vocab_size |
154880 | 154880 (unchanged) |
| quantization | fp8 (block 128×128) | none (bf16) |
Per-layer schedules were regenerated for the reduced depth:
layer_types: [linear, linear, linear, deepseek_sparse_attention, linear]mlp_layer_types: [dense, dense, dense, sparse, sparse]indexer_types: [full, full, full, full, full]Single-file model.safetensors (223 tensors). The tensor naming is analogous to the
original sharded checkpoint (model.language_model.layers.*, model.visual.*,
lm_head.weight, hyper-connection params hc_attn_* / hc_ffn_*, MLA params
q_a_proj/q_b_proj/kv_a_proj_with_mqa/kv_b_proj, indexer params, KDA linear-attention
params, and packed MoE mlp.experts.*).
Two intentional differences vs. the original:
weight_scale_inv tensors — the tiny model is bf16, not fp8.eh_proj/enorm/hnorm/shared_head.norm)
— the transformers Glm5Next model does not build the multi-token-prediction layer
(_keys_to_ignore_on_load_unexpected skips layers.45.*), so no converter is required.from transformers import Glm5NextForConditionalGeneration, AutoTokenizer
model = Glm5NextForConditionalGeneration.from_pretrained(
"inference-optimization/GLM-5.3-Flash-0.1B-A0.1B", device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("inference-optimization/GLM-5.3-Flash-0.1B-A0.1B")
input_ids = tokenizer("According to all known laws", return_tensors="pt").input_ids.to(model.device)
output = model.generate(input_ids, max_new_tokens=20)
print(tokenizer.decode(output[0]))
This model was created using the llm-compressor create-tiny-model claude skill.
Glm5NextConfig from the base config (removed quantization_config; shrank hidden/layer/expert/MLA/indexer/vision dims; regenerated per-layer schedules).init_weights + non-finite/extreme-value fixup) with transformers 5.16.1.perplexity = 1.05 (target <= 10) PASS
GEN: According to all known laws of aviation, there is no way a bee should be able to fly. Its wings are too small
total params: 84,361,950
transformers >= 5.16.0 (which registers the glm5_next model type).