Downloads · 30 days
1.5K
7% of all-time downloads
RedHatAI/gemma-4-31B-it-speculator.dflash
gemma-4-31B-it-speculator.dflash is a machine learning model from RedHatAI. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
A DFlash speculative decoding draft model for google/gemma-4-31B-it, trained with Speculators.
Downloads · 30 days
1.5K
7% of all-time downloads
All-time downloads
21.4K
Public
Parameters
2.5B
26.6 GB on disk
Likes
41
Trending 1
Click a slice to open those files.
.pt5.1 GB · 50%
From the Hugging Face model README
A DFlash speculative decoding draft model for google/gemma-4-31B-it, trained with Speculators.
It was trained using the Speculators library on the mlabonne/open-perfectblend dataset. Training data used responses from this dataset for the gemma-4-31B-it model (with reasoning).
| Setting | Value |
|---|---|
| Speculator | DFlash |
| Verifier | google/gemma-4-31B-it |
| Draft transformer layers | 5 |
| Auxiliary verifier hidden-state layers | 1, 17, 29, 47, 59 |
| Block size | 8 |
| Default proposed tokens | 7 |
| Sliding window | 2,048 |
| Proposal method | Greedy |
| Weight dtype | bfloat16 |
The published config.json declares draft_vocab_size as 262144. The recorded training command used --draft-vocab-size 128000; this difference is retained here for transparency and should be resolved against the training/export configuration before changing the published config.
Use a vLLM release/build with DFlash support and the Gemma-4 model support enabled. The draft model is used with the matching Gemma-4 verifier:
vllm serve google/gemma-4-31B-it \
--tensor-parallel-size 2 \
--speculative-config '{
"model": "RedHatAI/gemma-4-31B-it-speculator.dflash",
"num_speculative_tokens": 7,
"method": "dflash"
}'
The checkpoint's recorded training invocation used the following DFlash recipe (paths are replaced with placeholders):
torchrun --standalone --nproc_per_node=4 \
/path/to/speculators/train/__main__.py \
--draft-vocab-size 128000 \
--verifier-name-or-path google/gemma-4-31b-it \
--data-path /path/to/prepared-open-perfectblend-data \
--save-path /path/to/checkpoints \
--hidden-states-path /path/to/hidden-states \
--log-dir /path/to/training-logs \
--run-name dflash_5layers_5epochs \
--speculator-type dflash \
--block-size 8 \
--max-anchors 1536 \
--num-layers 5 \
--target-layer-ids 1 17 29 47 59 \
--sliding-window 2048 \
--epochs 3 \
--lr 6e-4 \
--weight-decay 0.01 \
--scheduler-type cosine \
--optimizer muon \
--muon-lr 0.003 \
--dpace-alpha 0.5 \
--per-position-loss-weight dpace \
--loss-fn ce \
--checkpoint-freq 0.1 \
--log-freq 100 \
--num-workers 12 \
--prefetch-factor 2 \
--fsdp-shard \
--vllm-endpoint http://localhost:8906/v1 \
--on-missing generate \
--on-generate delete \
--request-timeout 180 \
--total-seq-len 8192 \
--max-retries 20
The training run used 4 processes (world size 4), Speculators 0.8.0, vLLM 0.29.0, Transformers 5.14.1, and PyTorch 2.13.0. The data-path is the prepared tokenized data derived from mlabonne/open-perfectblend. The recorded run name contains 5epochs, but the actual --epochs setting was 3.
Average acceptance length and per-position acceptance rates from the reported evaluation:
| Subset | Average acceptance length | Pos. 0 | Pos. 1 | Pos. 2 | Pos. 3 | Pos. 4 | Pos. 5 | Pos. 6 |
|---|---|---|---|---|---|---|---|---|
| HumanEval | 5.9531 | 93.20% | 84.33% | 76.50% | 69.34% | 63.00% | 57.17% | 51.76% |
| math_reasoning | 6.6225 | 96.47% | 90.90% | 85.87% | 80.37% | 74.92% | 69.56% | 64.17% |
| qa | 4.0198 | 79.74% | 61.16% | 46.79% | 37.28% | 30.66% | 25.30% | 21.06% |
| question | 4.1512 | 82.59% | 63.30% | 49.22% | 38.98% | 31.96% | 26.89% | 22.19% |
| rag | 4.8501 | 87.37% | 73.66% | 61.38% | 51.84% | 43.38% | 36.82% | 30.56% |
| summarization | 3.9846 | 82.47% | 63.84% | 48.97% | 37.67% | 28.63% | 21.10% | 15.77% |
| tool_call | 4.3089 | 84.57% | 66.66% | 52.51% | 42.18% | 34.43% | 28.05% | 22.49% |
| translation | 4.8561 | 86.33% | 72.84% | 61.79% | 52.28% | 43.93% | 37.14% | 31.29% |
| writing | 4.1565 | 82.53% | 63.48% | 49.18% | 39.09% | 32.10% | 26.90% | 22.37% |
This model is distributed under the Apache-2.0 license. The Gemma-4 verifier is subject to its own license and terms.