Downloads · 30 days
745
58% of all-time downloads
b4ph/qwen3-4b-lowram-bench
qwen3-4b-lowram-bench is a text generation model from b4ph. Use it when you need the model to write or continue text. It is set up for llama.cpp. The card lists the license as apache-2.0.
Downloads · 30 days
745
58% of all-time downloads
All-time downloads
1.3K
Public
Repo size
27.7 GB
Likes
3
Public
Click a slice to open those files.
.gguf27.7 GB · 100%
From the Hugging Face model README

ANTIMEME SYSTEMWORKS // CREATIVE UTILITIES DIVISION
8 quantizations. One CPU setup. Quality, file size and throughput in the same record.
AM-RS-2026 // QWEN3-4B // V1.0_BUILD
GGUF conversions and quantizations of Qwen/Qwen3-4B, with measured WikiText-2 perplexity and CPU throughput. The files contain no fine-tuning. Compare the recorded setup and uncertainty before transferring these results to another machine.
Most GGUF model cards on the Hub give subjective quality labels ("very high quality, recommended") with no reproducible numbers, and the few that publish perplexity are single-setup with no way to reproduce them. This repo fills that gap:
data/results.tsv)bench/run_bench.sh)Perplexity on the canonical WikiText-2 test set (the exact corpus llama.cpp's own CI
uses; so these numbers are directly comparable to the ecosystem's), context 2048,
16 threads, all CPU (-ngl 0), seed 1. Throughput via llama-bench (512-token prompt
processing pp512 and 128-token generation tg128, 5 repeats, mean reported).
| Quant | File size | Perplexity (WikiText-2) | Δ vs F16 | pp512 (t/s) | tg128 (t/s) |
|---|---|---|---|---|---|
| F16 (BF16) | 8.05 GB | 13.4304 | ; | 357.6 | 2.52 |
| Q8_0 | 4.28 GB | 13.4409 | +0.0105 | 1355.9 | 5.04 |
| Q6_K | 3.31 GB | 13.4404 | +0.0099 | 1523.2 | 5.93 |
| Q5_K_M | 2.89 GB | 13.5362 | +0.1058 | 1917.1 | 5.64 |
| Q4_K_M | 2.50 GB | 13.7304 | +0.3000 | 2064.8 | 6.50 |
| Q4_K_M + imatrix | 2.50 GB | 13.6760 | +0.2456 | 1965.3 | 6.41 |
| Q3_K_M | 2.08 GB | 15.6641 | +2.2337 | 2142.5 | 6.56 |
| Q3_K_M + imatrix | 2.08 GB | 14.8237 | +1.3933 | 2308.2 | 5.89 |
Reading the table: Q8_0/Q6_K are essentially lossless (+0.01 PPL). Q4_K_M is the knee of the curve; 2.5 GB (31% of BF16) for +0.30 PPL, and it's the fastest generator of the non-Q3 set. Q3_K_M is a real quality cliff (+2.23 PPL), which is exactly where imatrix earns its keep.
imatrix ("importance matrix") quantization uses a calibration set
(wikitext-2 wiki.train.raw, 11 MB; standard practice) to learn which weight directions
matter most, so the quantizer spends its bits where they count. Measured here for base
Qwen3-4B (the delta vs the same non-imatrix quant):
| Quant | PPL without imatrix | PPL with imatrix | Δ (imatrix gain) |
|---|---|---|---|
| Q4_K_M | 13.7304 | 13.6760 | −0.054 (small) |
| Q3_K_M | 15.6641 | 14.8237 | −0.840 (large) |
The pattern is the well-documented one, now reproduced at this scale: imatrix pays off
disproportionately at low bit-counts, where every bit matters. At Q4_K_M the gain is
real but small; at Q3_K_M; where the plain quant is already 2.23 PPL worse than F16 –
imatrix reduces the perplexity gap (back to +1.39). The cost is a one-time calibration
pass (~3 h on this CPU; trivial on GPU) and a ~2.5 MB .dat file. Rule of thumb: run
imatrix when you drop to Q3 or below. The two imatrix files let you A/B this yourself.
Eight quantizations, CPU-only, 16 threads. The perplexity axis is truncated to show the measured differences; throughput starts at zero.
Open the interactive quant picker. Select a row for the exact GGUF download. File size is measured; the picker's RAM figure is a rule-of-thumb estimate.
| File | Quant | Size | Notes |
|---|---|---|---|
Qwen3-4B-F16.gguf | F16 | 8.05 GB | full-precision baseline |
Qwen3-4B-Q8_0.gguf | Q8_0 | 4.28 GB | near-lossless |
Qwen3-4B-Q6_K.gguf | Q6_K | 3.31 GB | K-quant (super-block scaling) |
Qwen3-4B-Q5_K_M.gguf | Q5_K_M | 2.89 GB | K-quant, "M" = mixed precision |
Qwen3-4B-Q4_K_M.gguf | Q4_K_M | 2.50 GB | balanced file size; runtime RAM depends on context |
Qwen3-4B-Q4_K_M_imatrix.gguf | Q4_K_M+im | 2.50 GB | imatrix-quantized |
Qwen3-4B-Q3_K_M.gguf | Q3_K_M | 2.08 GB | smallest plain quant |
Qwen3-4B-Q3_K_M_imatrix.gguf | Q3_K_M+im | 2.08 GB | imatrix-quantized |
Machine-readable results: data/results.tsv ·
Eval corpus: data/wiki.test.raw ·
Harness: bench/run_bench.sh
pip install -U "huggingface_hub[cli]"
# grab just the file you want
hf download b4ph/qwen3-4b-lowram-bench --include "Qwen3-4B-Q4_K_M.gguf" --local-dir ./models
Run locally (llama.cpp):
llama-cli -m models/Qwen3-4B-Q4_K_M.gguf -c 4096
Use a compatible llama.cpp-based client, such as llama-cli or llama-server, with support for this model and quantization.
Harness: llama.cpp build 10516, commit b95502ba9 (the exact build used; the
quantizer's behavior is version-sensitive, so pinning matters).
Hardware: 16-core x86-64 CPU (AVX-512 + VNNI), 61.6 GB RAM. GPU present (RTX 5090)
but unused (-ngl 0); all numbers are pure-CPU, so they're reproducible on any
comparable CPU box.
# quality axis — fixed corpus, fixed ctx, fixed seed
llama-perplexity -m Qwen3-4B-<QUANT>.gguf \
-f wiki.test.raw -c 2048 -t 16 -ngl 0 -s 1
# speed axis — 512-token prompt + 128-token generation, 5 repeats
llama-bench -m Qwen3-4B-<QUANT>.gguf -p 512 -n 128 -t 16 -ngl 0 -r 5
To add imatrix quants (as done for Q4_K_M and Q3_K_M here):
# 1. generate the importance matrix from a calibration set
llama-imatrix -m Qwen3-4B-F16.gguf -f wiki.train.raw -c 2048 -t 16 -ngl 0 -o imatrix.dat
# 2. quantize using it (note: long --imatrix flag)
llama-quantize --imatrix imatrix.dat Qwen3-4B-F16.gguf Qwen3-4B-Q4_K_M_imatrix.gguf Q4_K_M
The full loop (perplexity + speed for every quant, TSV output) is in
bench/run_bench.sh.
Converted from Qwen/Qwen3-4B via llama.cpp's
convert_hf_to_gguf.py (at the matching build commit). Model: 36 layers, hidden 2560,
GQA 32/8 heads, vocab 151936, 4.0B params, natively 262,144 context (RoPE-scaled).
LICENSE)Community benchmark, independent of Qwen/Alibaba. Not affiliated with or endorsed by Alibaba Cloud.
ANTIMEME SYSTEMWORKS // CREATIVE UTILITIES DIVISION // P.01