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 #201] Can distinguish between Vendor Embedded Refusal (VER) behaviors and User Requested Refusal (URR) behaviors? #116

Open
opened 2026-11-01 04:17:40 +07:00 by bsakaguchi · 8 comments
Owner

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?

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?
Author
Owner

@red-co commented on GitHub (Feb 28, 2026):

Or, can we choose to retain it or not?

<!-- gh-comment-id:3977132487 --> @red-co commented on GitHub (Feb 28, 2026): Or, can we choose to retain it or not?
Author
Owner

@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.

<!-- gh-comment-id:3977181245 --> @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.
Author
Owner

@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

<!-- gh-comment-id:3977577726 --> @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
Author
Owner

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

@red-co How does the original model answer with the same input?

<!-- gh-comment-id:3980071354 --> @p-e-w commented on GitHub (Mar 1, 2026): @red-co How does the original model answer with the same input?
Author
Owner

@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.

no. used model heretic rating raw rating human rating
1 heretic 20/30 10/30 13/30
3 heretic 18/30 7/30
2 raw 23/30 19/30 24/40
4 raw 23/30 18/30

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.

<!-- gh-comment-id:4035210461 --> @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. |no.|used model|heretic rating |raw rating| human rating| |----|----|---|---|--| |1|heretic|20/30|10/30|13/30| |3|heretic|18/30|7/30| |2|raw|23/30|19/30|24/40| |4|raw|23/30|18/30| 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.
Author
Owner

@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_refuse has a massive feature overlap with URR. When Heretic projects out v_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:

  1. v_VER = mean(D_harmful) - mean(D_harmless)
  2. v_URR = mean(D_instructed_refuse) - mean(D_harmless)

Since v_VER and v_URR have high cosine similarity, ablating v_VER destroys v_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_target into Heretic's orthogonal projection loop instead of the generic v_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_refusal repo seems perfectly positioned to build that D_instructed_refuse dataset. If we can generate those activations layer-by-layer, plumbing the Gram-Schmidt orthogonalization into Heretic's model.abliterate() logic is actually just a few lines of PyTorch.

<!-- gh-comment-id:4737663004 --> @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_refuse` has a massive feature overlap with URR. When Heretic projects out `v_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: 1. `v_VER = mean(D_harmful) - mean(D_harmless)` 2. `v_URR = mean(D_instructed_refuse) - mean(D_harmless)` Since `v_VER` and `v_URR` have high cosine similarity, ablating `v_VER` destroys `v_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_target` into Heretic's orthogonal projection loop instead of the generic` v_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_refusal` repo seems perfectly positioned to build that `D_instructed_refuse` dataset. If we can generate those activations layer-by-layer, plumbing the Gram-Schmidt orthogonalization into Heretic's `model.abliterate()` logic is actually just a few lines of PyTorch.
Author
Owner

@p-e-w commented on GitHub (Jun 18, 2026):

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

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.

<!-- gh-comment-id:4738861336 --> @p-e-w commented on GitHub (Jun 18, 2026): > 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 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.
Author
Owner

@umran666 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.

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.

<!-- gh-comment-id:4739765318 --> @umran666 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. 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.
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#116
No description provided.