Clef, NVFP4 with FP8 self-attention

This is a community quantization and is not an official Cloudflare release.

A mixed 4-bit / 8-bit quantization of Cloudflare/clef for NVIDIA Blackwell GPUs. All MLP projections and the linear-attention projections of the language model are NVFP4; the self-attention projections stay FP8; everything else (embeddings, norms, LM head, vision tower, joint head) is the released bf16, unchanged.

It is simonlehmann/clef-NVFP4 with more of the model moved from FP8 to NVFP4: about 18% more throughput on a 32 GB Blackwell card, with accuracy on the hard public tasks indistinguishable from that build.

20 GB instead of 51 GB.

Scheme

Language-model tensors (64 layers) Format Source
MLP gate / up / down, layers 0-55 NVFP4 unchanged from simonlehmann/clef-NVFP4
MLP gate / up / down, layers 56-63 NVFP4 re-quantized here (was FP8)
linear-attention in_proj_qkv, in_proj_z, out_proj, 48 layers NVFP4 re-quantized here (was FP8)
self-attention q / k / v / o, 16 layers FP8 unchanged from simonlehmann/clef-NVFP4
linear-attention in_proj_a / in_proj_b, norms, conv, embeddings, LM head, vision tower, joint head bf16 unchanged
  • NVFP4: 4-bit floating-point weights and activations in groups of 16, with an FP8 scale per group and one global scale per tensor. Activation group scales are computed at run time; the global activation scale is calibrated.
  • FP8: per-output-channel weights, per-token activation scale computed at run time.
  • Re-quantization: llm-compressor 0.14.0 GPTQModifier with the nvfp4_expanded_mse weight observer on the bf16 release, sequential pipeline, 256 calibration prompts of at most 8,192 tokens (BANKING77 train-split messages, CC BY 4.0, alone and concatenated into longer histories, plus synthetic event logs). in_proj_qkv and in_proj_z, which serving engines fuse into one matrix product, share a global scale. The new NVFP4 tensors replace the FP8 ones; nothing else was touched.

Self-attention is left at FP8 on purpose: converting it as well gives about 8% more speed but costs a measurable half point of accuracy on the hard tasks below.

Files

File Content
model.safetensors, model.safetensors.index.json all language-model and vision tensors in compressed-tensors layout (weight_packed / weight_scale / global scales for NVFP4; weight / weight_scale for FP8)
config.json model config with the two quantization groups
joint_head.safetensors, joint_head_config.json, joint_schema_model.py the joint head and its code, unchanged from the base repository
other files unchanged from the base repository

Loading: this is not a checkpoint a standard transformers or vllm serve one-liner can use as is. It needs an engine with the NVFP4 kernels (NVIDIA Blackwell) and Clef's joint schema head: vLLM 0.33 or newer run as a pooling model with the joint head (token_classify), fed prompts encoded by joint_schema_model.py, the same way as simonlehmann/clef-NVFP4. Keep model.safetensors.index.json next to the weights: without an index, vLLM loads every *.safetensors file in the folder as language-model weights, including the joint head, and fails at start-up.

model.safetensors sha256: 206cfb343b9d367dc3027f35e4a224b6cf1aff7e0a5131aa53655f3e58be5e64.

Fidelity against the bf16 model

Measured with the public Level5Tech/clef-quant-bench tasks. A flip is a question whose top answer differs from the bf16 model's.

Tasks released as records (ARC-Challenge, BANKING77, BoolQ, CLINC150, MMLU, When2Call; 21,174 questions), against that benchmark's bf16 reference. FP8 and NVFP4 rows are that benchmark's published results (CC BY 4.0), rescored on the same questions.

answers flipped accuracy change
a second bf16 engine (noise floor) 0.29% -0.02 pp
FP8 (published) 0.94% -0.04 pp
simonlehmann/clef-NVFP4 (NVFP4 MLP, FP8 elsewhere) 1.97% -0.19 pp
this checkpoint 2.41% -0.31 pp
NVFP4, plain (published) 2.83% -0.52 pp

All 12 tasks (31,275 questions), against bf16 served by the same engine. The hard tasks are ANLI R1-R3, MMLU, RAGTruth, ARC-Challenge and ContractNLI (14,063 questions). Brackets are 95% paired-bootstrap intervals.

hard tasks: flipped hard tasks: accuracy change all tasks: flipped all tasks: accuracy change
simonlehmann/clef-NVFP4 5.06% -0.59 pp [-0.94, -0.23] 3.41% -0.26 pp [-0.45, -0.07]
this checkpoint 5.95% -0.68 pp [-1.06, -0.31] 4.02% -0.30 pp [-0.51, -0.09]
fully NVFP4 (self-attention converted too; not published) 6.22% -1.06 pp [-1.44, -0.66] n/a n/a

This checkpoint against simonlehmann/clef-NVFP4: accuracy -0.09 pp [-0.46, +0.29] on the hard tasks and -0.04 pp [-0.24, +0.17] on all tasks; it disagrees with bf16 on 0.61 pp [0.41, 0.83] more questions.

Neither build is lossless: on the hard tasks both lose a little over half a point of accuracy against bf16.

Batch-composition dependence

Answers are bit-identical when a request is processed alone, and two loads that see the same requests in the same order agree exactly. When requests are batched, the answer to a given question can depend on what else is in the batch. This is small for bf16 and larger for every build with 4-bit activations, including the existing mixed build. On 3,500 hard-task questions, answered once alone and once at concurrency 8:

answers that differ, alone vs batched batched vs batched in another order
bf16 0.77% 0.69%
simonlehmann/clef-NVFP4 5.43% 4.71%
this checkpoint 5.89% 6.17%

Accuracy is unaffected in aggregate. The only way to get the same answer for the same question every time is to process requests one at a time; bf16 reduces the effect but does not remove it.

Speed

One RTX PRO 4500 Blackwell (32 GB), vLLM 0.33, synthetic prompts of 0.5k to 30k tokens (mean about 7k), closed loop: about 6,020 input tokens/s against about 5,100 for simonlehmann/clef-NVFP4 (+18%), stable over a 10-minute run. A single 5.3k-token request takes 0.83 s against 0.99 s.

License

Apache-2.0, following the base model. See LICENSE and NOTICE.

Downloads last month
-
Safetensors
Model size
16B params
Tensor type
BF16
ยท
U8
ยท
F8_E4M3
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for ptrus/clef-nvfp4-fp8attn

Base model

Qwen/Qwen3.8-27B
Finetuned
Cloudflare/clef
Quantized
(47)
this model