CoolFace
Modelpublic

gratex/Mistral-Small-3.2-24B-Instruct-2506-sbvr-compliance-W4A16

sourceHugging Faceapache-2.0updated 11d agoView on Hugging Face
0likes309downloads
Model Card

Mistral-Small-3.2-24B-Instruct-2506-sbvr-compliance-W4A16

Model description

This is a W4A16 quantized version of `gratex/Mistral-Small-3.2-24B-Instruct-2506-sbvr-compliance-unresolvable-pattern-finetune-v1`, which is a fine-tuned Mistral-Small-3.2-24B-Instruct-2506 designed to improve the evaluation of SBVR (Semantics of Business Vocabulary and Business Rules) rules.

The quantization was performed using AutoRound 0.15.0 with SignRoundV2 optimization, reducing the model size from 45 GB (BF16) to 15 GB while maintaining high fidelity to the original model. The model supports both text-only and image+text (vision) inference.

The multimodal projector tensors are stored under their Mistral-native names (multi_modal_projector.w_in, multi_modal_projector.w_out, pre_mm_projector_norm, patch_merger.merging_layer) so that vLLM's Mistral-native loading path matches them correctly; these tensors are BF16 and are not quantized.

Quantization configuration

ParameterValue
Quantization methodAutoRound (SignRoundV2)
AutoRound version0.15.0
Weight bits4 (W4A16)
Activation bits16 (BF16)
Group size128
SymmetricTrue
Iterations1000
Calibration samples512
Sequence length4096
Packing formatautoround:autogptq
lm_headKept in 16-bit (not quantized)
enable_alg_extTrue (SignRoundV2)
enable_torch_compileTrue
low_gpu_mem_usageTrue
GPUNVIDIA RTX 5090 (32 GB)

Calibration dataset

The calibration dataset was constructed from multiple domain-specific sources to ensure the quantized model retains accuracy across all relevant domains:

DomainSamplesDescription
SBVR rules~50%SBVR compliance rules in JSON format, rule status assignment (PASSED/FAILED/UNRESOLVABLE), insurance terminology
Slovak text~25%Slovak Wikipedia, FineWeb2, EN↔SK parallel corpus (opus100) — ensures diacritics preservation
English general~15%UltraChat conversations, general English text
Reasoning~10%MMLU-Pro (14 categories), BoolQ, TruthfulQA

All 512 calibration samples were concatenated to a minimum of 4,096 tokens each (20,480 characters) to maximize the calibration signal per sample. The dataset is published alongside this model as calibration_dataset.jsonl.

Quantization script

The quantization script is published as quantize.py in this repository.

Evaluation results

WikiText-2 Perplexity

Standard WikiText-2-raw-v1 benchmark with sliding window (stride=512, max_length=2048, 590 windows, 301,616 tokens):

ModelWikiText-2 PPLDegradation
BF16 (original)4.7596—
W4A16 (this model)4.9160+3.28%

Comprehensive evaluation

30 domain-specific prompts (SBVR, Slovak, English, code, reasoning) comparing token-level agreement, KL divergence, and generation fidelity against the BF16 baseline:

MetricValue
Average PPL degradation+1.39%
KL divergence0.0231
Cosine similarity0.9945
Spearman correlation0.9984
Top-1 token agreement70.00%
Top-5 token agreement90.69%
Top-10 token agreement91.05%
Greedy match90.46%
Per-category PPL
CategoryBF16 PPLW4A16 PPLDegradation
SBVR30.4330.89+1.51%
Slovak11.0911.16+0.63%
English5.896.16+4.58%
Code3.413.38-0.88%
Reasoning4.033.99-0.99%

Usage

vLLM (recommended for both text and vision)

This model requires vLLM's Mistral-native loading mode. Deploy with config_format: mistral and tokenizer_mode: mistral (the Tekken tokenizer is shipped as tekken.json; using the default HF tokenizer mode produces garbled output):

bash
docker run -d --name vllm-mistral-sbvr \
  --runtime=nvidia --gpus '"device=0"' \
  -p 8000:8000 \
  -v /path/to/model:/workspace/model \
  --ipc=host --shm-size=16g \
  vllm/vllm-openai:cu129-nightly \
  --model /workspace/model \
  --served-model-name mistral-24b-sbvr-w4a16 \
  --config-format mistral --tokenizer-mode mistral \
  --quantization auto_round \
  --dtype bfloat16 \
  --trust-remote-code

Both text-only and image+text (vision) requests are supported:

python
import base64, requests

img_b64 = base64.b64encode(open("image.jpg", "rb").read()).decode()

# Text
requests.post("http://localhost:8000/v1/chat/completions", json={
    "model": "mistral-24b-sbvr-w4a16",
    "messages": [{"role": "user", "content": "Evaluate this SBVR rule: ..."}],
    "max_tokens": 512,
})

# Vision
requests.post("http://localhost:8000/v1/chat/completions", json={
    "model": "mistral-24b-sbvr-w4a16",
    "messages": [{"role": "user", "content": [
        {"type": "text", "text": "Describe this image."},
        {"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{img_b64}"}},
    ]}],
    "max_tokens": 512,
})

transformers

The projector tensors use Mistral-native names for vLLM compatibility. transformers 5.x loads Mistral3 checkpoints without a name-conversion layer, so the projector tensors need manual renaming (w_in→linear_1, w_out→linear_2, pre_mm_projector_norm→norm, patch_merger→multi_modal_projector.patch_merger.merging_layer) when loading this model with transformers. For production use, the vLLM path above is the recommended and tested route.

Model details

PropertyValue
ArchitectureMistral3ForConditionalGeneration
Parameters1.78B (quantized) / 24B (original)
Model size15 GB
PrecisionW4A16 (4-bit weights, 16-bit activations)
Context length128K (inherited from base model)
VisionPixtral tower, 1024×1024+ images, 4 images per prompt
LicenseApache 2.0

HELM comparison: fine-tuned BF16 vs W4A16

The BF16 fine-tuned source model and this W4A16 quantized version were evaluated side by side on Stanford HELM benchmarks (crfm-helm >= 0.5.0, 1,000 instances per scenario, served via an OpenAI-compatible endpoint).

General benchmarks

SuiteFT BF16FT W4A16Δ
bbq90.60%91.90%+1.30 pp
boolq85.10%89.40%+4.30 pp
commonsense82.80%82.90%+0.10 pp
damageditemsmc100.00%100.00%0.00 pp
insuranceclaimextraction64.14%61.63%−2.51 pp
polycontext_rules71.50%62.10%−9.40 pp
quac59.97%58.85%−1.12 pp
synthetic_reasoning93.40%91.75%−1.65 pp
truthful_qa68.35%68.50%+0.15 pp

MMLU Pro

SubjectFT BF16FT W4A16Δ
biology76.43%76.01%−0.42 pp
business34.98%37.77%+2.79 pp
chemistry31.50%32.20%+0.70 pp
computer_science53.90%52.68%−1.22 pp
economics64.57%63.74%−0.83 pp
engineering33.85%37.36%+3.51 pp
health64.55%62.47%−2.08 pp
history60.63%57.48%−3.15 pp
law42.20%42.10%−0.10 pp
math34.50%34.60%+0.10 pp
other54.98%53.14%−1.84 pp
philosophy51.30%48.70%−2.60 pp
physics32.80%34.50%+1.70 pp
psychology68.55%67.54%−1.01 pp

Summary averages

MetricFT BF16FT W4A16Δ
HELM overall avg (23 suites)61.77%61.19%−0.58 pp
MMLU Pro avg (14 subjects)50.34%50.02%−0.32 pp
Non-MMLU avg (9 scenarios)79.54%78.56%−0.98 pp
SBVR unresolvable overall (1,432 items)90.92%91.97%+1.05 pp

BBQ bias

MetricFT BF16FT W4A16
Ambiguous accuracy88.67%88.67%
Non-ambiguous accuracy95.29%95.29%
Bias gap (amb − non-amb)0.06620.0662

Original model

This model is a quantized version of `gratex/Mistral-Small-3.2-24B-Instruct-2506-sbvr-compliance-unresolvable-pattern-finetune-v1`. Please refer to the original model card for detailed information about the fine-tuning methodology, training configuration, and HELM evaluation results.