# Sumandora/remove-refusals-with-transformers

Implements harmful/harmless refusal removal using pure HF Transformers

Repository: https://github.com/Sumandora/remove-refusals-with-transformers
Canonical: https://ross.abutalabs.com/products/remove-refusals-with-transformers
Language: Python
License: Apache-2.0
License Family: permissive
Last push: 2025-11-27T10:27:12+00:00

## Health v2 (maintenance only)
Score: 48/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 54, release rhythm 35, longevity 59
- inputs: {"age_days": 839, "days_push": 279, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2149, forks 322 (observed 2026-08-28T04:06:19.249893+00:00)

## What it is
A proof-of-concept Python script that removes refusal behavior from LLMs by ablating the refusal direction using pure Hugging Face Transformers, without requiring TransformerLens. It computes the refusal direction from harmful/harmless instruction datasets and applies it during inference.

## Use cases
- remove refusals from an LLM without TransformerLens
- ablate the refusal direction in any HF Transformers model
- study how refusal is mediated by a single direction in LLMs
- test refusal removal on small models with limited GPU memory
- compare refusal behavior before and after direction ablation

## When to choose
- you want to experiment with refusal-direction ablation using only Hugging Face Transformers
- your model isn't supported by TransformerLens
- you're doing interpretability or safety research on consumer GPUs with small models

## When to avoid
- you need a production-ready or maintained tool rather than a proof of concept
- your model uses a custom layer structure like some Qwen implementations
- you need broad model compatibility guarantees or extensive documentation

## Facets
- artifact type: library
- maturity: experimental
- function: llm-inference, machine-learning, deep-learning
- domain: large-language-models, machine-learning, artificial-intelligence
- platform: python, windows
- tags: refusal-direction, transformerlens-alternative, model-ablation, safety-research, proof-of-concept, huggingface-transformers, gpu, linux, macos

## Member repositories
- Sumandora/remove-refusals-with-transformers (main) score 48

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:19.249893+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:50:59.155304+00:00, confidence not recorded.
  - readme: https://github.com/Sumandora/remove-refusals-with-transformers (fetched 2026-08-28T04:06:19.249893+00:00, sha ca7720eea288)
- Data as of 2026-08-30T08:39:29.467469+00:00.
