Quantization details
- Scheme — W4A16 — FP4 (E2M1) weights group 16 (FP8 E4M3 scale + per-tensor FP32 global scale), BF16 activations, stored as compressed-tensors
nvfp4-pack-quantized.
- Kept in BF16 — the vision tower & projector (
model.visual.*), the multi-token-prediction head (mtp.*), all RMSNorms, token embeddings, the LM head, the entire linear-attention (GatedDeltaNet/SSM) path — FP4 is too coarse for the SSM weights, so the full linear_attn.* stays BF16. Left unquantized to preserve quality (about 55% of all parameters in this build).
- Tokenizer /
chat_template / generation_config are identical to the original. config.json is the original plus a quantization_config block.
This is post-training quantization (PTQ) — no retraining. AWQ uses a small calibration set (no gradient) to protect salient weight channels before rounding.
Benchmarks (measured)
Every column was measured with the same harness and settings — lm-evaluation-harness on vLLM, greedy, few-shot completion (no chat template). Percentages are recovery vs. the BF16 original.
Table with columns: Benchmark, BF16 (original), FP8-dynamic, AWQ-8bit, NVFP4A16 (this repo), NVFP4, AWQ-4bit| Benchmark | BF16 (original) | FP8-dynamic | AWQ-8bit | NVFP4A16 (this repo) | NVFP4 | AWQ-4bit |
|---|
| MMLU (5-shot) | 53.33 | 48.18 (90.3%) | 53.54 (100.4%) | 54.27 (101.8%) | 55.22 (103.5%) | 60.38 (113.2%) |
| GSM8K (5-shot, strict) | 58.23 | 56.63 (97.3%) | 56.56 (97.1%) | 54.51 (93.6%) | 51.71 (88.8%) | 54.06 (92.8%) |
| ARC-Challenge (0-shot) | 41.47 | 41.98 (101.2%) | 41.30 (99.6%) | 41.04 (99.0%) | 39.51 (95.3%) | 39.59 (95.5%) |
| Winogrande (5-shot) | 64.56 | 63.22 (97.9%) | 64.48 (99.9%) | 64.48 (99.9%) | 61.09 (94.6%) | 62.51 (96.8%) |
| KMMLU (5-shot, direct) | 43.29 | 42.58 (98.4%) | 43.20 (99.8%) | 42.01 (97.1%) | 41.14 (95.0%) | 42.10 (97.3%) |
| HAE-RAE (0-shot) | 45.65 | 45.00 (98.6%) | 45.10 (98.8%) | 44.91 (98.4%) | 42.07 (92.2%) | 41.06 (90.0%) |
| Average | 51.09 | 49.60 (97.1%) | 50.70 (99.2%) | 50.21 (98.3%) | 48.46 (94.8%) | 49.95 (97.8%) |
Evaluation (measured)
Fidelity to the BF16 original on an internal mixed English/Korean set (100 prompts, BF16 greedy answers scored under each build — same harness for every row).
Table with columns: Metric, This model, BF16 original| Metric | This model | BF16 original |
|---|
| Perplexity (lower = closer) | 1.9269 | 1.8515 (+4.1%) |
| Top-1 next-token agreement | 89.8% | 98.9% |
These measure fidelity to the base model, not absolute task scores.
Requirements
Table | |
|---|
| Runtime | vLLM — the architecture is in vLLM ≥ 0.17.0; tested here with vLLM 0.32.0. |
| 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: 3.1 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.2.0 + compressed-tensors>=0.15.0 (checked on CPU with Qwen3.5-0.8B FP8 / AWQ-4bit / NVFP4A16 / NVFP4). |
| trust_remote_code | not needed |
Usage (vLLM)
Start an OpenAI-compatible server:
vllm serve axteam/Qwen3.5-2B-NVFP4A16 --max-model-len 32768
Query it:
curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '{ "model": "axteam/Qwen3.5-2B-NVFP4A16", "messages": [{"role": "user", "content": "대한민국의 수도는 어디인가요?"}], "max_tokens": 512}'
Offline inference in Python:
from vllm import LLM, SamplingParams llm = LLM(model="axteam/Qwen3.5-2B-NVFP4A16", max_model_len=32768)params = SamplingParams(max_tokens=1024)out = llm.chat([{"role": "user", "content": "Explain model quantization in two sentences."}], params)print(out[0].outputs[0].text) # image input (URL or data: URI)messages = [{"role": "user", "content": [ {"type": "image_url", "image_url": {"url": "https://example.com/your-image.png"}}, {"type": "text", "text": "Describe this image."},]}]out = llm.chat(messages, params)print(out[0].outputs[0].text)
Thinking mode is off by default in this model's chat template; to turn it on pass chat_template_kwargs={"enable_thinking": True} (Python llm.chat(..., chat_template_kwargs=...), or "chat_template_kwargs": {"enable_thinking": true} in the request body).
Text-only serving: add --limit-mm-per-prompt '{"image": 0, "video": 0}' to skip loading the vision encoder's memory budget.
Reducing KV-cache memory (optional, serve-time)
The KV cache is kept in BF16 by default. KV-cache precision is a runtime choice, independent of the
weight quantization above; for long contexts or large batches FP8 roughly halves KV-cache memory:
vllm serve axteam/Qwen3.5-2B-NVFP4A16 --kv-cache-dtype fp8
License
Quantized derivative of Qwen/Qwen3.5-2B (Apache-2.0). All original weights, tokenizer and chat template belong to the Qwen team.
한국어 요약
Qwen/Qwen3.5-2B 를 NVFP4A16 (W4A16, FP4 weights) 로 양자화한 서빙용(4-bit) 모델입니다. 작성: axteam.
- 방식 — FP4(E2M1) 가중치 16묶음 + 활성화 BF16(W4A16). W4A4 NVFP4보다 품질이 크게 좋음. 형식 compressed-tensors
nvfp4-pack-quantized.
- BF16 유지 — 비전 타워·MTP 헤드·모든 norm·임베딩/LM 헤드·SSM(linear_attn) 경로 전체(FP4가 SSM 가중치엔 너무 거칠어서).
- PTQ — 재학습 없음.
- 품질(실측) — BF16 원본 대비 perplexity 1.9269(원본 1.8515, +4.1%), top-1 일치도 89.8%(원본 98.9%). 내부 영/한 100문항, 같은 하네스.
- 벤치마크(실측) — MMLU · GSM8K · ARC-Challenge · Winogrande · KMMLU · HAE-RAE 평균 BF16 51.09 → 이 모델 50.21 (회복률 98.3%). lm-evaluation-harness · vLLM, 모든 형식 같은 설정.
- 라이선스 — 원본 Apache-2.0 파생물. 가중치·토크나이저·chat_template 권리는 Qwen 팀.
- 요구사항 — vLLM ≥0.17.0 (0.32.0 에서 실측); GPU Turing(sm75) 이상 — 가중치 전용 FP4, FP4 텐서코어 불필요; 가중치 3.1 GB + KV 캐시; Transformers 직접 사용: transformers ≥5.2.0 + compressed-tensors ≥0.15.0.
- 실행 —
vllm serve axteam/Qwen3.5-2B-NVFP4A16 --max-model-len 32768 로 OpenAI 호환 서버(포트 8000), 또는 Python LLM(model="axteam/Qwen3.5-2B-NVFP4A16").chat(...) (위 예시). thinking 은 기본으로 꺼져 있음 — 켜려면 chat_template_kwargs={"enable_thinking": True}. 이미지 입력은 image_url 메시지로.
- KV 캐시 절감(런타임) —
--kv-cache-dtype fp8.