HLWQ — Hadamard-Lloyd Weight Quantization
Status: name reservation (v0.0.1). The full implementation will land in subsequent releases.
HLWQ is a post-training weight quantization technique for large language models. It compresses each block of weights via three steps:
- Per-block normalization to the unit hypersphere
- Walsh-Hadamard rotation to transform coordinates into approximately Gaussian random variables
- Lloyd-Max scalar quantization with centroids matched to the post-rotation Gaussian distribution
The combination achieves near-lossless compression at 5 bits per weight on Qwen3.5-9B (PPL 6.40 vs FP16 baseline 6.37), without any calibration data.
Reference
Vicentino, C. PolarQuant: Optimal Gaussian Weight Quantization via Hadamard Rotation for LLM Compression. arXiv:2603.29078, 2026.
Naming history
This technique was originally published under the name PolarQuant in the arxiv paper above. It is being rebranded to HLWQ (Hadamard-Lloyd Weight Quantization) to disambiguate from an unrelated, earlier algorithm also named PolarQuant published by Google Research:
Han, I., Kacham, P., Karbasi, A., Mirrokni, V., and Zandieh, A. PolarQuant: Quantizing KV Caches with Polar Transformation. arXiv:2502.02617, 2025.
Han et al.'s PolarQuant addresses KV cache compression with a random rotation (polar transformation). HLWQ addresses weight compression with a deterministic Walsh-Hadamard rotation. The applications and rotation mechanisms differ; only the historical name overlapped, and HLWQ is the disambiguated brand going forward.
License
Apache-2.0
Metadata
Release files for hlwq 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hlwq-0.0.1.tar.gz | 2.4 kB | Without provenance | Details for hlwq-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hlwq-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for hlwq-0.0.1-py3-none-any.whl |
Total release size: 5.0 kB
Release files / hlwq-0.0.1.tar.gz
| Download URL | hlwq-0.0.1.tar.gz |
|---|---|
| Size | 2.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ef440765060678c44877b5799ed750846cb4d1ff7ece0711bace36babbd5a2e
|
|
BLAKE2b-256 checksum How to use checksums |
604bc786b7cb2359254247021fce8ba01b89940d7913a2704405b6f6fc7cde83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / hlwq-0.0.1-py3-none-any.whl
| Download URL | hlwq-0.0.1-py3-none-any.whl |
|---|---|
| Size | 2.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d48f474262588b13e5d2fb35a34e2a18d476bf83cd74df2937caaecd4823b892
|
|
BLAKE2b-256 checksum How to use checksums |
e73ce21ac09dbdc635a846a52bbf8b3e86e3dafc8c0644a7601a9bf36e2de36a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Security for hlwq 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.