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.0
|
| 3 |
+
base_model: Jackrong/Qwopus3.6-27B-Coder
|
| 4 |
+
tags:
|
| 5 |
+
- gguf
|
| 6 |
+
- quantization
|
| 7 |
+
- moq
|
| 8 |
+
- mixture-of-quantizations
|
| 9 |
+
- qwen3.5
|
| 10 |
+
- coder
|
| 11 |
+
- code
|
| 12 |
+
- verified
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# Qwopus3.6-27B-Coder-GGUF-Predator-Q (MoQ-4.0)
|
| 16 |
+
|
| 17 |
+
**Mixture-of-Quantizations (MoQ) 4.0 BPW GGUF for Qwopus3.6-27B-Coder.**
|
| 18 |
+
|
| 19 |
+
**Canonical Predator-Q winner as of 2026-06-24** β verified on 6 benchmarks (HumanEval+ 164, MBPP+ 100, BigCodeBench 50, LCB-30 30). See "Multi-benchmark validation" section below for the full comparison vs. ASI-Evolved v2.
|
| 20 |
+
|
| 21 |
+
## Summary
|
| 22 |
+
|
| 23 |
+
| Metric | Value |
|
| 24 |
+
|---|---|
|
| 25 |
+
| File size | **12.6 GB** |
|
| 26 |
+
| Effective BPW | 4.04 |
|
| 27 |
+
| WikiText-2 PPL (Q) | 6.18 (vs F16 base 6.02) |
|
| 28 |
+
| Mean PPL(Q)/PPL(base) | 1.026 |
|
| 29 |
+
| Mean KL divergence (vs F16) | 0.034 |
|
| 30 |
+
| Same top p (vs F16) | 91.6% |
|
| 31 |
+
| RMS Ξp | 5.43% |
|
| 32 |
+
| **HumanEval+ base pass@1** | **92.7% (152/164)** |
|
| 33 |
+
| **HumanEval+ plus pass@1** | **89.6% (147/164)** |
|
| 34 |
+
| **MBPP+ base pass@1** | **92.0% (92/100)** |
|
| 35 |
+
| **MBPP+ plus pass@1** | **79.0% (79/100)** |
|
| 36 |
+
| **BigCodeBench pass@1** | **42.0% (21/50)** |
|
| 37 |
+
| **LCB-30 pass@1** | **50.0% (15/30)** |
|
| 38 |
+
|
| 39 |
+
## Multi-benchmark validation (2026-06-24, Phase 5)
|
| 40 |
+
|
| 41 |
+
**This is the canonical winner.** A more complex alternative (ASI-Evolved v2) was built and tested on the same 4 multi-task benchmarks. Result: **no statistically significant difference** on any benchmark (all McNemar p > 0.31, Bonferroni-corrected Ξ± = 0.0167). MoQ-4.0 is preferred because it is **2 GB smaller and requires zero LLM iteration cost** to build.
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
|
| 45 |
+
| Benchmark | MoQ-4.0 (12.4 GiB) | ASI-Evolved v2 (14.4 GiB) | Ξ | McNemar p |
|
| 46 |
+
|---|---|---|---|---|
|
| 47 |
+
| HumanEval+ base (164) | 152 (92.7%) | 153 (93.3%) | +0.6pp | 0.65 |
|
| 48 |
+
| HumanEval+ plus (164) | 147 (89.6%) | 144 (87.8%) | -1.8pp | 0.65 |
|
| 49 |
+
| MBPP+ base (100) | 92 (92.0%) | 93 (93.0%) | +1.0pp | 0.56 |
|
| 50 |
+
| MBPP+ plus (100) | 79 (79.0%) | 78 (78.0%) | -1.0pp | 0.56 |
|
| 51 |
+
| BigCodeBench (50) | 21 (42.0%) | 22 (44.0%) | +2.0pp | 0.32 |
|
| 52 |
+
| LCB-30 (30) | 15 (50.0%) | 16 (53.3%) | +3.3pp | 0.72 |
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
|
| 56 |
+
The v2 model has a 16% lower KL-divergence against F16 (0.0287 vs 0.034) but **does not produce measurably better outputs on any of the 6 code tasks tested**. The 2 GB file size savings of MoQ-4.0 are pure upside.
|
| 57 |
+
|
| 58 |
+
## Pareto frontier
|
| 59 |
+
|
| 60 |
+

|
| 61 |
+

|
| 62 |
+
|
| 63 |
+
MoQ-4.0 sits at the **Pareto-optimal corner**: smaller than all baseline quantization recipes, with capability equivalent to (or statistically tied with) the larger alternatives.
|
| 64 |
+
|
| 65 |
+
## Comparison to Baselines
|
| 66 |
+
|
| 67 |
+
| Build | File Size | BPW | KL-div | Same top p | PPL ratio | LCB-30 |
|
| 68 |
+
|-------|-----------|-----|--------|------------|-----------|--------|
|
| 69 |
+
| Q4_K_M | 15.4 GB | 4.69 | 0.019 | 93.6% | 1.009 | 50.0% |
|
| 70 |
+
| 4A BEST | 16.98 GB | 5.05 | 0.018 | 93.7% | 1.012 | 50.0% |
|
| 71 |
+
| ASI-Evolved v2 | 14.4 GiB | 4.51 | 0.0287 | 92.55% | 1.020 | 53.3% |
|
| 72 |
+
| **This (MoQ-4.0)** | **12.6 GB** | **4.04** | **0.034** | **91.6%** | **1.026** | **50.0%** |
|
| 73 |
+
|
| 74 |
+
**Net result:** Same HumanEval+/MBPP+/LCB-30 capability as Q4_K_M and 4A BEST, with **18% smaller file size** than Q4_K_M and **26% smaller** than 4A BEST. ASI-Evolved v2 has a marginal KL-div win that did not translate to task performance.
|
| 75 |
+
|
| 76 |
+
## What is MoQ?
|
| 77 |
+
|
| 78 |
+
MoQ (Mixture of Quantizations) is a search-based mixed-precision quantization method by Waleed Ahmad. It estimates per-tensor "elasticity" β sensitivity to low precision β then assigns each tensor a different Q-type to minimize quality loss per bit spent. This produces non-uniform recipes like:
|
| 79 |
+
|
| 80 |
+
- `ffn_down` β IQ3_S (aggressive β most redundant tensor)
|
| 81 |
+
- `ffn_gate` β IQ3_S (aggressive)
|
| 82 |
+
- `ffn_up` β IQ4_XS (slightly more conservative)
|
| 83 |
+
- `attn_qkv` (most layers) β IQ4_XS
|
| 84 |
+
- `attn_qkv` (special every-4th full-attention layers) β split: `attn_q`=IQ4_NL, `attn_k`=bf16, `attn_v`=bf16, `attn_output`=Q5_K
|
| 85 |
+
- `token_embd` β Q4_K
|
| 86 |
+
- Norms β bf16
|
| 87 |
+
|
| 88 |
+
The recipe was applied with **importance matrix (imatrix)** calibration, which makes IQ-quant decisions properly importance-aware. Without imatrix, the same recipe produces worse KL-div (0.059 vs 0.034).
|
| 89 |
+
|
| 90 |
+
## Recipe Source
|
| 91 |
+
|
| 92 |
+
The per-tensor recipe used here is `MoQ_qwen3.6-27b_tensors_4.0.txt` from [kaitchup/Qwen3.6-27B-GGUF-MoQ](https://huggingface.co/kaitchup/Qwen3.6-27B-GGUF-MoQ). Since Qwopus3.6-27B-Coder uses the same Qwen3.5 architecture (qwen35, 64 layers, 851 tensors), the recipe transfers directly without modification.
|
| 93 |
+
|
| 94 |
+
## Build Details
|
| 95 |
+
|
| 96 |
+
```bash
|
| 97 |
+
# 1. Generate imatrix (WikiText-2 test set, 100 chunks)
|
| 98 |
+
llama-imatrix -m qwopus_f16.gguf -f wikitext-2-raw/wiki.test.raw \
|
| 99 |
+
-o qwopus_imatrix.gguf -ngl 50 --chunks 100
|
| 100 |
+
|
| 101 |
+
# 2. Quantize with MoQ recipe + imatrix
|
| 102 |
+
llama-quantize --imatrix qwopus_imatrix.gguf \
|
| 103 |
+
--tensor-type-file MoQ_qwen3.6-27b_tensors_4.0.txt \
|
| 104 |
+
qwopus_f16.gguf qwopus_moq_4.0.gguf Q4_K
|
| 105 |
+
```
|
| 106 |
+
|
| 107 |
+
## Evaluation Details
|
| 108 |
+
|
| 109 |
+
- **WikiText-2 KL-div:** `llama-perplexity -c 512 -b 512 --kl-divergence --kl-divergence-base base_logits_0.dat --chunks 50 --seed 1337`
|
| 110 |
+
- **HumanEval+ / MBPP+:** evalplus library, untrusted_check with base+plus variants, max_tokens=1024, temperature=0
|
| 111 |
+
- **BigCodeBench:** custom harness using unittest test cases, 30s timeout per problem
|
| 112 |
+
- **LCB-30:** LiveCodeBench easy subset, 30 problems Γ 3 attempts each (pass@1)
|
| 113 |
+
- **Statistical test:** McNemar's test (paired, binary outcomes), Bonferroni correction across 6 benchmarks
|
| 114 |
+
- **Base logits:** F16 GGUF reference logits saved once and reused for all variant evaluations
|
| 115 |
+
|
| 116 |
+
## Known Limitations
|
| 117 |
+
|
| 118 |
+
- **Code-specific tasks:** Tested on 6 coding benchmarks. Performance on math/reasoning/long-form generation not measured.
|
| 119 |
+
- **Long context:** Not stress-tested beyond LCB-30's 4096-token context. Qwopus's full 262K context window requires the 4D-RoPE / Mamba-SSM hybrid architecture to work correctly β preserved here since all norms/embeddings are at full precision.
|
| 120 |
+
- **KL-div is higher than Q4_K_M** (0.034 vs 0.019). This is the cost of smaller file size with mixed-precision quantization. Same top token agreement remains high (91.6%).
|
| 121 |
+
|
| 122 |
+
## Provenance
|
| 123 |
+
|
| 124 |
+
- **Base model:** [Jackrong/Qwopus3.6-27B-Coder](https://huggingface.co/Jackrong/Qwopus3.6-27B-Coder) (BF16)
|
| 125 |
+
- **Recipe source:** [kaitchup/Qwen3.6-27B-GGUF-MoQ](https://huggingface.co/kaitchup/Qwen3.6-27B-GGUF-MoQ) `MoQ_qwen3.6-27b_tensors_4.0.txt`
|
| 126 |
+
- **Methodology reference:** Waleed Ahmad's MoQ ([w-ahmad](https://huggingface.co/w-ahmad)); kaitchup substack [article](https://kaitchup.substack.com/p/moq-ggufs-and-gsq-low-bit-ggufs-are)
|
| 127 |
+
- **Calibration data:** WikiText-2 test set (~80k lines), chunks=100
|
| 128 |
+
- **Multi-benchmark validation date:** 2026-06-24 (Phase 5)
|
| 129 |
+
- **Build date:** 2026-06-23
|
| 130 |
+
- **SHA256:** `587840e75895199e5ad771bfa7dfd9682f6d85ae295ad00001b78adb485c52c1`
|
| 131 |
+
|
| 132 |
+
## Reproduce
|
| 133 |
+
|
| 134 |
+
```bash
|
| 135 |
+
# Clone recipes from kaitchup
|
| 136 |
+
wget https://huggingface.co/kaitchup/Qwen3.6-27B-GGUF-MoQ/resolve/main/MoQ_qwen3.6-27b_tensors_4.0.txt
|
| 137 |
+
|
| 138 |
+
# Download Qwopus BF16 shards and convert to F16 GGUF
|
| 139 |
+
# (see Jackrong/Qwopus3.6-27B-Coder for conversion instructions)
|
| 140 |
+
|
| 141 |
+
# Generate imatrix
|
| 142 |
+
llama-imatrix -m qwopus_f16.gguf -f wikitext-2-raw/wiki.test.raw \
|
| 143 |
+
-o qwopus_imatrix.gguf -ngl 50 --chunks 100
|
| 144 |
+
|
| 145 |
+
# Quantize
|
| 146 |
+
llama-quantize --imatrix qwopus_imatrix.gguf \
|
| 147 |
+
--tensor-type-file MoQ_qwen3.6-27b_tensors_4.0.txt \
|
| 148 |
+
qwopus_f16.gguf qwopus_moq_4.0.gguf Q4_K
|
| 149 |
+
|
| 150 |
+
# Validate
|
| 151 |
+
./llama-perplexity -m qwopus_moq_4.0.gguf -f wikitext-2-raw/wiki.test.raw \
|
| 152 |
+
-c 2048 --chunks 30
|
| 153 |
+
```
|
| 154 |
+
|
| 155 |
+
## License
|
| 156 |
+
|
| 157 |
+
Apache 2.0 (inherited from base model)
|