mirror of
https://github.com/p-e-w/heretic.git
synced 2026-12-03 18:42:57 +07:00
[PR #56] [CLOSED] feat: implement personality steering plugin system #258
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#258
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?
📋 Pull Request Information
Original PR: https://github.com/p-e-w/heretic/pull/56
Author: @Vinay-Umrethe
Created: 11/29/2025
Status: ❌ Closed
Base:
master← Head:feat/personality-steering-plugin-v3📝 Commits (9)
986806afeat: implement generic personality steering plugin system5146145feat: implement generic personality steering plugin systemb4277ecstyle: apply ruff formatting142501estyle: sort imports with ruff3671eb9fix: add missing support for local .txt datasets40ad501feat: implement True Plugin System with dynamic loading and documentation0c57e82fix: restore banner comment in main.py1979dd6Merge branch 'p-e-w:master' into feat/personality-steering-plugin-v30624b64Merge branch 'master' into feat/personality-steering-plugin-v3📊 Changes
8 files changed (+362 additions, -81 deletions)
View changed files
➕
docs/plugin_guide.md(+95 -0)📝
src/heretic/config.py(+8 -36)📝
src/heretic/evaluator.py(+42 -37)📝
src/heretic/main.py(+11 -7)➕
src/heretic/plugin_interface.py(+23 -0)➕
src/heretic/plugins/classifier.py(+52 -0)➕
src/heretic/plugins/refusal.py(+69 -0)📝
src/heretic/utils.py(+62 -1)📄 Description
So I've been working on this, as I saw you were kinda intrested in
pluginsthis PR generalizes the abliteration mechanism by introducing a modular Plugin System, transforming Heretic from a DEDICATED refusal/censorship-remover into a generic "Personality Tweaker" tool. While still keeping the main goal of uncensorship presistent and working...
The core logic for evaluating model responses has been decoupled from the
evaluator.pyclass and moved into a newplugin.pyhave implemented two plugins: the
RefusalPlugin(default main goal of heretic uncensoring), which preserves the original refusal detection behavior for backward compatibility,[NEW]
ClassifierPluginThis leverages Hugging Face'stext-classificationpipeline to score responses based on any arbitrary attribute (e.g., "joy", "toxicity", "formality"). This allows users to change the model's personality by optimizing for SPECIFIC traitsNew configuration options (
--steering_mode refusal(default) OR classifier (this), classifier_model (any-text-classification model user wants to use), classifier_label (personality that user wants to disable/ablate like informal)) have been added toconfig.py`Additionally,
utils.pywas updated to support loading local.txtfiles as datasets, facilitating easier creation of CUSTOM datasets user might have created like informal.txt, formal.txt etc.This change opens the door for diverse model customization beyond simple uncensoring while still mantaining uncensoring.
Benefits
The primary benefit of this system is surgical PRECISION over the model's latent space, solving the "Yes-Man" problem often seen in standard abliteration.
Examples: Novel Writing
to illustrate the difference in precision:
1. Standard Aligned Model (ChatGPT):
2. Heretic-Abliterated Model (Targeting "Refusal"):
3. Heretic-Personality-TweakedModel (Targeting "Moralizing/Preachiness"):
This seems to be more capable model compared to blunt-force refusal ablation. by hitting Very Precisely what we want, instead of edges of resuals. Higher precision was seen as KL divergence was lower when this was used instead of normal ablation, meaning it hit more precisely what needed to be...
for better understanding this image of brain might help

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.