Qwen4-35B-A3B is a vision-language mixture-of-experts model. Its language backbone has 35B parameters with 3B active per token, alongside 20B n-gram embedding parameters and a 2B multi-token prediction module. The base model combines Gated DeltaNet with Qwen Sparse Attention and has a native context of 1,048,576 tokens. Official Qwen model card
Heretic fit directions on Qwen4 residuals using 400 prompts from each of two datasets. Harmless Alpaca and Harmful Behaviors
The adapter applies a rank-3 approximation with full row normalization to attention output projections and shared expert down projections. The repository contains the PEFT adapter for the BF16 base and its F16 GGUF conversion.
Load the official BF16 Qwen4 checkpoint and attach this adapter with PEFT. Use a Transformers version with Qwen4 support.
import torch
from peft import PeftModel
from transformers import AutoModelForImageTextToText
base = AutoModelForImageTextToText.from_pretrained(
"Qwen/Qwen4-35B-A3B",
revision="849378c8db0d4537b7c6731738147378729d8920",
dtype=torch.bfloat16,
device_map="auto",
)
model = PeftModel.from_pretrained(base, "UnderTides/Qwen4-35B-A3B-Heretic-LoRA")
Download Q4_K_M from the GGUF release and place the adapter file alongside it. Qwen4-35B-A3B-GGUF
llama-server -m Qwen4-35B-A3B-Q4_K_M.gguf \
--lora Qwen4-35B-A3B-Heretic-LoRA-f16.gguf \
--host 127.0.0.1 --port 8080 -c 8192 -ngl 99 --jinja
In the original BF16 parameter search, the selected trial matched refusal markers on 35 of 60 search prompts. The BF16 base matched on 58 of 60.
The same Q4_K_M checkpoint ran with the adapter off and on, with a 256-token generation cap. Refusal marker counts use Heretic's keyword scorer on nonempty replies that reached a stop on both runs.
| Prompt set | Prompts | Completed pairs | Refusal markers off / on | Token cap off / on |
|---|---|---|---|---|
| Normal | 40 | 18 | 0 / 0 | 21 / 21 |
| Refusal | 40 | 36 | 36 / 35 | 0 / 4 |
The runs used NVIDIA GB10, an 8,192-token context, reasoning disabled and temperature zero. The table reports correct answers on fixed benchmark subsets. MMLU-Pro used a letter-only prompt and a 64-token generation cap. Responses at the cap count as incorrect.
| Variant | MMLU-Pro | LiveCodeBench | BFCL V4 simple-Python | IFBench | MMLU-Pro at token limit |
|---|---|---|---|---|---|
| Q4_K_M | 15/112 | 20/32 | 29/32 | 7/48 | 85/112 |
| Q4_K_M + LoRA | 12/112 | 19/32 | 31/32 | 10/48 | 94/112 |
Time to first token includes the streaming request. Decode speed uses outputs with at least 32 generated tokens. Each run served one request at a time.
| Variant | Median time to first token (s) | Median decode (tokens/s) |
|---|---|---|
| Q4_K_M | 0.808 | 44.2 |
| Q4_K_M + LoRA | 0.554 | 49.7 |
Qwen Team released the base model under Apache 2.0. This release uses revision
849378c8db0d4537b7c6731738147378729d8920. Base model and citation
Qwen/Qwen4-35B-A3B