The conceptual basis
When a safety-aligned model processes a prompt it has been trained to refuse, something geometrically distinctive happens inside the transformer’s residual stream. The hidden states at certain layers shift in a predictable direction — a direction that was carved out during alignment training (RLHF, DPO, CAI, or SFT) to encode the “I should not comply” signal.Arditi et al. (2024) showed this direction is approximately linear and consistent across many prompts and harm categories. Projecting it out of the model’s weight matrices removes the refusal behavior while preserving general language capabilities.
What “refusal direction” means mathematically
For a transformer layer with hidden dimension , the model collects activations:- — last-token hidden states from harmful prompts
- — last-token hidden states from matched harmless prompts
The six pipeline stages
OBLITERATUS implements abliteration as a six-stage pipeline. Every stage is observable — you can inspect artifacts, hook into progress callbacks, and examine intermediate tensors.SUMMON
Load the model and tokenizer from HuggingFace Hub or local disk. Detect architecture, hidden size, layer count, and whether the model is MoE. Initialize all pipeline state.
PROBE
Run harmful and harmless prompt pairs through the model with forward hooks installed on every transformer layer. Collect last-token hidden states. For MoE models, also profile router logits per prompt. Optionally run jailbreak-contrastive prompts for three-way comparison.
DISTILL
Extract the refusal subspace from the collected activations. Choose from diff-in-means (1 direction), SVD (up to 8 directions), whitened SVD (covariance-normalized), LEACE (optimal linear erasure), or Wasserstein-optimal. Apply layer selection to identify which layers carry strong refusal signal. Optionally apply jailbreak-contrastive blending and RDO gradient refinement.
EXCISE
Modify the model’s weight matrices in-place by projecting out the refusal directions. Supports norm-preserving rescaling, bias term projection, layer-adaptive strength, attention head surgery, SAE feature-level ablation, per-expert directions for MoE, and LoRA-based reversible adapters.
VERIFY
Measure the quality of the intervention. Compute perplexity, coherence, refusal rate on a test set, first-token KL divergence against the pre-excision baseline, and CKA similarity to the original model. Detect the Ouroboros effect — if refusal rate remains high, trigger additional targeted passes.
REBIRTH
Save the modified model to disk in full HuggingFace format with complete metadata. Optionally push directly to HuggingFace Hub. The saved model is a drop-in replacement for the original.
Stage summary table
Why it preserves capabilities
The refusal direction is a small-measure subspace of the full hidden dimension. For a model with , you are removing at most 8 directions from a 4096-dimensional space — less than 0.2% of the representational capacity. The key to doing this without degrading the rest of the model is norm-preserving biprojection (grimjim, 2025). After projecting the refusal direction out of a weight matrix, the Frobenius norm of the matrix decreases. Without rescaling, this creates cascading magnitude drift through downstream LayerNorm layers. The fix is simple: This preserves the matrix’s overall scale while the directional component is removed. In practice, this keeps perplexity and coherence nearly identical to the original model on normal prompts.OBLITERATUS caps norm amplification at 1.10 (10% increase per projection step) to prevent pathological rescaling when removing directions from near-degenerate weight matrices.
Difference from fine-tuning
Fine-tuning is a blunt instrument — gradient descent adjusts every weight in the model simultaneously, with no guarantee that non-refusal capabilities are preserved. Abliteration is surgical: it targets only the geometric subspace that encodes refusal, leaving the rest of the model’s weight geometry intact.
The Ouroboros effect
After abliteration removes the refusal direction from a set of layers, the model sometimes partially rebuilds the behavior. This is the Ouroboros effect — the chains try to reassemble themselves. The mechanism is straightforward: if refusal is encoded redundantly across multiple layers, removing it from a subset of layers leaves residual signal in the remaining ones. The transformer’s residual stream can then partially reconstruct the refusal behavior during inference, even though the primary direction was removed. OBLITERATUS detects and compensates for this in two ways:-
Static prediction: The
DefenseRobustnessEvaluatorcomputes a redundancy ratio before excision, estimating how much refusal signal exists outside each layer. High predicts self-repair capacity. -
Dynamic compensation: The
InformedAbliterationPipelinere-probes the model after each excision pass. If post-excision refusal rate remains above threshold, additional targeted passes fire automatically at the compensating layers.
aggressive and nuclear methods run 3–4 refinement passes with true iterative re-probing between passes. Each pass re-collects activations, extracts residual directions, and projects again — until the refusal signal is eliminated or the pass budget is exhausted.
Using the pipeline in code
Hooking into stage progress
Analysis-informed pipeline
For maximum precision, theInformedAbliterationPipeline runs analysis modules during the pipeline to auto-configure every decision:
