How to use from
Docker Model Runner
docker model run hf.co/PureTensorAI/Jais-3-7B-NVFP4A16
Quick Links

Jais-3-7B NVFP4A16 (GPTQ, weights only, Arabic and English calibration)

NVFP4 quantization of inception42/Jais-3-7B, made by PureTensor from the official BF16 weights. Weights are 4-bit; activations stay 16-bit (W4A16). The file is 8.01 GB against 18.00 GB for BF16.

This is a test release. It is not affiliated with or endorsed by the model's authors.

Read this first: on ArabicMMLU and GSM8K this checkpoint is statistically indistinguishable from BF16. On English MMLU it is 0.8 points lower, a small but significant difference. In our test it served about twice as fast as BF16 on vLLM.

What was done

Source inception42/Jais-3-7B, BF16
Format compressed-tensors nvfp4-pack-quantized, scheme NVFP4A16: 4-bit E2M1 values, one FP8 E4M3 scale per group of 16, one FP32 scale per tensor
Quantized the weights of every Linear layer in the 36 transformer blocks
Kept in BF16 token embeddings and output head, all norms, all activations
Method GPTQ (block_size 128, dampening_frac 0.01, actorder static)
Calibration 2,048 chat-formatted samples, up to 2,048 tokens each: 1,024 Arabic instruction and answer pairs (the first rows of arbml/CIDAR) and 1,024 from mlabonne/open-perfectblend
Tools llm-compressor 0.15.0, compressed-tensors 0.20.1, transformers 5.21.0, torch 2.14.1

The base model's chat template requires a thinking field on assistant turns. For calibration and evaluation text we passed an empty reasoning_content.

Measured quality

One harness, BF16 as reference. The saved checkpoint reloaded from disk to logits identical to the in-memory quantized model, and the benchmarks below were run on the reloaded file.

BF16 This checkpoint Change Paired test
ArabicMMLU, accuracy (14,455 questions) 68.51 68.38 -0.13 565 lost, 546 gained, p = 0.59
GSM8K, exact match (1,319 problems) 85.60 84.08 -1.52 70 lost, 50 gained, p = 0.08
MMLU, accuracy (14,042 questions) 73.54 72.75 -0.79 465 lost, 353 gained, p = 1e-4
WikiText-2 perplexity (131,072 tokens) 10.13 10.42 +0.29
Text Tokens Mean KL divergence 99th percentile KL Same top token as BF16
WikiText-2 test (English) 131,072 0.038 0.33 90.4%
Chat (HuggingFaceH4/ultrachat_200k, test_sft, 256 conversations, English) 238,748 0.076 1.11 91.3%
Arabic (arbml/CIDAR, 256 pairs from row 9,000 on) 64,040 0.057 0.71 90.8%
  • Benchmarks: default arabicmmlu, mmlu and gsm8k configurations of lm-evaluation-harness 0.4.13, no chat template, GSM8K flexible-extract. The paired test is an exact McNemar test on per-question correctness.
  • KL divergence: full next-token distribution, teacher-forced, windows of 1,024 tokens. The Arabic and chat sets share a dataset family with the calibration data (different rows), so those two rows are flattering; ArabicMMLU, MMLU and WikiText are unrelated to it.
  • A caution from our other experiments: benchmark scores move by a point or two between calibration draws of the same recipe. The MMLU difference here is real for this file but small enough that another draw could land on either side.

On a real serving engine

Served with vLLM 0.34.0 on one NVIDIA Blackwell workstation GPU (compute capability 12.0), using vLLM's weight-only FP4 kernel (MarlinNvFp4LinearKernel).

BF16 This checkpoint
GSM8K through the completions API (flexible-extract) 85.44 84.23
Throughput, single stream 1.00x 2.08x
Throughput, 8 concurrent 1.00x 2.08x
Throughput, 32 concurrent 1.00x 1.86x

Throughput is fixed 256-token greedy generations and will differ on other hardware.

Usage

vLLM:

vllm serve PureTensorAI/Jais-3-7B-NVFP4A16 --trust-remote-code

Transformers (requires pip install compressed-tensors):

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

repo = "PureTensorAI/Jais-3-7B-NVFP4A16"
tok = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(repo, trust_remote_code=True, dtype=torch.bfloat16).to("cuda")

msgs = [{"role": "user", "content": "لخّص دورة الماء في جملتين."}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt", return_dict=True).to("cuda")
out = model.generate(**ids, max_new_tokens=256)
print(tok.decode(out[0, ids["input_ids"].shape[1]:], skip_special_tokens=True))

Limitations

  • In Transformers the weights are expanded back to 16-bit at load, so there the saving is disk and download size only. The speed gain needs an engine with an FP4 weight kernel, such as vLLM.
  • One calibration draw, no repeated seeds. No safety, dialect, or long-context evaluation was run on the quantized model.
  • Keep the tokenizer's default behaviour. All calibration text and all benchmarks here begin with the start-of-text token, which this model's tokenizer adds by default. The 0.9B model of this family, whose tokenizer does not add it, failed completely on prompts without that token when quantized the same way, while working normally with it. We have not tested this checkpoint without the start-of-text token.

License

Apache-2.0, as the base model. Changes from the base release: the Linear weights are quantized to NVFP4 and stored packed, and config.json gains a quantization_config block.

Downloads last month
49
Safetensors
Model size
9B params
Tensor type
BF16
·
U8
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for PureTensorAI/Jais-3-7B-NVFP4A16

Quantized
(10)
this model

Collection including PureTensorAI/Jais-3-7B-NVFP4A16