Qwen2.5-7B-Instruct-HXQ

Qwen2.5-7B-Instruct compressed with HXQ (HelixCode vector quantization).

Available as both HuggingFace safetensors (via helix-substrate) and native GGUF (via llama.cpp HXQ fork).

GGUF Runtime Benchmark (RTX 3090 Ti)

Benchmarked against standard GGUF K-quants on RTX 3090 Ti, full GPU offload (-ngl 99), using the hxq-affine-type branch at commit 580e9a2.

Decode Speed (tg128, 3 runs)

Format Size bpw tok/s vs Q4 vs Q6
Q4_K_M 4.36 GB 4.5 127.33 100% 129%
Q5_K_M 5.07 GB 5.5 117.30 92.1% 119%
HXQ_AF6 5.56 GB 6.25 114.02 89.5% 115.7%
Q6_K 5.82 GB 6.56 98.56 77.4% 100%

Perplexity (WikiText-2, 50 chunks, ctx=512)

Format bpw PPL vs Q4
HXQ_AF6 6.25 7.982 -0.333 (best)
Q6_K 6.56 8.116 -0.199
Q5_K_M 5.5 8.184 -0.131
Q4_K_M 4.5 8.315 baseline

Prefill (pp512, 3 runs)

Format tok/s vs Q4
Q5_K_M 2767 109%
Q4_K_M 2539 100%
HXQ_AF6 2293 90.3%
Q6_K 2259 89.0%

Summary: HXQ_AF6 has the lowest perplexity of all four formats and decodes 15.7% faster than Q6_K while being smaller (5.56 vs 5.82 GB). It trades ~10.5% decode speed vs Q4_K_M for better quality preservation at 6.25 bpw.

This pattern matches the 3B coder results, where HXQ also had the best PPL and fastest decode vs Q6_K.

Reproducibility

All claims are within-run comparisons using the same dataset, llama.cpp commit, and hardware. Do not compare these PPL numbers with numbers from other runs using different model variants, dataset files, or build configurations.

Receipt with SHA256 artifact hashes, exact commands, and dataset provenance: hxq_runtime_3090ti_qwen7b_instruct_20260509

Install and Run

Option 1: Native GGUF (llama.cpp)

# Build llama.cpp with HXQ support
git clone -b hxq-affine-type https://github.com/echo313unfolding/llama.cpp.git
cd llama.cpp && mkdir build && cd build
cmake .. -DGGML_CUDA=ON && make -j$(nproc) llama-cli

# Run
./bin/llama-cli -m qwen2.5-7b-instruct-hxq-affine6.gguf \
  -ngl 99 -p "Explain the theory of relativity in simple terms:" -n 128

Option 2: HuggingFace (Python)

pip install "helix-substrate[hf]"
import helix_substrate  # registers the HXQ quantizer with HuggingFace
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("EchoLabs33/qwen2.5-7b-instruct-hxq")
tokenizer = AutoTokenizer.from_pretrained("EchoLabs33/qwen2.5-7b-instruct-hxq")

inputs = tokenizer("Explain the theory of relativity in simple terms:", return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=128)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Safetensors Benchmark

Dense (BF16) HXQ (safetensors)
Size 14.2 GB 6.5 GB
Perplexity (WikiText-2, 2048 ctx) 6.949 7.388 (+6.34%)
Compression ratio 1x 2.2x
Compressed modules 0 196 HelixLinear layers

Note: The safetensors PPL (7.388) and GGUF PPL (7.982) use different evaluation configurations (ctx=2048/stride=512 vs ctx=512/50 chunks). They are not directly comparable.

Good to Know

  • GPU and CPU supported — runs on any CUDA GPU or CPU via standard PyTorch. Native GGUF runs via llama.cpp.
  • Fine-tunable via LoRA — compressed weights remain frozen, but LoRA adapters attach to each HelixLinear layer via HelixLinearSTE. See helix-substrate for training infrastructure.
  • Requires helix-substrate for safetensors path — the quantizer is not built into transformers.
  • Requires llama.cpp HXQ fork for GGUF path — standard llama.cpp does not have HXQ type support yet.
  • Tied embeddingslm_head shares embed_tokens, stored at full precision.

What is HXQ?

HXQ is a weight compression codec based on vector quantization with per-group affine correction:

  • Each weight matrix is replaced by a 256-entry codebook + uint8 index matrix + per-group affine scale/offset
  • The compressed form is the executable — codebook[indices] * scale + offset during matmul, no decompression step
  • Works on any nn.Linear regardless of architecture (Transformer, Mamba, MLP)
  • No calibration data required — codebooks are fit from the weights alone via k-means
  • 6.25 bits per weight in the GGUF affine-6 format

Companion Models

Same codec, multiple architectures:

Model Architecture GGUF Safetensors
qwen2.5-coder-3b-hxq Transformer (code) Yes Yes
qwen2.5-3b-instruct-hxq Transformer Yes Yes
qwen2.5-coder-1.5b-hxq Transformer (code) Yes Yes
qwen2.5-14b-instruct-hxq Transformer Yes Yes
qwen2.5-sentinel-3b-hxq Transformer (security) Yes

Citation

@software{hxq_2026,
  title={HXQ: Vector Quantization with Per-Group Affine Correction for Neural Network Weight Compression},
  author={Echo Labs},
  year={2026},
  url={https://github.com/echo313unfolding/helix-substrate}
}

License

Apache 2.0 (inherited from Qwen/Qwen2.5-7B-Instruct).

Downloads last month
48
Safetensors
Model size
8B params
Tensor type
I64
·
F32
·
U8
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for EchoLabs33/qwen2.5-7b-instruct-hxq

Base model

Qwen/Qwen2.5-7B
Quantized
(416)
this model

Collection including EchoLabs33/qwen2.5-7b-instruct-hxq

Evaluation results