Gemma 4 12B β€” MTP Assistant (speculative drafter) Β· GGUF

GGUF builds of google/gemma-4-12B-it-assistant β€” the Multi-Token Prediction (MTP) draft head for Gemma 4 12B β€” for use as a speculative-decoding drafter in the cortexist/llama.cpp fork.

⚠️ This is not a standalone model. It is a small draft head that must be loaded alongside the Gemma 4 12B target model. On its own it produces nothing useful. Paired with the target it does lossless speculative decoding β€” the greedy output is byte-for-byte identical to running the target alone, just faster when the target's decode is memory-bandwidth-bound.

Files

File Precision Size Notes
gemma-4-12B-it-assistant-MTP-Q4_K_M.gguf Q4_K_M ~0.31 GB token_embd Q6_K, rest Q4_K β€” recommended
gemma-4-12B-it-assistant-MTP-F16.gguf F16 ~0.82 GB full-precision conversion

Acceptance is essentially identical between the two quants (the head only proposes token ids the target then verifies), so Q4_K_M is the practical choice.

Requirements

  • The cortexist/llama.cpp fork. Upstream llama.cpp does not currently support this head (the converter for the gemma4_unified_assistant checkpoint and the gemma4_assistant runtime graph live in the fork).
  • A Gemma 4 12B target GGUF β€” e.g. your own conversion of google/gemma-4-12B-it. The drafter's backbone width (3840) must match the target's embedding length.

Usage

./build/bin/llama-server \
  -m  gemma-4-12B-it-Q4_K_M.gguf \
  -md gemma-4-12B-it-assistant-MTP-Q4_K_M.gguf \
  --spec-type draft-mtp --spec-draft-block-size 2 \
  -ngl 99 -ngld 99 -fa on \
  -ctk f16 -ctv f16 -ctkd f16 -ctvd f16 \
  -c 4096 --host 0.0.0.0 --port 8080
  • -md / --model-draft points at the drafter (mainline-style; --mtp-head is an accepted alias).
  • --spec-type draft-mtp enables the MTP path; --spec-draft-block-size B makes the head draft B βˆ’ 1 tokens per round (B = 2 is the sweet spot β€” see below).
  • Works the same in llama-cli and llama-speculative-simple.

How it works

The drafter is a small 4-layer, query-only transformer that cross-attends the target model's own KV cache and seeds from the target's last backbone hidden state. Each round it proposes B βˆ’ 1 tokens; the target verifies them in a single batched forward pass and accepts the longest correct prefix. Because the target does the accepting, output is identical to non-speculative greedy decoding β€” speculation only changes speed, never content.

Benchmarks β€” when does MTP actually help?

Speculative decoding pays off only when the target's verify step is memory-bandwidth-bound, so batching the drafted tokens through it is nearly free. On a fast, compute-bound GPU there's no spare bandwidth to exploit and the extra draft + wider-verify compute is a net cost. The 12B drafter shows this split cleanly.

Methodology: scripts/bench-gemma4-mtp.sh from the fork β€” Gemma 4 12B Q4_K_M target + this drafter, B = 2, -fa on, -ngl 99, 3 prompts Γ— 256 tokens, greedy (temperature 0, deterministic), throughput and acceptance read from the server's own timings. "Baseline" = target with no draft head loaded.

Jetson Orin NX (bandwidth-bound β†’ MTP wins)

KV cache Baseline tk/s MTP tk/s Speedup Draft accept
f16 7.53 9.89 1.31Γ— 74.8%
turbo3 7.24 8.17 1.13Γ— 72.0%

NVIDIA RTX A5000 (compute-bound β†’ MTP loses)

KV cache Baseline tk/s MTP tk/s Speedup Draft accept
f16 66.5 61.7 0.93Γ— 75.6%
turbo3 58.2 47.8 0.82Γ— 74.4%

Takeaways

  • On the edge (Orin NX), MTP is a real ~1.31Γ— win β€” and f16 KV + MTP is the best config.
  • On a fast desktop GPU (A5000), MTP is a net loss (0.93Γ—): the 12B decode is already compute-bound, so the draft/verify overhead isn't repaid.
  • Draft acceptance is ~72–76% on both machines β€” acceptance is a property of the model + prompt, independent of hardware. Only the throughput payoff flips sign.
  • turbo3 KV helps MTP less than f16 (and is even slightly slower at the baseline at this context length): its win is KV-cache VRAM at long context, while its per-step dequant adds compute β€” counterproductive on an already compute-bound verify. Use turbo3 to fit long context, not to go faster.

If you're deploying on a bandwidth-bound edge device, enable MTP. On a high-end discrete GPU that isn't bandwidth-starved on a model this size, plain decoding is simpler and faster.

Conversion

Converted from the official google/gemma-4-12B-it-assistant safetensors with the fork's convert_hf_to_gguf.py (registered as Gemma4UnifiedAssistantForCausalLM β†’ gemma4_assistant arch), then llama-quantize for Q4_K_M.

License

These are derivative GGUF builds of google/gemma-4-12B-it-assistant. Use is governed by the Gemma 4 license / Terms of Use. All credit for the underlying model belongs to Google DeepMind; cortexist only performed the GGUF conversion/quantization and benchmarking.

Downloads last month
1,234
GGUF
Model size
0.4B params
Architecture
gemma4_assistant
Hardware compatibility
Log In to add your hardware

4-bit

16-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for cortexist/gemma-4-12B-it-assistant-MTP-GGUF

Quantized
(13)
this model