Qwen2.5-3B SiliQuant A16 + Block-H4 (QuadSnake, 3.0 bpw)
An aggressive 3.0 bpw target (3.9116 bpw effective packed) quantization of Qwen/Qwen2.5-3B using A_16 Extended Hamming [16, 11, 4], Block-H4 Hadamard rotation, and QuadSnake serpentine load balancing (1.98 GB, 3.1175x total / 4.0904x quantized compression).
This release introduces the following key architectural and empirical highlights:
- Widening Relative Advantage at Low Bitwidths (
-11.42%KL) – BeatsBlock-H2at3.0 bpwby-11.42%WikiText-2 KL (0.168874vs0.190650) — a2.70xlarger relative margin than at4.5 bpw— and beats global sort by-14.38%(0.197239). - Sub-
2 GBCheckpointing With0Syndrome Errors – ShrinksQwen2.5-3Bmodel.safetensorsto1,979,680,423 B(1.84 GiB,248layers atk_bits=3+4layers atk_bits=2,g=128) with zero SECDED failures. - Compact Quotient Bit Allocation – Retains
12.140713WikiText-2 PPL (81.4824%top-1) and3.593180CPython PPL (86.4726%top-1) under4.0904xweight compression.
Models Overview
Every quantized weight vector $y \in A_{16} = 2\mathbb{Z}^{16} + C_{[16,11,4]}$ is algebraically encoded via Extended Hamming [16, 11, 4] systematic bits (qham11, 0.6875 bpw reconstructing the 5 parity coordinates {0, 1, 2, 4, 8}), minimum-byte packed quotients (qquot, k_bits in {2, 3, 4}), sparse CSR overflow tuples (qov_rowptr, qov_col, qov_val), and exact IEEE-754 integer bit patterns for block scales (scales_fp16_bits, colscale_fp32_bits) immune to BF16 mantissa truncation. Embeddings, lm_head, RMSNorm weights, and biases remain in untouched bfloat16.
| Property | Specification |
|---|---|
| Base Model & Architecture | Qwen/Qwen2.5-3B (qwen2, tie_word_embeddings=True) |
| Format & Recipe | siliquant-hf-v1 (b30_hA16_BlockH4_quad_snake_real, group size g=128, target 3.0 bpw) |
| Quantized Linear Layers | 252 layers (2,774,532,096 weights; k_bits=2: 4 layers, k_bits=3: 248 layers) |
| Rotation & Permutation | Block-H4 4-point Hadamard transform with serpentine QuadSnake ordering (use_colscale=True) |
| Effective Quantized Bitwidth | 3.9116 bpw (4.0904x quantized / 3.1175x total vs BF16) |
| SECDED Verification | 0 syndrome errors across 173,408,256 A_16 blocks (max_abs_roundtrip_diff=0.0) |
| Checkpoint Footprint | 1,979,680,423 B (1.84 GiB, model.safetensors) |
| Calibration Protocol | 6,144 disjoint WikiText-2 validation tokens (12 x 512) |
model.safetensors SHA-256 | 75d466506ede2489233cbcfd0993e14f7c0096639c82a25490e0c2442ea045a3 |
Benchmark Results & Pareto Evaluations
All quantized perplexity and token-distribution divergence metrics below are measured directly against the untouched Qwen/Qwen2.5-3B BF16 reference under identical evaluation splits:
| Evaluation Metric | BF16 Reference | This Release | Comparison vs Prior Baselines |
|---|---|---|---|
| WikiText-2 Validation PPL | 10.970193 | 12.140713 | 0.168874 KL (-11.42% vs Block-H2, -14.38% vs global sort) |
| WikiText-2 Top-1 Agreement | 100.0% | 81.4824% | 2.70x wider margin over Block-H2 than at 4.5 bpw |
| CPython Held-Out PPL | 3.111936 | 3.593180 | 0.151010 mean KL divergence |
| CPython Top-1 Agreement | 100.0% | 86.4726% | 3.9116 bpw (4.0904x quant / 3.1175x total compression) |
Energy Efficiency & Power Profile
| Hardware Target | Workload / Telemetry Scope | Avg Power (W) | Energy / Token (J/tok) | Efficiency (tok/J) | Run Energy (Wh/run) | Measurement Status |
|---|---|---|---|---|---|---|
RTX 3080 Laptop GPU (8 GiB) | Quantization sweep boundary (idle -> post) | 13.27 W -> 20.70 W (end idle boundary) | Not recorded | Not recorded | Not recorded | Not recorded (54 -> 61 °C, 0 throttles; NVML active inference telemetry absent) |
Host CPU (multi-arm sweep total) | Combined 7,091.2 s campaign envelope | ~24.49 W sweep mean | Not applicable | Not applicable | 48.24 Wh (full multi-arm campaign RAPL: 173,656.88 J) | Campaign host RAPL only; per-model serving energy not recorded |
[!NOTE] Energy readings are not guaranteed to be consistent due to uncontrollable variables (thermal state, ambient temperature, fan curve, and dynamic power limits).
Getting Started
Install dependencies:
pip install -U torch transformers safetensors accelerate
Run standard Hugging Face inference with transformers from_pretrained (zero custom CUDA/C++ compilation required):
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL_ID = "ahrazzle/Qwen2.5-3B-Siliquant-A16-BlockH4-QuadSnake-3.0bpw"
device = "cuda" if torch.cuda.is_available() else "cpu"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID,
trust_remote_code=True,
dtype="auto",
# Optional (requires `accelerate`): device_map="auto",
).to(device)
inputs = tokenizer("The exact identity of the Hadamard matrix is", return_tensors="pt").to(device)
with torch.inference_mode():
outputs = model.generate(**inputs, max_new_tokens=48, do_sample=False)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
hf download ahrazzle/Qwen2.5-3B-Siliquant-A16-BlockH4-QuadSnake-3.0bpw --local-dir ./Qwen2.5-3B-Siliquant-A16-BlockH4-QuadSnake-3.0bpw
cd ./Qwen2.5-3B-Siliquant-A16-BlockH4-QuadSnake-3.0bpw
python3 -B siliquant_dequant.py verify .
python3 -B siliquant_dequant.py unpack . --out unpacked_bf16.safetensors --dtype bfloat16
siliquant_dequant.py verify .checks every file SHA-256 listed insiliquant_verification_receipt.json(rejecting tampered, missing, unlisted, or symlinked files) and verifies[16, 11, 4]codec parity across 100% ofA_16blocks.
kernels/sm86_a16_blockh4.cu— standalone reference zero-spill Amperesm_86PTX fused4-bit nibble-packedA_16+Block-H4dp4a.s32.s32GEMV kernel.kernels/avx512_a16_blockh4.c— standalone reference IntelAVX-512(vpermb+vpopcntq+vpdpbusd) CPUA_16+Block-H4GEMV decoder.- Note: The shipped checkpoint uses lossless packed
qham11+qquot+ CSR containers for bit-exact distribution; dense BF16 unpacking or nibble re-packing converts between archive and streaming kernel layouts.
Custom Infrastructure Stack & Source Repositories
Every open-source component used to design, quantize, compile, verify, and execute this release is publicly available below:
| Stack Layer | Component | Role in This Release | Public Repository |
|---|---|---|---|
| Lattice Quantization & ECC | SiliQuant | [16, 11, 4] Extended Hamming A_16 + Block-H4 quantization, QuadSnake/QuadLPT recipes, & lossless siliquant-hf-v1 packing/verification | Moissanite-Labs/siliquant |
| Bare-Metal Silicon Kernels | SiliKernels | Zero-spill Ampere sm_86 PTX CUDA (sm86_a16_blockh4.cu) & Intel AVX-512 VBMI/VNNI C11 (avx512_a16_blockh4.c) dequant/GEMV kernels | Moissanite-Labs/silikernels |
| Verified Zero-Spill Compiler | HoloEmit | Formally verified pure-Init Lean 4.36.0 compiler targeting zero-spill sm_86 PTX & AVX-512 C11 [16, 11, 4] SECDED decoders | Moissanite-Labs/holoemit |
| Metrology & Telemetry | SiliSense | Pure-stdlib silicon physics metrology, contention sentinel, & .sys hardware fault-canary telemetry | Moissanite-Labs/silisense |
| Workbench OS | ML-OS | Research workbench OS providing deterministic run stamping, CPU/GPU lease discipline, & environment hygiene | Moissanite-Labs/ml-os |
| Verification & Audit Harness | Aletheia | 3-mode isolated -I parity, fail-closed receipt verification, mutation auditing, & secret/path leak scanning | Foundation-0/aletheia |
| Five-Layer Stack Blueprint | Siliconcordat | Open L1–L5 stack specification (loom · weft · warp · exo · mde) | siliconcordat/.github |
Usage, Scope & Honest Limitations
- Intended Usage – Research evaluation and quantized inference of
Qwen/Qwen2.5-3Bvia Hugging Facetransformersfrom_pretrained, or dense weight inspection viasiliquant_dequant.py. - Observed Limitations & Format Boundaries – Loading with
transformersfrom_pretraineddequantizes layers in PyTorch rather than dispatching directly to the bundled fixed-4-bit PTX/AVX-512 reference GEMV kernels. At3.0 bpwtarget bitwidth (k_bits=2,3), long-horizon reasoning and exact syntax preservation incur higher divergence (+1.17WT2 PPL over BF16) than4.5 bpwvariants. - Hardware & Telemetry Scope – Where full E2E serving NVML telemetry was not separately captured at quantization time, GPU power/energy fields explicitly report
Not recorded (NVML active inference telemetry absent in run receipt)rather than extrapolating. - License Inheritance – Qwen Research License (inherited from
Qwen/Qwen2.5-3B; upstream notice preserved inNOTICE_UPSTREAM_LICENSE.txt).
Citation
@misc{moissanitelabs2026qwen253bsiliquanta16blockh4q,
title={Qwen2.5-3B SiliQuant A16 + Block-H4 (QuadSnake, 3.0 bpw)},
author={Moissanite Labs and Foundation-0},
year={2026},
howpublished={\url{https://huggingface.co/ahrazzle/Qwen2.5-3B-Siliquant-A16-BlockH4-QuadSnake-3.0bpw}}
}