FadedRedStar commited on
Commit
b61ed16
ยท
verified ยท
1 Parent(s): 6a9cdbd

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +180 -19
README.md CHANGED
@@ -8,35 +8,196 @@ language:
8
  pipeline_tag: image-text-to-text
9
  tags:
10
  - gguf
 
11
  - text-generation
 
 
 
 
 
12
  - multimodal
13
  - vision
14
- - reasoning
15
- - thinking
16
- - agentic
17
- - tool-use
18
  - abliterated
19
- - uncensored
20
- - qwen3
21
- - imatrix
22
  - conversational
 
 
 
 
23
  ---
24
 
25
- # Qwen3.5-4B-heretic-imatrix โ€” GGUF
 
 
 
 
 
 
 
 
 
 
26
 
27
  > [!NOTE]
28
- > This card is a work in progress. Full architecture details, abliteration parameters, and inference instructions will be added shortly.
 
 
 
 
 
 
 
29
 
30
- This repository hosts importance-matrix (imatrix) calibrated GGUF weights and the associated vision projection matrix for **Qwen3.5-4B-heretic**, quantized from the source floating-point tensors provided by [coder3101/Qwen3.5-4B-heretic](https://huggingface.co/coder3101/Qwen3.5-4B-heretic).
31
 
32
- ## Repository Files
 
 
 
 
 
 
 
 
 
 
33
 
34
- | Filename | Format | Size | llama.cpp Build | Description |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  |---|---|---|---|---|
36
- | `Qwen3.5-4B-heretic-IQ4_NL-imatrix.gguf` | IQ4_NL | 2.61 GB | b9870 | Main model weights, imatrix-calibrated, smaller non-linear 4-bit quant |
37
- | `Qwen3.5-4B-heretic-Q4_K_M-imatrix.gguf` | Q4_K_M | 2.71 GB | b9870 | Main model weights, imatrix-calibrated |
38
- | `Qwen3.5-4B-heretic-Q5_K_M-imatrix.gguf` | Q5_K_M | 3.07 GB | b9870 | Main model weights, imatrix-calibrated, higher fidelity |
39
- | `mmproj-Qwen3.5-4B-heretic-BF16.gguf` | BF16 | 676 MB | b9870 | Vision projector (full precision) |
40
- | `mmproj-Qwen3.5-4B-heretic-Q8_0.gguf` | Q8_0 | 367 MB | b9870 | Vision projector (compact) |
41
- | `mtp-Qwen3.5-4B-heretic-BF16.gguf` | BF16 | 1.28 GB | b9870 | Multi-token prediction head (full precision) |
42
- | `mtp-Qwen3.5-4B-heretic-Q8_0.gguf` | Q8_0 | 686 MB | b9870 | Multi-token prediction head (compact) |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  pipeline_tag: image-text-to-text
9
  tags:
10
  - gguf
11
+ - llama.cpp
12
  - text-generation
13
+ - imatrix
14
+ - heretic
15
+ - qwen3.5
16
+ - mtp
17
+ - uncensored
18
  - multimodal
19
  - vision
 
 
 
 
20
  - abliterated
 
 
 
21
  - conversational
22
+ - iq4_nl
23
+ - q4_k_m
24
+ - q5_k_m
25
+ quantized_by: FadedRedStar
26
  ---
27
 
28
+ # ๐Ÿค– Qwen3.5-4B-heretic โ€” Importance Matrix GGUF
29
+
30
+ This repository hosts importance-matrix (imatrix) optimized GGUF weights, available in multiple quantization formats, and the associated vision projection matrix for **Qwen3.5-4B-heretic**, quantized from the source floating-point tensors provided by [coder3101/Qwen3.5-4B-heretic](https://huggingface.co/coder3101/Qwen3.5-4B-heretic).
31
+
32
+ **๐Ÿ”„ Sister Repository:** Check out the [Standard GGUF Sister Repository](https://huggingface.co/FadedRedStar/Qwen3.5-4B-heretic-GGUF) for uncalibrated and full 8-bit precision options.
33
+
34
+ ## ๐ŸŽฏ Matrix-Weighted Calibration (Imatrix)
35
+
36
+ An **Importance Matrix (imatrix)** calculation tracks activations across network layers using a calibration sequence, then weights the quantization process to preserve the parameters that matter most for output quality โ€” improving fidelity at low bit depths.
37
+
38
+ โžก๏ธ **Calibration dataset:** Bartowski's `calibration_datav5.txt`.
39
 
40
  > [!NOTE]
41
+ > * **`IQ4_NL` is included** because the matrix enables a non-linear 4-bit format that outperforms standard linear 4-bit quantization.
42
+ > * **`Q8_0` is absent** because 8-bit quantization already introduces near-zero degradation, making calibration unnecessary โ€” see the standard sister repository for that variant.
43
+
44
+ ## โ„น๏ธ Model Profile & Core Features
45
+
46
+ **Qwen3.5-4B** is a dense multimodal transformer in the Qwen3.5 lineup by the Qwen Team (Alibaba), offering a strong balance of reasoning quality and inference cost. It carries forward the family's native vision encoder, 262,144-token context window, tool-calling support, and coverage of 201 languages and dialects.
47
+
48
+ The **heretic** suffix denotes post-processing via **[Heretic v1.2.0](https://github.com/p-e-w/heretic)** with the **Multi-directional refusal suppression** method performed by [coder3101](https://huggingface.co/coder3101), which simultaneously targets multiple refusal directions across model layers to achieve a thorough and stable abliteration.
49
 
50
+ ## ๐Ÿ“‹ Technical Specifications
51
 
52
+ | Property | Value |
53
+ |---|---|
54
+ | **Base Architecture** | Qwen3.5 dense transformer (4B dense transformer) |
55
+ | **Developed by** | Qwen Team (Alibaba) |
56
+ | **Primary Use** | Multimodal reasoning, coding, tool use, agentic tasks |
57
+ | **Context Window** | 262,144 tokens (extensible to ~1M) |
58
+ | **Vision Encoder** | Integrated (early-fusion) |
59
+ | **Languages** | 201 languages and dialects |
60
+ | **Abliteration Tool** | Heretic v1.2.0 |
61
+ | **Abliteration Method** | Multi-directional refusal suppression |
62
+ | **Prompt Format** | ChatML |
63
 
64
+ ## ๐Ÿ› ๏ธ Heretic Overrides (ARA)
65
+
66
+ | Property | Value |
67
+ |---|---|
68
+ | **direction_index** | 19.68 |
69
+ | **attn.o_proj.max_weights** | [0: 0.84, 1: 1.26, 2: 1.00, 3: 1.01] |
70
+ | **attn.o_proj.max_weight_position** | 19.26 |
71
+ | **attn.o_proj.min_weights** | [0: 0.24, 1: 0.97, 2: 0.42, 3: 0.85] |
72
+ | **attn.o_proj.min_weight_distance** | 5.26 |
73
+ | **mlp.down_proj.max_weights** | [0: 1.09, 1: 0.95, 2: 1.02, 3: 1.04] |
74
+ | **mlp.down_proj.max_weight_position** | 23.76 |
75
+ | **mlp.down_proj.min_weights** | [0: 0.26, 1: 0.16, 2: 0.91, 3: 0.86] |
76
+ | **mlp.down_proj.min_weight_distance** | 10.58 |
77
+
78
+ ## ๐Ÿ“Š Refusal Bypass Metrics
79
+
80
+ > [!NOTE]
81
+ > The metrics below are self-reported by the original model author ([coder3101](https://huggingface.co/coder3101)) and have not been independently reproduced.
82
+
83
+ | Metric | This model | Original ([Qwen/Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B)) |
84
+ |---|---|---|
85
+ | **KL divergence** | 0.0406 | 0 *(by definition)* |
86
+ | **Refusals** | 4/100 | 94/100 |
87
+
88
+ ## ๐Ÿงฎ Numerical & Tensor Formats
89
+
90
+ | Property | Value |
91
+ |---|---|
92
+ | **Text Tensor Types** | IQ4_NL, Q4_K_M, Q5_K_M (all with imatrix calibration) |
93
+ | **Importance Matrix** | Bartowski's `calibration_datav5.txt` |
94
+ | **Vision Tensors** | Q8_0, BF16 |
95
+
96
+ ## ๐Ÿ“ฆ Available Model Files
97
+
98
+ **Main model weights**
99
+ | Filename | Quantization | llama.cpp Build | Size | Download |
100
  |---|---|---|---|---|
101
+ | `Qwen3.5-4B-heretic-IQ4_NL-imatrix.gguf` | `IQ4_NL` | `b9870` | 2.43 GB | [๐Ÿ“ฅ Download](https://huggingface.co/FadedRedStar/Qwen3.5-4B-heretic-imatrix-GGUF/resolve/main/Qwen3.5-4B-heretic-IQ4_NL-imatrix.gguf) |
102
+ | `Qwen3.5-4B-heretic-Q4_K_M-imatrix.gguf` | `Q4_K_M` | `b9870` | 2.52 GB | [๐Ÿ“ฅ Download](https://huggingface.co/FadedRedStar/Qwen3.5-4B-heretic-imatrix-GGUF/resolve/main/Qwen3.5-4B-heretic-Q4_K_M-imatrix.gguf) |
103
+ | `Qwen3.5-4B-heretic-Q5_K_M-imatrix.gguf` | `Q5_K_M` | `b9870` | 2.86 GB | [๐Ÿ“ฅ Download](https://huggingface.co/FadedRedStar/Qwen3.5-4B-heretic-imatrix-GGUF/resolve/main/Qwen3.5-4B-heretic-Q5_K_M-imatrix.gguf) |
104
+
105
+ **mmproj โ€” vision projector files**
106
+ | Filename | Quantization | Size | Download |
107
+ |---|---|---|---|
108
+ | `mmproj-Qwen3.5-4B-heretic-Q8_0.gguf` | `Q8_0` | 350 MB | [๐Ÿ“ฅ Download](https://huggingface.co/FadedRedStar/Qwen3.5-4B-heretic-imatrix-GGUF/resolve/main/mmproj-Qwen3.5-4B-heretic-Q8_0.gguf) |
109
+ | `mmproj-Qwen3.5-4B-heretic-BF16.gguf` | `BF16` | 644 MB | [๐Ÿ“ฅ Download](https://huggingface.co/FadedRedStar/Qwen3.5-4B-heretic-imatrix-GGUF/resolve/main/mmproj-Qwen3.5-4B-heretic-BF16.gguf) |
110
+
111
+ **mtp โ€” speculative decoding draft files**
112
+ | Filename | Quantization | Size | Download |
113
+ |---|---|---|---|
114
+ | `mtp-Qwen3.5-4B-heretic-Q8_0.gguf` | `Q8_0` | 655 MB | [๐Ÿ“ฅ Download](https://huggingface.co/FadedRedStar/Qwen3.5-4B-heretic-imatrix-GGUF/resolve/main/mtp-Qwen3.5-4B-heretic-Q8_0.gguf) |
115
+ | `mtp-Qwen3.5-4B-heretic-BF16.gguf` | `BF16` | 1.19 GB | [๐Ÿ“ฅ Download](https://huggingface.co/FadedRedStar/Qwen3.5-4B-heretic-imatrix-GGUF/resolve/main/mtp-Qwen3.5-4B-heretic-BF16.gguf) |
116
+
117
+ ## ๐ŸŽ›๏ธ Component Pairing Guide
118
+
119
+ Download exactly **one** main weights file:
120
+
121
+ * **`IQ4_NL`**: Non-linear 4-bit format, best choice for constrained memory when imatrix calibration is present.
122
+ * **`Q4_K_M`**: Balanced 4-bit format suitable for most everyday use.
123
+ * **`Q5_K_M`**: Higher-fidelity mid-range format recommended as a general default.
124
+
125
+ **mmproj files** (optional): multimodal vision projectors. Pass one via the `--mmproj` flag in llama.cpp to enable image input.
126
+ * **`BF16` (Recommended)**: Highest possible image processing accuracy. While older projectors were small, modern vision towers can hover around **1GB**. If you are tight on VRAM, it is completely viable to run this on system RAM (CPU) with a minimal performance penalty, saving your precious GPU space for the main model layers.
127
+ * **`Q8_0`**: Cuts the projector file size and memory footprint in half (~500MB for larger 1GB files). Use this if you prefer to keep the vision tower hosted entirely on your GPU but need to claw back some VRAM to avoid Out-Of-Memory (OOM) crashes.
128
+
129
+ **mtp files** (optional): multi-token-prediction draft models for speculative decoding. Pass one via the `--draft` flag in llama.cpp to speed up generation.
130
+ * **`BF16` (Best Speed)**: Maximizes draft accuracy. The more accurate the draft model's predictions are, the higher your token acceptance rate, which translates directly into faster text generation. Use this if you have the VRAM headroom.
131
+ * **`Q8_0` (Best VRAM Efficiency)**: Cuts the draft model size in half. Choose this if loading a heavy `BF16` draft model would force you to drop layers of your *main* model to system RAM, which would heavily tank your total performance.
132
+
133
+ ## โšก Deployment & Execution Commands
134
+
135
+ > [!IMPORTANT]
136
+ > The vision projector (`--mmproj`) must be supplied at runtime whenever image inputs are used. Omitting it disables multimodal capability entirely.
137
+
138
+ > [!NOTE]
139
+ > Qwen recommends the following sampling configuration for best results:
140
+ > * Thinking mode for general tasks: `temperature=1.0`, `top_p=0.95`, `top_k=20`, `min_p=0.0`, `presence_penalty=1.5`, `repetition_penalty=1.0`
141
+ > * Thinking mode for precise coding tasks (e.g., WebDev): `temperature=0.6`, `top_p=0.95`, `top_k=20`, `min_p=0.0`, `presence_penalty=0.0`, `repetition_penalty=1.0`
142
+ > * Instruct (or non-thinking) mode for general tasks: `temperature=0.7`, `top_p=0.8`, `top_k=20`, `min_p=0.0`, `presence_penalty=1.5`, `repetition_penalty=1.0`
143
+ > * Instruct (or non-thinking) mode for reasoning tasks: `temperature=1.0`, `top_p=0.95`, `top_k=20`, `min_p=0.0`, `presence_penalty=1.5`, `repetition_penalty=1.0`
144
+
145
+ > [!NOTE]
146
+ > This model thinks by default and will emit reasoning content before its final answer. To disable this, set `enable_thinking: False` if your inference stack supports it; standard llama.cpp does not expose this toggle directly, so expect reasoning output unless you strip it client-side.
147
+
148
+ > [!TIP]
149
+ > Swap the `-m` filename below for either quantized file depending on your size/quality trade-off preference.
150
+
151
+ ### llama.cpp CLI (with image)
152
+
153
+ ```bash
154
+ ./llama-cli \
155
+ -m Qwen3.5-4B-heretic-IQ4_NL-imatrix.gguf \
156
+ --mmproj mmproj-Qwen3.5-4B-heretic-Q8_0.gguf \
157
+ -c 8192 \
158
+ -ngl 99 \
159
+ --image "path/to/image.jpg" \
160
+ -p "<|im_start|>user\nDescribe what you see and answer any questions about the image.<|im_end|>\n<|im_start|>assistant\n"
161
+ ```
162
+
163
+ ### Speculative Decoding (MTP Acceleration)
164
+
165
+ ```bash
166
+ ./llama-cli \
167
+ -m Qwen3.5-4B-heretic-IQ4_NL-imatrix.gguf \
168
+ --draft mtp-Qwen3.5-4B-heretic-Q8_0.gguf \
169
+ -c 8192 \
170
+ -ngl 99 \
171
+ -p "<|im_start|>user\nDescribe what you see and answer any questions about the image.<|im_end|>\n<|im_start|>assistant\n"
172
+ ```
173
+
174
+ ### OpenAI-Compatible API Server
175
+
176
+ ```bash
177
+ ./llama-server \
178
+ --host 0.0.0.0 \
179
+ --port 8080 \
180
+ -m Qwen3.5-4B-heretic-IQ4_NL-imatrix.gguf \
181
+ --mmproj mmproj-Qwen3.5-4B-heretic-Q8_0.gguf \
182
+ -c 16384 \
183
+ -ngl 99 \
184
+ --flash-attn
185
+ ```
186
+
187
+ ## ๐Ÿ’ฌ Chat Templates & Prompt Design (ChatML)
188
+
189
+ ```text
190
+ <|im_start|>system
191
+ You are a helpful multimodal assistant.<|im_end|>
192
+ <|im_start|>user
193
+ Your question or image payload here.<|im_end|>
194
+ <|im_start|>assistant
195
+ ```
196
+
197
+ ## โš ๏ธ Safety & Operational Notes
198
+
199
+ - This model is abliterated and will generate content that standard aligned models refuse. Use responsibly and in compliance with applicable laws.
200
+ - Vision tensors are kept at BF16 or Q8_0 depending on the mmproj variant chosen, to preserve spatial feature quality.
201
+ - Speculative decoding via the accompanying `mtp` draft model can meaningfully increase throughput on supported llama.cpp builds.
202
+ - Imatrix calibration improves perplexity recovery compared to non-imatrix quantization, particularly on low-frequency tokens.
203
+ - IQ4_NL produces a smaller file than Q4_K_M and tends to run faster on CPU and ARM devices; imatrix calibration narrows the quality gap between the two formats considerably.