GLM-5.2 DSpark speculator
Overview
A DSpark speculator model for the zai-org/GLM-5.2-FP8 base model, enabling faster
inference through speculative decoding. DSpark extends the DFlash parallel draft
backbone with two lightweight heads: a Markov logit-bias head (low-rank
intra-block token dependency) and a per-position confidence head (accept-rate
prediction). Trained with the speculators
library.
main is the final epoch-3 checkpoint (best validation).
Model Specifications
- Base Model: zai-org/GLM-5.2-FP8
- Chat Template: GLM-5.2 (compatible with
/chat/completions)
- Format: Safetensors
- License: MIT
- Draft: 5 layers,
block_size=8, full vocabulary (154,880), aux layers [8, 23, 39, 55, 70]
- Validation Hardware: NVIDIA B300
Checkpoint series
Per-epoch checkpoints of a single 3-epoch run. main = the final (epoch-3) checkpoint;
each epoch is also a permanent revision.
Evaluation Results
Validation metrics after epoch 3 (held-out split):
Per-position acceptance (positions 1-7):
0.829 / 0.723 / 0.646 / 0.587 / 0.539 / 0.500 / 0.464
Epoch-over-epoch mean accepted length (train-set proxy for epochs 1-2, val for epoch 3):
3.376 → 3.819 → 3.967 (val).
Training Details
The model was trained using the Speculators library on prompts from
Magpie-Align/Magpie-Llama-3.1-Pro-300K-Filtered and HuggingFaceH4/ultrachat_200k,
with responses regenerated by GLM-5.2-FP8 itself (published as
mgoin/GLM-5.2-FP8-magpie-ultrachat).
Training is online: the draft consumes hidden states streamed on-the-fly from a
live GLM-5.2-FP8 vLLM server, with the trainer running FSDP data-parallel on separate
GPUs. The three commands below (data prep → server → trainer) reproduce the run.
Install speculators and vLLM from main.
GPU indices/parallelism are examples — adjust to your hardware.
Data Preparation
--assistant-pattern is currently needed for GLM-5.2's inline-reasoning chat
format (the <think>...</think> trace is kept inside the assistant turn); it may be
auto-detected by future speculators versions.
vLLM Server Launch (hidden-states server)
Training Command
Notes:
- Omitting
--draft-vocab-size trains on the full vocabulary; pass
--draft-vocab-size 32000 for a reduced draft vocab.
- DSpark-specific flags:
--markov-rank, --enable-confidence-head,
--confidence-head-with-markov, --confidence-head-alpha. Dropping them (and
using --speculator-type dflash) recovers a plain DFlash draft.
Deployment
DSpark inference support in vLLM is landing; once available, deploy with speculative
decoding:
References
- DFlash: Block Diffusion for Flash Speculative Decoding (arXiv:2602.06036) — the
parallel draft backbone DSpark builds on.
- DSpark (DeepSeek) — the Markov + confidence-head additions replicated here.
- speculators — training library.
AI assistance was used to build the training pipeline and run these experiments.