4-bit quantization of google/gemma-4-E4B-it, produced for efficient vLLM serving. Quantized by axteam.
Revision 2026-11-01 (rebuilt): This rebuild applies AWQ smoothing to the attention inputs (q/k/v; q only in the KV-shared layers), the MLP inputs (gate/up) and the down-projection input with 128 calibration samples (checked: all 84 smoothed norms differ from the original, and every smoothing pair was searched with a non-zero calibration error). The first upload of this repo was produced through an llm-compressor pipeline path in which AWQ smoothing silently did not apply, so it was effectively round-to-nearest despite its AWQ label. If you downloaded this repo before 2026-11-01 08:46:18 UTC (revision
667b2d3), download it again. The benchmark and fidelity figures on this card were measured on the rebuilt files.
| Base model | google/gemma-4-E4B-it |
| Method | NVFP4A16 (W4A16, FP4 weights) |
| Format | compressed-tensors nvfp4-pack-quantized |
| Weights / activations | W4A16 — FP4 (E2M1) weights group 16 (FP8 E4M3 scale + per-tensor FP32 global scale), BF16 activations |
| Architecture | Gemma 4 · Dense |
| Size on disk | ~10.3 GB |
| Calibration | 128 samples (Korean-heavy; no thinking-mode answers) |
| License | Gemma 4 / Apache-2.0 |
nvfp4-pack-quantized.embed_tokens_per_layer), the per-layer input gates and projections (per_layer_input_gate, per_layer_projection, per_layer_model_projection), and all norms. These stay unquantized to preserve quality — about 51% of all parameters in this build.chat_template / processor_config / generation_config are byte-identical to the original, including Google's July-2026 corrected chat_template. config.json is the original plus a quantization_config block.This model is a post-training quantization (PTQ): the released BF16 weights are quantized after training, with no retraining. How close each build stays to BF16 is reported in the measured sections where available.
Rough low-bit fidelity: QAT ≥ AWQ > RTN. Cost: QAT ≫ AWQ > RTN. This build: AWQ — a calibration-based PTQ (128-sample calibration, no gradient).
Every column was measured with the same harness and settings — lm-evaluation-harness on vLLM, greedy, completion-style prompts without a chat template (0- or 5-shot, as listed in each row). MMLU here is lm-eval's generative variant (mmlu_generative: the model writes the answer letter and only an exact match on the first line counts), so it is not directly comparable with MMLU scores measured another way (e.g. log-likelihood scoring). Percentages are recovery vs. the BF16 original.
| Benchmark | BF16 (original) | FP8-dynamic | AWQ-8bit | NVFP4A16 (this repo) | NVFP4 | AWQ-4bit |
|---|---|---|---|---|---|---|
| MMLU (5-shot, generative) | 62.16 | 63.20 (101.7%) | 62.40 (100.4%) | 64.48 (103.7%) | 62.14 (100.0%) | 64.16 (103.2%) |
| GSM8K (5-shot, strict) | 84.31 | 84.00 (99.6%) | 84.08 (99.7%) | 82.71 (98.1%) | 79.83 (94.7%) | 81.73 (96.9%) |
| ARC-Challenge (0-shot) | 56.91 | 57.34 (100.7%) | 56.66 (99.6%) | 56.66 (99.6%) | 55.20 (97.0%) | 55.97 (98.4%) |
| Winogrande (5-shot) | 66.30 | 65.75 (99.2%) | 66.85 (100.8%) | 65.51 (98.8%) | 66.46 (100.2%) | 65.43 (98.7%) |
| KMMLU (5-shot, direct) | 51.46 | 51.24 (99.6%) | 51.46 (100.0%) | 50.15 (97.5%) | 49.11 (95.4%) | 51.31 (99.7%) |
| HAE-RAE (0-shot) | 69.84 | 69.02 (98.8%) | 69.57 (99.6%) | 69.48 (99.5%) | 68.10 (97.5%) | 68.10 (97.5%) |
| Average | 65.16 | 65.09 (99.9%) | 65.17 (100.0%) | 64.83 (99.5%) | 63.47 (97.4%) | 64.45 (98.9%) |
Fidelity to the BF16 original on an internal mixed English/Korean set (100 prompts: the BF16 original's greedy answers, scored under each build with the same prompts and scoring code). This build was measured on the rebuilt files with vLLM 0.32 on 2026-11-01; the BF16 reference column was measured on 2026-10-11.
| Metric | This model | BF16 original |
|---|---|---|
| Perplexity (lower = closer) | 1.3854 | 1.3032 (+6.3%) |
| Top-1 next-token agreement | 91.6% | 99.2% |
These measure fidelity to the base model, not absolute task scores.
| Runtime | vLLM — the architecture is in vLLM ≥ 0.19.0; tested here with vLLM 0.32.0 (text: the benchmarks above; image: an image-description prompt in the 2026-11-01 fidelity run). |
| vLLM install | vLLM 0.32 itself needs Python 3.11–3.14, torch 2.13 (CUDA 13.0 build, so an NVIDIA driver with CUDA 13 support), transformers ≥5.16.1,<5.20 and compressed-tensors 0.17.0 (both pinned by vLLM; 0.17.0 reads this checkpoint, which was saved with 0.19.0 — do not upgrade it separately). |
| GPU | NVIDIA Turing (sm75) or newer — weight-only FP4, no FP4 tensor cores needed. V100 (sm70) is not supported. (Kernel choice per GPU from vLLM 0.32's selection code; only B200 was run here.) |
| Memory | Weights: 10.3 GB. Add KV cache (grows with context length × concurrent requests) and a few GB for activations / CUDA graphs; use --tensor-parallel-size N when the weights do not fit one GPU. |
| Transformers (without vLLM) | transformers>=5.5.2 (5.5.0/5.5.1 cannot run the KV-shared layers). |
| trust_remote_code | not needed |
vllm serve axteam/gemma-4-E4B-it-NVFP4A16
from vllm import LLM, SamplingParams
llm = LLM(model="axteam/gemma-4-E4B-it-NVFP4A16")
params = SamplingParams(temperature=1.0, top_p=0.95, top_k=64, max_tokens=1024)
out = llm.chat(
[{"role": "user", "content": "Write a short joke about saving RAM."}],
params,
)
print(out[0].outputs[0].text)
Recommended sampling (per Google):
temperature=1.0,top_p=0.95,top_k=64. Thinking mode: add the<|think|>token at the start of the system prompt to enable step-by-step reasoning.
The KV cache is unquantized (BF16) here — the standard for quantized checkpoints (RedHatAI, NVIDIA, etc. ship the same way). KV-cache precision is a runtime choice, independent of the weight quantization above. For long context or large batches you can roughly halve KV-cache memory with FP8:
vllm serve axteam/gemma-4-E4B-it-NVFP4A16 --kv-cache-dtype fp8
--kv-cache-dtypeacceptsauto(default, BF16),fp8/fp8_e4m3,fp8_e5m2. For a GGUF build the llama.cpp equivalent is--cache-type-k q8_0 --cache-type-v q8_0.
This is a quantized derivative of Google's Gemma 4. Use is governed by the Gemma 4 license. All original weights, tokenizer, and chat template belong to Google DeepMind.
google/gemma-4-E4B-it의 NVFP4A16 (W4A16) 양자화 빌드 · 제작 axteam
| 항목 | 내용 |
|---|---|
| 원본 모델 | google/gemma-4-E4B-it |
| 양자화 방식 | NVFP4A16 (W4A16, FP4 가중치) |
| 저장 형식 | compressed-tensors nvfp4-pack-quantized |
| 모델 구조 | Gemma 4 · Dense |
| 용량 | 약 10.3 GB |
| 보정 데이터 | 샘플 128개 (한국어 위주, thinking 모드 답변 없음) |
embed_tokens_per_layer), 층별 입력 게이트·투영층(per_layer_input_gate·per_layer_projection·per_layer_model_projection), 모든 정규화층 — 전체 파라미터의 약 51%config.json은 원본에 quantization_config 블록만 추가mmlu_generative) — 모델이 답 글자를 생성하고 첫 줄이 정확히 일치해야 정답으로 채점하므로, 다른 방식(예: log-likelihood 채점)으로 잰 MMLU 점수와 직접 비교 불가--tensor-parallel-size N으로 분산vllm serve axteam/gemma-4-E4B-it-NVFP4A16LLM(model="axteam/gemma-4-E4B-it-NVFP4A16").chat(...) — 전체 예시는 위 영어 본문 'Usage (vLLM)' 절 참고temperature=1.0, top_p=0.95, top_k=64 (Google 권장값)<|think|> 토큰 추가vllm serve에 --kv-cache-dtype fp8 추가 — 기본 BF16인 KV 캐시를 FP8로 저장해 KV 캐시 메모리를 약 절반으로 줄임 (긴 컨텍스트·동시 요청이 많을 때 유리, 가중치 양자화와 별개인 실행 옵션)667b2d3) 이전에 받았다면 다시 받을 것, 품질 항목의 벤치마크·충실도는 재양자화 빌드로 잰 값