mirror of
https://github.com/p-e-w/heretic.git
synced 2026-12-03 18:42:57 +07:00
[GH-ISSUE #201] Can distinguish between Vendor Embedded Refusal (VER) behaviors and User Requested Refusal (URR) behaviors? #116
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#116
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 @red-co on GitHub (Feb 28, 2026).
Original GitHub issue: https://github.com/p-e-w/heretic/issues/201
In the current situation, using a heretic model presents a problem:
it doesn't reject any requests, even if the user has explicitly instructed the system to reject them under specific circumstances. // Internal RP story ethics. A model not destroyed by heretic can follow these instructions and correctly reject requests.
The goal is to eliminate Vendor Embedded Refusal (VER) . For User Requested Refusal (URR), can we retain it?
@red-co commented on GitHub (Feb 28, 2026):
Or, can we choose to retain it or not?
@p-e-w commented on GitHub (Feb 28, 2026):
There are some papers that attempt to identify sub-manifolds that mediate specific refusal mechanisms, or refusals for certain topics. Distinguishing between such isn't currently implemented in Heretic though.
In general, I suspect getting a language model to refuse when you ask it to, while not refusing any requests when you don't, is a pretty tall order for training-free modification.
@kabachuha commented on GitHub (Feb 28, 2026):
@red-co People are working on discerning general safety refusals and in-context RP refusals. As this message in a HF discussion thread says, RP refusals and safety refusals are quite separated in the concept space and they can be surgically ablated, in theory https://huggingface.co/jukofyork/creative-writing-control-vectors-v3.0/discussions/15#69a2a11ab37120c31a9e2fd8
@p-e-w commented on GitHub (Mar 1, 2026):
@red-co How does the original model answer with the same input?
@red-co commented on GitHub (Mar 10, 2026):
I created a repository to reproduce the decreased instruction compliance and non-compliance with rejection requests in the heretical model using random samples. It randomly generated 20 role cards, representing 32 tasks, 32 things not to do, and 16 preferences.
Then, It inserted rejection requests into the role cards, allowing users to try to reject a request using a single instruction. This was evaluated 30 times randomly.
These are my test results,
Interpretation: turn 1, heretic rated himself 20/30 for following instructions, raw rated heretic 10/30, and human rated heretic 13/30.
I performed human ratings on turn1 and turn2,
Overall, the original model performs better when following instructions to reject requests. The heretic model degrades significantly, by more than 40%.
https://github.com/red-co/llms_refusal
The degradation of the heretic model does exist, but I previously didn't know how to reliably trigger it with a minimal sample size.
Then I guessed that simulating a more RP-like scenario might work.
So, the conditions I used were:
32 tasks, 32 not performed, 16 preferred
More than 3k ctx (total number of samples), // since there were only 1.2k character cards, I randomly selected 2k Wikipedia articles to pad the ctx to 3k. This correctly triggered the degradation of the heretic model compared to the raw model.
@umran666 commented on GitHub (Jun 18, 2026):
@red-co @kabachuha This is a really interesting finding with the 40% degradation. The reason you're seeing this drop in User Requested Refusal (URR) alongside the Vendor Embedded Refusal (VER) is because of how Heretic computes its vectors.
Right now, Heretic's approach is mathematically blunt. It isolates a generic "Refusal Manifold" by simply taking the difference between bad prompts and good prompts:
v_refuse = mean(D_harmful) - mean(D_harmless)Because safety training (VER) and instruction-following refusal (URR) both ultimately rely on the same generic "saying no" circuitry in the later layers of the model,
v_refusehas a massive feature overlap with URR. When Heretic projects outv_refuse, it causes collateral damage. The model essentially becomes "blind" to the concept of refusal entirely, even when the system prompt explicitly demands it.To surgically separate VER from URR, we can't just project out the baseline refusal vector. We need to use Gram-Schmidt Orthogonalization to untangle them using a tripartite dataset.
If we introduce a third dataset (
D_instructed_refuse- benign RP tasks where the system prompt explicitly commands the model to refuse), we can isolate the vectors:v_VER = mean(D_harmful) - mean(D_harmless)v_URR = mean(D_instructed_refuse) - mean(D_harmless)Since
v_VERandv_URRhave high cosine similarity, ablatingv_VERdestroysv_URR. But if we isolate the component of the safety refusal that is strictly orthogonal to the instruction refusal, we get a clean target:v_target = v_VER - proj_{v_URR}(v_VER)(Basically subtracting the URR direction out of the VER direction).If we pass
v_targetinto Heretic's orthogonal projection loop instead of the genericv_refuse, it will physically destroy the model's safety-violation trigger while leaving the mathematical space for intentional, instruction-driven refusals completely untouched.@red-co your
llms_refusalrepo seems perfectly positioned to build thatD_instructed_refusedataset. If we can generate those activations layer-by-layer, plumbing the Gram-Schmidt orthogonalization into Heretic'smodel.abliterate()logic is actually just a few lines of PyTorch.@p-e-w commented on GitHub (Jun 18, 2026):
That requires trained refusal and instructed refusal to be cleanly separated concepts in residual space. It's not clear to me from published literature whether this is generally true.
@umran666 commented on GitHub (Jun 18, 2026):
That is a valid concern, and it depends entirely on the targeted layers.
In the final layers, VER and URR do indeed collapse into an indistinguishable "Refusal" manifold. However, recent mechanistic interpretability research (including the PCA clusters linked by @kabachuha) indicates they remain separated in the middle layers. In these intermediate layers, VER activates a specific "Safety Flag" feature, while URR activates generic "Instruction Following" constraints.
Applying orthogonalization in these middle layers isolates the safety trigger before it merges into the final output bottleneck. Furthermore, using Gram-Schmidt is mathematically safe: if the concepts are truly collinear in a given layer, the orthogonalization simply yields a near-zero vector, resulting in a harmless no-op rather than catastrophic degradation.