CoolFace
Modelpublic

systalyze/gemma4-26b-a4b-it-dspark

sourceHugging Faceapache-2.0updated 11d agoView on Hugging Face
0likes388downloads
Model Card

Gemma-4 26B-A4B DSpark — Speculative Decoding Draft for vLLM

DSpark draft model for `google/gemma-4-26B-A4B-it`. Speeds up Gemma 4 26B-A4B inference with DSpark speculative decoding in vLLM — up to ~2× output throughput vs the same target without a draft (math, concurrency 1).

This checkpoint is a draft head only (not a standalone LLM). Pair it with the Gemma-4 26B-A4B-it target.

Target`google/gemma-4-26B-A4B-it`
MethodDSpark (num_speculative_tokens=7)
Peak speedup2.01× (math, concurrency 1)
Strongest domainMath (AL ≈ 3.35–3.37)
Hardware for numbers below8×H200, vLLM 0.28, TP=1 DP=4

<p> <a href="https://arxiv.org/abs/2607.05147"><img alt="DSpark paper" src="https://img.shields.io/badge/Paper-DSpark-b31b1b?logo=arxiv"></a> <a href="https://github.com/deepseek-ai/DeepSpec"><img alt="DeepSpec" src="https://img.shields.io/badge/Code-DeepSpec-111111?logo=github"></a> <a href="https://docs.vllm.ai/"><img alt="vLLM" src="https://img.shields.io/badge/Serve-vLLM-1a7f37"></a> <a href="https://huggingface.co/google/gemma-4-26B-A4B-it"><img alt="Target" src="https://img.shields.io/badge/Target-Gemma--4--26B--A4B--it-4285F4"></a> </p>

[!IMPORTANT] This model cannot generate text on its own. It needs intermediate hidden states from the 26B target at every forward pass. AutoModel.from_pretrained loads the weights, but this repo has no standalone generate() path.

Quick start (vLLM)

bash
vllm serve google/gemma-4-26B-A4B-it \
  --speculative-config '{"method": "dspark", "model": "systalyze/gemma4-26b-a4b-it-dspark", "num_speculative_tokens": 7}'

Benchmarks vs base (no draft)

Same GPUs, same prompts: base = target alone; +DSpark = this draft + target. AL = (accepted + num_drafts) / num_drafts. aiperf 0.12, 512 requests, temperature 1.0, ignore_eos=true.

Coding throughput

ISL ~U[3500,10000], OSL ~U[200,400].

ConcurrencyBase tok/s+DSpark tok/sSpeedupAL
1172.2296.21.72×2.77
2327.5534.01.63×2.75
4556.7872.11.57×2.78
8862.61367.21.59×2.79

Speedup by domain

ISL/OSL held fixed; only prompt content changes.

Domainc=1c=2c=4c=8
Math2.01×1.92×1.79×1.70×
Coding1.86×1.78×1.66×1.63×
RAG1.71×1.66×1.58×1.53×
Chat1.62×1.62×1.56×1.49×

Acceptance length by domain

Domainc=1c=2c=4c=8
Math3.353.363.373.36
Coding3.103.083.083.11
RAG2.602.652.622.63
Chat2.642.642.692.62

Context length (coding, OSL fixed)

AL stays flat as context grows; speedup falls mainly from target verify cost.

Speedup vs base

ISLc=1c=2c=4c=8
1k1.81×1.82×1.79×1.85×
4k1.76×1.71×1.64×1.67×
8k1.68×1.60×1.52×1.48×
16k1.58×1.51×1.39×1.35×

Acceptance length

ISLc=1c=2c=4c=8
1k2.822.862.862.83
4k2.762.772.762.77
8k2.742.772.772.75
16k2.762.772.772.81

Architecture

PropertyValue
Parameters1,984,647,681 (1.985B)
Draft layers5 (full_attention)
Hidden size2,816
Target layers consumed[3, 10, 18, 25, 28] of 30 (zero-based)
Block size / γ7
Markov headvanilla, rank 256
Confidence headenabled
Mask tokenid 4 (<mask>)
Vocabulary262,144
Precisionbfloat16

The tokenizer is copied from google/gemma-4-26B-A4B-it; the draft shares the target vocabulary.

Intended use

Draft component for speculative decoding of google/gemma-4-26B-A4B-it. With an exact verifier, accepted tokens match the target distribution — the draft affects latency/throughput, not response content.

Out of scope: standalone generation, classification, embeddings, or pairing with any other target.

Loading with Transformers

python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained(
    "systalyze/gemma4-26b-a4b-it-dspark",
    trust_remote_code=True,
    dtype=torch.bfloat16,
    attn_implementation="flex_attention",
)
tokenizer = AutoTokenizer.from_pretrained(
    "systalyze/gemma4-26b-a4b-it-dspark",
    trust_remote_code=True,
)

trust_remote_code=True and attn_implementation="flex_attention" are required (flex BlockMask attention path). Hub task is text-generation (not feature-extraction) — this is still a draft head for speculative decoding, not a standalone generator.

Training

Distilled against google/gemma-4-26B-A4B-it (thinking disabled) on prompts from Open PerfectBlend with responses regenerated by the target. Training used cached target hidden states.

Files

modeling_gemma4_dspark.py, configuration_gemma4_dspark.py, common.py, markov_head.py, sampling.py, and metrics.py are vendored from DeepSpec (relative imports + Gemma4DSparkConfig for from_pretrained).

License

  • —Weights and tokenizer: Apache 2.0, consistent with google/gemma-4-26B-A4B-it
  • —Vendored Python modules: DeepSpec / MIT — see NOTICE

Citation

bibtex
@misc{cheng2026dsparkconfidencescheduledspeculativedecoding,
      title={DSpark: Confidence-Scheduled Speculative Decoding with Semi-Autoregressive Generation},
      author={Xin Cheng and Xingkai Yu and Chenze Shao and Jiashi Li and Yunfan Xiong and Yi Qian and Jiaqi Zhu and Shirong Ma and Xiaokang Zhang and Jiasheng Ye and Qinyu Chen and Chengqi Deng and Jiping Yu and Damai Dai and Zhengyan Zhang and Yixuan Wei and Yixuan Tan and Wenkai Yang and Runxin Xu and Yu Wu and Zhean Xu and Xuanyu Wang and Muyang Chen and Rui Tian and Xiao Bi and Zhewen Hao and Shaoyuan Chen and Huanqi Cao and Wentao Zhang and Anyi Xu and Huishuai Zhang and Dongyan Zhao and Wenfeng Liang},
      year={2026},
      eprint={2607.05147},
      archivePrefix={arXiv},
      primaryClass={cs.AI},
      url={https://arxiv.org/abs/2607.05147},
}