Downloads · 30 days
212
37% of all-time downloads
AlayaNeW/GLM-5.2-DSpark
GLM-5.2-DSpark is a text generation model from AlayaNeW. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
This repository releases a DSpark draft model for GLM-5.2, trained and published by AlayaNeW. It is a speculator, not a standalone LLM: pair it with a GLM-5.2 target (BF16 or FP8) in SGLang or vLLM.
Downloads · 30 days
212
37% of all-time downloads
All-time downloads
575
Public
Parameters
4.4B
8.8 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors8.8 GB · 100%
From the Hugging Face model README
This repository releases a DSpark draft model for GLM-5.2, trained and published by AlayaNeW. It is a speculator, not a standalone LLM: pair it with a GLM-5.2 target (BF16 or FP8) in SGLang or vLLM.
AlayaNeW/GLM-5.2-DSparkzai-org/GLM-5.2 / zai-org/GLM-5.2-FP8| Field | Value |
|---|---|
| Architecture | Qwen3DSparkModel (qwen3_dspark) |
| Draft layers | 5 (4× sliding attention + 1× full attention) |
| Hidden size / head dim | 6144 / 128 |
| Attention | MHA, 64 Q heads, 64 KV heads |
| Sliding window | 1024 |
| Block size $\gamma$ | 8 |
| Target layers (KV inject) | [1, 20, 38, 56, 75] (GLM-5.2 has 78 layers) |
| Markov head | vanilla, rank 512 |
| Confidence head | enabled (with Markov features) |
| Vocab | 154880 (same as GLM-5.2) |
| Precision | bfloat16 |
The training data is a mixture of code, reasoning, Chinese alignment, and long-context corpora. Answers were regenerated by GLM-5.2 to build the target cache. The draft was trained from scratch at 8k sequence length using DeepSpec。
Requires a recent SGLang or vLLM build with native DSpark support. This draft is for GLM-5.2 only.
export SGLANG_ENABLE_SPEC_V2=1
sglang serve \
--model-path zai-org/GLM-5.2-FP8 \
--trust-remote-code \
--tp-size 8 \
--reasoning-parser glm45 \
--tool-call-parser glm47 \
--context-length 202752 \
--mem-fraction-static 0.85 \
--cuda-graph-max-bs 256 \
--disable-shared-experts-fusion \
--host 0.0.0.0 \
--port 8100 \
--speculative-algorithm DSPARK \
--speculative-draft-model-path AlayaNeW/GLM-5.2-DSpark \
--speculative-dspark-block-size 8
vllm serve zai-org/GLM-5.2-FP8 \
--trust-remote-code \
--tensor-parallel-size 8 \
--tool-call-parser glm47 \
--enable-auto-tool-choice \
--reasoning-parser glm45 \
--max-model-len 202752 \
--max-num-seqs 256 \
--gpu-memory-utilization 0.85 \
--max-cudagraph-capture-size 256 \
--host 0.0.0.0 \
--port 8100 \
--served-model-name GLM-5.2 \
--speculative-config '{
"method": "dspark",
"model": "AlayaNeW/GLM-5.2-DSpark",
"num_speculative_tokens": 8,
"draft_sample_method": "probabilistic"
}'
This draft includes a confidence head. vLLM can enable adaptive verification (load-aware verify budget; losslessness unchanged):
--speculative-config '{
"method": "dspark",
"model": "AlayaNeW/GLM-5.2-DSpark",
"num_speculative_tokens": 8,
"draft_sample_method": "probabilistic",
"enable_adaptive_verification": true
}'
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8100/v1", api_key="EMPTY")
resp = client.chat.completions.create(
model="GLM-5.2",
messages=[{"role": "user", "content": "Write a Python function that checks if a number is prime."}],
max_tokens=1024,
extra_body={"chat_template_kwargs": {"enable_thinking": False}},
)
print(resp.choices[0].message.content)
--speculative-dspark-block-size 8, --speculative-num-draft-tokens 9 = block size + 1)Acceptance length is the per-request mean of completion tokens divided by verification steps. Higher is better.
| Context Len | AL | Pos 0 | Pos 1 | Pos 2 | Pos 3 | Pos 4 | Pos 5 | Pos 6 | Pos 7 |
|---|---|---|---|---|---|---|---|---|---|
| 1k | 4.75 | 84.28 | 68.72 | 55.81 | 45.87 | 38.09 | 31.93 | 26.92 | 22.64 |
| 2k | 4.65 | 83.64 | 68.00 | 54.98 | 44.79 | 36.68 | 30.42 | 25.46 | 21.44 |
| 8k | 4.80 | 84.33 | 69.57 | 57.15 | 47.40 | 39.39 | 32.68 | 27.13 | 22.37 |
| 16k | 4.74 | 84.25 | 69.18 | 56.59 | 46.36 | 38.09 | 31.65 | 26.26 | 21.70 |
| 32k | 4.52 | 83.30 | 67.37 | 53.97 | 43.12 | 34.85 | 28.13 | 22.76 | 18.37 |
| Category | AL | Pos 0 | Pos 1 | Pos 2 | Pos 3 | Pos 4 | Pos 5 | Pos 6 | Pos 7 |
|---|---|---|---|---|---|---|---|---|---|
| coding | 4.34 | 84.21 | 66.83 | 51.88 | 40.30 | 31.43 | 24.66 | 19.54 | 15.67 |
| stem | 3.60 | 76.62 | 56.13 | 40.20 | 29.33 | 21.70 | 15.98 | 11.66 | 8.36 |
| humanities | 3.54 | 76.44 | 55.38 | 39.23 | 28.25 | 20.62 | 15.22 | 11.12 | 8.09 |
| math | 3.72 | 77.59 | 57.41 | 42.00 | 30.99 | 23.25 | 17.50 | 13.29 | 9.96 |
| multilingual | 5.05 | 84.59 | 70.43 | 59.02 | 50.43 | 43.45 | 37.50 | 32.31 | 27.60 |
| qa | 3.71 | 76.26 | 55.80 | 41.32 | 31.14 | 23.98 | 18.26 | 13.96 | 10.72 |
| rag | 5.35 | 87.21 | 74.31 | 64.01 | 55.02 | 47.85 | 41.40 | 35.39 | 30.29 |
| roleplay | 2.80 | 67.73 | 41.69 | 25.42 | 16.09 | 11.13 | 7.80 | 5.82 | 4.53 |
| reasoning | 4.19 | 80.65 | 62.19 | 47.78 | 37.65 | 29.79 | 24.06 | 19.99 | 16.51 |
| summarization | 4.53 | 84.10 | 67.37 | 54.29 | 43.26 | 34.78 | 28.23 | 22.50 | 18.14 |
| writing | 3.27 | 72.69 | 49.30 | 33.60 | 23.86 | 17.54 | 13.19 | 10.04 | 7.65 |
If you use this draft model, please cite AlayaNeW/GLM-5.2-DSpark:
@misc{alayanew2026glm52dspark,
title={GLM-5.2-DSpark},
author={AlayaNeW},
year={2026},
howpublished={\url{https://huggingface.co/AlayaNeW/GLM-5.2-DSpark}}
}