TurboQuant crushes Gemma 4 quant benchmarks
💡Quantization win: 3.1bpK near q4_0 on Gemma4 +34% speed, Qwen PPL beats q8_0
⚡ 30-Second TL;DR
What Changed
tq3j/q4_0: 37/37 quality, 8/8 NIAH on Gemma 4
Why It Matters
Enables near-lossless long-context inference on consumer Apple silicon, beating prior forks. Highlights per-layer calibration potential for broader LLM quantization advances.
What To Do Next
Test TurboQuant Gemma branch on llama.cpp for your M-series Mac.
Key Points
- •tq3j/q4_0: 37/37 quality, 8/8 NIAH on Gemma 4
- •tq2j/q4_0: 36/37, +34% speed at 131K context vs q4_0
- •Qwen2.5 7B: 8.927 PPL vs q8_0 8.949 at 6.41 bpv
- •Per-layer outlier handling key to gains
- •FWHT + QJL fits Gemma 4 large heads
🧠 Deep Insight
AI-generated analysis for this event — not the original article.
🔑 Enhanced Key Takeaways
- •TurboQuant leverages a hybrid approach combining Fast Walsh-Hadamard Transform (FWHT) with Johnson-Lindenstrauss (QJL) projections to mitigate the precision loss typically associated with extreme KV cache compression in large-head models like Gemma 4.
- •The implementation specifically targets the M4 Pro's unified memory architecture, utilizing custom Metal kernels that bypass standard llama.cpp memory access patterns to reduce latency during long-context token generation.
- •Unlike static quantization methods, TurboQuant's per-layer outlier-aware mechanism dynamically adjusts the bit-width based on the activation magnitude of specific attention heads, allowing for higher compression ratios in layers with lower entropy.
📊 Competitor Analysis▸ Show
| Feature | TurboQuant | llama.cpp (Standard) | ExLlamaV2 |
|---|---|---|---|
| KV Cache Quant | Per-layer Outlier-Aware | Static (q4/q8) | Static/Limited |
| Context Speedup | ~34% (131K) | Baseline | ~15-20% |
| Architecture Focus | Gemma 4 / M4 Pro | General Purpose | NVIDIA/CUDA |
| Pricing | Open Source | Open Source | Open Source |
🛠️ Technical Deep Dive
- FWHT Integration: Utilizes Fast Walsh-Hadamard Transform to decorrelate KV cache activations before projection, minimizing the error introduced by dimensionality reduction.
- QJL Projection: Employs Johnson-Lindenstrauss Lemma-based random projections to map high-dimensional KV vectors into a lower-dimensional subspace while preserving pairwise distances.
- Outlier-Aware Quantization: Implements a threshold-based mechanism that identifies high-magnitude activation channels, keeping them in higher precision (e.g., FP16) while quantizing the remaining bulk to 2-3 bits.
- Metal Kernel Optimization: Custom-written kernels for Apple Silicon (M4 Pro) that optimize memory bandwidth utilization for the specific tensor shapes found in Gemma 4's multi-head attention blocks.
🔮 Future ImplicationsAI analysis grounded in cited sources
⏳ Timeline
Weekly AI Recap
Read this week's curated digest of top AI events →
👉Related Updates
AI-curated news aggregator. All content rights belong to original publishers.
Original source: Reddit r/LocalLLaMA ↗
This is a summary, not the original. Read the source, or get the weekly briefing.
The weekly digest
One email a week. Unsubscribe anytime.