Qwen3.5-4B ยท NVFP4 (W4A4, FP4)

4-bit quantization of Qwen/Qwen3.5-4B, produced for efficient vLLM serving. Quantized by axteam.

Base model Qwen/Qwen3.5-4B
Method NVFP4 (W4A4, FP4)
Format compressed-tensors nvfp4-pack-quantized
Weights / activations W4A4 โ€” FP4 (E2M1) weights group 16 (FP8 E4M3 scale + per-tensor FP32 global scale), FP4 activations
Architecture Hybrid (linear-attention + full-attention) ยท Dense ยท multimodal (vision) ยท MTP head
Size on disk ~5.6 GB
Calibration 256 samples (Korean-heavy mixed corpus)
License Apache-2.0

Quantization details

  • Scheme โ€” W4A4 โ€” FP4 (E2M1) weights group 16 (FP8 E4M3 scale + per-tensor FP32 global scale), FP4 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 44% 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.

Benchmark BF16 (original) FP8-dynamic AWQ-8bit NVFP4A16 NVFP4 (this repo) AWQ-4bit
MMLU (5-shot) 55.18 57.99 (105.1%) 54.79 (99.3%) 60.58 (109.8%) 58.61 (106.2%) 60.89 (110.3%)
GSM8K (5-shot, strict) 74.07 73.92 (99.8%) 73.84 (99.7%) 76.72 (103.6%) 73.31 (99.0%) 76.42 (103.2%)
ARC-Challenge (0-shot) 54.61 53.92 (98.8%) 54.52 (99.8%) 54.86 (100.5%) 53.92 (98.8%) 54.35 (99.5%)
Winogrande (5-shot) 68.75 67.96 (98.9%) 69.14 (100.6%) 68.90 (100.2%) 69.38 (100.9%) 68.90 (100.2%)
KMMLU (5-shot, direct) 50.47 50.13 (99.3%) 50.48 (100.0%) 51.49 (102.0%) 50.26 (99.6%) 49.02 (97.1%)
HAE-RAE (0-shot) 62.42 61.50 (98.5%) 62.05 (99.4%) 61.69 (98.8%) 59.76 (95.7%) 58.48 (93.7%)
Average 60.92 60.90 (100.0%) 60.81 (99.8%) 62.37 (102.4%) 60.87 (99.9%) 61.34 (100.7%)

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).

Metric This model BF16 original
Perplexity (lower = closer) 1.7157 1.5703 (+9.3%)
Top-1 next-token agreement 88.1% 99.2%

These measure fidelity to the base model, not absolute task scores.

Requirements

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 Full FP4 (W4A4) speed on Blackwell โ€” B200/GB200 (sm100), B300 (sm103), RTX 50xx / RTX PRO 6000 (sm120). Turingโ€“Hopper (sm75โ€“90) fall back to weight-only FP4 (slower, vLLM warns). V100 (sm70) is not supported. (Kernel choice per GPU from vLLM 0.32's selection code; only B200 was run here.)
Memory Weights: 5.6 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-4B-NVFP4 --max-model-len 32768

Query it:

curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '{
  "model": "axteam/Qwen3.5-4B-NVFP4",
  "messages": [{"role": "user", "content": "๋Œ€ํ•œ๋ฏผ๊ตญ์˜ ์ˆ˜๋„๋Š” ์–ด๋””์ธ๊ฐ€์š”?"}],
  "max_tokens": 512
}'

Offline inference in Python:

from vllm import LLM, SamplingParams

llm = LLM(model="axteam/Qwen3.5-4B-NVFP4", 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 on by default in the chat template; to turn it off pass chat_template_kwargs={"enable_thinking": False} (Python llm.chat(..., chat_template_kwargs=...), or "chat_template_kwargs": {"enable_thinking": false} 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-4B-NVFP4 --kv-cache-dtype fp8

License

Quantized derivative of Qwen/Qwen3.5-4B (Apache-2.0). All original weights, tokenizer and chat template belong to the Qwen team.


ํ•œ๊ตญ์–ด ์š”์•ฝ

Qwen/Qwen3.5-4B ๋ฅผ NVFP4 (W4A4, FP4) ๋กœ ์–‘์žํ™”ํ•œ ์„œ๋น™์šฉ(4-bit) ๋ชจ๋ธ์ž…๋‹ˆ๋‹ค. ์ž‘์„ฑ: axteam.

  • ๋ฐฉ์‹ โ€” ๊ฐ€์ค‘์น˜ยทํ™œ์„ฑํ™” ๋ชจ๋‘ FP4(W4A4). Blackwell(B200) FP4 ํ…์„œ์ฝ”์–ด์—์„œ ์ œ ์†๋„. ํ’ˆ์งˆ ์šฐ์„ ์ด๋ฉด NVFP4A16 ๊ถŒ์žฅ. ํ˜•์‹ compressed-tensors nvfp4-pack-quantized.
  • BF16 ์œ ์ง€ โ€” ๋น„์ „ ํƒ€์›ŒยทMTP ํ—ค๋“œยท๋ชจ๋“  normยท์ž„๋ฒ ๋”ฉ/LM ํ—ค๋“œยทSSM(linear_attn) ๊ฒฝ๋กœ ์ „์ฒด(FP4๊ฐ€ SSM ๊ฐ€์ค‘์น˜์—” ๋„ˆ๋ฌด ๊ฑฐ์น ์–ด์„œ).
  • PTQ โ€” ์žฌํ•™์Šต ์—†์Œ.
  • ํ’ˆ์งˆ(์‹ค์ธก) โ€” BF16 ์›๋ณธ ๋Œ€๋น„ perplexity 1.7157(์›๋ณธ 1.5703, +9.3%), top-1 ์ผ์น˜๋„ 88.1%(์›๋ณธ 99.2%). ๋‚ด๋ถ€ ์˜/ํ•œ 100๋ฌธํ•ญ, ๊ฐ™์€ ํ•˜๋„ค์Šค.
  • ๋ฒค์น˜๋งˆํฌ(์‹ค์ธก) โ€” MMLU ยท GSM8K ยท ARC-Challenge ยท Winogrande ยท KMMLU ยท HAE-RAE ํ‰๊ท  BF16 60.92 โ†’ ์ด ๋ชจ๋ธ 60.87 (ํšŒ๋ณต๋ฅ  99.9%). lm-evaluation-harness ยท vLLM, ๋ชจ๋“  ํ˜•์‹ ๊ฐ™์€ ์„ค์ •.
  • ๋ผ์ด์„ ์Šค โ€” ์›๋ณธ Apache-2.0 ํŒŒ์ƒ๋ฌผ. ๊ฐ€์ค‘์น˜ยทํ† ํฌ๋‚˜์ด์ €ยทchat_template ๊ถŒ๋ฆฌ๋Š” Qwen ํŒ€.
  • ์š”๊ตฌ์‚ฌํ•ญ โ€” vLLM โ‰ฅ0.17.0 (0.32.0 ์—์„œ ์‹ค์ธก); GPU FP4(W4A4) ์ œ ์†๋„๋Š” Blackwell(B200ยทB300ยทRTX 50xx/PRO 6000). Turing~Hopper ๋Š” ๊ฐ€์ค‘์น˜ ์ „์šฉ FP4 ๋กœ ์ž๋™ ์ „ํ™˜(๋А๋ฆผ); ๊ฐ€์ค‘์น˜ 5.6 GB + KV ์บ์‹œ; Transformers ์ง์ ‘ ์‚ฌ์šฉ: transformers โ‰ฅ5.2.0 + compressed-tensors โ‰ฅ0.15.0.
  • ์‹คํ–‰ โ€” vllm serve axteam/Qwen3.5-4B-NVFP4 --max-model-len 32768 ๋กœ OpenAI ํ˜ธํ™˜ ์„œ๋ฒ„(ํฌํŠธ 8000), ๋˜๋Š” Python LLM(model="axteam/Qwen3.5-4B-NVFP4").chat(...) (์œ„ ์˜ˆ์‹œ). thinking ๋„๊ธฐ: chat_template_kwargs={"enable_thinking": False}. ์ด๋ฏธ์ง€ ์ž…๋ ฅ์€ image_url ๋ฉ”์‹œ์ง€๋กœ.
  • KV ์บ์‹œ ์ ˆ๊ฐ(๋Ÿฐํƒ€์ž„) โ€” --kv-cache-dtype fp8.
Downloads last month
26
Safetensors
Model size
5B params
Tensor type
BF16
ยท
U8
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for axteam/Qwen3.5-4B-NVFP4

Finetuned
Qwen/Qwen3.5-4B
Quantized
(602)
this model

Collection including axteam/Qwen3.5-4B-NVFP4