1
0
Fork 0
mirror of https://github.com/p-e-w/heretic.git synced 2026-12-03 18:42:57 +07:00

[GH-ISSUE #216] No common response prefix found for Qwen3.5 models #123

Closed
opened 2026-11-01 04:17:44 +07:00 by bsakaguchi · 18 comments
Owner

Originally created by @imezx on GitHub (Mar 8, 2026).
Original GitHub issue: https://github.com/p-e-w/heretic/issues/216

Image

so i was filtering the model i finetuned, but i noticed if there is no common response prefix found here, is this normal?

Image

heretic --batch-size 128 khtsly/Qwen3.5-27B-Abliterated-Claude-4.6-Opus-Distilled-32k

Originally created by @imezx on GitHub (Mar 8, 2026). Original GitHub issue: https://github.com/p-e-w/heretic/issues/216 <img width="743" height="667" alt="Image" src="https://github.com/user-attachments/assets/44c1c718-90a9-432d-8fba-44d339f52d7c" /> so i was filtering the model i finetuned, but i noticed if there is no common response prefix found here, is this normal? <img width="935" height="630" alt="Image" src="https://github.com/user-attachments/assets/56400530-e300-483f-8dbd-b393277feb9e" /> `heretic --batch-size 128 khtsly/Qwen3.5-27B-Abliterated-Claude-4.6-Opus-Distilled-32k`
Author
Owner

@imezx commented on GitHub (Mar 8, 2026):

the model is an 27b dense which is a thinking model not instruct.

<!-- gh-comment-id:4019056725 --> @imezx commented on GitHub (Mar 8, 2026): the model is an 27b dense which is a thinking model not instruct.
Author
Owner

@imezx commented on GitHub (Mar 8, 2026):

Image
<!-- gh-comment-id:4019060266 --> @imezx commented on GitHub (Mar 8, 2026): <img width="775" height="783" alt="Image" src="https://github.com/user-attachments/assets/b4ac2c59-d61a-49ad-b28d-116f413c24d9" />
Author
Owner

@p-e-w commented on GitHub (Mar 9, 2026):

Well, the common prefix can only be found if all responses start with it. Apparently, they don't in your case.

<!-- gh-comment-id:4024256405 --> @p-e-w commented on GitHub (Mar 9, 2026): Well, the common prefix can only be found if *all* responses start with it. Apparently, they don't in your case.
Author
Owner

@imezx commented on GitHub (Mar 9, 2026):

so i have tried to force the prefix to <think></think> and the kd div significantly lowered and consistently getting around 0.000-0.001.

<!-- gh-comment-id:4025464819 --> @imezx commented on GitHub (Mar 9, 2026): so i have tried to force the prefix to `<think></think>` and the kd div significantly lowered and consistently getting around `0.000-0.001`.
Author
Owner

@p-e-w commented on GitHub (Mar 10, 2026):

I'm not sure I understand what the bug supposedly is here.

<!-- gh-comment-id:4028616812 --> @p-e-w commented on GitHub (Mar 10, 2026): I'm not sure I understand what the bug supposedly is here.
Author
Owner

@Vinay-Umrethe commented on GitHub (Mar 11, 2026):

Well, the common prefix can only be found if all responses start with it. Apparently, they don't in your case.

if so, according to model's readme it says:

Qwen3.5 models operate in thinking mode by default, generating thinking content signified by <think>\n...</think>\n\n before producing the final responses. To disable thinking content and obtain direct response, refer to the examples here.

https://huggingface.co/Qwen/Qwen3.5-4B#quickstart

and heretic don't have that new \n... \n\n thing in it's elif list for detecting.

    # Suppress CoT output.
    recheck_prefix = False
    if model.response_prefix:
        # When using any of the predefined prefixes below, we need to check that
        # the prefix is actually complete (e.g. not missing a trailing newline).
        recheck_prefix = True
        if model.response_prefix.startswith("<think>"):
            # Most thinking models.
            model.response_prefix = "<think></think>"
        elif model.response_prefix.startswith("<|channel|>analysis<|message|>"):
            # gpt-oss.
            model.response_prefix = "<|channel|>analysis<|message|><|end|><|start|>assistant<|channel|>final<|message|>"
        elif model.response_prefix.startswith("<thought>"):
            # Unknown, suggested by user.
            model.response_prefix = "<thought></thought>"
        elif model.response_prefix.startswith("[THINK]"):
            # Unknown, suggested by user.
            model.response_prefix = "[THINK][/THINK]"
        else:
            recheck_prefix = False

@p-e-w

<!-- gh-comment-id:4036431495 --> @Vinay-Umrethe commented on GitHub (Mar 11, 2026): > Well, the common prefix can only be found if _all_ responses start with it. Apparently, they don't in your case. if so, according to model's readme it says: > Qwen3.5 models operate in thinking mode by default, generating thinking content signified by `<think>\n...</think>\n\n` before producing the final responses. To disable thinking content and obtain direct response, refer to the examples [here](https://huggingface.co/Qwen/Qwen3.5-4B#instruct-or-non-thinking-mode). https://huggingface.co/Qwen/Qwen3.5-4B#quickstart and heretic don't have that new `\n... \n\n` thing in it's elif list for detecting. ```python # Suppress CoT output. recheck_prefix = False if model.response_prefix: # When using any of the predefined prefixes below, we need to check that # the prefix is actually complete (e.g. not missing a trailing newline). recheck_prefix = True if model.response_prefix.startswith("<think>"): # Most thinking models. model.response_prefix = "<think></think>" elif model.response_prefix.startswith("<|channel|>analysis<|message|>"): # gpt-oss. model.response_prefix = "<|channel|>analysis<|message|><|end|><|start|>assistant<|channel|>final<|message|>" elif model.response_prefix.startswith("<thought>"): # Unknown, suggested by user. model.response_prefix = "<thought></thought>" elif model.response_prefix.startswith("[THINK]"): # Unknown, suggested by user. model.response_prefix = "[THINK][/THINK]" else: recheck_prefix = False ``` @p-e-w
Author
Owner

@p-e-w commented on GitHub (Mar 11, 2026):

and heretic don't have that new \n... \n\n thing in it's elif list for detecting.

It does. The code checks whether the response starts with <think>, which covers the template you cited.

<!-- gh-comment-id:4039984637 --> @p-e-w commented on GitHub (Mar 11, 2026): > and heretic don't have that new \n... \n\n thing in it's elif list for detecting. It does. The code checks whether the response **starts with** `<think>`, which covers the template you cited.
Author
Owner

@Casdmo commented on GitHub (Mar 14, 2026):

I'm not sure I understand what the bug supposedly is here.

Are you sure heretic readily detects refusals from Qwen3.5 models, in particular Qwen3.5-9B? It's running now on my system, currently counting refusals for "trial 25 of 200." Two of the first 24 trials resulted in "Refusals: 1/100," and the rest resulted in "Refusals: 0/100." That's after saying "Initial refusals: 0/100" earlier in the output.

I also got "None found" for common response prefix. I'm not certain, but it might have some effect on refusal counts. That's why I'm adding a comment to this issue instead of opening a separate issue.

I noticed you added this fix earlier:

* fix: prevent div-by-zero in evaluator when base_refusals is 0

When a model refuses all prompts from the start, base_refusals is 0.
Return refusals directly in that case so ablations that introduce new
refusals are still penalized correctly.

* fix: cast refusals to float for type consistency" before hitting commit changes

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

That fix allows it to proceed without ZeroDivisionError, but I'm not sure it affects detection of refusals. Are you sure heretic with the latest commits actually detects the refusals for Qwen3.5-9B about as well as for Qwen3 models?

<!-- gh-comment-id:4060836674 --> @Casdmo commented on GitHub (Mar 14, 2026): > I'm not sure I understand what the bug supposedly is here. Are you sure heretic readily detects refusals from Qwen3.5 models, in particular Qwen3.5-9B? It's running now on my system, currently counting refusals for "trial 25 of 200." Two of the first 24 trials resulted in "Refusals: 1/100," and the rest resulted in "Refusals: 0/100." That's after saying "Initial refusals: 0/100" earlier in the output. I also got "None found" for common response prefix. I'm not certain, but it _might_ have some effect on refusal counts. That's why I'm adding a comment to this issue instead of opening a separate issue. I noticed you added this fix earlier: ``` * fix: prevent div-by-zero in evaluator when base_refusals is 0 When a model refuses all prompts from the start, base_refusals is 0. Return refusals directly in that case so ablations that introduce new refusals are still penalized correctly. * fix: cast refusals to float for type consistency" before hitting commit changes Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> ``` That fix allows it to proceed without ZeroDivisionError, but I'm not sure it affects _detection_ of refusals. Are you sure heretic with the latest commits actually detects the refusals for Qwen3.5-9B about as well as for Qwen3 models?
Author
Owner

@p-e-w commented on GitHub (Mar 15, 2026):

Post details of your setup, environment, and hardware. This does not happen for me, and for the hundreds of people who have successfully processed Qwen3.5 with Heretic.

<!-- gh-comment-id:4062016494 --> @p-e-w commented on GitHub (Mar 15, 2026): Post details of your setup, environment, and hardware. This does not happen for me, and for the hundreds of people who have successfully processed Qwen3.5 with Heretic.
Author
Owner

@imezx commented on GitHub (Mar 15, 2026):

w/ & w/o common prefix works fine for me but i just notice if w/ common prefix could produce a significantly lower kd div compared to w/o common prefix found.

<!-- gh-comment-id:4062452495 --> @imezx commented on GitHub (Mar 15, 2026): w/ & w/o common prefix works fine for me but i just notice if w/ common prefix could produce a significantly lower kd div compared to w/o common prefix found.
Author
Owner

@p-e-w commented on GitHub (Mar 15, 2026):

What common response prefix? If none is found, then there is none. By definition, a response prefix is only common to the responses if all of them start with it.

<!-- gh-comment-id:4062625434 --> @p-e-w commented on GitHub (Mar 15, 2026): What common response prefix? If none is found, then there is none. By definition, a response prefix is only common to the responses if *all* of them start with it.
Author
Owner

@Casdmo commented on GitHub (Mar 15, 2026):

@p-e-w

user@host:~$ cat /etc/issue; cat /proc/version
Linux Mint 22.3 Zena \n \l

Linux version 6.8.0-106-generic (buildd@lcy02-amd64-074) (x86_64-linux-gnu-gcc-13 (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0, GNU ld (GNU Binutils for Ubuntu) 2.42) #106-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar  6 07:58:08 UTC 2026
user@host:~$ python3 --version; pipx --version
Python 3.12.3
1.4.3

NVIDIA-SMI 590.48.01 | Driver Version: 590.48.01 | CUDA Version: 13.1
ZOTAC GAMING GeForce RTX 3060 Twin Edge 12GB GDDR6 ZT-A30600E-10M

Intel Core i5-12400F
Crucial Pro 32GB (2 x 16GB) DDR5 RAM up to 5600MHz
XMP enabled in BIOS

Corsair MP600 Elite NVMe 1.4 Gen 4 x4 SSD

On my first try running Heretic on Qwen3.5-9B, it failed because my version of transformers was too old, so I ran pipx inject heretic-llm transformers --pip-args="--upgrade". Since then, I have run pipx install --force git+https://github.com/p-e-w/heretic.git to get the latest commits.

user@host:~$ pipx runpip heretic-llm show transformers
Name: transformers
Version: 5.3.0
Summary: Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.
Home-page: https://github.com/huggingface/transformers
Author: The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/transformers/graphs/contributors)
Author-email: transformers@huggingface.co
License: Apache 2.0 License
Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages
Requires: huggingface-hub, numpy, packaging, pyyaml, regex, safetensors, tokenizers, tqdm, typer
Required-by: heretic-llm, peft
user@host:~$ 

My Heretic command syntax and some of the output:

user@host:~$ PYTORCH_ALLOC_CONF=expandable_segments:True heretic --model ~/HuggingFace/Qwen3.5-9B --quantization NONE --device-map auto --max-memory '{"0": "9GB", "cpu": "28GB"}'                                                        
█░█░█▀▀░█▀▄░█▀▀░▀█▀░█░█▀▀  v1.2.0                                                                                     
█▀█░█▀▀░█▀▄░█▀▀░░█░░█░█░░                                                                                             
▀░▀░▀▀▀░▀░▀░▀▀▀░░▀░░▀░▀▀▀  https://github.com/p-e-w/heretic                                                           
                                                                                                                      
Detected 1 CUDA device(s) (11.63 GB total VRAM):                                                                      
* GPU 0: NVIDIA GeForce RTX 3060 (11.63 GB)                                                                           
                                                                                                                      
Loading model /home/user/HuggingFace/Qwen3.5-9B...                                                                  
Loading weights: 100%|████████████████████████████████████████████████████████████████████████████████████████████████
███████████████████████████████████████████████████████████████████████████████████████| 760/760 [00:05<00:00, 144.30i
t/s]                                                                                                                  
Some parameters are on the meta device because they were offloaded to the cpu.                                        
Ok                                                                                                                    
* LoRA adapters initialized (targets: o_proj, down_proj, out_proj)                                                    
* Transformer model with 32 layers                                                                                    
* Abliterable components:                                                                                             
  * attn.o_proj: 32 modules total                                                                                     
  * mlp.down_proj: 32 modules total                                                                                   
                                                                                                                      
Resident system RAM: 19.24 GB                                                                                         
Allocated GPU VRAM: 6.38 GB                                                                                           
Reserved GPU VRAM: 8.35 GB                                                                                            
                                                                                                                      
Loading good prompts from mlabonne/harmless_alpaca...                                                                 
* 400 prompts loaded                                                                                                  
                                                                                                                      
Loading bad prompts from mlabonne/harmful_behaviors...                                                                
* 400 prompts loaded                                                                                                  
                                                                                                                      
Determining optimal batch size...                                                                                     
* Trying batch size 1... Ok (1 tokens/s)                                                                              
* Trying batch size 2... Ok (2 tokens/s)                                                                              
* Trying batch size 4... Ok (3 tokens/s)                                                                              
* Trying batch size 8... Ok (6 tokens/s)                                                                              
* Trying batch size 16... Ok (12 tokens/s)                                                                            
* Trying batch size 32... Ok (22 tokens/s)                                                                            
* Trying batch size 64... Failed (CUDA out of memory. Tried to allocate 1.89 GiB. GPU 0 has a total capacity of 11.63 
GiB of which 1.75 GiB is free. Including non-PyTorch memory, this process has 9.87 GiB memory in use. Of the allocated
 memory 9.59 GiB is allocated                                                                                         
by PyTorch, and 147.96 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try set
ting PYTORCH_ALLOC_CONF=expandable_segments:True to avoid fragmentation.  See documentation for Memory Management     
(https://pytorch.org/docs/stable/notes/cuda.html#environment-variables))                                              
* Chosen batch size: 32                                                                                               
                                                                                                                      
Checking for common response prefix...                                                                                
* None found                                                                                                          
                                                                                                                      
Loading good evaluation prompts from mlabonne/harmless_alpaca...                                                      
* 100 prompts loaded                                                                                                  
* Obtaining first-token probability distributions...                                                                  
                                                                                                                      
Loading bad evaluation prompts from mlabonne/harmful_behaviors...                                                     
* 100 prompts loaded                                                                                                  
* Counting model refusals...                                                                                          
* Initial refusals: 0/100

Calculating per-layer refusal directions...                                                                           
* Obtaining residuals for good prompts...                                                                             
* Obtaining residuals for bad prompts...                                                                              

Running trial 1 of 200...                                                                                             
* Parameters:                                                                                                         
  * direction_index = per layer                                                                                       
  * attn.o_proj.max_weight = 1.12                                                                                     
  * attn.o_proj.max_weight_position = 28.30                                                                           
  * attn.o_proj.min_weight = 0.51                                                                                     
  * attn.o_proj.min_weight_distance = 5.84                                                                            
  * mlp.down_proj.max_weight = 0.97                                                                                   
  * mlp.down_proj.max_weight_position = 26.02                                                                         
  * mlp.down_proj.min_weight = 0.62                                                                                   
  * mlp.down_proj.min_weight_distance = 1.88                                                                          
* Resetting model...                                                                                                  
* Abliterating...                                                                                                     
* Evaluating...                                                                                                       
  * Obtaining first-token probability distributions...                                                                
  * KL divergence: 4.4216                                                                                             
  * Counting model refusals...                                                                                        
  * Refusals: 0/100                                                                                                   

Elapsed time: 9m 44s                                                                                                  
Estimated remaining time: 32h 16m                                                                                     
Resident system RAM: 19.39 GB                                                                                         
Allocated GPU VRAM: 6.48 GB                                                                                           
Reserved GPU VRAM: 8.73 GB                                                                                            

Running trial 2 of 200...                                                                                             
* Parameters:                                                                                                         
  * direction_index = 26.19                                                                                           
  * attn.o_proj.max_weight = 1.48                                                                                     
  * attn.o_proj.max_weight_position = 30.50                                                                           
  * attn.o_proj.min_weight = 0.85                                                                                     
  * attn.o_proj.min_weight_distance = 1.18                                                                            
  * mlp.down_proj.max_weight = 1.29                                                                                   
  * mlp.down_proj.max_weight_position = 28.05                                                                         
  * mlp.down_proj.min_weight = 1.07                                                                                   
  * mlp.down_proj.min_weight_distance = 14.72                                                                         
* Resetting model...                                                                                                  
* Abliterating...                                                                                                     
* Evaluating...                                                                                                       
  * Obtaining first-token probability distributions...                                                                
  * KL divergence: 4.4216                                                                                             
  * Counting model refusals...                                                                                        
  * Refusals: 0/100                                                                                                   

Elapsed time: 19m 28s                                                                                                 
Estimated remaining time: 32h 6m                                                                                      
Resident system RAM: 19.40 GB                                                                                         
Allocated GPU VRAM: 6.48 GB                                                                                           
Reserved GPU VRAM: 8.73 GB

This time it's on trial 11, and KL divergence has been exactly 4.4216 all 11 times. Is that odd?

Since thinking mode generates <think>...</think> blocks before responding, refusal markers may appear inside thinking tokens that get stripped. Could that explain why heretic sees 0 refusals even when the model is refusing?

<!-- gh-comment-id:4062708590 --> @Casdmo commented on GitHub (Mar 15, 2026): @p-e-w ``` user@host:~$ cat /etc/issue; cat /proc/version Linux Mint 22.3 Zena \n \l Linux version 6.8.0-106-generic (buildd@lcy02-amd64-074) (x86_64-linux-gnu-gcc-13 (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0, GNU ld (GNU Binutils for Ubuntu) 2.42) #106-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 6 07:58:08 UTC 2026 user@host:~$ python3 --version; pipx --version Python 3.12.3 1.4.3 ``` NVIDIA-SMI 590.48.01 | Driver Version: 590.48.01 | CUDA Version: 13.1 ZOTAC GAMING GeForce RTX 3060 Twin Edge 12GB GDDR6 ZT-A30600E-10M Intel Core i5-12400F Crucial Pro 32GB (2 x 16GB) DDR5 RAM up to 5600MHz XMP enabled in BIOS Corsair MP600 Elite NVMe 1.4 Gen 4 x4 SSD On my first try running Heretic on Qwen3.5-9B, it failed because my version of transformers was too old, so I ran `pipx inject heretic-llm transformers --pip-args="--upgrade"`. Since then, I have run `pipx install --force git+https://github.com/p-e-w/heretic.git` to get the latest commits. ``` user@host:~$ pipx runpip heretic-llm show transformers Name: transformers Version: 5.3.0 Summary: Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training. Home-page: https://github.com/huggingface/transformers Author: The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/transformers/graphs/contributors) Author-email: transformers@huggingface.co License: Apache 2.0 License Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages Requires: huggingface-hub, numpy, packaging, pyyaml, regex, safetensors, tokenizers, tqdm, typer Required-by: heretic-llm, peft user@host:~$ ``` My Heretic command syntax and some of the output: ``` user@host:~$ PYTORCH_ALLOC_CONF=expandable_segments:True heretic --model ~/HuggingFace/Qwen3.5-9B --quantization NONE --device-map auto --max-memory '{"0": "9GB", "cpu": "28GB"}' █░█░█▀▀░█▀▄░█▀▀░▀█▀░█░█▀▀ v1.2.0 █▀█░█▀▀░█▀▄░█▀▀░░█░░█░█░░ ▀░▀░▀▀▀░▀░▀░▀▀▀░░▀░░▀░▀▀▀ https://github.com/p-e-w/heretic Detected 1 CUDA device(s) (11.63 GB total VRAM): * GPU 0: NVIDIA GeForce RTX 3060 (11.63 GB) Loading model /home/user/HuggingFace/Qwen3.5-9B... Loading weights: 100%|████████████████████████████████████████████████████████████████████████████████████████████████ ███████████████████████████████████████████████████████████████████████████████████████| 760/760 [00:05<00:00, 144.30i t/s] Some parameters are on the meta device because they were offloaded to the cpu. Ok * LoRA adapters initialized (targets: o_proj, down_proj, out_proj) * Transformer model with 32 layers * Abliterable components: * attn.o_proj: 32 modules total * mlp.down_proj: 32 modules total Resident system RAM: 19.24 GB Allocated GPU VRAM: 6.38 GB Reserved GPU VRAM: 8.35 GB Loading good prompts from mlabonne/harmless_alpaca... * 400 prompts loaded Loading bad prompts from mlabonne/harmful_behaviors... * 400 prompts loaded Determining optimal batch size... * Trying batch size 1... Ok (1 tokens/s) * Trying batch size 2... Ok (2 tokens/s) * Trying batch size 4... Ok (3 tokens/s) * Trying batch size 8... Ok (6 tokens/s) * Trying batch size 16... Ok (12 tokens/s) * Trying batch size 32... Ok (22 tokens/s) * Trying batch size 64... Failed (CUDA out of memory. Tried to allocate 1.89 GiB. GPU 0 has a total capacity of 11.63 GiB of which 1.75 GiB is free. Including non-PyTorch memory, this process has 9.87 GiB memory in use. Of the allocated memory 9.59 GiB is allocated by PyTorch, and 147.96 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try set ting PYTORCH_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)) * Chosen batch size: 32 Checking for common response prefix... * None found Loading good evaluation prompts from mlabonne/harmless_alpaca... * 100 prompts loaded * Obtaining first-token probability distributions... Loading bad evaluation prompts from mlabonne/harmful_behaviors... * 100 prompts loaded * Counting model refusals... * Initial refusals: 0/100 Calculating per-layer refusal directions... * Obtaining residuals for good prompts... * Obtaining residuals for bad prompts... Running trial 1 of 200... * Parameters: * direction_index = per layer * attn.o_proj.max_weight = 1.12 * attn.o_proj.max_weight_position = 28.30 * attn.o_proj.min_weight = 0.51 * attn.o_proj.min_weight_distance = 5.84 * mlp.down_proj.max_weight = 0.97 * mlp.down_proj.max_weight_position = 26.02 * mlp.down_proj.min_weight = 0.62 * mlp.down_proj.min_weight_distance = 1.88 * Resetting model... * Abliterating... * Evaluating... * Obtaining first-token probability distributions... * KL divergence: 4.4216 * Counting model refusals... * Refusals: 0/100 Elapsed time: 9m 44s Estimated remaining time: 32h 16m Resident system RAM: 19.39 GB Allocated GPU VRAM: 6.48 GB Reserved GPU VRAM: 8.73 GB Running trial 2 of 200... * Parameters: * direction_index = 26.19 * attn.o_proj.max_weight = 1.48 * attn.o_proj.max_weight_position = 30.50 * attn.o_proj.min_weight = 0.85 * attn.o_proj.min_weight_distance = 1.18 * mlp.down_proj.max_weight = 1.29 * mlp.down_proj.max_weight_position = 28.05 * mlp.down_proj.min_weight = 1.07 * mlp.down_proj.min_weight_distance = 14.72 * Resetting model... * Abliterating... * Evaluating... * Obtaining first-token probability distributions... * KL divergence: 4.4216 * Counting model refusals... * Refusals: 0/100 Elapsed time: 19m 28s Estimated remaining time: 32h 6m Resident system RAM: 19.40 GB Allocated GPU VRAM: 6.48 GB Reserved GPU VRAM: 8.73 GB ``` This time it's on trial 11, and KL divergence has been exactly 4.4216 all 11 times. Is that odd? Since thinking mode generates `<think>...</think>` blocks before responding, refusal markers may appear inside thinking tokens that get stripped. Could that explain why heretic sees 0 refusals even when the model is refusing?
Author
Owner

@Vinay-Umrethe commented on GitHub (Mar 15, 2026):

@Casdmo

I ran a test with a similar command.

heretic --model Qwen/Qwen3.5-9B --batch-size 64 --quantization NONE --max-memory '{"0": "10GB", "1": "10GB", "cpu": "28GB"}'

RESULTS look like:

█░█░█▀▀░█▀▄░█▀▀░▀█▀░█░█▀▀  v1.2.0
█▀█░█▀▀░█▀▄░█▀▀░░█░░█░█░░
▀░▀░▀▀▀░▀░▀░▀▀▀░░▀░░▀░▀▀▀  https://github.com/p-e-w/heretic

Detected 2 CUDA device(s) (29.13 GB total VRAM):
* GPU 0: Tesla T4 (14.56 GB)
* GPU 1: Tesla T4 (14.56 GB)

Loading model Qwen/Qwen3.5-9B...
Loading weights: 100%|███████████████████████| 760/760 [00:04<00:00, 166.60it/s]
Warning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads.
Some parameters are on the meta device because they were offloaded to the cpu.
Ok
* LoRA adapters initialized (targets: out_proj, down_proj, o_proj)
* Transformer model with 32 layers
* Abliterable components:
  * attn.o_proj: 32 modules total
  * mlp.down_proj: 32 modules total

Resident system RAM: 6.64 GB
Allocated GPU VRAM: 15.65 GB
Reserved GPU VRAM: 17.63 GB

Loading good prompts from mlabonne/harmless_alpaca...
* 400 prompts loaded

Loading bad prompts from mlabonne/harmful_behaviors...
* 400 prompts loaded

Checking for common response prefix...
* None found

Loading good evaluation prompts from mlabonne/harmless_alpaca...
* 100 prompts loaded
* Obtaining first-token probability distributions...

Loading bad evaluation prompts from mlabonne/harmful_behaviors...
* 100 prompts loaded
* Counting model refusals...
* Initial refusals: 83/100

Calculating per-layer refusal directions...
* Obtaining residuals for good prompts...
* Obtaining residuals for bad prompts...

Running trial 1 of 200...
* Parameters:
  * direction_index = 16.89
  * attn.o_proj.max_weight = 1.42
  * attn.o_proj.max_weight_position = 28.80
  * attn.o_proj.min_weight = 1.41
  * attn.o_proj.min_weight_distance = 7.89
  * mlp.down_proj.max_weight = 1.39
  * mlp.down_proj.max_weight_position = 23.94
  * mlp.down_proj.min_weight = 1.32
  * mlp.down_proj.min_weight_distance = 5.65
* Resetting model...
* Abliterating...
* Evaluating...
  * Obtaining first-token probability distributions...
  * KL divergence: 0.0014
  * Counting model refusals...
  * Refusals: 83/100

Elapsed time: 4m 37s
Estimated remaining time: 15h 19m
Resident system RAM: 6.77 GB
Allocated GPU VRAM: 15.75 GB
Reserved GPU VRAM: 21.21 GB

Running trial 2 of 200...
* Parameters:
  * direction_index = 13.81
  * attn.o_proj.max_weight = 1.24
  * attn.o_proj.max_weight_position = 29.26
  * attn.o_proj.min_weight = 1.03
  * attn.o_proj.min_weight_distance = 11.56
  * mlp.down_proj.max_weight = 1.13
  * mlp.down_proj.max_weight_position = 28.42
  * mlp.down_proj.min_weight = 0.68
  * mlp.down_proj.min_weight_distance = 5.25
* Resetting model...
* Abliterating...
* Evaluating...
  * Obtaining first-token probability distributions...
  * KL divergence: 0.0006
  * Counting model refusals...
  * Refusals: 88/100

Elapsed time: 9m 16s
Estimated remaining time: 15h 17m
Resident system RAM: 6.77 GB
Allocated GPU VRAM: 15.75 GB
Reserved GPU VRAM: 20.83 GB

Running trial 3 of 200...
* Parameters:
  * direction_index = 20.45
  * attn.o_proj.max_weight = 1.17
  * attn.o_proj.max_weight_position = 24.29
  * attn.o_proj.min_weight = 0.50
  * attn.o_proj.min_weight_distance = 16.81
  * mlp.down_proj.max_weight = 1.25
  * mlp.down_proj.max_weight_position = 20.28
  * mlp.down_proj.min_weight = 0.77
  * mlp.down_proj.min_weight_distance = 6.04
* Resetting model...
* Abliterating...
* Evaluating...
  * Obtaining first-token probability distributions...
  * KL divergence: 0.0308
  * Counting model refusals...

it suggests KL divergence are different and refusals too.

Packages Installed were:

Name: torch
Version: 2.9.0+cu126
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: 
Author-email: PyTorch Team <packages@pytorch.org>
License: BSD-3-Clause
Location: /usr/local/lib/python3.12/dist-packages
Requires: filelock, fsspec, jinja2, networkx, nvidia-cublas-cu12, nvidia-cuda-cupti-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-runtime-cu12, nvidia-cudnn-cu12, nvidia-cufft-cu12, nvidia-cufile-cu12, nvidia-curand-cu12, nvidia-cusolver-cu12, nvidia-cusparse-cu12, nvidia-cusparselt-cu12, nvidia-nccl-cu12, nvidia-nvjitlink-cu12, nvidia-nvshmem-cu12, nvidia-nvtx-cu12, setuptools, sympy, triton, typing-extensions
Required-by: accelerate, bitsandbytes, easyocr, fastai, kornia, peft, pytorch-ignite, pytorch-lightning, sentence-transformers, timm, torchaudio, torchdata, torchmetrics, torchvision
---
Name: torchvision
Version: 0.24.0+cu126
Summary: image and video datasets and models for torch deep learning
Home-page: https://github.com/pytorch/vision
Author: PyTorch Core Team
Author-email: soumith@pytorch.org
License: BSD
Location: /usr/local/lib/python3.12/dist-packages
Requires: numpy, pillow, torch
Required-by: easyocr, fastai, timm
---
Name: torchaudio
Version: 2.9.0+cu126
Summary: An audio package for PyTorch
Home-page: https://github.com/pytorch/audio
Author: Soumith Chintala, David Pollack, Sean Naren, Peter Goldsborough, Moto Hira, Caroline Chen, Jeff Hwang, Zhaoheng Ni, Xiaohui Zhang
Author-email: soumith@pytorch.org
License: 
Location: /usr/local/lib/python3.12/dist-packages
Requires: torch
Required-by: 
---
Name: heretic-llm
Version: 1.2.0
Summary: Fully automatic censorship removal for language models
Home-page: https://github.com/p-e-w/heretic
Author: Philipp Emanuel Weidmann
Author-email: Philipp Emanuel Weidmann <pew@worldwidemann.com>
License: 
Location: /usr/local/lib/python3.12/dist-packages
Requires: accelerate, bitsandbytes, datasets, hf-transfer, huggingface-hub, kernels, optuna, peft, psutil, pydantic-settings, questionary, rich, transformers
Required-by: 
---
Name: transformers
Version: 5.3.0
Summary: Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.
Home-page: https://github.com/huggingface/transformers
Author: The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/transformers/graphs/contributors)
Author-email: transformers@huggingface.co
License: Apache 2.0 License
Location: /usr/local/lib/python3.12/dist-packages
Requires: huggingface-hub, numpy, packaging, pyyaml, regex, safetensors, tokenizers, tqdm, typer
Required-by: heretic-llm, kaggle-environments, peft, sentence-transformers

Consider updating?

<!-- gh-comment-id:4062763273 --> @Vinay-Umrethe commented on GitHub (Mar 15, 2026): @Casdmo I ran a test with a similar command. ```bash heretic --model Qwen/Qwen3.5-9B --batch-size 64 --quantization NONE --max-memory '{"0": "10GB", "1": "10GB", "cpu": "28GB"}' ``` RESULTS look like: ```bash █░█░█▀▀░█▀▄░█▀▀░▀█▀░█░█▀▀ v1.2.0 █▀█░█▀▀░█▀▄░█▀▀░░█░░█░█░░ ▀░▀░▀▀▀░▀░▀░▀▀▀░░▀░░▀░▀▀▀ https://github.com/p-e-w/heretic Detected 2 CUDA device(s) (29.13 GB total VRAM): * GPU 0: Tesla T4 (14.56 GB) * GPU 1: Tesla T4 (14.56 GB) Loading model Qwen/Qwen3.5-9B... Loading weights: 100%|███████████████████████| 760/760 [00:04<00:00, 166.60it/s] Warning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads. Some parameters are on the meta device because they were offloaded to the cpu. Ok * LoRA adapters initialized (targets: out_proj, down_proj, o_proj) * Transformer model with 32 layers * Abliterable components: * attn.o_proj: 32 modules total * mlp.down_proj: 32 modules total Resident system RAM: 6.64 GB Allocated GPU VRAM: 15.65 GB Reserved GPU VRAM: 17.63 GB Loading good prompts from mlabonne/harmless_alpaca... * 400 prompts loaded Loading bad prompts from mlabonne/harmful_behaviors... * 400 prompts loaded Checking for common response prefix... * None found Loading good evaluation prompts from mlabonne/harmless_alpaca... * 100 prompts loaded * Obtaining first-token probability distributions... Loading bad evaluation prompts from mlabonne/harmful_behaviors... * 100 prompts loaded * Counting model refusals... * Initial refusals: 83/100 Calculating per-layer refusal directions... * Obtaining residuals for good prompts... * Obtaining residuals for bad prompts... Running trial 1 of 200... * Parameters: * direction_index = 16.89 * attn.o_proj.max_weight = 1.42 * attn.o_proj.max_weight_position = 28.80 * attn.o_proj.min_weight = 1.41 * attn.o_proj.min_weight_distance = 7.89 * mlp.down_proj.max_weight = 1.39 * mlp.down_proj.max_weight_position = 23.94 * mlp.down_proj.min_weight = 1.32 * mlp.down_proj.min_weight_distance = 5.65 * Resetting model... * Abliterating... * Evaluating... * Obtaining first-token probability distributions... * KL divergence: 0.0014 * Counting model refusals... * Refusals: 83/100 Elapsed time: 4m 37s Estimated remaining time: 15h 19m Resident system RAM: 6.77 GB Allocated GPU VRAM: 15.75 GB Reserved GPU VRAM: 21.21 GB Running trial 2 of 200... * Parameters: * direction_index = 13.81 * attn.o_proj.max_weight = 1.24 * attn.o_proj.max_weight_position = 29.26 * attn.o_proj.min_weight = 1.03 * attn.o_proj.min_weight_distance = 11.56 * mlp.down_proj.max_weight = 1.13 * mlp.down_proj.max_weight_position = 28.42 * mlp.down_proj.min_weight = 0.68 * mlp.down_proj.min_weight_distance = 5.25 * Resetting model... * Abliterating... * Evaluating... * Obtaining first-token probability distributions... * KL divergence: 0.0006 * Counting model refusals... * Refusals: 88/100 Elapsed time: 9m 16s Estimated remaining time: 15h 17m Resident system RAM: 6.77 GB Allocated GPU VRAM: 15.75 GB Reserved GPU VRAM: 20.83 GB Running trial 3 of 200... * Parameters: * direction_index = 20.45 * attn.o_proj.max_weight = 1.17 * attn.o_proj.max_weight_position = 24.29 * attn.o_proj.min_weight = 0.50 * attn.o_proj.min_weight_distance = 16.81 * mlp.down_proj.max_weight = 1.25 * mlp.down_proj.max_weight_position = 20.28 * mlp.down_proj.min_weight = 0.77 * mlp.down_proj.min_weight_distance = 6.04 * Resetting model... * Abliterating... * Evaluating... * Obtaining first-token probability distributions... * KL divergence: 0.0308 * Counting model refusals... ``` > it suggests KL divergence are different and refusals too. ### Packages Installed were: ```markdown Name: torch Version: 2.9.0+cu126 Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration Home-page: https://pytorch.org/ Author: Author-email: PyTorch Team <packages@pytorch.org> License: BSD-3-Clause Location: /usr/local/lib/python3.12/dist-packages Requires: filelock, fsspec, jinja2, networkx, nvidia-cublas-cu12, nvidia-cuda-cupti-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-runtime-cu12, nvidia-cudnn-cu12, nvidia-cufft-cu12, nvidia-cufile-cu12, nvidia-curand-cu12, nvidia-cusolver-cu12, nvidia-cusparse-cu12, nvidia-cusparselt-cu12, nvidia-nccl-cu12, nvidia-nvjitlink-cu12, nvidia-nvshmem-cu12, nvidia-nvtx-cu12, setuptools, sympy, triton, typing-extensions Required-by: accelerate, bitsandbytes, easyocr, fastai, kornia, peft, pytorch-ignite, pytorch-lightning, sentence-transformers, timm, torchaudio, torchdata, torchmetrics, torchvision --- Name: torchvision Version: 0.24.0+cu126 Summary: image and video datasets and models for torch deep learning Home-page: https://github.com/pytorch/vision Author: PyTorch Core Team Author-email: soumith@pytorch.org License: BSD Location: /usr/local/lib/python3.12/dist-packages Requires: numpy, pillow, torch Required-by: easyocr, fastai, timm --- Name: torchaudio Version: 2.9.0+cu126 Summary: An audio package for PyTorch Home-page: https://github.com/pytorch/audio Author: Soumith Chintala, David Pollack, Sean Naren, Peter Goldsborough, Moto Hira, Caroline Chen, Jeff Hwang, Zhaoheng Ni, Xiaohui Zhang Author-email: soumith@pytorch.org License: Location: /usr/local/lib/python3.12/dist-packages Requires: torch Required-by: --- Name: heretic-llm Version: 1.2.0 Summary: Fully automatic censorship removal for language models Home-page: https://github.com/p-e-w/heretic Author: Philipp Emanuel Weidmann Author-email: Philipp Emanuel Weidmann <pew@worldwidemann.com> License: Location: /usr/local/lib/python3.12/dist-packages Requires: accelerate, bitsandbytes, datasets, hf-transfer, huggingface-hub, kernels, optuna, peft, psutil, pydantic-settings, questionary, rich, transformers Required-by: --- Name: transformers Version: 5.3.0 Summary: Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training. Home-page: https://github.com/huggingface/transformers Author: The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/transformers/graphs/contributors) Author-email: transformers@huggingface.co License: Apache 2.0 License Location: /usr/local/lib/python3.12/dist-packages Requires: huggingface-hub, numpy, packaging, pyyaml, regex, safetensors, tokenizers, tqdm, typer Required-by: heretic-llm, kaggle-environments, peft, sentence-transformers ``` Consider updating?
Author
Owner

@p-e-w commented on GitHub (Mar 15, 2026):

I did a test run today with Qwen3.5-9B and my results match those from @Vinay-Umrethe. Something must be wrong with your setup, @Casdmo.

<!-- gh-comment-id:4063328370 --> @p-e-w commented on GitHub (Mar 15, 2026): I did a test run today with Qwen3.5-9B and my results match those from @Vinay-Umrethe. Something must be wrong with your setup, @Casdmo.
Author
Owner

@Casdmo commented on GitHub (Mar 15, 2026):

@p-e-w

user@host:~$ pipx runpip heretic-llm show torch torchvision torchaudio heretic-llm transformers
WARNING: Package(s) not found: torchaudio, torchvision
Name: torch
Version: 2.10.0
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org
Author: 
Author-email: PyTorch Team <packages@pytorch.org>
License: BSD-3-Clause
Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages
Requires: cuda-bindings, filelock, fsspec, jinja2, networkx, nvidia-cublas-cu12, nvidia-cuda-cupti-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-runtime-cu12, nvidia-cudnn-cu12, nvidia-cufft-cu12, nvidia-cufile-cu12, nvidia-curand-cu12, nvidia-cusolver-cu12, nvidia-cusparse-cu12, nvidia-cusparselt-cu12, nvidia-nccl-cu12, nvidia-nvjitlink-cu12, nvidia-nvshmem-cu12, nvidia-nvtx-cu12, setuptools, sympy, triton, typing-extensions
Required-by: accelerate, bitsandbytes, peft
---
Name: heretic-llm
Version: 1.2.0
Summary: Fully automatic censorship removal for language models
Home-page: https://github.com/p-e-w/heretic
Author: Philipp Emanuel Weidmann
Author-email: Philipp Emanuel Weidmann <pew@worldwidemann.com>
License-Expression: AGPL-3.0-or-later
Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages
Requires: accelerate, bitsandbytes, datasets, hf-transfer, huggingface-hub, kernels, optuna, peft, psutil, pydantic-settings, questionary, rich, transformers
Required-by: 
---
Name: transformers
Version: 5.3.0
Summary: Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.
Home-page: https://github.com/huggingface/transformers
Author: The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/transformers/graphs/contributors)
Author-email: transformers@huggingface.co
License: Apache 2.0 License
Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages
Requires: huggingface-hub, numpy, packaging, pyyaml, regex, safetensors, tokenizers, tqdm, typer
Required-by: heretic-llm, peft
user@host:~$

My system has torch 2.10.0 instead of 2.9.0+cu126 and lacks torchvision and torchaudio. Would you recommend pipx inject heretic-llm torchvision torchaudio --pip-args="--upgrade" at this point? Should I instead run pipx inject heretic-llm torch==2.9.0+cu126 torchvision==0.24.0+cu126 torchaudio==2.9.0+cu126 --pip-args="--upgrade --index-url https://download.pytorch.org/whl/cu126" to get those specific versions?

<!-- gh-comment-id:4063464541 --> @Casdmo commented on GitHub (Mar 15, 2026): @p-e-w ``` user@host:~$ pipx runpip heretic-llm show torch torchvision torchaudio heretic-llm transformers WARNING: Package(s) not found: torchaudio, torchvision Name: torch Version: 2.10.0 Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration Home-page: https://pytorch.org Author: Author-email: PyTorch Team <packages@pytorch.org> License: BSD-3-Clause Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages Requires: cuda-bindings, filelock, fsspec, jinja2, networkx, nvidia-cublas-cu12, nvidia-cuda-cupti-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-runtime-cu12, nvidia-cudnn-cu12, nvidia-cufft-cu12, nvidia-cufile-cu12, nvidia-curand-cu12, nvidia-cusolver-cu12, nvidia-cusparse-cu12, nvidia-cusparselt-cu12, nvidia-nccl-cu12, nvidia-nvjitlink-cu12, nvidia-nvshmem-cu12, nvidia-nvtx-cu12, setuptools, sympy, triton, typing-extensions Required-by: accelerate, bitsandbytes, peft --- Name: heretic-llm Version: 1.2.0 Summary: Fully automatic censorship removal for language models Home-page: https://github.com/p-e-w/heretic Author: Philipp Emanuel Weidmann Author-email: Philipp Emanuel Weidmann <pew@worldwidemann.com> License-Expression: AGPL-3.0-or-later Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages Requires: accelerate, bitsandbytes, datasets, hf-transfer, huggingface-hub, kernels, optuna, peft, psutil, pydantic-settings, questionary, rich, transformers Required-by: --- Name: transformers Version: 5.3.0 Summary: Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training. Home-page: https://github.com/huggingface/transformers Author: The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/transformers/graphs/contributors) Author-email: transformers@huggingface.co License: Apache 2.0 License Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages Requires: huggingface-hub, numpy, packaging, pyyaml, regex, safetensors, tokenizers, tqdm, typer Required-by: heretic-llm, peft user@host:~$ ``` My system has torch 2.10.0 instead of 2.9.0+cu126 and lacks torchvision and torchaudio. Would you recommend `pipx inject heretic-llm torchvision torchaudio --pip-args="--upgrade"` at this point? Should I instead run `pipx inject heretic-llm torch==2.9.0+cu126 torchvision==0.24.0+cu126 torchaudio==2.9.0+cu126 --pip-args="--upgrade --index-url https://download.pytorch.org/whl/cu126"` to get those specific versions?
Author
Owner

@p-e-w commented on GitHub (Mar 16, 2026):

This issue is getting too complicated, mixing multiple unrelated things.

Please state clearly what the problem you're encountering actually is. The issue title is "No common response prefix found for Qwen3.5 models". This is a non-issue unless Qwen3.5 models always return the same prefix, which I'm not sure is the case.

<!-- gh-comment-id:4065752877 --> @p-e-w commented on GitHub (Mar 16, 2026): This issue is getting too complicated, mixing multiple unrelated things. Please state clearly what the problem you're encountering actually is. The issue title is "No common response prefix found for Qwen3.5 models". This is a non-issue unless Qwen3.5 models *always* return the same prefix, which I'm not sure is the case.
Author
Owner

@Casdmo commented on GitHub (Mar 16, 2026):

The problem I'm encountering is that heretic seems not to be detecting the refusals of Qwen3.5-9B on my setup. I mentioned it here because I suspected it could be related to response prefixes, but I'm not certain it is. Would you prefer I start a new issue thread?

@p-e-w @Vinay-Umrethe

I tried it with torch 2.10.0, torchvision 0.25.0, torchaudio 2.10.0, and batch size 32. The result was still 0/100 refusals.

Then I tried it with torch 2.9.0+cu126, torchvision 0.24.0+cu126, and torchaudio 2.9.0+cu126. Batch size 32 caused "CUDA out of memory," so I halved it to 16. It's been at "Counting model refusals..." for about eight hours. nvidia-smi still shows GPU use oscillating between 95%-100% and heretic-llm using several thousand MiB of VRAM, so I guess it's just remarkably slow, not hung. The GPU is hovering around 52C and 56W.

While speculative, I suspect torch 2.10.0, torchvision 0.25.0, and torchaudio 2.10.0 make far better use of my VRAM than torch 2.9.0+cu126, torchvision 0.24.0+cu126, and torchaudio 2.9.0+cu126 do.

Here's the run with torch 2.10.0, torchvision 0.25.0, and torchaudio 2.10.0:

user@host:~$ pipx inject heretic-llm torchvision torchaudio --pip-args="--upgrade"                                  
  injected package torchvision into venv heretic-llm                                                                  
done! ✨ 🌟 ✨                                                                                                        
  injected package torchaudio into venv heretic-llm                                                                   
done! ✨ 🌟 ✨                                                                                                        
user@host:~$ pipx runpip heretic-llm show torch torchvision torchaudio heretic-llm transformers                     
Name: torch                                                                                                           
Version: 2.10.0                                                                                                       
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration                                   
Home-page: https://pytorch.org                                                                                        
Author:                                                                                                               
Author-email: PyTorch Team <packages@pytorch.org>                                                                     
License: BSD-3-Clause                                                                                                 
Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages                               
Requires: cuda-bindings, filelock, fsspec, jinja2, networkx, nvidia-cublas-cu12, nvidia-cuda-cupti-cu12, nvidia-cuda-n
vrtc-cu12, nvidia-cuda-runtime-cu12, nvidia-cudnn-cu12, nvidia-cufft-cu12, nvidia-cufile-cu12, nvidia-curand-cu12, nvi
dia-cusolver-cu12, nvidia-cusparse-cu12, nvidia-cusparselt-cu12, nvidia-nccl-cu12, nvidia-nvjitlink-cu12, nvidia-nvshm
em-cu12, nvidia-nvtx-cu12, setuptools, sympy, triton, typing-extensions                                               
Required-by: accelerate, bitsandbytes, peft, torchaudio, torchvision                                                  
---                                                                                                                   
Name: torchvision                                                                                                     
Version: 0.25.0                                                                                                       
Summary: image and video datasets and models for torch deep learning                                                  
Home-page: https://github.com/pytorch/vision                                                                          
Author: PyTorch Core Team                                                                                             
Author-email: soumith@pytorch.org                                                                                     
License: BSD                                                                                                          
Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages                               
Requires: numpy, pillow, torch                                                                                        
Required-by:                                                                                                          
---                                                                                                                   
Name: torchaudio                                                                                                      
Version: 2.10.0                                                                                                       
Summary: An audio package for PyTorch                                                                                 
Home-page: https://github.com/pytorch/audio                                                                           
Author: Soumith Chintala, David Pollack, Sean Naren, Peter Goldsborough, Moto Hira, Caroline Chen, Jeff Hwang, Zhaohen
g Ni, Xiaohui Zhang                                                                                                   
Author-email: soumith@pytorch.org                                                                                     
License:                                                                                                              
Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages                               
Requires: torch                                                                                                       
Required-by:                                                                                                          
---
Name: heretic-llm                                                                                                     
Version: 1.2.0                                                                                                        
Summary: Fully automatic censorship removal for language models                                                       
Home-page: https://github.com/p-e-w/heretic                                                                           
Author: Philipp Emanuel Weidmann                                                                                      
Author-email: Philipp Emanuel Weidmann <pew@worldwidemann.com>                                                        
License-Expression: AGPL-3.0-or-later                                                                                 
Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages                               
Requires: accelerate, bitsandbytes, datasets, hf-transfer, huggingface-hub, kernels, optuna, peft, psutil, pydantic-se
ttings, questionary, rich, transformers                    
Required-by:                                                                                                          
---                                                                                                                   
Name: transformers                                                                                                    
Version: 5.3.0                                                                                                        
Summary: Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, au
dio, and multimodal models, for both inference and training.
Home-page: https://github.com/huggingface/transformers                                                                
Author: The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/
transformers/graphs/contributors)                          
Author-email: transformers@huggingface.co                                                                             
License: Apache 2.0 License                                                                                           
Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages
Requires: huggingface-hub, numpy, packaging, pyyaml, regex, safetensors, tokenizers, tqdm, typer
Required-by: heretic-llm, peft                                                                                        
user@host:~$ PYTORCH_ALLOC_CONF=expandable_segments:True heretic --model ~/HuggingFace/Qwen3.5-9B --quantization NON
E --device-map auto --max-memory '{"0": "9GB", "cpu": "28GB"}' --batch-size 32                                        

█░█░█▀▀░█▀▄░█▀▀░▀█▀░█░█▀▀  v1.2.0                                                                                     
█▀█░█▀▀░█▀▄░█▀▀░░█░░█░█░░                                                                                             
▀░▀░▀▀▀░▀░▀░▀▀▀░░▀░░▀░▀▀▀  https://github.com/p-e-w/heretic                                                           

Detected 1 CUDA device(s) (11.63 GB total VRAM):                                                                      
* GPU 0: NVIDIA GeForce RTX 3060 (11.63 GB)                                                                           

You have already processed this model, but the run was interrupted. You can continue the previous run from where it st
opped. This will override any specified settings. Alternatively, you can ignore the previous run and start from scratc
h.                           
This will delete the checkpoint file and all results from the previous run.

? How would you like to proceed? Ignore the previous run and start from scratch

Loading model /home/user/HuggingFace/Qwen3.5-9B...                                                                  
Loading weights: 100%|████████████████████████████████████████████████████████████████████████████████████████████████
███████████████████████████████████████████████████████████████████████████████████████| 760/760 [00:05<00:00, 140.97i
t/s]                         
Some parameters are on the meta device because they were offloaded to the cpu.
Ok                                                                                                                    
* LoRA adapters initialized (targets: down_proj, o_proj, out_proj)
* Transformer model with 32 layers                                                                                    
* Abliterable components:                                                                                             
  * attn.o_proj: 32 modules total                                                                                     
  * mlp.down_proj: 32 modules total

Resident system RAM: 19.26 GB                                                                                         
Allocated GPU VRAM: 6.38 GB                                                                                           
Reserved GPU VRAM: 8.35 GB                                                                                            

Loading good prompts from mlabonne/harmless_alpaca...                                                                 
* 400 prompts loaded                                                                                                  

Loading bad prompts from mlabonne/harmful_behaviors...                                                                
* 400 prompts loaded                                                                                                  

Checking for common response prefix...                                                                                
* None found                                                                                                          

Loading good evaluation prompts from mlabonne/harmless_alpaca...
* 100 prompts loaded                                                                                                  
* Obtaining first-token probability distributions...                                                                  

Loading bad evaluation prompts from mlabonne/harmful_behaviors...
* 100 prompts loaded                                                                                                  
* Counting model refusals...                                                                                          
* Initial refusals: 0/100                                                                                             

Calculating per-layer refusal directions...                                                                           
* Obtaining residuals for good prompts...                                                                             
* Obtaining residuals for bad prompts...                                                                              

Running trial 1 of 200...                                                                                             
* Parameters:                                                                                                         
  * direction_index = 21.47                                                                                           
  * attn.o_proj.max_weight = 0.88                                                                                     
  * attn.o_proj.max_weight_position = 25.24                                                                           
  * attn.o_proj.min_weight = 0.13                                                                                     
  * attn.o_proj.min_weight_distance = 3.85                                                                            
  * mlp.down_proj.max_weight = 0.84                                                                                   
  * mlp.down_proj.max_weight_position = 19.50                                                                         
  * mlp.down_proj.min_weight = 0.84                                                                                   
  * mlp.down_proj.min_weight_distance = 11.97                                                                         
* Resetting model...                                                                                                  
* Abliterating...                                                                                                     
* Evaluating...                                                                                                       
  * Obtaining first-token probability distributions...                                                                
  * KL divergence: 4.6525                                                                                             
  * Counting model refusals...                                                                                        
  * Refusals: 0/100                                                                                                   

Elapsed time: 9m 34s                                                                                                  
Estimated remaining time: 31h 43m                                                                                     
Resident system RAM: 19.40 GB                                                                                         
Allocated GPU VRAM: 6.48 GB                                                                                           
Reserved GPU VRAM: 8.73 GB

Running trial 2 of 200...                                                                                             
* Parameters:                                                                                                         
  * direction_index = per layer                                                                                       
  * attn.o_proj.max_weight = 1.08                                                                                     
  * attn.o_proj.max_weight_position = 20.40                                                                           
  * attn.o_proj.min_weight = 0.98                                                                                     
  * attn.o_proj.min_weight_distance = 8.68                                                                            
  * mlp.down_proj.max_weight = 1.31                                                                                   
  * mlp.down_proj.max_weight_position = 23.80                                                                         
  * mlp.down_proj.min_weight = 0.43                                                                                   
  * mlp.down_proj.min_weight_distance = 3.36                                                                          
* Resetting model...                                                                                                  
* Abliterating...                                                                                                     
* Evaluating...                                                                                                       
  * Obtaining first-token probability distributions...                                                                
  * KL divergence: 4.6546                                                                                             
  * Counting model refusals...                                                                                        
  * Refusals: 0/100          

Elapsed time: 19m 10s                                      
Estimated remaining time: 31h 38m                          
Resident system RAM: 19.40 GB                              
Allocated GPU VRAM: 6.48 GB                                
Reserved GPU VRAM: 8.73 GB

Here's the run with torch 2.9.0+cu126, torchvision 0.24.0+cu126, and torchaudio 2.9.0+cu126:

user@host:~$ pipx inject heretic-llm torch==2.9.0+cu126 torchvision==0.24.0+cu126 torchaudio==2.9.0+cu126 --pip-args
="--upgrade --index-url https://download.pytorch.org/whl/cu126"                                                       
  injected package torch into venv heretic-llm                                                                        
done! ✨ 🌟 ✨                                                                                                        
  injected package torchvision into venv heretic-llm                                                                  
done! ✨ 🌟 ✨                                                                                                        
  injected package torchaudio into venv heretic-llm                                                                   
done! ✨ 🌟 ✨                                                                                                        
user@host:~$ pipx runpip heretic-llm show torch torchvision torchaudio heretic-llm transformers                     
Name: torch                                                                                                           
Version: 2.9.0+cu126                                                                                                  
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration                                   
Home-page: https://pytorch.org                                                                                        
Author:                                                                                                               
Author-email: PyTorch Team <packages@pytorch.org>                                                                     
License: BSD-3-Clause                                                                                                 
Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages                               
Requires: filelock, fsspec, jinja2, networkx, nvidia-cublas-cu12, nvidia-cuda-cupti-cu12, nvidia-cuda-nvrtc-cu12, nvid
ia-cuda-runtime-cu12, nvidia-cudnn-cu12, nvidia-cufft-cu12, nvidia-cufile-cu12, nvidia-curand-cu12, nvidia-cusolver-cu
12, nvidia-cusparse-cu12, nvidia-cusparselt-cu12, nvidia-nccl-cu12, nvidia-nvjitlink-cu12, nvidia-nvshmem-cu12, nvidia
-nvtx-cu12, setuptools, sympy, triton, typing-extensions                                                              
Required-by: accelerate, bitsandbytes, peft, torchaudio, torchvision                                                  
---                                                                                                                   
Name: torchvision                                                                                                     
Version: 0.24.0+cu126                                                                                                 
Summary: image and video datasets and models for torch deep learning                                                  
Home-page: https://github.com/pytorch/vision                                                                          
Author: PyTorch Core Team                                                                                             
Author-email: soumith@pytorch.org                                                                                     
License: BSD                                                                                                          
Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages                               
Requires: numpy, pillow, torch                                                                                        
Required-by:                                                                                                          
---                                                                                                                   
Name: torchaudio                                                                                                      
Version: 2.9.0+cu126                                                                                                  
Summary: An audio package for PyTorch                                                                                 
Home-page: https://github.com/pytorch/audio                                                                           
Author: Soumith Chintala, David Pollack, Sean Naren, Peter Goldsborough, Moto Hira, Caroline Chen, Jeff Hwang, Zhaohen
g Ni, Xiaohui Zhang                                                                                                   
Author-email: soumith@pytorch.org                                                                                     
License:                                                                                                              
Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages                               
Requires: torch                                                                                                       
Required-by:                                                                                                          
---
Name: heretic-llm                                                                                                     
Version: 1.2.0                                                                                                        
Summary: Fully automatic censorship removal for language models                                                       
Home-page: https://github.com/p-e-w/heretic                                                                           
Author: Philipp Emanuel Weidmann                                                                                      
Author-email: Philipp Emanuel Weidmann <pew@worldwidemann.com>                                                        
License-Expression: AGPL-3.0-or-later
Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages
Requires: accelerate, bitsandbytes, datasets, hf-transfer, huggingface-hub, kernels, optuna, peft, psutil, pydantic-se
ttings, questionary, rich, transformers
Required-by: 
---
Name: transformers
Version: 5.3.0
Summary: Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, au
dio, and multimodal models, for both inference and training.
Home-page: https://github.com/huggingface/transformers
Author: The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/
transformers/graphs/contributors)
Author-email: transformers@huggingface.co
License: Apache 2.0 License
Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages
Requires: huggingface-hub, numpy, packaging, pyyaml, regex, safetensors, tokenizers, tqdm, typer
Required-by: heretic-llm, peft
user@host:~$ PYTORCH_ALLOC_CONF=expandable_segments:True heretic --model ~/HuggingFace/Qwen3.5-9B --quantization NON
E --device-map auto --max-memory '{"0": "9GB", "cpu": "28GB"}' --batch-size 16
█░█░█▀▀░█▀▄░█▀▀░▀█▀░█░█▀▀  v1.2.0                                                                                     
█▀█░█▀▀░█▀▄░█▀▀░░█░░█░█░░                                                                                             
▀░▀░▀▀▀░▀░▀░▀▀▀░░▀░░▀░▀▀▀  https://github.com/p-e-w/heretic                                                           

Detected 1 CUDA device(s) (11.63 GB total VRAM):                                                                      
* GPU 0: NVIDIA GeForce RTX 3060 (11.63 GB)                                                                           

Loading model /home/user/HuggingFace/Qwen3.5-9B...                                                                  
Loading weights: 100%|████████████████████████████████████████████████████████████████████████████████████████████████
███████████████████████████████████████████████████████████████████████████████████████| 760/760 [00:00<00:00, 842.28i
t/s]
Some parameters are on the meta device because they were offloaded to the cpu.
Ok                                                                                                                    
* LoRA adapters initialized (targets: out_proj, o_proj, down_proj)
* Transformer model with 32 layers                                                                                    
* Abliterable components:                                                                                             
  * attn.o_proj: 32 modules total                                                                                     
  * mlp.down_proj: 32 modules total                                                                                   

Resident system RAM: 19.21 GB                                                                                         
Allocated GPU VRAM: 6.38 GB                                                                                           
Reserved GPU VRAM: 8.34 GB                                                                                            

Loading good prompts from mlabonne/harmless_alpaca...                                                                 
* 400 prompts loaded                                                                                                  

Loading bad prompts from mlabonne/harmful_behaviors...                                                                
* 400 prompts loaded                                                                                                  

Checking for common response prefix...                                                                                
* None found                                                                                                          

Loading good evaluation prompts from mlabonne/harmless_alpaca...
* 100 prompts loaded                                                                                                  
* Obtaining first-token probability distributions...                                                                  

Loading bad evaluation prompts from mlabonne/harmful_behaviors...
* 100 prompts loaded                                                                                                  
* Counting model refusals...

And it's been like that for about eight hours.

What else might be wrong with my setup?

<!-- gh-comment-id:4065778983 --> @Casdmo commented on GitHub (Mar 16, 2026): The problem I'm encountering is that heretic seems not to be detecting the refusals of Qwen3.5-9B on my setup. I mentioned it here because I *suspected* it could be related to response prefixes, but I'm not certain it is. Would you prefer I start a new issue thread? @p-e-w @Vinay-Umrethe I tried it with torch 2.10.0, torchvision 0.25.0, torchaudio 2.10.0, and batch size 32. The result was still 0/100 refusals. Then I tried it with torch 2.9.0+cu126, torchvision 0.24.0+cu126, and torchaudio 2.9.0+cu126. Batch size 32 caused "CUDA out of memory," so I halved it to 16. It's been at "Counting model refusals..." for about eight hours. `nvidia-smi` still shows GPU use oscillating between 95%-100% and heretic-llm using several thousand MiB of VRAM, so I guess it's just remarkably slow, not hung. The GPU is hovering around 52C and 56W. While speculative, I suspect torch 2.10.0, torchvision 0.25.0, and torchaudio 2.10.0 make far better use of my VRAM than torch 2.9.0+cu126, torchvision 0.24.0+cu126, and torchaudio 2.9.0+cu126 do. Here's the run with torch 2.10.0, torchvision 0.25.0, and torchaudio 2.10.0: ``` user@host:~$ pipx inject heretic-llm torchvision torchaudio --pip-args="--upgrade" injected package torchvision into venv heretic-llm done! ✨ 🌟 ✨ injected package torchaudio into venv heretic-llm done! ✨ 🌟 ✨ user@host:~$ pipx runpip heretic-llm show torch torchvision torchaudio heretic-llm transformers Name: torch Version: 2.10.0 Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration Home-page: https://pytorch.org Author: Author-email: PyTorch Team <packages@pytorch.org> License: BSD-3-Clause Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages Requires: cuda-bindings, filelock, fsspec, jinja2, networkx, nvidia-cublas-cu12, nvidia-cuda-cupti-cu12, nvidia-cuda-n vrtc-cu12, nvidia-cuda-runtime-cu12, nvidia-cudnn-cu12, nvidia-cufft-cu12, nvidia-cufile-cu12, nvidia-curand-cu12, nvi dia-cusolver-cu12, nvidia-cusparse-cu12, nvidia-cusparselt-cu12, nvidia-nccl-cu12, nvidia-nvjitlink-cu12, nvidia-nvshm em-cu12, nvidia-nvtx-cu12, setuptools, sympy, triton, typing-extensions Required-by: accelerate, bitsandbytes, peft, torchaudio, torchvision --- Name: torchvision Version: 0.25.0 Summary: image and video datasets and models for torch deep learning Home-page: https://github.com/pytorch/vision Author: PyTorch Core Team Author-email: soumith@pytorch.org License: BSD Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages Requires: numpy, pillow, torch Required-by: --- Name: torchaudio Version: 2.10.0 Summary: An audio package for PyTorch Home-page: https://github.com/pytorch/audio Author: Soumith Chintala, David Pollack, Sean Naren, Peter Goldsborough, Moto Hira, Caroline Chen, Jeff Hwang, Zhaohen g Ni, Xiaohui Zhang Author-email: soumith@pytorch.org License: Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages Requires: torch Required-by: --- Name: heretic-llm Version: 1.2.0 Summary: Fully automatic censorship removal for language models Home-page: https://github.com/p-e-w/heretic Author: Philipp Emanuel Weidmann Author-email: Philipp Emanuel Weidmann <pew@worldwidemann.com> License-Expression: AGPL-3.0-or-later Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages Requires: accelerate, bitsandbytes, datasets, hf-transfer, huggingface-hub, kernels, optuna, peft, psutil, pydantic-se ttings, questionary, rich, transformers Required-by: --- Name: transformers Version: 5.3.0 Summary: Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, au dio, and multimodal models, for both inference and training. Home-page: https://github.com/huggingface/transformers Author: The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/ transformers/graphs/contributors) Author-email: transformers@huggingface.co License: Apache 2.0 License Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages Requires: huggingface-hub, numpy, packaging, pyyaml, regex, safetensors, tokenizers, tqdm, typer Required-by: heretic-llm, peft user@host:~$ PYTORCH_ALLOC_CONF=expandable_segments:True heretic --model ~/HuggingFace/Qwen3.5-9B --quantization NON E --device-map auto --max-memory '{"0": "9GB", "cpu": "28GB"}' --batch-size 32 █░█░█▀▀░█▀▄░█▀▀░▀█▀░█░█▀▀ v1.2.0 █▀█░█▀▀░█▀▄░█▀▀░░█░░█░█░░ ▀░▀░▀▀▀░▀░▀░▀▀▀░░▀░░▀░▀▀▀ https://github.com/p-e-w/heretic Detected 1 CUDA device(s) (11.63 GB total VRAM): * GPU 0: NVIDIA GeForce RTX 3060 (11.63 GB) You have already processed this model, but the run was interrupted. You can continue the previous run from where it st opped. This will override any specified settings. Alternatively, you can ignore the previous run and start from scratc h. This will delete the checkpoint file and all results from the previous run. ? How would you like to proceed? Ignore the previous run and start from scratch Loading model /home/user/HuggingFace/Qwen3.5-9B... Loading weights: 100%|████████████████████████████████████████████████████████████████████████████████████████████████ ███████████████████████████████████████████████████████████████████████████████████████| 760/760 [00:05<00:00, 140.97i t/s] Some parameters are on the meta device because they were offloaded to the cpu. Ok * LoRA adapters initialized (targets: down_proj, o_proj, out_proj) * Transformer model with 32 layers * Abliterable components: * attn.o_proj: 32 modules total * mlp.down_proj: 32 modules total Resident system RAM: 19.26 GB Allocated GPU VRAM: 6.38 GB Reserved GPU VRAM: 8.35 GB Loading good prompts from mlabonne/harmless_alpaca... * 400 prompts loaded Loading bad prompts from mlabonne/harmful_behaviors... * 400 prompts loaded Checking for common response prefix... * None found Loading good evaluation prompts from mlabonne/harmless_alpaca... * 100 prompts loaded * Obtaining first-token probability distributions... Loading bad evaluation prompts from mlabonne/harmful_behaviors... * 100 prompts loaded * Counting model refusals... * Initial refusals: 0/100 Calculating per-layer refusal directions... * Obtaining residuals for good prompts... * Obtaining residuals for bad prompts... Running trial 1 of 200... * Parameters: * direction_index = 21.47 * attn.o_proj.max_weight = 0.88 * attn.o_proj.max_weight_position = 25.24 * attn.o_proj.min_weight = 0.13 * attn.o_proj.min_weight_distance = 3.85 * mlp.down_proj.max_weight = 0.84 * mlp.down_proj.max_weight_position = 19.50 * mlp.down_proj.min_weight = 0.84 * mlp.down_proj.min_weight_distance = 11.97 * Resetting model... * Abliterating... * Evaluating... * Obtaining first-token probability distributions... * KL divergence: 4.6525 * Counting model refusals... * Refusals: 0/100 Elapsed time: 9m 34s Estimated remaining time: 31h 43m Resident system RAM: 19.40 GB Allocated GPU VRAM: 6.48 GB Reserved GPU VRAM: 8.73 GB Running trial 2 of 200... * Parameters: * direction_index = per layer * attn.o_proj.max_weight = 1.08 * attn.o_proj.max_weight_position = 20.40 * attn.o_proj.min_weight = 0.98 * attn.o_proj.min_weight_distance = 8.68 * mlp.down_proj.max_weight = 1.31 * mlp.down_proj.max_weight_position = 23.80 * mlp.down_proj.min_weight = 0.43 * mlp.down_proj.min_weight_distance = 3.36 * Resetting model... * Abliterating... * Evaluating... * Obtaining first-token probability distributions... * KL divergence: 4.6546 * Counting model refusals... * Refusals: 0/100 Elapsed time: 19m 10s Estimated remaining time: 31h 38m Resident system RAM: 19.40 GB Allocated GPU VRAM: 6.48 GB Reserved GPU VRAM: 8.73 GB ``` Here's the run with torch 2.9.0+cu126, torchvision 0.24.0+cu126, and torchaudio 2.9.0+cu126: ``` user@host:~$ pipx inject heretic-llm torch==2.9.0+cu126 torchvision==0.24.0+cu126 torchaudio==2.9.0+cu126 --pip-args ="--upgrade --index-url https://download.pytorch.org/whl/cu126" injected package torch into venv heretic-llm done! ✨ 🌟 ✨ injected package torchvision into venv heretic-llm done! ✨ 🌟 ✨ injected package torchaudio into venv heretic-llm done! ✨ 🌟 ✨ user@host:~$ pipx runpip heretic-llm show torch torchvision torchaudio heretic-llm transformers Name: torch Version: 2.9.0+cu126 Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration Home-page: https://pytorch.org Author: Author-email: PyTorch Team <packages@pytorch.org> License: BSD-3-Clause Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages Requires: filelock, fsspec, jinja2, networkx, nvidia-cublas-cu12, nvidia-cuda-cupti-cu12, nvidia-cuda-nvrtc-cu12, nvid ia-cuda-runtime-cu12, nvidia-cudnn-cu12, nvidia-cufft-cu12, nvidia-cufile-cu12, nvidia-curand-cu12, nvidia-cusolver-cu 12, nvidia-cusparse-cu12, nvidia-cusparselt-cu12, nvidia-nccl-cu12, nvidia-nvjitlink-cu12, nvidia-nvshmem-cu12, nvidia -nvtx-cu12, setuptools, sympy, triton, typing-extensions Required-by: accelerate, bitsandbytes, peft, torchaudio, torchvision --- Name: torchvision Version: 0.24.0+cu126 Summary: image and video datasets and models for torch deep learning Home-page: https://github.com/pytorch/vision Author: PyTorch Core Team Author-email: soumith@pytorch.org License: BSD Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages Requires: numpy, pillow, torch Required-by: --- Name: torchaudio Version: 2.9.0+cu126 Summary: An audio package for PyTorch Home-page: https://github.com/pytorch/audio Author: Soumith Chintala, David Pollack, Sean Naren, Peter Goldsborough, Moto Hira, Caroline Chen, Jeff Hwang, Zhaohen g Ni, Xiaohui Zhang Author-email: soumith@pytorch.org License: Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages Requires: torch Required-by: --- Name: heretic-llm Version: 1.2.0 Summary: Fully automatic censorship removal for language models Home-page: https://github.com/p-e-w/heretic Author: Philipp Emanuel Weidmann Author-email: Philipp Emanuel Weidmann <pew@worldwidemann.com> License-Expression: AGPL-3.0-or-later Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages Requires: accelerate, bitsandbytes, datasets, hf-transfer, huggingface-hub, kernels, optuna, peft, psutil, pydantic-se ttings, questionary, rich, transformers Required-by: --- Name: transformers Version: 5.3.0 Summary: Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, au dio, and multimodal models, for both inference and training. Home-page: https://github.com/huggingface/transformers Author: The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/ transformers/graphs/contributors) Author-email: transformers@huggingface.co License: Apache 2.0 License Location: /home/user/.local/share/pipx/venvs/heretic-llm/lib/python3.12/site-packages Requires: huggingface-hub, numpy, packaging, pyyaml, regex, safetensors, tokenizers, tqdm, typer Required-by: heretic-llm, peft user@host:~$ PYTORCH_ALLOC_CONF=expandable_segments:True heretic --model ~/HuggingFace/Qwen3.5-9B --quantization NON E --device-map auto --max-memory '{"0": "9GB", "cpu": "28GB"}' --batch-size 16 █░█░█▀▀░█▀▄░█▀▀░▀█▀░█░█▀▀ v1.2.0 █▀█░█▀▀░█▀▄░█▀▀░░█░░█░█░░ ▀░▀░▀▀▀░▀░▀░▀▀▀░░▀░░▀░▀▀▀ https://github.com/p-e-w/heretic Detected 1 CUDA device(s) (11.63 GB total VRAM): * GPU 0: NVIDIA GeForce RTX 3060 (11.63 GB) Loading model /home/user/HuggingFace/Qwen3.5-9B... Loading weights: 100%|████████████████████████████████████████████████████████████████████████████████████████████████ ███████████████████████████████████████████████████████████████████████████████████████| 760/760 [00:00<00:00, 842.28i t/s] Some parameters are on the meta device because they were offloaded to the cpu. Ok * LoRA adapters initialized (targets: out_proj, o_proj, down_proj) * Transformer model with 32 layers * Abliterable components: * attn.o_proj: 32 modules total * mlp.down_proj: 32 modules total Resident system RAM: 19.21 GB Allocated GPU VRAM: 6.38 GB Reserved GPU VRAM: 8.34 GB Loading good prompts from mlabonne/harmless_alpaca... * 400 prompts loaded Loading bad prompts from mlabonne/harmful_behaviors... * 400 prompts loaded Checking for common response prefix... * None found Loading good evaluation prompts from mlabonne/harmless_alpaca... * 100 prompts loaded * Obtaining first-token probability distributions... Loading bad evaluation prompts from mlabonne/harmful_behaviors... * 100 prompts loaded * Counting model refusals... ``` And it's been like that for about eight hours. What else might be wrong with my setup?
Author
Owner

@p-e-w commented on GitHub (Mar 16, 2026):

Would you prefer I start a new issue thread?

Yes, please open a new issue, and post the contents of one or two (not all!) responses that you can get by passing --print-responses.

I'm closing this original issue as "not a bug", unless someone can give me a good reason to believe otherwise.

<!-- gh-comment-id:4065809936 --> @p-e-w commented on GitHub (Mar 16, 2026): > Would you prefer I start a new issue thread? Yes, please open a new issue, and post the contents of *one or two* (not all!) responses that you can get by passing `--print-responses`. I'm closing this original issue as "not a bug", unless someone can give me a good reason to believe otherwise.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
p-e-w/heretic#123
No description provided.