--- license: apache-2.0 base_model: - google/gemma-4-E4B-it tags: - GGUF - Imatrix - Gemma - Dense - Gemma4 - LLM - Text --- # 📟 Gemma4-4B-Dense-Imatrix-Q4_K_M.gguf (2026 Edition) > "Local intelligence... to the max." This is a custom-quantized version of **Gemma4-4B**, specifically optimized to obtain the highest possible local byte-intelligence ratio with 8GB+ RAM consumer laptops or computers. ## 🧠 Why this model is different Unlike a standard quant, this model was processed using a **custom Importance Matrix (imatrix)**. The training data for the imatrix was hand-curated to preserve: * **Incredible reasoning:** Inclusion of custom coding examples built with frontier models provides high retention of very specific and sharp architectural reasoning skills * **Logical Flow:** Inclusion of `llama.cpp` source code, logic puzzles, and historical writing in the imatrix training to ensure the model stays coherent at low bitrates. * **High Speed:** Built using llama.cpp specifically for local-first AI and edge computing setups like apple silicon with minimum 24GB RAM ## 🛠 Quantization Details - **Base Model:** Gemma4-4B - **Quantization:** Q4_K_M - **Format:** GGUF - **Size:** ~5.34 GB - **Context Length:** 262144 tokens ### ⚙️ Recommended Inference Settings Optimize for balance between creativity and coherence: * **`--repeat-penalty`: 1.1 – 1.4** *(Sweet spot! Pushes away from familiar loops. >1.5 causes "robot-speak".)* * **`--repeat-last-n`: 128 – 256** *(Larger window ensures the model doesn't forget recent repetitions.)* * **`--temperature`: 0.7 – 0.8** *(Prevents over-committing to safe/repetitive tokens.)* * **`--top-p`: 0.90** *(Trims low-probability hallucinations without killing creativity.)* * **`--min-p`: 0.05 – 0.1** *(Optional: Prunes very low-probability tokens if your backend supports it.)* ### 📈 Perplexity Benchmarks The following results were generated using `llama-perplexity` on the `wikitext-2-raw/wiki.test.raw` dataset. | Model | Precision | Perplexity (PPL) | Δ PPL | | :--- | :--- | :--- | :--- | | Gemma4-4B (Baseline) | BF16 | **62.3100** | - | | **Gemma4-4B (Quant)** | **Q4_K_M** | **60.5833** | **-1.7267** | ### ⚖️ Evaluation Verdict *coming soon* ### 🚀 Hardware Performance (Apple M2) *coming soon* ### 🌐 Links Check out my other models! -------------------------------------------- *24GB+ (RAM)* [Qwen3.8-27B-SuperDense](https://huggingface.co/macwhisperer/Qwen3.8-27B-SuperDense). [Qwen3.6-35B-SuperMoE](https://huggingface.co/macwhisperer/Qwen3.6-35B-SuperMoE). [Qwen3.6-27B-SuperDense](https://huggingface.co/macwhisperer/Qwen3.6-27B-SuperDense). [Gemma4-31B-SuperDense](https://huggingface.co/macwhisperer/Gemma4-31B-SuperDense). [Gemma4-26B-SuperMoE](https://huggingface.co/macwhisperer/Gemma4-26B-SuperMoE). -------------------------------------------- *16GB+ (RAM)* [Gemma4-12B-SuperDense](https://huggingface.co/macwhisperer/Gemma4-12B-SuperDense). -------------------------------------------- *8GB+ (RAM)* [Qwen3.5-9B-SuperDense](https://huggingface.co/macwhisperer/Qwen3.5-9B-SuperDense). [Qwen3.5-4B-SuperDense](https://huggingface.co/macwhisperer/Qwen3.5-4B-SuperDense). [Gemma4-2B-SuperDense](https://huggingface.co/macwhisperer/Gemma4-2B-SuperDense). -------------------------------------------- *4GB+ (RAM)* [Smartchild](https://huggingface.co/macwhisperer/smartchild). -------------------------------------------- All make excellent companions to this model! ---