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
Labels
No labels
bug
enhancement
enhancement
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
p-e-w/heretic#123
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @imezx on GitHub (Mar 8, 2026).
Original GitHub issue: https://github.com/p-e-w/heretic/issues/216
so i was filtering the model i finetuned, but i noticed if there is no common response prefix found here, is this normal?
heretic --batch-size 128 khtsly/Qwen3.5-27B-Abliterated-Claude-4.6-Opus-Distilled-32k@imezx commented on GitHub (Mar 8, 2026):
the model is an 27b dense which is a thinking model not instruct.
@imezx commented on GitHub (Mar 8, 2026):
@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.
@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 around0.000-0.001.@p-e-w commented on GitHub (Mar 10, 2026):
I'm not sure I understand what the bug supposedly is here.
@Vinay-Umrethe commented on GitHub (Mar 11, 2026):
if so, according to model's readme it says:
https://huggingface.co/Qwen/Qwen3.5-4B#quickstart
and heretic don't have that new
\n... \n\nthing in it's elif list for detecting.@p-e-w
@p-e-w commented on GitHub (Mar 11, 2026):
It does. The code checks whether the response starts with
<think>, which covers the template you cited.@Casdmo commented on GitHub (Mar 14, 2026):
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:
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?
@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.
@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.
@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.
@Casdmo commented on GitHub (Mar 15, 2026):
@p-e-w
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 runpipx install --force git+https://github.com/p-e-w/heretic.gitto get the latest commits.My Heretic command syntax and some of the output:
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?@Vinay-Umrethe commented on GitHub (Mar 15, 2026):
@Casdmo
I ran a test with a similar command.
RESULTS look like:
Packages Installed were:
Consider updating?
@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.
@Casdmo commented on GitHub (Mar 15, 2026):
@p-e-w
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 runpipx 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?@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.
@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-smistill 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:
Here's the run with torch 2.9.0+cu126, torchvision 0.24.0+cu126, and torchaudio 2.9.0+cu126:
And it's been like that for about eight hours.
What else might be wrong with my setup?
@p-e-w commented on GitHub (Mar 16, 2026):
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.