StillDeadcode's picture
Card: the final state (T1+T2 leaderboard, public scoring subset, calib Hessians)
2dcf006 verified
|
Raw History Blame Contribute Delete
19.1 kB
---
license: other
license_name: mixed-open
license_link: LICENSE.md
language:
- multilingual
pretty_name: Qwen3.8-27B Quantization Challenge
size_categories:
- 10M<n<100M
tags:
- quantization
- calibration
- kl-divergence
- gptq
- hessian
- long-context
- agentic
configs:
- config_name: calib
data_files: corpus/calib.jsonl
- config_name: public
data_files: corpus/public.jsonl
---
# Qwen3.8-27B Quantization Challenge
Quantize [Qwen/Qwen3.8-27B](https://huggingface.co/Qwen/Qwen3.8-27B) and stay as close to it as
possible. Entries are scored by the KL divergence of their next-token distribution from the BF16
model's, teacher-forced over a **private corpus** drawn the same way as the two published here.
The [leaderboard](https://radiance.stilldeadco.de/leaderboard) scores a fixed 1,448,401-token subset of it.
| | calib | public (scoring subset) | private (not released) |
|---|---:|---:|---:|
| tokens | **10,259,331** | **1,694,621** | **10,324,055** |
| documents | 4,789 | 596 | 4,748 |
| 256K-token agentic traces | 8 | 2 | 8 |
- **calib** is for calibration: GPTQ, AWQ, imatrix, QAT, anything. It comes with the BF16 model's
**Hessian of every linear's input** over the whole corpus (257 files) and its golden distributions.
- **public** is for scoring yourself: 596 documents of its
4,760-document split, every 8th one, and 2 of its 8 agentic traces, cut
the way the leaderboard cuts the private corpus. Its golden distributions use exactly the format
and settings that score the private corpus.
- **private** has the same mix, sampled with a different seed stream and disjoint from both. Its
sha256 is in `corpus/manifest.json`, so the scoring corpus is fixed before any entry exists.
## How the references were made
- Model: Qwen3.8-27B in BF16, every weight as released.
- Engine: [radiance](https://codeberg.org/StillDeadcode/radiance) on 2x AMD Radeon AI PRO R9700
(tensor parallel 2).
- KV cache: BF16. Tensor-parallel wire: exact (BF16 partial sums, never an 8-bit wire).
- Teacher forcing: every document goes through prefill once, with the prefix cache and
speculation off. Each position's full 248,320-token distribution is computed in f32.
- The official FP8 checkpoint was scored with the same settings, run from its own weights
byte for byte.
## Corpus
Each line of `corpus/<split>.jsonl` is
`{"source", "category", "kind", "tokens", "prompt"}`. `prompt` is the exact text the model reads:
plain text, or a conversation already rendered with Qwen3.8's chat template (`kind: chat`).
`tokens` counts the Qwen3.8 tokenizer's tokens, with no BOS. Every token is scored from the first.
Tokens by category:
| category | calib | public | private |
|---|---:|---:|---:|
| long-agentic | 1,980,045 | 490,721 | 1,992,019 |
| agentic | 1,089,833 | 226,585 | 1,064,965 |
| code | 1,007,333 | 112,585 | 1,008,026 |
| web | 900,144 | 113,445 | 901,666 |
| reasoning | 714,092 | 57,401 | 712,599 |
| chat | 704,539 | 119,711 | 700,808 |
| multilingual | 656,900 | 94,789 | 669,740 |
| science | 604,894 | 78,102 | 617,742 |
| books | 559,476 | 62,085 | 560,684 |
| math | 502,916 | 62,072 | 504,829 |
| long | 421,934 | 127,103 | 475,772 |
| tools | 410,310 | 59,309 | 410,778 |
| encyclopedic | 301,326 | 43,163 | 300,719 |
| qa | 300,166 | 41,576 | 300,175 |
| legal | 105,423 | 5,974 | 103,533 |
Documents are capped at 8K-100K tokens depending on the source (the `long` category runs to 100K).
They are deduplicated by content hash across all three splits and dealt round-robin, so each
split has the same mix. Chat, reasoning, tool-calling and agentic sources keep their assistant
turns, including thinking blocks.
### The 256K-token agentic traces
Each split holds 8 agentic coding sessions of about 250K tokens (the published public subset 2 of
its 8), generated for this challenge by
Qwen3.8-27B itself (the official FP8 checkpoint, its default sampling settings). Each session
works on a real open-source repository pinned to a commit, inside an offline sandbox. It has
`bash`, `read_file`, `write_file` and `edit_file` tools and works through a queue of engineering
tasks: orientation, running and fixing the tests, code review, edge-case and property tests, a
small feature, a refactor, a benchmark, error handling, documentation, typing, git archaeology
and a final self-review. It runs until it reaches 245K tokens. The whole session is one document, rendered with the chat
template, tool definitions included: what the model read before its last turn, plus that turn.
Each split uses different repositories.
| split | repository | commit | tokens | turns |
|---|---|---|---:|---:|
| calib | [attrs](https://github.com/python-attrs/attrs) | `ee66e72748` | 246,898 | 157 |
| calib | [click](https://github.com/pallets/click) | `2247b35ea1` | 245,120 | 172 |
| calib | [cobra](https://github.com/spf13/cobra) | `adbc881390` | 245,199 | 125 |
| calib | [express](https://github.com/expressjs/express) | `1c6f1b0fe4` | 253,163 | 134 |
| calib | [lua](https://github.com/lua/lua) | `8cb93bada5` | 248,066 | 142 |
| calib | [requests](https://github.com/psf/requests) | `611c6162cb` | 245,667 | 166 |
| calib | [rich](https://github.com/Textualize/rich) | `9d8f9a372c` | 250,158 | 169 |
| calib | [ripgrep](https://github.com/BurntSushi/ripgrep) | `6892bc2b7e` | 245,774 | 126 |
| public | [flask](https://github.com/pallets/flask) | `d086db856b` | 245,423 | 177 |
| public | [tqdm](https://github.com/tqdm/tqdm) | `9cf5a12b1f` | 245,298 | 116 |
### Sources
| dataset | revision | licence |
|---|---|---|
| [HuggingFaceFW/fineweb-edu](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu) | `87f09149ef` | ODC-By 1.0 |
| [epfml/FineWeb2-HQ](https://huggingface.co/datasets/epfml/FineWeb2-HQ) | `c0c06e94fd` | ODC-By 1.0 |
| [wikimedia/wikipedia](https://huggingface.co/datasets/wikimedia/wikipedia) | `b04c8d1ceb` | CC BY-SA 3.0 / GFDL |
| [common-pile/wikimedia_filtered](https://huggingface.co/datasets/common-pile/wikimedia_filtered) | `0641bb84bd` | openly licensed, each record's licence in its metadata (Common Pile v0.1) |
| [common-pile/arxiv_papers_filtered](https://huggingface.co/datasets/common-pile/arxiv_papers_filtered) | `033cf7f53f` | openly licensed, each record's licence in its metadata (Common Pile v0.1) |
| [common-pile/peS2o_filtered](https://huggingface.co/datasets/common-pile/peS2o_filtered) | `297747513b` | openly licensed, each record's licence in its metadata (Common Pile v0.1) |
| [common-pile/pubmed_filtered](https://huggingface.co/datasets/common-pile/pubmed_filtered) | `c156f0569a` | openly licensed, each record's licence in its metadata (Common Pile v0.1) |
| [HuggingFaceTB/finemath](https://huggingface.co/datasets/HuggingFaceTB/finemath) | `e92b25a616` | ODC-By 1.0 |
| [common-pile/libretexts_filtered](https://huggingface.co/datasets/common-pile/libretexts_filtered) | `70388bca52` | openly licensed, each record's licence in its metadata (Common Pile v0.1) |
| [emozilla/pg19](https://huggingface.co/datasets/emozilla/pg19) | `c021754c8e` | public-domain books (PG-19) |
| [common-pile/project_gutenberg_filtered](https://huggingface.co/datasets/common-pile/project_gutenberg_filtered) | `3cdf6879c8` | openly licensed, each record's licence in its metadata (Common Pile v0.1) |
| [common-pile/doab_filtered](https://huggingface.co/datasets/common-pile/doab_filtered) | `defb24ca72` | openly licensed, each record's licence in its metadata (Common Pile v0.1) |
| [common-pile/caselaw_access_project_filtered](https://huggingface.co/datasets/common-pile/caselaw_access_project_filtered) | `50e1961a5e` | openly licensed, each record's licence in its metadata (Common Pile v0.1) |
| [common-pile/stackexchange_filtered](https://huggingface.co/datasets/common-pile/stackexchange_filtered) | `c0ac737383` | openly licensed, each record's licence in its metadata (Common Pile v0.1) |
| [common-pile/stackv2_edu_filtered](https://huggingface.co/datasets/common-pile/stackv2_edu_filtered) | `c354dbe884` | openly licensed, each record's licence in its metadata (Common Pile v0.1) |
| [bigcode/the-stack-smol-xl](https://huggingface.co/datasets/bigcode/the-stack-smol-xl) | `e782ebf35c` | permissively licensed source files (each file's own licence) |
| [allenai/WildChat-4.8M](https://huggingface.co/datasets/allenai/WildChat-4.8M) | `c827c6df8f` | ODC-By 1.0 |
| [HuggingFaceTB/smoltalk2](https://huggingface.co/datasets/HuggingFaceTB/smoltalk2) | `fc6cc2103c` | see the source's card |
| [open-thoughts/OpenThoughts3-1.2M](https://huggingface.co/datasets/open-thoughts/OpenThoughts3-1.2M) | `61bcf9d4eb` | Apache 2.0 |
| [NousResearch/hermes-function-calling-v1](https://huggingface.co/datasets/NousResearch/hermes-function-calling-v1) | `dae3e1d28c` | Apache 2.0 |
| [glaiveai/glaive-function-calling-v2](https://huggingface.co/datasets/glaiveai/glaive-function-calling-v2) | `e7f4b64560` | Apache 2.0 |
| [nvidia/When2Call](https://huggingface.co/datasets/nvidia/When2Call) | `0582f7749d` | CC BY 4.0 |
| [nebius/SWE-rebench-openhands-trajectories](https://huggingface.co/datasets/nebius/SWE-rebench-openhands-trajectories) | `35455389ab` | CC BY 4.0 |
| [nvidia/Nemotron-SWE-v1](https://huggingface.co/datasets/nvidia/Nemotron-SWE-v1) | `0fe17a965b` | CC BY 4.0 |
| [SWE-bench/SWE-smith-trajectories](https://huggingface.co/datasets/SWE-bench/SWE-smith-trajectories) | `08e109b4a5` | MIT |
| agent traces (this dataset) | generated | Apache 2.0 (the model's output); repository content keeps its own licence |
Filtering per source: language and quality filters where the source offers them, a prose check on
book and web text, and an article filter on Wikimedia. Each source's scanned, accepted and skipped
counts are in `corpus/manifest.json` under `datasets.sources`.
## Golden distributions: `golden/<split>/` (42.2 GB + 7.0 GB)
The BF16 model's next-token distribution at every scored position, stored sparse: the 512 most
likely tokens exactly, plus the mass of the rest.
| file | layout |
|---|---|
| `kld.json` | `format` (`radiance-kld-top-1`), `n_vocab`, `top` (512), `rows`, and `docs`: one `{source, tokens, score_from, row0}` per document |
| `tokens.i32` | every document's tokens, concatenated, int32 |
| `top.bin` | `[rows, 512]` of `{int32 id, float32 log p}`, most likely first |
| `rows.f32` | `[rows, 3]` float32: the reference's NLL of the true next token, its entropy (nats), and the tail mass `1 - sum(exp(top lp))` summed from the full row |
| `gen.u8` | `[rows]` uint8: 1 where the row's next token is one the model writes itself (scored), 0 where the prompt supplies it |
Document `d` has `tokens - 1 - score_from` rows, starting at `row0`. Row `row0 + j` is the
distribution after token `score_from + j`, predicting token `score_from + j + 1`.
### The score
Per position, the candidate's distribution `q` is coarsened onto the reference's 513 cells (its
512 tokens and one tail cell holding the rest of `q`'s mass), and
`KL(p || q) = sum_i p_i (log p_i - log q_i)` over the 513 cells.
This is a lower bound on the full-vocabulary KL. At 512 tokens the tail mass is small: its
median per position is below 1e-6. **Mean KL over the scored positions ranks the leaderboard.** The
leaderboard also shows the median, p99 and p99.9 KL, top-1 agreement (argmax match), the
perplexity ratio, and the mean KL over the 256K-token traces alone.
Only the positions the model writes itself are scored (`gen.u8`): all of a plain-text document,
and in a chat the body of each assistant turn, tool calls included, up to and including the
`<|im_end|>` closing it. System and user turns (tool results arrive in user turns), the
`<|im_start|>role\n` header each turn opens with and the tokens between turns are the prompt's. There
the BF16 model's own distribution is arbitrary (it expects a turn to end in the middle of a JSON tool
result), so those rows would carry most of the KL while saying little about a quant.
## Hessians: `hessians/calib/` (50.4 GB)
`H = sum over tokens of x x^T` for the whole input `x` of every linear in the text model. That is
the matrix GPTQ / OBQ / LDLQ start from, accumulated over every token of the corpus. One
safetensors file per input. Linears that read the same input share one file: q/k/v (or the delta
net's in-projections) share the layer input, and gate/up share the post-attention input.
- `hessian_upper`: f32 `[k (k + 1) / 2]`, the upper triangle packed row by row (row `i`'s entries
`j = i .. k-1` after row `i-1`'s).
- metadata: `k`, `rows` (tokens summed), `linears` (the checkpoint tensors that read this input).
- H is the raw sum: divide by `rows` for the second moment. Under tensor parallelism the inputs
split by column (`o_proj`, `out_proj`, `down_proj`) were gathered to their full width first, so
every file holds the whole matrix, cross terms included.
```python
import numpy as np, safetensors.numpy as st
t = st.load_file("hessians/calib/model.language_model.layers.3.mlp.down_proj.input.safetensors")["hessian_upper"]
k = int((np.sqrt(8 * t.size + 1) - 1) / 2)
H = np.zeros((k, k), np.float32); H[np.triu_indices(k)] = t; H = H + np.triu(H, 1).T
```
## Scoring an entry yourself
- **GGUF** (llama.cpp): `tools/llama_kld.cpp` is a single-file scorer that builds against llama.cpp
(see its header). It reads `golden/public/` and writes a report over every row and the per-row
results beside it (`report.json.rows`), with a BF16 KV cache and flash attention.
- **radiance**: `radiance --model ENTRY.rad --tp 2 --kv-cache-dtype bf16 --tp-wire exact
--max-model-len 262144 --kld-ref golden/public --kld-out report.json`, the same two files
(the per-row file from radiance 1.13.0 on).
- Either report scores every row; `python tools/mergerep.py golden/public scored.json report.json`
takes the leaderboard's summary over the rows `gen.u8` marks.
- **Anything else**: compute your model's log-softmax at every row's position, coarsen onto the
row's 512 ids plus the tail, and average over the rows `gen.u8` marks. `tools/score.py` is a
reference implementation in numpy that applies the mask itself; its `score_rows` takes a document a
slice of positions at a time, since a 256K-token document's full logits fit nowhere.
Every engine must reproduce the corpus tokens exactly: feed `tokens.i32`, never re-tokenize
`prompt`.
## Leaderboard (private corpus)
Live at [radiance.stilldeadco.de/leaderboard](https://radiance.stilldeadco.de/leaderboard). The entries are scored on a fixed subset of the private
corpus: 595 documents, every 8th one and 2 of its 256K-token traces (1,448,401 tokens,
1,053,665 scored positions), the subset the public file is cut like. GGUF entries run on
llama.cpp (flash attention through rocWMMA), the others on radiance, at tensor parallel 2 where the
format shards and on one card where it does not (ParoQuant and M2XFP4).
All entries were measured with a BF16 KV cache. Sizes and bits per weight count the text model
only (embeddings, 64 layers, lm_head), so formats that ship the vision tower or the MTP head are
not charged for them.
| # | Quant | Engine | Size (GB) | bpw | KL mean | KL median | KL p99 | KL p99.9 | Top-1 | PPL ratio | KL mean, 256K agentic |
|---:|---|---|---:|---:|---:|---:|---:|---:|---:|---:|---:|
| 1 | I8A8-GPTQ-FWHT128 | radiance | 28.59 | 8.505 | 0.00046 | 0.000115 | 0.0040 | 0.0188 | 99.18% | 1.0001 | 0.00038 |
| 2 | Q8_0 | llama.cpp | 28.58 | 8.502 | 0.00071 | 0.000176 | 0.0063 | 0.0282 | 99.01% | 1.0002 | 0.00070 |
| 3 | UD-Q8_K_XL | llama.cpp | 30.88 | 9.184 | 0.00076 | 0.000269 | 0.0058 | 0.0245 | 98.48% | 1.0003 | 0.00067 |
| 4 | UD-Q8_K_L | llama.cpp | 27.68 | 8.234 | 0.00084 | 0.000187 | 0.0074 | 0.0360 | 98.97% | 1.0002 | 0.00082 |
| 5 | UD-Q6_K_XL | llama.cpp | 24.94 | 7.417 | 0.00114 | 0.000245 | 0.0108 | 0.0538 | 98.82% | 1.0004 | 0.00105 |
| 6 | UD-Q6_K_L | llama.cpp | 23.83 | 7.089 | 0.00129 | 0.000281 | 0.0126 | 0.0610 | 98.74% | 1.0003 | 0.00122 |
| 7 | UD-Q6_K_M | llama.cpp | 22.73 | 6.760 | 0.00158 | 0.000346 | 0.0152 | 0.0709 | 98.61% | 1.0006 | 0.00149 |
| 8 | UD-Q6_K | llama.cpp | 21.62 | 6.431 | 0.00194 | 0.000429 | 0.0187 | 0.0834 | 98.45% | 1.0006 | 0.00181 |
| 9 | UD-Q5_K_XL | llama.cpp | 20.51 | 6.102 | 0.00268 | 0.000593 | 0.0269 | 0.1217 | 98.17% | 1.0010 | 0.00239 |
| 10 | UD-Q5_K_M | llama.cpp | 19.41 | 5.773 | 0.00328 | 0.000811 | 0.0335 | 0.1581 | 97.87% | 1.0010 | 0.00278 |
| 11 | FP8 (official) | radiance | 29.47 | 8.766 | 0.00389 | 0.000912 | 0.0367 | 0.1929 | 97.76% | 1.0021 | 0.00309 |
| 12 | UD-Q5_K_S | llama.cpp | 18.30 | 5.444 | 0.00428 | 0.001039 | 0.0438 | 0.2168 | 97.60% | 1.0012 | 0.00345 |
| 13 | PARO-int5 | radiance | 20.53 | 6.107 | 0.00598 | 0.001725 | 0.0599 | 0.2895 | 96.99% | 1.0035 | 0.00487 |
| 14 | UD-Q4_K_XL | llama.cpp | 17.20 | 5.115 | 0.00608 | 0.001443 | 0.0650 | 0.3566 | 97.17% | 1.0028 | 0.00485 |
| 15 | UD-Q4_K_M | llama.cpp | 16.10 | 4.790 | 0.00820 | 0.001990 | 0.0919 | 0.4426 | 96.73% | 1.0040 | 0.00649 |
| 16 | UD-Q4_K_S | llama.cpp | 15.00 | 4.461 | 0.01057 | 0.002530 | 0.1178 | 0.5558 | 96.31% | 1.0047 | 0.00822 |
| 17 | Q4_1 | llama.cpp | 17.24 | 5.128 | 0.01114 | 0.002998 | 0.1166 | 0.5458 | 96.04% | 1.0067 | 0.00905 |
| 18 | PARO-M2XFP4 | radiance | 18.44 | 5.486 | 0.01448 | 0.004030 | 0.1544 | 0.7051 | 95.49% | 1.0081 | 0.01215 |
| 19 | UD-IQ4_XS | llama.cpp | 13.89 | 4.132 | 0.01499 | 0.003852 | 0.1659 | 0.7828 | 95.47% | 1.0074 | 0.01118 |
| 20 | PARO-int4 | radiance | 17.49 | 5.203 | 0.01863 | 0.004891 | 0.2027 | 0.9571 | 94.98% | 1.0130 | 0.01605 |
| 21 | Q4_0 | llama.cpp | 15.78 | 4.694 | 0.02068 | 0.005458 | 0.2116 | 1.0007 | 94.80% | 1.0159 | 0.02010 |
| 22 | M2XFP4 | radiance | 17.55 | 5.220 | 0.02213 | 0.006414 | 0.2264 | 1.0193 | 94.45% | 1.0154 | 0.02136 |
| 23 | UD-Q3_K_XL | llama.cpp | 12.78 | 3.803 | 0.02403 | 0.006113 | 0.2736 | 1.2370 | 94.35% | 1.0165 | 0.01931 |
| 24 | PARO-MXFP4 | radiance | 17.68 | 5.259 | 0.02901 | 0.008011 | 0.3235 | 1.4966 | 93.64% | 1.0197 | 0.01779 |
| 25 | UD-IQ3_S | llama.cpp | 11.68 | 3.474 | 0.03473 | 0.008993 | 0.3886 | 1.7089 | 93.27% | 1.0230 | 0.02769 |
| 26 | Quark-AWQ-MXFP4 | radiance | 16.79 | 4.994 | 0.03824 | 0.011191 | 0.3998 | 1.6483 | 92.74% | 1.0266 | 0.03489 |
| 27 | UD-IQ3_XXS | llama.cpp | 10.57 | 3.145 | 0.05052 | 0.014753 | 0.5509 | 2.2667 | 91.62% | 1.0352 | 0.03938 |
| 28 | UD-Q2_K_XL | llama.cpp | 9.47 | 2.816 | 0.07920 | 0.023557 | 0.8639 | 3.3125 | 89.64% | 1.0581 | 0.06427 |
| 29 | UD-IQ2_S | llama.cpp | 8.36 | 2.487 | 0.12976 | 0.040951 | 1.3828 | 4.6869 | 86.94% | 1.1028 | 0.10870 |
| 30 | UD-IQ2_XXS | llama.cpp | 7.26 | 2.158 | 0.22446 | 0.084123 | 2.2139 | 6.3650 | 82.47% | 1.1921 | 0.18339 |
| 31 | UD-IQ1_M | llama.cpp | 6.72 | 1.998 | 0.30216 | 0.125083 | 2.7378 | 6.3261 | 79.59% | 1.2865 | 0.27165 |
| 32 | UD-IQ1_S | llama.cpp | 6.18 | 1.839 | 0.43328 | 0.190094 | 3.5875 | 7.5817 | 75.83% | 1.4543 | 0.41850 |
The top entry, I8A8-GPTQ-FWHT128, is
[StillDeadcode/qwen3.8-27b-iq8r](https://huggingface.co/StillDeadcode/qwen3.8-27b-iq8r): int8
weights in groups of 128 after a 128-wide Hadamard rotation, GPTQ against `hessians/calib/`, with
int8 activations.