CoolFace
Modelpublic

AlayaNeW/GLM-5.2-DSpark

sourceHugging Facemitupdated 21d agoView on Hugging Face
1likes498downloads
Model Card

GLM-5.2-DSpark

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.

Architecture

FieldValue
ArchitectureQwen3DSparkModel (qwen3_dspark)
Draft layers5 (4× sliding attention + 1× full attention)
Hidden size / head dim6144 / 128
AttentionMHA, 64 Q heads, 64 KV heads
Sliding window1024
Block size $\gamma$8
Target layers (KV inject)[1, 20, 38, 56, 75] (GLM-5.2 has 78 layers)
Markov headvanilla, rank 512
Confidence headenabled (with Markov features)
Vocab154880 (same as GLM-5.2)
Precisionbfloat16

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

Quick Start

Requires a recent SGLang or vLLM build with native DSpark support. This draft is for GLM-5.2 only.

Serve with SGLang

bash
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

Serve with vLLM

bash
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):

bash
  --speculative-config '{
    "method": "dspark",
    "model": "AlayaNeW/GLM-5.2-DSpark",
    "num_speculative_tokens": 8,
    "draft_sample_method": "probabilistic",
    "enable_adaptive_verification": true
  }'

Call the server

python
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)

Evaluation

  • Runtime: SGLang on 8 NVIDIA B200 GPUs (TP8)
  • Speculation block size: 8 (--speculative-dspark-block-size 8, --speculative-num-draft-tokens 9 = block size + 1)
  • Sampling: temperature 0.7, top-p 0.95 (thinking disabled)

Acceptance length is the per-request mean of completion tokens divided by verification steps. Higher is better.

Speed-Bench: Low Entropy

Context LenALPos 0Pos 1Pos 2Pos 3Pos 4Pos 5Pos 6Pos 7
1k4.7584.2868.7255.8145.8738.0931.9326.9222.64
2k4.6583.6468.0054.9844.7936.6830.4225.4621.44
8k4.8084.3369.5757.1547.4039.3932.6827.1322.37
16k4.7484.2569.1856.5946.3638.0931.6526.2621.70
32k4.5283.3067.3753.9743.1234.8528.1322.7618.37

Speed-Bench: Qualitative

CategoryALPos 0Pos 1Pos 2Pos 3Pos 4Pos 5Pos 6Pos 7
coding4.3484.2166.8351.8840.3031.4324.6619.5415.67
stem3.6076.6256.1340.2029.3321.7015.9811.668.36
humanities3.5476.4455.3839.2328.2520.6215.2211.128.09
math3.7277.5957.4142.0030.9923.2517.5013.299.96
multilingual5.0584.5970.4359.0250.4343.4537.5032.3127.60
qa3.7176.2655.8041.3231.1423.9818.2613.9610.72
rag5.3587.2174.3164.0155.0247.8541.4035.3930.29
roleplay2.8067.7341.6925.4216.0911.137.805.824.53
reasoning4.1980.6562.1947.7837.6529.7924.0619.9916.51
summarization4.5384.1067.3754.2943.2634.7828.2322.5018.14
writing3.2772.6949.3033.6023.8617.5413.1910.047.65

Citation

If you use this draft model, please cite AlayaNeW/GLM-5.2-DSpark:

bibtex
@misc{alayanew2026glm52dspark,
  title={GLM-5.2-DSpark},
  author={AlayaNeW},
  year={2026},
  howpublished={\url{https://huggingface.co/AlayaNeW/GLM-5.2-DSpark}}
}