CoolFace
Modelpublic

sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF

sourceHugging Faceapache-2.0updated 4mo agoView on Hugging Face
0likes100downloads
Model Card

Qwen3-4B-Instruct-2507 — BitClass2 Mixed-Precision GGUF

Mixed-precision GGUF quantizations of Qwen3-4B-Instruct-2507 using Hessian-informed per-tensor bit allocation. Each tensor group receives the precision level that minimizes quality loss for its measured sensitivity — more bits where they matter, fewer where they don't.

Available Quantizations

FileBPWSizePPL ↓tok/sUse Case
`Qwen3-4B-Instruct-2507-Q8_0.gguf`8.54.28 GB2.65111.4Near-lossless reference
`Qwen3-4B-Instruct-2507-Q6_K.gguf`5.82.93 GB2.88813.6High quality, moderate size
`Qwen3-4B-Instruct-2507-Q5_K_M.gguf`5.22.60 GB2.97114.3Balanced quality and size
`Qwen3-4B-Instruct-2507-Q4_K_M.gguf`4.72.35 GB2.97814.1Best quality-to-size ratio
`Qwen3-4B-Instruct-2507-Q3_K_S.gguf`3.21.62 GB3.21418.9Maximum compression

Recommended: Q4KM for the best quality-to-size ratio (PPL 2.978 at just 2.35 GB). Q3KS for maximum compression. Q6_K for high quality.

How It Works

Standard quantization applies one precision level uniformly across all tensors. BitClass2 uses Hessian-based sensitivity analysis (Hdiag = mean(X²) per layer) to identify which tensors lose the most quality when quantized, then solves an LP-optimal knapsack allocation: minimize Σ(sensitivity × quantizationerror) subject to total size ≤ target. Sensitive tensors get higher precision, insensitive ones get lower precision, at the same total file size.

Within each suffix group, the fractional BPW planner further varies types per-layer using blended imatrix + Hessian scores, so late attention layers (most sensitive) get higher precision than middle layers (least sensitive).

Key Sensitivity Findings (Qwen3-4B)

  • —Late attention layers (29-35) are most sensitive — blk.34 k/v score 1.0
  • —down_proj is the most sensitive MLP tensor — projects back to residual stream
  • —gate_proj/up_proj are least sensitive — safe to quantize aggressively
  • —K > V for attention weight sensitivity — kproj averages 0.66 vs vproj 0.50

Usage

bash
# Download
huggingface-cli download sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF \
    Qwen3-4B-Instruct-2507-Q4_K_M.gguf --local-dir .

# Chat with llama.cpp
llama-cli -m Qwen3-4B-Instruct-2507-Q4_K_M.gguf -cnv

# Serve via API
llama-server -m Qwen3-4B-Instruct-2507-Q4_K_M.gguf --port 8080

# Ollama
ollama run hf.co/sh111111111111111/Qwen3-4B-Instruct-2507-BitClass2-GGUF:Qwen3-4B-Instruct-2507-Q4_K_M.gguf

Benchmark Details

All benchmarks run on NVIDIA GB10 ATOM (128GB unified memory, aarch64). llama.cpp commit 406f4e3. PPL via llama-perplexity (2 chunks, 851 context). tok/s via llama-bench (tg128, ngl=999).

Disclaimer

Independent project. Not affiliated with or endorsed by Qwen, Unsloth, ByteShape, Bartowski, or llama.cpp.

License

Apache 2.0, inherited from Qwen3-4B-Instruct-2507.