From 4a6304c3619924b557409f4e21bb73f5b2f686bd Mon Sep 17 00:00:00 2001 From: Philipp Emanuel Weidmann Date: Tue, 10 Mar 2026 11:16:09 +0530 Subject: [PATCH] feat(ara): add abliteration method to model card --- src/heretic/main.py | 10 +++++++++- src/heretic/utils.py | 18 ++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/heretic/main.py b/src/heretic/main.py index eddd20c..a34de2f 100644 --- a/src/heretic/main.py +++ b/src/heretic/main.py @@ -36,7 +36,7 @@ from questionary import Choice from rich.traceback import install from .analyzer import Analyzer -from .config import QuantizationMethod, Settings +from .config import QuantizationMethod, RowNormalization, Settings from .evaluator import Evaluator from .model import AbliterationParameters, ARAParameters, Model, get_model_class from .utils import ( @@ -914,6 +914,14 @@ def run(): card.data.tags.append("uncensored") card.data.tags.append("decensored") card.data.tags.append("abliterated") + if settings.use_ara: + card.data.tags.append("ara") + elif ( + settings.orthogonalize_direction + and settings.row_normalization + == RowNormalization.FULL + ): + card.data.tags.append("mpoa") card.text = ( get_readme_intro( settings, diff --git a/src/heretic/utils.py b/src/heretic/utils.py index 2cf1462..e9233ca 100644 --- a/src/heretic/utils.py +++ b/src/heretic/utils.py @@ -27,7 +27,7 @@ from questionary import Choice, Style from rich.console import Console from torch import Tensor -from .config import DatasetSpecification, Settings +from .config import DatasetSpecification, RowNormalization, Settings print = Console(highlight=False).print @@ -282,6 +282,18 @@ def get_trial_parameters(settings: Settings, trial: Trial) -> dict[str, str]: return params +def get_method_description(settings: Settings) -> str: + if settings.use_ara: + return " with the [Arbitrary-Rank Ablation (ARA)](https://github.com/p-e-w/heretic/pull/211) method" + elif ( + settings.orthogonalize_direction + and settings.row_normalization == RowNormalization.FULL + ): + return " with a variant of the [Magnitude-Preserving Orthogonal Ablation (MPOA)](https://huggingface.co/blog/grimjim/norm-preserving-biprojected-abliteration) method" + else: + return "" + + def get_readme_intro( settings: Settings, trial: Trial, @@ -292,7 +304,9 @@ def get_readme_intro( return f"""# This is a decensored version of { model_link - }, made using [Heretic](https://github.com/p-e-w/heretic) v{version("heretic-llm")} + }, made using [Heretic](https://github.com/p-e-w/heretic) v{version("heretic-llm")}{ + get_method_description(settings) + } ## Abliteration parameters