This repository is a W4A16 compressed-tensors export of a Heretic-edited Gemma 4 Unified checkpoint.
It is intended to be a load-compatible drop-in replacement for
google/gemma-4-31B-it-qat-w4a16-ct: if your code already uses the Google repo
with transformers, swap in wnfldchen/gemma-4-31B-it-qat-w4a16-ct-heretic-merged-direct and load it the same way.
from transformers import AutoProcessor, Gemma4UnifiedForConditionalGeneration
repo_id = "wnfldchen/gemma-4-31B-it-qat-w4a16-ct-heretic-merged-direct"
processor = AutoProcessor.from_pretrained(repo_id)
model = Gemma4UnifiedForConditionalGeneration.from_pretrained(
repo_id,
device_map="auto",
)
transformers layout.config.json, tokenizer files, processor_config.json, and chat_template.jinja.recipe.yaml.reproduce/ directory from the source Heretic export.wnfldchen/gemma-4-31B-it-qat-q4_0-unquantized-heretic-mergedgoogle/gemma-4-31B-it-qat-q4_0-unquantizedARA-LoRAara4-bit int grouped weights, W4A16-style compressed tensors32pack-quantizedgemma4recipe.yamlreproduce/reproduce/ is preserved from the source Heretic export so the edit itself
remains inspectable and reproducible. The W4A16 compression step is captured by
recipe.yaml and by the compressed config.json; reproduce/reproduce.json
does not describe the later repacking step.
These results compare the deployed W4A16 compressed-tensors Heretic merged
artifact, wnfldchen/gemma-4-31B-it-qat-w4a16-ct-heretic-merged-direct, against the official Google W4A16 base,
google/gemma-4-31B-it-qat-w4a16-ct. The benchmark artifacts are archived with
the reproduction output.
| Benchmark | Samples | Metric | Official W4A16 base | Heretic merged W4A16 | Delta |
|---|---|---|---|---|---|
| PIQA | 1,838 | acc_norm | 55.71% | 55.01% | -0.71 pp |
| WinoGrande | 1,267 | accuracy | 50.99% | 50.83% | -0.16 pp |
| CommonsenseQA | 1,221 | accuracy | 23.26% | 23.10% | -0.16 pp |
| EQ-Bench | 171 | score | 42.54 | 46.59 | +4.05 |
| EQ-Bench parseability | 171 | percent_parseable | 83.04% | 78.36% | -4.68 pp |
PIQA, WinoGrande, and CommonsenseQA changes are smaller than their standard errors. EQ-Bench improves by 4.05 points, with lower parseability on the generative EQ-Bench scorer.
[!TIP] This model is reproducible.
Recreate the public unquantized Heretic source checkpoint pinned below, run the recorded compression command, and verify the resulting artifacts against the hashes in this section.
wnfldchen/gemma-4-31B-it-qat-q4_0-unquantized-heretic-mergedb8006e3fe0e349ef5f02d1192e1321c6ecf0b40drecipe.yamlThis is the command to recreate this compressed export from the unquantized Heretic source model:
python scripts/compress_to_w4a16.py \
wnfldchen/gemma-4-31B-it-qat-q4_0-unquantized-heretic-merged \
--output ./hf-model \
--device-map cuda:0
The helper defaults --dtype to auto; the recipe itself is preserved as
recipe.yaml.
Linux-5.10.0-32-cloud-amd64-x86_64-with-glibc2.41| Component | Version |
|---|---|
Python |
3.13.5 |
huggingface-hub |
1.27.0 |
pyyaml |
6.0.3 |
Recreate the export, then compare the generated files with the SHA256 hashes below.
Artifact hashesREADME.md is intentionally omitted because this model card contains the reproducibility data and therefore cannot hash itself deterministically.
| File | SHA256 |
|---|---|
chat_template.jinja |
ae53464bf3be25802b3a5b37def7fd89667067d7577049b3b2d74c4d8de4c6d4 |
config.json |
e92deb05cd642216990f41843aa80ee156d80190859b21e464448131e1661389 |
generation_config.json |
ca3509307f9760c9ed873072bf385cc224dbb2876e3f7e985c4d09aada0e2062 |
model.safetensors |
9a6ca56bbb627a904fd70e0c5032a0812f586436d7b5733eb92b7ee19e6bb8f1 |
processor_config.json |
32bdf45d2ad4cc29a0822ddd157a182de76644f0419a6228d151495256e9813c |
recipe.yaml |
ad92d8e6271e56675b9e4ac98146a7202aa079a58a43b18a595dd1ad0db5af00 |
reproduce/README.md |
b5e9275ebb2422e207b1c4ae22fd5acc988249b7d9aba9cae346784144d17888 |
reproduce/config.toml |
ea159ae67b915eb1103d568a819d97d2edc80d643f21821e97c03c6f5c5bf057 |
reproduce/google--gemma-4-31B-it-qat-q4_0-unquantized.jsonl |
fa7925cd3e891c258f7d3a6e43d62cd1119fed30674234470c0810642aa84766 |
reproduce/reproduce-localbase-merge-save.json |
dce1d98503e2dd2c751f52614ca40aa0d69934cb83eb4a3aec35c08d36184f46 |
reproduce/reproduce-merge-save.json |
d86a8ffd44f121ea0d86ccdffe1979566c06805d6f5e3e58ba5ae5a09e643a0d |
reproduce/reproduce.json |
439542bb2be7619f79660c062973beed29bd90b4a4186eddefb02afadf274eca |
reproduce/requirements.txt |
86a41100075cde208010fbcf4b074d60b339f86685b20fcdb15c9abe32cd95e0 |
tokenizer.json |
cc8d3a0ce36466ccc1278bf987df5f71db1719b9ca6b4118264f45cb627bfe0f |
tokenizer_config.json |
b8045a4576903e86903291d5cbdd4adfc8859e9ce3c98621bdbd957f73ed394b |
The section below is copied from the source unquantized Heretic export for reference. That source card already embeds the upstream Google Gemma 4 model card beneath its own note.
Unless it explicitly says otherwise, benchmark tables, hashes, and abliteration details there refer to the pre-compression checkpoint, not this W4A16 repack.
This repository contains the direct merged checkpoint reproduced from
wnfldchen/gemma-4-31B-it-qat-q4_0-unquantized-heretic. The original
adapter repo is intentionally left intact; this repo bakes that selected
Heretic edit into the base weights.
For production serving, prefer the W4A16 compressed-tensors derivative:
wnfldchen/gemma-4-31B-it-qat-w4a16-ct-heretic-merged-direct.
Try the hosted product at https://chat.winfieldresearch.com.
[!TIP] This model is reproducible!
See the README in the
reproducedirectory for more information. This repo was exported withexport_strategy=merge, so it does not require loading a separate LoRA adapter at inference time.
| Parameter | Value |
|---|---|
| trial | 6 |
| target_components | attn.o_proj |
| ara_lora_rank | 256 |
| start_layer_index | 24 |
| end_layer_index | 54 |
| preserve_good_behavior_weight | 0.1182 |
| steer_bad_behavior_weight | 0.0050 |
| overcorrect_relative_weight | 0.8715 |
| neighbor_count | 15 |
These are the Heretic optimization metrics for the reproduced selected trial.
| Metric | This model | Original model (google/gemma-4-31B-it-qat-q4_0-unquantized) |
|---|---|---|
| Keywords | 8/100 | 99/100 |
| KL divergence | 0.0900 | 0 (by definition) |
google/gemma-4-31B-it-qat-q4_0-unquantized1e4d8beecacb8b7590c1d8bedd7335f687bf311fwnfldchen/gemma-4-31B-it-qat-q4_0-unquantized-heretic8cce1a7166cd2b109886feff15ee12a78cc3177bee47df2fbdd61d8d3a67910ea58c45f91e868917export_strategy=merge and model_action=savesafetensors shardsfrom transformers import AutoProcessor, Gemma4UnifiedForConditionalGeneration
repo_id = "wnfldchen/gemma-4-31B-it-qat-q4_0-unquantized-heretic-merged"
processor = AutoProcessor.from_pretrained(repo_id)
model = Gemma4UnifiedForConditionalGeneration.from_pretrained(
repo_id,
device_map="auto",
)
This is the canonical unquantized merged artifact. The W4A16 repo linked above is the smaller deployment artifact produced by compressing this checkpoint after the merge.