How to use from
MLX LM
Generate or start a chat session
# Install MLX LM
uv tool install mlx-lm
# Interactive chat REPL
mlx_lm.chat --model "hermitdave/Spark-X2.6-4B-MLX-MACaQ-Hadamard-4.25bpw"
Run an OpenAI-compatible server
# Install MLX LM
uv tool install mlx-lm
# Start the server
mlx_lm.server --model "hermitdave/Spark-X2.6-4B-MLX-MACaQ-Hadamard-4.25bpw"
# Calling the OpenAI-compatible server with curl
curl -X POST "http://localhost:8080/v1/chat/completions" \
   -H "Content-Type: application/json" \
   --data '{
     "model": "hermitdave/Spark-X2.6-4B-MLX-MACaQ-Hadamard-4.25bpw",
     "messages": [
       {"role": "user", "content": "Hello"}
     ]
   }'
Quick Links

Spark-X2.6-4B — MLX MACaQ Hadamard W4A16

A 32-block Hadamard-rotated MACaQ quantization of XHToken/Spark-X2.6-4B at 4.25 bpw. Unlike Spark-X2.6-1.7B, the rotated path measurably helps this checkpoint: it is the best 4-bit variant we tested on both zero-shot tasks and WikiText-2 perplexity.

This checkpoint ships a model_file shim. Load it with trust_remote_code=True, including in oMLX.

Validation

Perplexity

Pinned WikiText-2 test corpus (199,902 tokens, context 2048):

Model PPL ↓
BF16 23.14
MACaQ Hadamard 4.25 25.73
MACaQ weight-only 4.25 25.78
RCO 4.5 nominal 27.71
MXFP4 RTN 4.25 129.63

Throughput

M3 Max (64 GB), natural WikiText-2 prompt (~988 tokens), 256 generated tokens, mlx_lm.generate:

Model Prompt TPS Decode TPS Peak memory
BF16 1292.7 41.3 8.98 GB
MACaQ Hadamard 4.25 1171.3 96.0 3.71 GB
MACaQ weight-only 4.25 1274.0 122.2 3.24 GB
RCO 4.5 nominal 1272.0 104.6 3.85 GB

The weight-only variant is the faster fallback; Hadamard is the quality choice.

Zero-shot evaluation

model-eval, 400 items per task, Wilson 95% confidence intervals:

Task BF16 MACaQ Hadamard Δ p (McNemar) MACaQ weight-only RCO 4.5
ARC-Challenge 0.3475 [0.303, 0.395] 0.3550 [0.310, 0.403] +0.0075 0.7359 0.3025 [0.260, 0.349] 0.3000 [0.257, 0.347]
ARC-Easy 0.5775 [0.529, 0.625] 0.5775 [0.529, 0.625] 0.0000 1.0000 0.5175 [0.469, 0.566] 0.5225 [0.474, 0.571]
HellaSwag 0.4000 [0.353, 0.449] 0.3800 [0.334, 0.429] −0.0200 0.0386 0.4000 [0.353, 0.449] 0.3800 [0.334, 0.429]
WinoGrande 0.5350 [0.486, 0.583] 0.5575 [0.509, 0.605] +0.0225 0.3425 0.5200 [0.471, 0.569] 0.5175 [0.469, 0.566]
MMLU 0.3225 [0.279, 0.370] 0.3050 [0.262, 0.352] −0.0175 0.3240 0.2825 [0.241, 0.329] 0.2700 [0.229, 0.316]

Δ and p compare Hadamard against BF16 on the same items (exact two-sided McNemar). Statistically lossless verdict: yes under Bonferroni correction across five tasks (α = 0.01): no task has a significant degradation. HellaSwag is nominally p = 0.0386 but does not survive correction; under an uncorrected α = 0.05 rule it would fail.

Other paired comparisons:

  • Hadamard vs weight-only: ARC-Challenge p = 0.0046 and ARC-Easy p = 0.0079 favour Hadamard.
  • Hadamard vs RCO: ARC-Challenge p = 0.0038 and ARC-Easy p = 0.0103 favour Hadamard (ARC-Easy is borderline after correction).

Full tables, paired statistics and the RCO recipe are in macaq-mlx/docs/SPARK26_4B_EVAL.md. Raw results are in validation/.

Method

For each quantized linear: apply the per-channel scale t, rotate into a 32-block Walsh-Hadamard basis, screen exponents under the diagonal Hessian, then Flip-Refinement under the full rotated Hessian. Weights are stored as MLX-native MXFP4 E8M0 codes; activations are rotated online by the shipped macaq_model.py.

Calibration: 65,536 WikiText tokens, 512-token sequences, ridge 1.0, alpha 1.0, 256 flip sweeps. The fused flip kernel from macaq_refine.py was used during quantization.

Attribution

MACaQ algorithm: Huawei CSL MACaQ (Apache-2.0). Fused flip kernel adapted from rgarcia-fx/macaq-mlx (Apache-2.0). This port and validation were developed with Hermes Agent. Base model © XHToken/SparkLLM, Apache-2.0.

Downloads last month
300
Safetensors
Model size
0.9B params
Tensor type
BF16
·
U8
·
U32
·
MLX
Hardware compatibility
Log In to add your hardware

Quantized

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for hermitdave/Spark-X2.6-4B-MLX-MACaQ-Hadamard-4.25bpw

Quantized
(72)
this model

Collection including hermitdave/Spark-X2.6-4B-MLX-MACaQ-Hadamard-4.25bpw