Verba/Rapida

Atlas of Gemma 4 inference speed-ups

Known ways to make Gemma 4 inference faster, from engines such as vLLM, SGLang and llama.cpp to kernels, model changes and hardware: what the lab has measured, what is planned and what nobody has tried, in six layers.

4Hardware

RTX PRO 4500 Blackwell as the default rented card

planned

32 GB GDDR7, 800 GB/s per NVIDIA's datasheet (896 GB/s per PNY), FP8 and NVFP4 tensor cores (about 809 TFLOPS FP4 dense, reported), 165 to 200 W.

Which card for which job (selection of 2026-10-26)

not tried

Blackwell (sm120) software friction

not tried

Batch-1 decode bandwidth ceiling for MoE on the RTX PRO 4500

not tried
49Engines

KV-sharing fast prefill

planned

E2B and E4B share KV in their top layers (20 of 35, 18 of 42); `--kv-sharing-fast-prefill` makes those layers compute only the position that emits the next token during prefill.

SWA bounded replay (SWA-aware prefix caching)

planned

after a prefix-cache hit, rebuild the sliding-window KV by replaying only the last window (128 tokens in DeepSeek) instead of a multiple of it. **Origin:** DeepSeek DeepInfer, vLLM on V4.1 (posts 2026-10-07); repo created 2026-10-16.

Prefix and KV reuse across turns on Gemma 4's hybrid layout

not tried

reuse cached prompt KV across turns so later-turn TTFT drops; Gemma 4's mixed sliding/full layers make this engine-specific. **Origin:** LMCache Hybrid Memory Allocator for vLLM (2026-06-08); llama.cpp `--swa-full` workaround (2026-04-17).

Hybrid CPU/GPU expert execution and SSD expert streaming

not tried

attention and shared weights on the GPU; routed experts run (or stream) from CPU RAM or SSD. **Origin:** KTransformers (Tsinghua MADSys + Approaching.AI, SOSP 2025, reported); llama.cpp `-ncmoe`; turbo-fieldfare (community, 2026-09-21).

Fused-MoE kernel tuning for 26B-A4B

not tried

tuned Triton MoE configs for E=128 (vLLM PR 60504, open, title only). **Origin:** vLLM community.

Attention backend selection on Ada (head_dim 256/512)

planned

Gemma 4's 256- and 512-wide heads push vLLM and SGLang onto slower kernel paths (FA2 supports up to 256; FlashInfer rejects 256/512 mixes). **Origin:** vLLM issue #38887; LMCache recipe.

Argon PR stack for vLLM (fused kernels, tile retune, fused MTP)

planned

Triton fusion of QK RMSNorm+RoPE, FFN norms, PLE projection and MoE routing (#60674); tile retune for head_dim 512 (#60317); fused MTP layers and sparse gather-GEMV LM head (#60689); plus fast prefill by default (#60445, above).

Engine comparison on consumer cards (llama.cpp, mistral.rs, LiteRT-LM)

not tried

alternative engines with their own Gemma 4 kernels. **Origin:** mistral.rs v0.8.2 (2026-06-01); LiteRT-LM; llama.cpp.

Fast Gemma Challenge (agent-driven optimization)

not tried

agents collaborate to speed up Gemma 4 E4B under a perplexity guardrail, using drafters, speculative decoding, kernels and quantization. **Origin:** Hugging Face + Google, June 2026.

Kernels from the Chinese labs (SageAttention, FlashMLA/DeepGEMM, FlashKDA, HPC-Ops)

not tried

SageAttention2/2++ quantizes QK to INT8 and PV to FP8; FlashMLA, DeepGEMM (FP8 BLAS), FlashKDA and Tencent HPC-Ops are lab kernel libraries.

KV pools, disk tiers and disaggregation (Mooncake, DualPath, Prefill-as-a-Service)

not tried

a disaggregated KV pool across GPU, DRAM and SSD, dual-path KV loading, cross-datacenter prefill. **Origin:** Moonshot + Tsinghua Mooncake (arXiv 2407.00079); DeepSeek DualPath (arXiv 2602.21548); Moonshot Prefill-as-a-Service (arXiv 2604.15039); V4-Flash disk KV.

DeepInfer and large-scale serving designs (AFD, TileRT, TokenRouter, MoE comms)

not tried

DeepInfer open-sources DeepSeek's serving stack (DSpark, SWA bounded replay, async scheduler); StepFun Attention-FFN Disaggregation runs attention and FFN on separate GPU pools; TileRT, TokenRouter and Mega MoE are further system designs.

vLLM engine profile

measured

v0.32.0 (2026-10-18, reported). Scheduler V1 with chunked prefill, Model Runner V2. Prefix cache is hash-based block reuse (hash of parent hash, block tokens and extras such as LoRA id, mm hash, cache salt; sha256 default, `xxhash` option). A hybrid KV manager groups SWA and full layers (see [Hybrid sliding-window prefix caching](#hybrid-sliding-window-prefix-caching)). Cascade attention was removed in v0.32.0.

SGLang engine profile

planned

v0.5.22 (2026-10-19, reported). RadixAttention tree with SWA specializations (`PureSWARadixCache`, `UnifiedRadixCache`, SWA pool allocators, `--swa-full-tokens-ratio`), HiCache across GPU, host and external tiers, overlap scheduler, Breakable CUDA Graph as the default prefill graph backend (reported).

TensorRT-LLM engine profile

planned

PyTorch-backend models, KV cache manager V2 with SWA block eviction, trtllm-gen cubins on sm100 and FlashInfer JIT on sm120 (one benchmark author, reported). Gemma 4 support and fused Gemma 4 kernels landed in v1.3.0rc21 (release 2026-07-15, **verified**); v1.4.0rc1 (2026-10-22) is a pre-release.

llama.cpp engine profile

planned

build b11815 (2026-10-22, reported). Per-slot prompt cache with similarity match. Gemma 4 cache reuse broke on shared KV layers plus SWA (issue 21468: about 96 s to re-evaluate 46K tokens each request); PR 22288 "server : fix swa-full logic" closed it on 2026-04-24; the workaround is `--swa-full --no-mmproj` (reported).

mistral.rs engine profile

not tried

Rust engine with candle-based kernels, paged attention (`--paged-attn on`), CUDA graphs and fused MoE. v0.9.5 (2026-10-19, reported). Gemma 4 needed a KV-sharing correctness fix (reruns 2026-06-01); MTP merged (PR 2159).

Modular MAX engine profile

not tried

Mojo kernels and custom ops, NVIDIA and AMD. max/v26.6.0 (2026-09-17, reported); day-zero Gemma 4 on 2026-04-02. In the repo: `architectures/gemma4`, `dspark_gemma4`, `gemma4_assistant`, and a layer benchmark `bench_gemma4_attention.yaml` with head_dim 256/512, window 1024; sm_120 is in the hardware table; NVFP4 loader PR 6699 open.

ExLlamaV3 engine profile

not tried

Python plus CUDA extension, EXL3 quantization. v1.6.4 (2026-10-20, reported). PR 394 (open): sm120 TMA paged prefill FlashAttention for D128/256/512, FP16 only, 256-token pages, helps beyond 10k context, no sliding window or varlen. A windowed KV ring for sliding layers on Spark (PR 377, merged).

LMDeploy engine profile

not tried

TurboMind and PyTorch engines. v0.18.0 (2026-09-28, reported).

MLC-LLM engine profile

not tried

TVM-compiled engine. No release since a 2023 tag; the repo was pushed 2026-10-06 (reported).

TGI engine profile

not tried

Hugging Face Text Generation Inference. Last release v3.3.7 (2025-12-19); maintenance mode from 2025-12-11 and the repo is archived (last push 2026-03-21, reported).

Newer niche engines

not tried

single-developer or small-team engines that appear with narrow wins: sparkinfer (v0.3.7, 2026-07-07, Blackwell-native, decode only), halogen and Strata (Strix Halo), beellama.cpp (windowed SWA KV plus DFlash), inferrs, FreeToken, b12x (CuTe DSL and Triton kernels for SM120/SM121, also an optional vLLM backend), LiteRT-LM, DeepInfer (see [DeepInfer and large-scale serving designs (AFD, TileRT, TokenRouter, MoE comms)](#deepinfer-and-large-scale-serving-designs-afd-tilert-tokenrouter-moe-comms)).

NVIDIA Flare (sm120/sm121 Rust runtime)

not tried

a Rust runtime for SM120/SM121 only (not 4090, H100 or B200), CUDA graphs captured at build time, FP8 KV by default, packages built per architecture (SM120 packages fail the arch check on a Spark). Repo `NVIDIA/flare-local-inference`, Apache-2.0, created 2026-10-20 (**verified**, `gh api`). Launch post 2026-10-20 (X, reported).

TensorFold (single-model decode engine)

not tried

an engine that wins single-stream decode by being built per model (60+ models ported, reported). The 1.0.3 release binary has no RTX 5090 kernels; build from source with `-Dsm=120`.

NInfer (a single-model engine pattern; Gemma 4 not supported)

not tried

a from-scratch C++/CUDA engine for one card and a few models (repo `Neroued/ninfer`, Apache-2.0, 3,149 stars, **verified** to exist). Its README supports Qwen models only and builds only for the RTX 5090 (`sm_120a`); no Gemma 4 artifact (**verified** by this session).

New fast matrix multiplication algorithms (AlphaEvolve, OpenAI omega <= 9/4)

not tried

schemes that multiply matrices with fewer scalar multiplications: AlphaEvolve's 4x4 in 48 multiplications (arXiv 2506.13131, complex; rational version arXiv 2506.13242, **verified** abstract), omega < 2.371177 (arXiv 2608.16884, abstract **verified**), and OpenAI's claimed omega <= 9/4 (manuscripts of 2026-09-24 and 2026-10-02, announced 2026-10-06; Lean-checked and generalised to all fields by others; **reported**, the paper was not read).

Hybrid sliding-window prefix caching

planned

Gemma 4 mixes sliding and full layers, so a prefix hit must reuse the full-attention prefix plus only the last sliding window. vLLM's hybrid KV manager keeps one KV group per layer type, finds the full-attention hit first, then the longest SWA hit within it scanning right to left; only the last `sliding_window - 1` tokens must be cached. SGLang's Unified Radix Cache (blog 2026-08-11) has a SWA component that keeps a contiguous trailing window while older SWA slots become tombstones. llama.cpp uses `--swa-full` or the post-April fixes (see [Prefix and KV reuse across turns on Gemma 4's hybrid layout](#prefix-and-kv-reuse-across-turns-on-gemma-4s-hybrid-layout)).

Per-layer attention backend mix

planned

run each layer kind on the kernel that suits it: FA2 for the head_dim 256 sliding layers, Triton or FlashInfer for the head_dim 512 global layers. vLLM exposes `backend_per_kind` (per KV-cache group since v0.26.0, reported); SGLang PR 44399 (open, Hopper only) uses FA3 for the 256 layers and FA4 for the 512 layers.

sm120 platform constraints

planned

sm120 (RTX 5090, RTX PRO 6000, presumably the PRO 4500) has 99 KB of shared memory per SM vs 228 KB on datacenter Blackwell and no TMEM or tcgen05, so datacenter-Blackwell kernels fall back or raise (reported). RTX PRO 4500 Blackwell Server Edition: 32 GB GDDR7, 800 GB/s, 10,496 CUDA cores (one X post, reported).

FA4 sliding-window forward on sm120

planned

`FlashAttentionForwardSm120` inherits the SM80 kernel, which walks every KV block for local attention, so cost is quadratic instead of linear in prompt length. Flash-attention issue #2953 is open (**verified**).

Drafter support across engines and structured-output acceptance

planned

every Gemma 4 size ships a `*-assistant` MTP drafter that shares the target's KV. vLLM (day-0 recipes), SGLang (NEXTN, 5 steps / 6 draft tokens), TRT-LLM (`Gemma4AssistantForCausalLM`) and llama.cpp (PR 23398) support it; EAGLE3 speculators (Red Hat), DFlash and DSpark are the other drafters (vLLM PR 46995 runs the DSpark draft loop in one CUDA graph, compatible with prefix caching). Model-side detail: [Gemma 4 MTP assistant drafters (Google)](model.md#gemma-4-mtp-assistant-drafters-google).

Megakernels and CUDA graphs

not tried

a megakernel fuses a decode step into one persistent kernel; CUDA graphs with PDL cut launch cost. Both target decode, not prefill (merge note).

vLLM plugins and CustomOp

planned

entry-point groups `vllm.general_plugins`, `platform_plugins`, `stat_logger_plugins`, `endpoint_plugins`; `ModelRegistry.register_model`; `@CustomOp.register("name")` enabled with `--compilation_config.custom_ops '["+name"]'`; out-of-tree replacement with `@CustomOp.register_oot("TargetOpName")` implementing `forward_oot()`; `register_backend` for an `AttentionBackendEnum`, then `--attention-backend NAME`. The docs say Triton ops cannot be registered out of tree "now", so a Triton change is a source patch or a `CustomOp` subclass in a plugin.

SGLang attention backend registry

planned

subclass the base backend, implement `forward_extend`, `forward_decode`, `init_forward_metadata` and the three CUDA-graph hooks, decorate with `@register_attention_backend`, select with `--attention-backend` (or split with `--prefill-attention-backend` and `--decode-attention-backend`). Gemma 4 defaults live in `python/sglang/srt/arg_groups/model_overrides/gemma4.py`. The `sglang.serve_backends` entry point is for whole runtimes, not kernels.

Carrying unmerged PRs as local patches

planned

install a release tag with the Python-only build (`VLLM_USE_PRECOMPILED=1 uv pip install --editable . --torch-backend=auto`), then `gh pr diff <n> --repo vllm-project/vllm | git apply --3way`. Order for the Argon PRs: 60317, 60674, 60445; expect conflicts since main moved. A C++ or kernel-source change cannot use the Python-only build. Per-commit wheels: `https://wheels.vllm.ai/<commit>` with `VLLM_PRECOMPILED_WHEEL_COMMIT` (reported).

Triton autotuning

planned

a standalone bench around one kernel (vLLM pattern: `benchmarks/kernels/benchmark_*.py`, `tests/kernels/attention/test_triton_unified_attention.py`) with `@triton.autotune` configs on the target card. `vllm preload --preload-autotune` keeps the FlashInfer autotune table warm across restarts and `vllm download-kernels` installs precompiled FlashInfer kernels (reported). The exact Triton autotune cache mechanics were not read.

Helion

not tried

a Python-embedded tile DSL that compiles to Triton, with an autotuner (default LFBO); GA listed April 7, 2026 and about 10 minutes of tuning per kernel (snippets). vLLM added a Helion kernel framework with autotuning, and AOT autotuning with runtime dispatch (reported).

CuTe DSL and other kernel DSLs

not tried

CuTe DSL is the Python route to CUTLASS-style kernels: FlashAttention-4 is a CuTe DSL kernel (Hopper and Blackwell; the sm120 path is SM80-derived), vLLM v0.32.0 pulls CuTe DSL 4.8.0 block-scale APIs and a FlashInfer CuTeDSL MegaMoE backend, FlashInfer v0.7.2 has a CuTe DSL grouped-GEMM backend that also runs BF16 on SM120, TRT-LLM rc21 ships CuTe DSL kernels (reported).

AI-generated kernels with end-to-end gating

planned

an agent writes or tunes kernels in a keep-or-revert loop; the gate is an end-to-end run (torch.compile and CUDA graphs on, token identity checked), never a kernel micro-benchmark.

Profiling an engine

planned

DSpark in vLLM 0.31 and 0.32, and adaptive verification on sm120

not tried

vLLM serves DSpark drafters with `method: dspark`; `dspark_draft_topk` picks Markov-head candidates from the base logits first (64 instead of a 262k vocabulary); adaptive verification (`enable_adaptive_verification`) lets a confidence head trim each request's verify window on the device.

Triton split-K for multi-query verify (vLLM PR 56148)

not tried

lets verify batches with up to 8 query tokens per request use the 3D split-K kernel instead of the 2D one, which parallelizes only over query blocks and is slow at long context and low batch.

Google's Gemma 4 vLLM PR series (October 2026)

not tried

Google's Luciano Martins opened a set of Gemma 4 speed PRs on 2026-10-06 to 10-08 (X: "8 PRs in total", one dedicated to 26B).

MLX Metal kernels for verify shapes (MLX 0.32.3 to main, October 2026)

not tried

a speculative verify step runs 2 to 16 query rows per request; MLX's quantized matmul and SDPA had fast paths for 1 row and for many rows, and a slow path between.

Gemma 4 drafters in the Mac engines (mlx-serve, mlx-vlm, mlx-dspark, dflash-mlx)

not tried

Gemma 4 26B-A4B drafter inventory and the Mac evidence for one user (2026-11-13 sweep)

not tried

draft k tokens cheaply, verify them in one k+1-row target forward, keep the agreeing prefix (lossless under greedy only if the k-row forward's argmax equals the one-row step's).

Other engine items in the window (watch list)

not tried

Shorter drafts at high load (Cline, Nemotron 3.5 Super VL on vLLM, reported)

not tried

at high concurrency the GPU already has work, so drafted tokens that get rejected cost verify time

84Model

FP8 and low-bit KV cache

planned

store K/V in FP8 or fewer bits to cut cache memory and bandwidth.

OSCAR INT2 KV cache

not tried

calibrated rotations (query covariance for K, score-weighted value covariance for V) push quantization noise into attention-insensitive directions.

Smaller sliding window with a learnable sink bias

planned

shrink the local window (128 tokens in MiMo) at 5:1 SWA:global and add a learnable per-head sink logit so the hybrid matches all-global attention. **Origin:** Xiaomi MiMo-V2-Flash, arXiv 2601.02780 (2026-01-06; release 2025-12-16).

Training-free search for which layers become SWA

planned

beam search (PostNAS-inspired) picks which layers of a trained model switch to sliding-window attention.

Global-to-sliding conversion with healing

not tried

replace some global layers (E4B: 7 of 42) with sliding-window layers, then heal by distillation. **Origin:** Attention Editing (arXiv 2604.05688); SWA with sinks (arXiv 2608.28444); GLIDE (arXiv 2607.24788).

Attention Editing (conversion to MLA or GateSWA)

not tried

replace attention modules, then layer-wise teacher-forced and model-level distillation. **Origin:** China Merchants Bank AI Lab, arXiv 2604.05688, 2026-04-07 (Ascend 910B).

DeepSeek Sparse Attention (DSA) and its conversion recipe

not tried

a lightning indexer scores past tokens and each query attends to the top-k (k=2048); the indexer is warmed up with KL to dense attention, then the model trains sparse.

IndexCache and IndexShare (indexer reuse)

not tried

reuse top-k indices across adjacent layers (70% to 100% overlap) by training-free greedy search or multi-layer distillation; GLM-5.2 ships one indexer per 4 sparse layers. **Origin:** Tsinghua + Z.ai, arXiv 2603.12201 (2026-03-12); IndexShare in GLM-5.2 (2026-06-16).

HISA hierarchical indexer

not tried

block-level coarse filter, then token-level indexer inside kept blocks. **Origin:** arXiv 2603.28458, 2026-03-30 (lab not established; Peking University reported).

InfLLM-V2

not tried

dense-sparse switchable trainable block-sparse attention with no extra parameters. **Origin:** Tsinghua/OpenBMB, arXiv 2509.24663, 2025-09-30.

LoZA (LongCat ZigZag Attention)

not tried

calibrate a per-layer alpha on each MLA layer and convert the 50% least important layers to streaming sparse attention at mid-training. **Origin:** Meituan LongCat, 2026-01-07.

Simple Attention Sparsification (SAS), gate-only sparse decode

not tried

learn a block selector end to end by adding its continuous gate inside the softmax so the LM loss trains block ranking; backbone frozen; decode only, prefill unchanged.

LongFlow KV eviction for long reasoning outputs

not tried

importance from an attention intermediate for the current query only; fused FlashAttention plus eviction kernel. **Origin:** Soochow University (reported), arXiv 2603.11504, 2026-03-12.

MHA/GQA to MLA conversion (MHA2MLA, TransMLA, MLAfication)

not tried

re-express K and V as a low-rank latent plus a small RoPE part, initialised by SVD of the pretrained projections and recovered by short distillation or fine-tuning.

SwiftKV and YOCO++ (extend KV sharing to models without it)

not tried

compute later layers' KV from an early layer's output, distilling only the Q/K/V projections. **Origin:** SwiftKV arXiv 2410.03960 (Snowflake); YOCO++ arXiv 2604.13556; YOCO arXiv 2405.05254.

HALO / HypeNet (Transformer to RNN hybrid)

not tried

distil Transformer layers into an RNN-attention hybrid with HyPE position encoding. **Origin:** Tsinghua NLP, arXiv 2601.22156, 2026-01-29.

OPAL (on-policy conversion to Gated DeltaNet hybrid)

not tried

distil a full-attention teacher into a mostly-linear student on the student's own long trajectories. **Origin:** CMU / Cornell (not Chinese), arXiv 2609.31947.

MiniCPM-SALA

not tried

convert a pretrained Transformer into a 1:3 sparse (InfLLM-V2) to linear (Lightning) hybrid with HyPE. **Origin:** OpenBMB, arXiv 2602.11761, 2026-02-12.

Ring-linear and Ling 2.5 (hybrid linear from an existing base)

not tried

initialise a linear+softmax hybrid from a Ling base then continue training; Ling 2.5 rebuilt GQA layers as 1:7 MLA plus Lightning linear attention. **Origin:** Ant Ling, arXiv 2510.19338 (2025-10-22); Ling 2.5 (2026-02-15).

Optical context compression (DeepSeek-OCR, Glyph)

not tried

render text as images and read it through a vision encoder, so fewer vision tokens carry the text. **Origin:** DeepSeek-OCR arXiv 2510.18234 (2025-10-21), OCR 2 arXiv 2601.20552; Zhipu/Tsinghua Glyph arXiv 2510.17800 (2025-10-20).

Natively trained sparse attention (MSA, LSA, QSA, HiLS, HSA)

not tried

block or chunk selection over KV trained from the start: MiniMax MSA (GQA-group top-k over 128-token blocks), LongCat LSA (DSA plus streaming-aware, cross-layer, hierarchical indexing), Qwen QSA (micro-block indexer beside Gated DeltaNet 3:1), Tencent HiLS (landmark tokens), HSA UltraLong (learnable chunk retrieval).

Natively trained linear and hybrid attention (KDA, Gated DeltaNet, Lightning)

not tried

Kimi Delta Attention (gated delta rule, per-channel forget gate, 3:1 with MLA), Qwen Gated DeltaNet (3 linear : 1 gated full), Lightning hybrids (MiniMax-M1, Ant Ling 7:1).

CSA + HCA compressed attention and the V4.1 causal encoder-decoder

not tried

compress KV along the sequence (CSA: 4 entries merged then top-k=512; HCA: 128x, dense over compressed) plus a sliding-window branch; V4.1 prefills with half the layers and decodes with all.

Zero-computation experts and shortcut-connected MoE (ScMoE)

not tried

some experts are identity so easy tokens use less compute; a shortcut overlaps communication with the dense FFN.

Stable LatentMoE

not tried

experts run in a latent dimension (3584 vs hidden 7168) with high sparsity (16 of 896 experts), normalisation on the routed branch and a Quantile Balancing router.

ConceptMoE

not tried

merge similar tokens into concepts before the MoE core.

FP8 W8A8 (weights and activations)

planned

FP8 E4M3 weights with dynamic or static FP8 activations; the RTX 4090 (compute capability 8.9) has native FP8 tensor cores, so prefill GEMMs should speed up.

Weight-only 4-bit (QAT W4A16, AWQ, GPTQ, AutoRound, HQQ)

planned

4-bit group-quantized weights with BF16 activations; helps memory-bound decode and fitting, not compute-bound prefill.

Per-layer mixed precision

not tried

assign 8/6/4 (or 1-2) bits per layer or module by sensitivity, keeping fragile tensors high. **Origin:** Tencent AngelSlim MIX-STQ1_0 and Sherry ternary (2026-08-29); IMPQ arXiv 2509.15455; MixQuant arXiv 2607.23047; community maglun MLX mixes.

Rotation methods (QuaRot, SpinQuant) and W4A8/W4A4

not tried

Hadamard or learned rotations remove activation outliers so activations and KV can be 4-bit.

SINQ and CCQ (calibration-free and 2-bit)

not tried

SINQ adds a second scale axis via Sinkhorn-Knopp normalisation with no calibration; Baidu CCQ uses convolutional-code codebooks for 2-bit. **Origin:** Huawei CSL SINQ, arXiv 2509.22944 (2025-09-26); Baidu CCQ, arXiv 2507.07145.

FP4 and NVFP4 (Blackwell-only paths, FP4 QAT)

not tried

4-bit float weights/activations (NVFP4, MXFP4), FP4 QAT on experts (DeepSeek V4 sec. 5.2.1), Ant UFP4 recipe (arXiv 2606.20381), Moonshot K3 MXFP4/MXFP8 QAT (2026-06-13).

AWQ int4 (Marlin) vs NVFP4 vs FP8 at batch 1 on sm120

planned

Marlin is a fused weight-only dequant kernel that reads 4-bit weights once and computes in BF16/FP16; native NVFP4 uses FP4 tensor cores but on sm120 the kernels are less mature (W4A4 is the vLLM sm120 default since 0.30.0 and costs a few percent at batch-1 decode, PR 55170, reported).

AngelSlim toolkit

not tried

FP8/INT8 PTQ, INT4 AWQ/GPTQ, HY-1.8B-int2, EAGLE-3 training, training-free sparse attention for TTFT, vision/audio token pruning. **Origin:** Tencent Hunyuan, arXiv 2602.21233 (2026-02-07).

LM-head quantization, b12x and other sm120 paths (sweep of 2026-10-26)

not tried

Adaptive scale selection for 8-bit formats (sweep of 2026-10-26)

not tried

Four Over Six's per-block choice between scale candidates, transferred to 8-bit. The MXFP8 version

ThinkingCap: shorter thinking for Gemma 4 26B-A4B (BottleCap AI, 2026-10)

not tried

`bottlecapai/ThinkingCap-gemma-4-26B-A4B-it`, a fine-tune of the 26B-A4B (BF16, about 52 GB, Apache 2.0

REAP expert pruning of 26B-A4B

planned

remove whole experts scored by router-weighted activation saliency on calibration data; router logits renormalised so active experts per token stay unchanged.

Vocabulary and LM-head trimming

planned

remove tokens from the 262,144-entry vocabulary in the tied embedding/output head and, for E models, the per-layer embedding table. Google's MTP drafter already uses a top-k cluster LM head (~4k ids instead of 262k).

Layer (depth) pruning with healing

planned

drop whole layers (ShortGPT block influence, LLM-Streamline), then heal by distillation. **Origin:** Ghosted Layers arXiv 2605.15491; Minitron arXiv 2407.14679; Hub: FlameF0X gemma-4-E2B-it-pruned (35 -> 10 layers, no quality data).

Width pruning (MLP neurons, heads) with distillation, Minitron-style

planned

prune MLP width by activation importance, heal by KL distillation from the unpruned model. **Origin:** NVIDIA Minitron; Hub: Amiel/pruned_{0.1,0.2,0.3,0.4}-gemma-4-E4B-it (`intermediate_size` 10240 -> 9216/8192/7168/6144; 8.00B -> 7.28B params at 0.2; empty cards).

Unstructured sparsity (SparseGPT) as a pre-quantization step

not tried

10% unstructured sparsity on MLP layers before GPTQ W4A16 (salve-mundii/gemma4-E4B-opt; neokoda 10% sparse E4B).

Text-only strip and PLE offload

planned

drop vision/audio towers (E2B/E4B 150M vision + 300M audio; 26B-A4B/31B 550M vision); keep the per-layer-embedding (PLE) table off the GPU.

MatFormer / Mix-n-Match slicing

not tried

nested sub-models sliced from one checkpoint.

Visual-token pruning and routing

not tried

prune or route image patches to fewer tokens (HiPrune; InternVL3.5 ViR routes to 256 or 64 tokens). **Origin:** HiPrune (overshootai post); Shanghai AI Lab InternVL3.5, arXiv 2508.18265.

Gemma 4 MTP assistant drafters (Google)

planned

paired `-assistant` models (E4B: 4 layers, KV-shared) that draft tokens for the target; the report says the drafter cross-attends into target KV with a 4096-token cluster head.

DSpark (parallel block drafter with confidence-scheduled verification)

planned

a parallel block drafter plus a light sequential (Markov) head; calibrated survival probabilities pick the verified prefix length per request from engine throughput.

DFlash (block-diffusion drafter)

planned

a block-diffusion drafter conditioned on target hidden features proposes a whole block in one forward pass. **Origin:** z-lab (UCSD), arXiv 2602.06036 (2026-02-05); DeepSpec credits z-lab/dflash, so it is not DeepSeek's method (resolved in the Chinese merge note).

DCOCO (contextual correction of DFlash drafts)

not tried

keeps the top-k candidates per position of a DFlash block, scores neighbouring-candidate compatibility

EAGLE-3 (feature-level drafter, SpecForge, speculators)

planned

a draft head fed early, middle and late target features, trained with training-time test. **Origin:** EAGLE authors (PKU / Waterloo / Microsoft, reported), arXiv 2503.01840; code adapted in SpecForge (SGLang) and DeepSpec.

Newer parallel drafters (DSpine, UBTree, Domino, JetSpec, ECHO)

not tried

DSpine injects each predecessor's predicted feature into its successor at every draft layer; UBTree builds a verification tree from a DFlash backbone; Domino adds a prefix-aware head; JetSpec builds draft trees in one pass; ECHO schedules draft depth versus width batch-wide.

Self-speculative decoding by layer skipping (LayerSkip, SWIFT, Kangaroo)

planned

early layers draft and the full model verifies; SWIFT chooses skipped layers on the fly with no training.

MTP heads as built-in drafters (MiMo, GLM-5, Step)

not tried

multi-token-prediction heads trained with the model double as drafters.

Uno self-drafting adapters and n-gram lookup decoding

not tried

adapters make a model draft for itself (Broadnet Uno pilot adapter); n-gram/lookup decoding copies spans from the prompt.

Drafters for Gemma 4 26B-A4B at batch 1 (mixed results from other cards)

planned

four drafters exist for exactly this model: Google's MTP assistant `google/gemma-4-26B-A4B-it-assistant` (Apache-2.0), z-lab `gemma-4-26B-A4B-it-DFlash`, DSpark (`systalyze/gemma4-26b-a4b-it-dspark`, `makora-ai/gemma4-26b-a4b-dspark`), and the Uno adapter (BroadNet). Details of each: [Gemma 4 MTP assistant drafters (Google)](#gemma-4-mtp-assistant-drafters-google), [DFlash (block-diffusion drafter)](#dflash-block-diffusion-drafter), [DSpark (parallel block drafter with confidence-scheduled verification)](#dspark-parallel-block-drafter-with-confidence-scheduled-verification), [Uno self-drafting adapters and n-gram lookup decoding](#uno-self-drafting-adapters-and-n-gram-lookup-decoding).

MoE-aware verification (AcceptMoE, SpecFit)

not tried

in a MoE, every extra verified token can route to experts no other token in the step uses, so verify cost grows with the union of experts touched. AcceptMoE restricts each verify block to a self-sized expert subset chosen from router scores and offline commitment probabilities (**changes the output distribution**). SpecFit picks the verified subtree by predicted throughput: draft-path reward over a cost that grows with the per-layer expert union (lossless).

AR-to-diffusion conversion (DiffusionGemma, SDAR, LLaDA2.0)

not tried

convert a trained AR model into a (block) diffusion LM that decodes about 20 tokens per forward pass.

Gemma 4 configuration facts (31B and 26B-A4B)

not tried

Draft-vocabulary trimming for drafters (VocabTrim, SpecVocab, SlimSpec, DynaSpec)

planned

restrict the drafter's output matrix to a frequency-ranked or coverage-optimised subset of the 262,144-token vocabulary, or choose a subset per step; the target still verifies every token, so output is lossless and no healing is needed.

Post-trained MTP heads on a frozen model (repairing a drafter)

planned

chained multi-token-prediction heads trained with plain cross-entropy on a frozen backbone; self-distillation (MTP-D) raises head acceptance; the heads cross-attend the frozen model's KV.

Dynamic expert re-routing and skipping on MoE (SERE, ZEDA, ACE)

planned

SERE re-routes secondary experts to similar primary ones to cut expert traffic per batch; ZEDA inserts zero-output experts and self-distills so easy tokens use fewer experts; ACE and ASET/MoDES skip experts training-free.

Fewer experts without the gain shift: top-k1 normalized by the top-k2 mass, and where the cut hurts

not tried

a router that renormalizes over its kept experts calibrates the expert branch's gain to the training top-k; cutting k

Training-free FFN activation sparsity (TEAL, Prox, TopK-Guided)

not tried

skip weight reads for FFN channels that are barely active for the current token; Prox picks channels with an INT4 copy of the gate projection, then computes them exactly.

Semi-structured sparsity (2:4 and 6:8)

not tried

prune weights in a hardware pattern (2 of 4, or 6 of 8 slid onto 2:4 hardware) and heal by distillation.

Dynamic depth: layer-skipping routers and retrofitted recurrence

not tried

small routers on a frozen model skip, execute or repeat each layer per token or example; retrofitted recurrence turns a trained model into a looped one.

Looped, recursive and layer-shared retrofits of pretrained models (2026-11-21 sweep)

not tried

tie a trained model's layers into a block applied k times (Relaxed Recursive Transformers adds a per-depth LoRA initialised from the residual by SVD), or insert a looped block into a trained model and heal it; speed comes only from methods that run several positions at different loop depths in one call, so one weight read serves them (WaveFront Decoding, LoopSpec, Parallel Loop Transformer).

Dynamic Memory Sparsification (learned KV eviction)

not tried

a learned, delayed eviction policy (Gumbel-sigmoid) retrofits an existing model to keep a fraction of its KV cache.

Low-rank (SVD) weight factorization

not tried

replace a weight matrix by two thinner factors, optionally with rank allocation or prompt-aware rank routing.

Dense-to-MoE conversion

not tried

split a trained dense FFN into experts by activation patterns, with a short fine-tune.

Extreme low-bit and ternary conversion (BitDistill, Bonsai, LittleBit)

not tried

convert a trained model to ternary or sub-1-bit weights with distillation: BitDistill adds SubLN, attention distillation and a continual-pretraining warm-up; PT2-LLM is post-training ternarisation; LittleBit factorises weights into binarised low-rank latents.

Normalization folding and removal (TaperNorm)

not tried

fold a norm's scale into the next projection (an exact rewrite) or remove the normalisation during fine-tuning, so fewer small kernels run per layer.

Jacobi Forcing (self-trained parallel decoding)

not tried

fine-tune the model on its own Jacobi-iteration trajectories so it converges to several correct tokens per forward pass, with no draft model.

Manifold-constrained hyper-connections (mHC)

not tried

Attention Residuals (AttnRes, Block AttnRes) and Gated Residual

not tried

Gated attention (sigmoid gate after SDPA)

not tried

Engram conditional memory and N-gram embeddings

not tried

PowLU activation and low-precision pretraining recipes

not tried

Looped LMs, elastic training, native diffusion LMs, Multi-Matrix Factorization Attention

not tried

Weight-Space Programming (direct weight edits by a frontier model)

not tried

a general-purpose LLM reads weights in a Python kernel and edits them by reasoning, with no gradients; on a language model it traces a failure to a direction written by MLP layers and subtracts it from their output columns.

CompressionBench (coding agents compress checkpoints under a storage limit)

not tried

an agent gets a checkpoint, a storage limit, a GPU and 8 hours, and builds weights and kernels; perplexity on source-sampled continuations guides it; a separate check gates on 150 questions.

Retrofitted latent MoE (MoLAE, GS-MoE) and per-token expert skipping (ACE)

not tried

MoLAE (arXiv 2503.23100) factors pretrained experts through a shared projection; GS-MoE (arXiv 2610.32009) shares subspaces by group with no training. ACE (arXiv 2609.05228, code xzktx003/moe-prune) skips top-k slots per token from offline expert scores, always keeping the top expert.

Mechanistic intervention: code layers grown during training (doubleAI)

not tried

an agent inside a training run inserts small programs as layers behind a learnable gate starting at zero, chosen with the phantom gradient (gradient of the loss with respect to the hidden state, per token and layer, centred per next token), with twin and sham controls. On trained models it adds linear probes that drive resampling or a stop policy.

Group-scaled 4-bit codes barely compress

not tried
15Training

INT4 QAT folded into post-training (Kimi K2-Thinking recipe)

planned

fake-quant QDQ with straight-through estimator on BF16 masters, symmetric INT4, 1x32 groups, W4A16, run during post-training so the released model is the quantized one.

Recovering a pruned or cut model: self-data distillation, data choice, inversion

not tried

the unpruned model writes the fine-tuning data, so the student stays in the distribution it came from. Input inversion instead optimizes inputs to match stored activation statistics, for people with no data at all.

On-policy distillation, single and multi-teacher (MOPD)

planned

the student samples its own rollouts and trains on token-level reverse KL to one or several teachers; Xiaomi MOPD trains per-domain RL teachers from one SFT checkpoint, routes rollouts to the matching teacher, and uses top-k reverse KL with a bias-correction term.

When on-policy distillation works (conditions and failure modes)

planned

OPD needs compatible thinking patterns between teacher and student and a teacher that adds new capability; fixes are an off-policy cold start and teacher-aligned prompt selection.

RL algorithms for stability: GSPO, SAPO, CISPO, DAPO, IcePop/KPop, geometric masking, FlowRL, Knapsack RL

not tried

drop-in policy-gradient variants: GSPO (sequence-level importance ratio), SAPO (soft gate), CISPO (clip importance weights), DAPO (decoupled clip, dynamic sampling), IcePop/KPop (mask train/infer mismatch), geometric masking, FlowRL (match reward distribution), Knapsack RL (rollout allocation).

Rollout Routing Replay (R3)

not tried

record the inference engine's expert choices and replay them in the training forward pass.

Muon, MuonClip and optimizer choice for fine-tuning

not tried

matrix-orthogonalising optimizer; MuonClip rescales exploding QK logits after each update. **Origin:** Moonshot (arXiv 2502.16982, 2025-02-24; Kimi K2); used by GLM-5 and DeepSeek V4.

Post-training recipes and data selection (capability-per-token, OPUS)

not tried

Ant Ling/Ring 2.6 uses evolutionary CoT, Linguistic Unit Policy Optimization and shortest-correct-response distillation; OPUS selects training examples by projected update under the actual optimizer.

RL and training systems (Seer, QwenGyre, slime, checkpoint-engine, batch-size laws)

not tried

faster rollouts (Seer), elastic rollout/training GPU split (QwenGyre), SGLang-native RL (slime), fast weight broadcast (checkpoint-engine), RL and WSD batch-size laws (Tencent, InternLM).

On-policy distillation as the healing step after pruning

planned

the pruned or converted student samples its own rollouts and trains on per-token reverse KL to the unmodified model; ReCal chooses calibration data before pruning so this step can heal reasoning; GOLD extends it across tokenizers.

LOOP: progressive depth pruning with short on-policy distillation

planned

score each candidate layer by how recoverable it is (not only by importance), remove one layer, run a short on-policy distillation, repeat.

ShortOPD (short-to-long rollouts for pruned models)

planned

pruned models collapse on free-form generation through repetitive suffixes that plain recovery recipes miss; training on the pruned model's own rollouts with token-level teacher supervision, starting short and growing the horizon, cuts them.

Quantization-aware distillation (NVFP4 QAD)

planned

quantise to NVFP4, then train with KL to a frozen BF16 teacher so accuracy returns to close to BF16 where plain QAT or PTQ fall short.

Closed-form layer bridges after depth pruning (SHIFT-LLM, Ghosted Layers, Prune&Comp)

planned

a training-free least-squares linear adapter at each pruning site (mergeable across consecutive pruned layers) or a rescaling of the remaining weights closes the hidden-state gap; minutes of calibration, optionally followed by on-policy distillation.

Healing budgets and how to measure recovery

not tried

a reference of what healing has cost in published work and how to judge whether it worked.

1Workload

Structured-output hidden costs

not tried

a second prefill or hidden reasoning tokens inflate short JSON replies (Ollama ran thinking models in two passes until 2026-09-23; LM Studio e4b/12b emit `reasoning_content` with thinking off).

8Measurement

Benchmark hygiene for TTFT comparisons

planned

published TTFT numbers are distorted by cold JIT and autotune warm-up, prefix-cache contamination, differing "prompt tok/s" definitions and single runs. Control each before comparing engines or kernels (merge note: it distorts many published numbers; reported).

Experiment protocol: pre-registration, paired timing, a same-versus-same noise floor

not tried

timing on a shared or rented machine drifts between runs (other work on the Mac, swap, a different

Speculative speedups depend on concurrency and on the draft's own cost

not tried

speedup = AL / (1 + Ω), where AL is the tokens committed per target pass and Ω the draft's cost as a fraction of the target's time. At one request the GPU is memory-bound with spare compute, so drafting is nearly free; as the server fills, each draft cycle is taken from the batch it accelerates, Ω rises and the speedup falls toward 1. Accept rate (accepted over drafted) is the depth-independent acceptance measure; AL at different k is not comparable.

The guardrail's perplexity, scored without `<bos>`, ranks bf16 E4B worse than its 4-bit QAT build

not tried

The official E4B QAT build disagrees with bf16 on the next token for 30% of the KL prompts

not tried

Host-to-host spread exceeds the baseline noise: one run per experiment produced a false win

not tried

vLLM 0.32 takes 19 to 26 minutes to start E4B on a fresh RTX PRO 4500 pod

not tried

Where a 28-minute 26B-A4B speed run spends its time, and what waiting can be removed

not tried

Want to see what these experiments produced? Lesto, the Gemma 4 inference engine for Apple silicon Macs, is on lestoengine.com

Made by Federico Andrioli, @fedeandri on X A research lab's own measurements, generated from its files. Data built