Views
No views yet
[!IMPORTANT] Naming notice (2026-04-10). The "HLWQ" technique used in this model is being rebranded to HLWQ (Hadamard-Lloyd Weight Quantization). The change is only the name; the algorithm and the weights in this repository are unchanged.The rebrand resolves a name collision with an unrelated, earlier KV cache quantization method also named HLWQ (Han et al., arXiv:2502.02617, 2025). HLWQ addresses weight quantization with a deterministic Walsh-Hadamard rotation and Lloyd-Max scalar codebook; Han et al.'s HLWQ addresses KV cache quantization with a random polar rotation. The two methods are technically distinct.Existing loaders that load this repository by ID continue to work without changes. Future model uploads will use the HLWQ name.Reference paper for this technique: arXiv:2603.29078 (v2 in preparation; v1 still uses the old name).
| Metric | Value |
|---|---|
| Method | HLWQ Q4 (MLX) |
| Perplexity (WikiText-2) | 6.90 |
| Throughput | 19.7 tok/s |
| Memory | 4.8 GB |
| Platform | Mac mini M4 |
| Quantization | 4-bit with Hadamard rotation |


| Method | tok/s | Memory | PPL | Platform |
|---|---|---|---|---|
| FP16 baseline | 45.7 | 17.9 GB | 6.37 | RTX PRO 6000 |
| HLWQ Q5 + torchao | 43.1 | 6.5 GB | 6.56 | RTX PRO 6000 |
| torchao INT4 (absmax) | 43.3 | 6.3 GB | 6.68 | RTX PRO 6000 |
| HLWQ MLX Q4 | 19.7 | 4.8 GB | 6.90 | Mac mini M4 |
Runs comfortably on any Mac with 8 GB+ unified memory. No GPU required -- Metal handles everything.
pip install mlx-lm1from mlx_lm import load, generate
2
3model, tokenizer = load("caiovicentino1/Qwen3.5-9B-HLWQ-MLX-4bit")
4
5response = generate(
6 model, tokenizer,
7 prompt="Explain the theory of relativity in simple terms:",
8 max_tokens=200,
9 verbose=True # Shows tok/s
10)
11print(response)1mlx_lm.generate \
2 --model caiovicentino1/Qwen3.5-9B-HLWQ-MLX-4bit \
3 --prompt "Write a Python function to sort a list:" \
4 --max-tokens 3001mlx_lm.chat \
2 --model caiovicentino1/Qwen3.5-9B-HLWQ-MLX-4bit \
3 --max-tokens 500Original Weights --> Normalize --> Hadamard Rotate --> Lloyd-Max Q4 --> MLX Format
|
Metal Acceleration <-- MLX Inference <-- Dequant --+| Component | Details |
|---|---|
| Framework | MLX (Apple's ML framework for Apple Silicon) |
| Quantization | HLWQ Q4 (4-bit, block_size=128) |
| Rotation | 128x128 Walsh-Hadamard (self-inverse, deterministic) |
| Centroids | Pre-computed MSE-optimal for N(0,1) |
| Acceleration | Metal Performance Shaders (MPS) |
| Compatibility | Mac M1/M2/M3/M4 (8 GB+ unified memory) |
| Requirement | Minimum | Recommended |
|---|---|---|
| macOS | 13.5+ (Ventura) | 14.0+ (Sonoma) |
| Apple Silicon | M1 | M4 |
| Unified Memory | 8 GB | 16 GB |
| Python | 3.10+ | 3.11+ |
| mlx | 0.5.0+ | Latest |
1@article{vicentino2026polarquant,
2 title={HLWQ: Optimal Gaussian Weight Quantization via Hadamard Rotation for LLM Compression},
3 author={Vicentino, Caio},
4 journal={arXiv preprint arXiv:2603.7424577},
5 year={2026}
6}