A DFlash2 speculative decoding draft model for GLM-5.3-Flash, trained exclusively on English and Korean agentic coding trajectories. All training data was generated by GLM-5.3-Flash itself while driving Claude Code, Codex, and OpenCode to resolve real GitHub issues.
Because speculative decoding is lossless—the target model verifies every drafted token—output quality is identical to running the target model directly. The drafter only accelerates generation.
DFLASH speculative decoding algorithm.Tested with SGLang 0.5.21 on 2× NVIDIA B200 GPUs using the FP8 target model:
python -m sglang.launch_server \
--model-path zai-org/GLM-5.3-Flash \
--tp-size 2 --trust-remote-code \
--context-length 262144 --mem-fraction-static 0.93 \
--tool-call-parser glm47 --reasoning-parser glm45 \
--speculative-algorithm DFLASH \
--speculative-draft-model-path lablup/GLM-5.3-Flash-DFlash2-Agentic \
--speculative-draft-attention-backend fa4
| Model | Overall | EN | KO | Claude Code | Codex | OpenCode | Solo turns | Accept len |
|---|---|---|---|---|---|---|---|---|
| DFlash2 (this model) | 291 (2.31×) | 284 (2.29×) | 297 (2.31×) | 271 (2.17×) | 309 (2.40×) | 297 (2.38×) | 353 (2.21×) | 4.80 |
| DFlash2 (incoai) | 248 (1.97×) | 259 (2.08×) | 240 (1.86×) | 264 (2.11×) | 223 (1.73×) | 252 (2.03×) | 288 (1.81×) | 4.28 |
| MTP (SGLang EAGLE, 5 steps) | 239 (1.89×) | 238 (1.91×) | 240 (1.87×) | 224 (1.79×) | 229 (1.78×) | 264 (2.12×) | 281 (1.76×) | 4.09 |
| No speculation | 126 | 124 | 129 | 125 | 129 | 124 | 159 | – |
Throughput values show the median per-turn decode speed (in tok/s) across all requests generating at least 16 output tokens. Values in parentheses indicate the speedup relative to non-speculative decoding in the same column.
low, high, max).--max-running-requests 16 --chunked-prefill-size 4096).--speculative-algorithm EAGLE --speculative-num-steps 5 --speculative-eagle-topk 1 --speculative-num-draft-tokens 6 (the fastest MTP configuration we found for this workload).--speculative-draft-attention-backend fa4.(completion_tokens − 1) / (end_to_end_latency − ttft) from SGLang's request logs.spec_accept_length (the average number of tokens accepted per verification step), averaged across requests.incoai) and were excluded across all configurations, leaving 52 valid sessions.All training data was collected by running live coding agents backed by GLM-5.3-Flash. The drafter is trained strictly on tokens generated by the target model under the exact prompt contexts the target model saw during execution.
| Metric | Value |
|---|---|
| GitHub repositories | 977 (across 31 programming languages) |
| Agent sessions (with logged requests) | 50,268 |
| Target-model requests | 2,178,249 |
| Training samples | 80,299 |
| Total context tokens in samples | 2.58B |
| Supervised (loss) tokens | 0.611B |
| Maximum sample length | 262,144 tokens |
training_repos.json, and overall dataset statistics along with the held-out repository list are available in data_summary.json.low, high, or max) were sampled per session.Tokens processed and generated by GLM-5.3-Flash across all training sessions:
| Split | Sessions | Requests | Input tokens | Output tokens | Samples | Supervised tokens |
|---|---|---|---|---|---|---|
| Total | 50,268 | 2,178,249 | 91.90B | 610.95M | 80,299 | 610.56M |
| English | 25,151 | 1,073,677 | 45.03B | 294.29M | 40,103 | 293.90M |
| Korean | 25,117 | 1,104,572 | 46.87B | 316.66M | 39,994 | 316.20M |
| Claude Code | 16,757 | 799,868 | 34.94B | 278.35M | 39,029 | 277.79M |
| Codex | 16,682 | 695,268 | 29.34B | 145.45M | 16,999 | 145.44M |
| OpenCode | 16,829 | 683,113 | 27.61B | 187.15M | 24,069 | 186.87M |
| Effort: low | 16,699 | 548,492 | 17.65B | 105.75M | 20,424 | 105.56M |
| Effort: high | 16,736 | 739,352 | 30.20B | 186.05M | 24,981 | 185.76M |
| Effort: max | 16,833 | 890,405 | 44.05B | 319.15M | 34,692 | 318.78M |
Framework: SpecForge (commit 53398a8), using the DFlash training strategy and DFlash2 draft architecture in disaggregated online mode.
| Hyperparameter | Value |
|---|---|
| Optimizer | AdamW |
| Peak learning rate | 6e-4 |
| LR schedule | Cosine decay with 4% warmup |
| Gradient clipping | 1.0 |
| Feature capture | Online (re-captured every pass with freshly sampled anchors) |
| Effective batch size | 16 samples / step (2 ranks × 1 sample × 8 grad accum) |
| Tokens per step | ~1M context tokens (≤16K anchor blocks) |
| Anchors per sample | 1,024 |
| Max sample length | 262,144 tokens |
| Draft loss | DFlash loss with position decay γ = 7 |
| DFlash2 selector loss | Weight α = 1.0 (0.5% warmup, 1% ramp), strict top-k |
| Attention backend | FlexAttention |
| Precision | BF16 drafter, FP8 target |
| Sharding strategy | FSDP SHARD_GRAD_OP |
| Random seed | 42 |
Released checkpoint: Step 9,750. Average training metrics over steps 9,560–9,750:
| Parameter | Value |
|---|---|
| Target model | GLM-5.3-Flash (320B total / 18B active MoE, 45 layers, hidden size 4096, vocab size 154,880) |
| Draft layers | 5 non-causal layers with sliding-window attention (window size 2048) |
| Hidden / FFN dimension | 4096 / 12288 |
| Attention heads / KV heads / head dim | 32 / 8 / 128 |
| Block size | 8 (1 anchor token + 7 draft tokens) |
Target layers read (target_layer_ids) |
5, 14, 24, 33, 42 |
| Conv kernel / group size | 2 / 16 |
| Candidate selector rank / top-k | 256 / 16 |
| Mask token ID | 154856 |
| Embeddings & LM head | Shared with target model (frozen) |
| Trainable parameters | 1.17B |
| Weights dtype | bfloat16 |
The model architecture is identical to incoai/GLM-5.3-Flash-DFlash2; only the training dataset and recipe differ. The relevant section of config.json is:
"dflash_config": {
"block_size": 8,
"conv_group_size": 16,
"conv_kernel_size": 2,
"mask_token_id": 154856,
"selector_rank": 256,
"selector_top_k": 16,
"target_layer_ids": [5, 14, 24, 33, 42]
}
This draft model is released under the MIT License. It requires GLM-5.3-Flash as the target model; please refer to the base model repository for its license terms.
zai-org/GLM-5.3-Flash