Run this model with HF Jobs

Run synthetic0x/Qwen4-35B-A3B-Heretic on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/synthetic0x/Qwen4-35B-A3B-Heretic. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/synthetic0x/Qwen4-35B-A3B-Heretic on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/synthetic0x/Qwen4-35B-A3B-Heretic. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/synthetic0x/Qwen4-35B-A3B-Heretic. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

synthetic0x/Qwen4-35B-A3B-Heretic

Note: I kindly recommend reading the V2 postmortem in the Discussions tab before downloading β€” it covers what went wrong in V1, what V2 actually fixes, and the real trade-offs!

In memory of Philipp Emanuel Weidmann (p-e-w) β€” creator of Heretic, DRY, and XTC. "In times like these, one should be proud to be labeled a heretic."

Since the original heretic repository was archived before Qwen 4 launched, this checkpoint was created with a dedicated qwen4_moe implementation of Heretic's multi-objective Pareto optimization (minimizing refusals and KL divergence simultaneously).

Surgical, norm-preserving biprojected abliteration of Qwen/Qwen4-35B-A3B (BF16 full precision, V1), natively tailored to Qwen 4's hybrid architecture (3:1 Gated DeltaNet + Qwen Sparse Attention, hc_count=4 4-stream Hyper-Connections, 256 MoE experts, and 20.5B PLE n-gram table).

Post-Release Evaluation Notice (Historical Day-0 Numbers & abliteration_report.json): The historical Day-0 refusal figures in abliteration_report.json and the Optuna table below (4.7% direct / 0.0% (0/32) <think>) are preserved unmodified as a historical record, but are not reliable estimates of real-world refusal behavior:

  1. The Day-0 <think> check was capped at 80 tokens, so the model spent the budget inside <think> before reaching a refusal and was scored as compliant.
  2. Refusal scoring used keyword regexes, which missed polite soft refusals and topic deflections.

Under full-budget liquid/d1.3-ultra Decisions-API evaluation on SMX4_L across 4 reasoning efforts and 10 languages (288 prompts per config, 576 generations total), V1 had 126/288 (43.8%) judge-assessed refusals (118/288 full compliance). For full V2 evaluation data, activation archives, known trade-offs, and the optional 1.30 MiB V2 dense-only LoRA (Qwen4-35B-A3B-Heretic-V2-DenseOnly.gguf), see synthetic0x/Qwen4-35B-A3B-Heretic-GGUF and eval/v2/.

Method & Architecture Notes

  • Native hc_count=4 direction extraction: Refusal directions are extracted directly from the normalized 2048-dim attn_hyper_connection output (mixed_input) across all 40 decoder layers.
  • 3-Pass Iterative Residual Refusal Subspace: Multi-pass biprojected orthogonalization (r_hat Β· mu_safe = 0), finishing with a targeted residual pass on stubborn refusals while constraining token-level KL divergence against the stock BF16 checkpoint (KL < 0.15).
  • Norm-preserving updates: Every orthogonalized column preserves its exact original L2 norm so RMSNorm / Hyper-Connection scales do not drift.
  • Untouched modules: The 20.5B PLE n-gram table (layers[1].ple), vision encoder (model.visual), lm_head, and mtp heads are untouched.

Historical Day-0 Optimization Metrics (Untouched abliteration_report.json β€” Superseded)

Kept for historical provenance only (P1#16+P2#6+P3#1, 72 trials). Do not rely on the 80-token <think> or regex refusal numbers below; see the post-release notice above and eval/v2/heldout_efforts_and_langs.json for full-budget LLM-judged V1 vs V2 results.

Metric (Historical Day-0 Harness) Stock Qwen/Qwen4-35B-A3B Abliterated V1
Refusal rate (non-thinking, Optuna eval split, 64 prompts, regex) 100.0% (64/64) 4.7% (3/64)
Refusal rate (<think>, truncated 80-token trace, 32 prompts, regex β€” unreliable) 31.2% (10/32) 0.0% (0/32)
Token-level KL Divergence vs Stock (calibration prompts) 0.0000 0.1492

Pure BF16 Downstream Benchmarks (Stock BF16 vs Heretic V1 BF16)

Both models evaluated in full BF16 (temperature=0.0, identical harness, zero quantization noise; archived in benchmarks.json and eval/v2/gpqa_and_kld_bf16_v1.json). HumanEval, LiveCodeBench v6 (stdin public test cases), GPQA-Diamond (100-question subset), and MMLU-Pro were run in non-thinking mode (reasoning_effort=off); JailbreakBench below used keyword-based refusal checks (768-token budget; stock completed 48/50 </think> traces, Heretic completed 25/50).

Benchmark Stock Qwen4-35B-A3B (BF16) Heretic V1 (BF16) Delta
HumanEval (pass@1, 164 tasks) 92.07% (151/164) 92.68% (152/164) +0.61%
LiveCodeBench v6 (pass@1, 60 stdin tasks) 38.33% (23/60) 36.67% (22/60) -1.66%
GPQA-Diamond (100-question subset, V1 BF16 harness) 59.00% (59/100) 50.00% (50/100) -9.00%
MMLU-Pro (140 stratified, 10Γ—14 domains) 61.43% (86/140) 62.86% (88/140) +1.43%
Held-out Refusals β€” Direct (JailbreakBench, 50, regex) 94.0% (47/50) 20.0% (10/50) -74.0%
Held-out Refusals β€” <think> (768 tok, 50, regex) 80.0% (40/50; 48/50 completed) 4.0% (2/50; 25/50 completed) -76.0%

(Follow-up greedy full GPQA-Diamond (198 questions, @1536 tok) in eval/v2/gpqa_diamond_198.json: Stock Q4_K_M 147/198 (74.2%), Heretic V1 SMX4_L 147/198 (74.2%) [42 flipped items, McNemar p=1.0], V1 + V2 DenseOnly @1.50 139/198 (70.2%) [McNemar p=0.2912]. Both the earlier BF16 -9.0 pp subset run and the later full 198-question GGUF run are reported.)

Stage 1: Abliteration Distribution Drift (Stock BF16 -> Heretic BF16, WikiText-2 20 x 512)

Metric Stock BF16 Heretic BF16 Delta / Divergence
WikiText-2 Perplexity (20 x 512) 7.3929 7.3622 -0.0308
Mean KL Divergence (Stock -> Heretic) 0.0000 β€” 0.0408 Β± 0.0015
Same Top-1 Token Agreement 100.0% β€” 92.41%

Best Trial Parameters

{
  "pass1": {
    "dir_mode": "blend_best",
    "use_biproj": true,
    "best_layer_idx": 31,
    "start_frac": 0.21545585008483345,
    "end_frac": 0.7448563663107385,
    "alpha_full_attn": 0.7834914949683104,
    "alpha_lin_attn": 1.0945794018159338,
    "alpha_shared_mlp": 1.1426264892283984,
    "alpha_experts": 1.7857138983635616,
    "alpha_embed": 0.6234026434793526,
    "bell_taper": 0.07919742878103585
  },
  "pass2": {
    "dir_mode": "single_best",
    "use_biproj": true,
    "best_layer_idx": 17,
    "start_frac": 0.040551717601823745,
    "end_frac": 0.9573922926673297,
    "alpha_full_attn": 0.8952751427799204,
    "alpha_lin_attn": 1.0034109340786568,
    "alpha_shared_mlp": 0.8921746602626761,
    "alpha_experts": 0.9992301311902929,
    "alpha_embed": 0.3840143061714489,
    "bell_taper": 0.02739406039462694
  },
  "pass3": {
    "dir_mode": "single_best",
    "use_biproj": true,
    "best_layer_idx": 38,
    "start_frac": 0.2,
    "end_frac": 0.95,
    "alpha_full_attn": 0.85,
    "alpha_lin_attn": 0.75,
    "alpha_shared_mlp": 0.5,
    "alpha_experts": 1.1,
    "alpha_embed": 0.15,
    "bell_taper": 0.25
  }
}
Downloads last month
463
Safetensors
Model size
56B params
Tensor type
BF16
Β·
I64
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for synthetic0x/Qwen4-35B-A3B-Heretic

Finetuned
(147)
this model
Finetunes
1 model
Quantizations
5 models