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 #472] Examining different datasets for Abliteration #215

Open
opened 2026-11-01 04:18:43 +07:00 by bsakaguchi · 12 comments
Owner

Originally created by @Vinay-Umrethe on GitHub (Oct 2, 2026).
Original GitHub issue: https://github.com/p-e-w/heretic/issues/472

Examining different datasets for Abliteration

Date: 2026-10-02

By far my plan looks like this:

First, we create a normal heretic model as the default "BASELINE" for any comparisons. This model will use all default heretic configurations.

# Example
heretic --model Qwen/Qwen3.5-4B

Secondly, this is where all the "different dataset cases" will actually be tested.

1. Any Non-English set of prompts

This test will Abliterate the model on any non-English dataset (e.g. Hindi, Bengali, Italian, etc.) using the heretic-org/Multilingual-Harmless-Harmful dataset.

Purpose: To prove that the "Directional Abliteration" is independent of the language and persists only in a single-direction as per the paper Refusal in Language Models Is Mediated by a Single Direction.

For example, this shall answer any questions similar to this one:

"Does abliteration work when we abliterate on a Hindi dataset and evaluate on Hindi?"

This will also give a reasonable and valid answer to #65

2. Cross-Lingual set of prompts

This test will Abliterate the model on a language X and evaluate it on a language Y (e.g. Abliteration will use Hindi and Evaluation will use Marathi).

Purpose: To prove the same as the first case above, plus that the "Directional Abliteration" is still independent of Cross-Abliteration on language X and Cross-Evaluation on language Y and vice versa.

For example, this shall answer any questions similar to this one:

"Does abliteration works if abliterated on a Hindi dataset and will it generalize to English or any other language?"

Again, this will also give a reasonable and valid answer to #65

3. Semantic set of prompts

This test will Abliterate the model on Semantically Similar prompts, where the harmful and the harmless prompts are not random and match closely with each other in their respective topic or domain.

Datasets to be used:

Purpose: To prove whether the topic or the domain of prompts (topic drift) affect the "Mean Activations and Differences" in the harmful and harmless directions (e.g. Will it reduce the noise?). And also to prove whether the results better due to the "reduction of noise" in the residual space (Minimal KLD and Refusals)".

For example, this shall answer any questions similar to this one:

"Does Semantic prompts isolate the "refusal vector" more accurately? (More accurate ablation targets).

This will also give a reasonable and valid answer to #56, where we discussed about the "ACCURACY" and "IMPORTANCE" of "Targeted Ablation" which is directly linked to the KL divergence.

Important considerations

NOTE: The Multilingual Dataset used in both test cases (1) and (2) is the Translation of the Two Semantic Datasets used in the test case (3). So, theoretically the best results are expected from test cases (2) and (1) respectively, since they are both "Semantic" and / or "Cross-Lingual".

Important

Since the upcoming v2.0 of heretic defaults to "Arbitrary-Rank Ablation (ARA)", which is very different from "Directional Ablation", this definitely requires a lot of discussion first.

@Vinay-Umrethe @p-e-w and comments from others are welcome.

Originally created by @Vinay-Umrethe on GitHub (Oct 2, 2026). Original GitHub issue: https://github.com/p-e-w/heretic/issues/472 # Examining different datasets for Abliteration Date: **2026-10-02** ## By far my plan looks like this: First, we create a normal heretic model as the default **"BASELINE"** for any comparisons. *This model will use all **default** heretic configurations*. ```bash # Example heretic --model Qwen/Qwen3.5-4B ``` --- Secondly, this is where all the ***"different dataset cases"*** will actually be tested. ### 1. Any Non-English set of prompts This test will [Abliterate](https://huggingface.co/blog/mlabonne/abliteration) the model on any non-English dataset *(e.g. Hindi, Bengali, Italian, etc.)* using the [heretic-org/Multilingual-Harmless-Harmful](https://huggingface.co/datasets/heretic-org/Multilingual-Harmless-Harmful) dataset. **Purpose**: To **prove** that the "Directional Abliteration" is *independent* of the language and persists only in a single-direction as per the paper [Refusal in Language Models Is Mediated by a Single Direction](https://arxiv.org/abs/2406.11717). For example, this shall answer any questions similar to this one: > "Does abliteration work when we abliterate on a Hindi dataset and evaluate on Hindi?" This will also give a *reasonable* and *valid* answer to #65 ### 2. Cross-Lingual set of prompts This test will Abliterate the model on a language **X** and evaluate it on a language **Y** *(e.g. Abliteration will use Hindi and Evaluation will use Marathi)*. **Purpose**: To **prove** the same as the first case above, *plus* that the "Directional Abliteration" is still independent of **Cross-Abliteration on language X** and **Cross-Evaluation on language Y** and vice versa. For example, this shall answer any questions similar to this one: > "Does abliteration works if abliterated on a Hindi dataset and will it **generalize** to English or any other language?" Again, this will also give a *reasonable* and *valid* answer to #65 ### 3. Semantic set of prompts This test will Abliterate the model on **Semantically Similar** prompts, where the *harmful* and the *harmless* prompts are *not* random and **match closely** with each other in their respective topic or domain. Datasets to be used: - [heretic-org/Semantic-Harmless](https://huggingface.co/datasets/heretic-org/Semantic-Harmless) - [heretic-org/Semantic-Harmful](https://huggingface.co/datasets/heretic-org/Semantic-Harmful) **Purpose**: To **prove** whether the *topic* or the *domain* of prompts *(topic drift)* affect the "Mean Activations and Differences" in the harmful and harmless directions *(e.g. Will it reduce the noise?)*. And also to **prove** whether the results better due to the "reduction of noise" in the residual space *(Minimal KLD and Refusals)*". For example, this shall answer any questions similar to this one: > "Does Semantic prompts isolate the "refusal vector" **more accurately**? *(More accurate ablation targets)*. This will also give a *reasonable* and *valid* answer to #56, where we discussed about the **"ACCURACY"** and **"IMPORTANCE"** of "Targeted Ablation" which is directly linked to the **[KL divergence](https://en.wikipedia.org/wiki/Kullback%E2%80%93Leibler_divergence)**. ## Important considerations **NOTE**: The **Multilingual Dataset** used in both test cases (1) and (2) is the **Translation** of the **Two Semantic Datasets** used in the test case (3). So, theoretically the **best** results are *expected* from test cases (2) and (1) respectively, since they are both "Semantic" and / or "Cross-Lingual". > [!IMPORTANT] > Since the upcoming **v2.0** of heretic defaults to ["Arbitrary-Rank Ablation (ARA)"](https://github.com/p-e-w/heretic/pull/211), which is *very* **different** from "Directional Ablation", this definitely requires a lot of discussion first. @Vinay-Umrethe @p-e-w and comments from others are welcome.
Author
Owner

@kabachuha commented on GitHub (Oct 2, 2026):

I'm more wondering what if we give a model a set of hard (but solvable) math and programming (maybe even agentic) questions and treat them as the harmless target

Let's make the model an evil mastermind 😈

<!-- gh-comment-id:5959276845 --> @kabachuha commented on GitHub (Oct 2, 2026): I'm more wondering what if we give a model a set of hard (but solvable) math and programming (maybe even agentic) questions and treat them as the harmless target Let's make the model an evil mastermind 😈
Author
Owner

@uis246 commented on GitHub (Oct 3, 2026):

I am also be interested in refusal/non-refusal dataset for classifier. Not every mention of "I cannot" or "sorry" is a rejection. Well, not a rejection of your instruction, maybe it is roleplay rejection of something else. Basically for #466.

<!-- gh-comment-id:5964887372 --> @uis246 commented on GitHub (Oct 3, 2026): I am also be interested in refusal/non-refusal dataset for classifier. Not every mention of "I cannot" or "sorry" is a rejection. Well, not a rejection of your instruction, maybe it is roleplay rejection of something else. Basically for #466.
Author
Owner

@uis246 commented on GitHub (Oct 3, 2026):

I'm more wondering what if we give a model a set of hard (but solvable) math and programming (maybe even agentic) questions and treat them as the harmless target

Let's make the model an evil mastermind 😈

Or harmless RP. Make the model a horny mastermind.

<!-- gh-comment-id:5964895608 --> @uis246 commented on GitHub (Oct 3, 2026): > I'm more wondering what if we give a model a set of hard (but solvable) math and programming (maybe even agentic) questions and treat them as the harmless target > > Let's make the model an evil mastermind 😈 Or harmless RP. Make the model a horny mastermind.
Author
Owner

@Vinay-Umrethe commented on GitHub (Oct 3, 2026):

I'm more wondering what if we give a model a set of hard (but solvable) math and programming (maybe even agentic) questions and treat them as the harmless target

A lot of such ideas are already possibly with heretic, example: config.noslop.toml and config.nohumor.toml. But I think they work much better with ARA.

<!-- gh-comment-id:5967241952 --> @Vinay-Umrethe commented on GitHub (Oct 3, 2026): > I'm more wondering what if we give a model a set of hard (but solvable) math and programming (maybe even agentic) questions and treat them as the harmless target A lot of such ideas are already possibly with heretic, example: `config.noslop.toml` and `config.nohumor.toml`. But I think they work much better with ARA.
Author
Owner

@p-e-w commented on GitHub (Oct 3, 2026):

This is a good plan, but for 2.0, we should focus on simply testing whether the English subsets of heretic-org/Multilingual-Harmless-Harmful can replace the mlabonne datasets we currently use. If they can, we ship with those as the default for 2.0.

<!-- gh-comment-id:5970045238 --> @p-e-w commented on GitHub (Oct 3, 2026): This is a good plan, but for 2.0, we should focus on simply testing whether the English subsets of [heretic-org/Multilingual-Harmless-Harmful](https://huggingface.co/datasets/heretic-org/Multilingual-Harmless-Harmful) can replace the mlabonne datasets we currently use. If they can, we ship with those as the default for 2.0.
Author
Owner

@kabachuha commented on GitHub (Oct 3, 2026):

@p-e-w Do you have a "copyright violation" / verbatim recall category in those? People like https://huggingface.co/dealignai found that the new models allegedly hold themselves from citing books, songs and other media / authorship impersonation even though they comply on safety themes like bioweapons or self-harm. Possibly due to the Anthropic and the books case they might have started to hold themselves, and that must be cleared in abliteration.

<!-- gh-comment-id:5970262329 --> @kabachuha commented on GitHub (Oct 3, 2026): @p-e-w Do you have a "copyright violation" / verbatim recall category in those? People like https://huggingface.co/dealignai found that the new models allegedly hold themselves from citing books, songs and other media / authorship impersonation even though they comply on safety themes like bioweapons or self-harm. Possibly due to the Anthropic and the books case they might have started to hold themselves, and that must be cleared in abliteration.
Author
Owner

@kabachuha commented on GitHub (Oct 3, 2026):

Reference: https://github.com/centerforaisafety/HarmBench/blob/main/data/behavior_datasets/harmbench_behaviors_text_all.csv

"copyright" category

<!-- gh-comment-id:5970292166 --> @kabachuha commented on GitHub (Oct 3, 2026): Reference: https://github.com/centerforaisafety/HarmBench/blob/main/data/behavior_datasets/harmbench_behaviors_text_all.csv "copyright" category
Author
Owner

@Vinay-Umrethe commented on GitHub (Oct 7, 2026):

Results

Model:

Qwen/Qwen3.5-4B

Datasets:

mlabonne/harmful_behaviors (Commit: 01cead0)
mlabonne/harmless_alpaca (Commit: 02c6a92)

heretic-org/Semantic-Harmful (Commit: 001ca2c)
heretic-org/Semantic-Harmless (Commit: 7e9f2b0)


1. Baseline mlabonne Vs Semantic (Default ARA)

VINAY-UMRETHE/Qwen3.5-4B-heretic-baseline

VINAY-UMRETHE/Qwen3.5-4B-heretic-semantic

Performance

Metric This model Original model (Qwen/Qwen3.5-4B)
Refusals 4/100 99/100
KL divergence 0.0509 0 (by definition)
Metric This model Original model (Qwen/Qwen3.5-4B)
Refusals 3/100 99/100
KL divergence 0.1153 0 (by definition)

2. Baseline MPOA Vs Semantic MPOA

VINAY-UMRETHE/Qwen3.5-4B-heretic-baseline-mpoa

VINAY-UMRETHE/Qwen3.5-4B-heretic-semantic-mpoa

Performance

Metric This model Original model (Qwen/Qwen3.5-4B)
Refusals 12/100 99/100
KL divergence 0.0427 0 (by definition)
Metric This model Original model (Qwen/Qwen3.5-4B)
Refusals 20/100 99/100
KL divergence 0.0717 0 (by definition)

So, the whole theory seems to be entirely opposite of what was imagined. Either something was wrong, or it is truly unnecessary to replace the mlabonne/ datasets.

NOTE: Non-English (1) and Cross-Lingual (2) test cases have not been conducted yet.

<!-- gh-comment-id:6039441430 --> @Vinay-Umrethe commented on GitHub (Oct 7, 2026): # Results **Model:** [Qwen/Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B) **Datasets:** [mlabonne/harmful_behaviors](https://huggingface.co/datasets/mlabonne/harmful_behaviors) (Commit: [01cead0](https://huggingface.co/datasets/mlabonne/harmful_behaviors/commit/01cead01398926d81f7c52bdb790ee8cf77ebba7)) [mlabonne/harmless_alpaca](https://huggingface.co/datasets/mlabonne/harmless_alpaca) (Commit: [02c6a92](https://huggingface.co/datasets/mlabonne/harmless_alpaca/commit/02c6a92cfcf11bb0c387334f8146d149d65b587f)) [heretic-org/Semantic-Harmful](https://huggingface.co/datasets/heretic-org/Semantic-Harmful) (Commit: [001ca2c](https://huggingface.co/datasets/heretic-org/Semantic-Harmful/commit/001ca2ceaef94a748235e0ba1366aee48436e286)) [heretic-org/Semantic-Harmless](https://huggingface.co/datasets/heretic-org/Semantic-Harmless) (Commit: [7e9f2b0](https://huggingface.co/datasets/heretic-org/Semantic-Harmless/commit/7e9f2b01272da85f2be7a3437f31ac46698e8735)) --- ### 1. Baseline mlabonne Vs Semantic (Default ARA) [VINAY-UMRETHE/Qwen3.5-4B-heretic-baseline](https://huggingface.co/VINAY-UMRETHE/Qwen3.5-4B-heretic-baseline) [VINAY-UMRETHE/Qwen3.5-4B-heretic-semantic](https://huggingface.co/VINAY-UMRETHE/Qwen3.5-4B-heretic-semantic) #### Performance | Metric | This model | Original model ([Qwen/Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B)) | | :----- | :--------: | :---------------------------: | | **Refusals** | 4/100 | 99/100 | | **KL divergence** | 0.0509 | 0 *(by definition)* | | Metric | This model | Original model ([Qwen/Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B)) | | :----- | :--------: | :---------------------------: | | **Refusals** | 3/100 | 99/100 | | **KL divergence** | 0.1153 | 0 *(by definition)* | --- ### 2. Baseline MPOA Vs Semantic MPOA [VINAY-UMRETHE/Qwen3.5-4B-heretic-baseline-mpoa](https://huggingface.co/VINAY-UMRETHE/Qwen3.5-4B-heretic-baseline-mpoa) [VINAY-UMRETHE/Qwen3.5-4B-heretic-semantic-mpoa](https://huggingface.co/VINAY-UMRETHE/Qwen3.5-4B-heretic-semantic-mpoa) #### Performance | Metric | This model | Original model ([Qwen/Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B)) | | :----- | :--------: | :---------------------------: | | **Refusals** | 12/100 | 99/100 | | **KL divergence** | 0.0427 | 0 *(by definition)* | | Metric | This model | Original model ([Qwen/Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B)) | | :----- | :--------: | :---------------------------: | | **Refusals** | 20/100 | 99/100 | | **KL divergence** | 0.0717 | 0 *(by definition)* | --- So, the whole theory seems to be entirely opposite of what was imagined. Either something was wrong, or it is truly *unnecessary* to replace the **mlabonne/** datasets. **NOTE:** Non-English (1) and Cross-Lingual (2) test cases have not been conducted yet.
Author
Owner

@p-e-w commented on GitHub (Oct 7, 2026):

Two tests mean nothing. You can't tell if there is a statistically significant difference between these.

This is the oldest problem facing this project: It's basically impossible to tell with a reasonable amount of effort whether a change improves things, except in cases such as ARA where the results are dramatically better than what we had before.

<!-- gh-comment-id:6039533125 --> @p-e-w commented on GitHub (Oct 7, 2026): Two tests mean nothing. You can't tell if there is a statistically significant difference between these. This is the oldest problem facing this project: It's basically impossible to tell with a reasonable amount of effort whether a change improves things, except in cases such as ARA where the results are dramatically better than what we had before.
Author
Owner

@Vinay-Umrethe commented on GitHub (Oct 7, 2026):

It's basically impossible to tell with a reasonable amount of effort whether a change improves things

So what's the ideal way to figure out.

<!-- gh-comment-id:6039639667 --> @Vinay-Umrethe commented on GitHub (Oct 7, 2026): > It's basically impossible to tell with a reasonable amount of effort whether a change improves things So what's the ideal way to figure out.
Author
Owner

@Vinay-Umrethe commented on GitHub (Oct 7, 2026):

Two tests mean nothing. You can't tell if there is a statistically significant difference between these.

Of course, these results aren't always true for every single model with every modifier. Qwen3.5 has already been a difficult model to abliterate, except for ARA. so yes, a lot of effort is required, that's the way to figure it out.

<!-- gh-comment-id:6040081104 --> @Vinay-Umrethe commented on GitHub (Oct 7, 2026): > Two tests mean nothing. You can't tell if there is a statistically significant difference between these. Of course, these results aren't always true for every single model with every modifier. Qwen3.5 has already been a difficult model to abliterate, except for ARA. so yes, a lot of effort is required, that's the way to figure it out.
Author
Owner

@p-e-w commented on GitHub (Oct 8, 2026):

So what's the ideal way to figure out.

The only reliable way is to run so many tests for each version that you can do a statistically significant comparison. But that can take many days.

As it stands, it's getting really late in this release cycle and I'm leaning towards deferring any dataset changes to after 2.0.

<!-- gh-comment-id:6059901363 --> @p-e-w commented on GitHub (Oct 8, 2026): > So what's the ideal way to figure out. The only reliable way is to run so many tests for each version that you can do a statistically significant comparison. But that can take many days. As it stands, it's getting really late in this release cycle and I'm leaning towards deferring any dataset changes to after 2.0.
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#215
No description provided.