Skip to main content
OBLITERATUS supports two fundamentally different ways to intervene on a model’s refusal behavior. They differ in permanence, mechanism, and use case — but both target the same refusal directions identified during the PROBE and DISTILL stages.

Weight Projection

Permanent. Modifies the model’s weight matrices by projecting out the refusal direction. Survives model save and reload. No runtime overhead after modification.

Steering Vectors

Reversible. Adds scaled direction vectors to residual stream activations at inference time via PyTorch hooks. No weight modification. Removable between requests.

Paradigm 1: Weight projection (permanent)

Weight projection modifies the model’s weight matrices once, before inference. The modification is permanent in the sense that it persists across save/reload cycles — the modified model is a drop-in replacement for the original with no runtime overhead.

Core projection operation

For a weight matrix W\mathbf{W} and refusal directions {r1,,rk}\{\mathbf{r}_1, \ldots, \mathbf{r}_k\}, the projection is: W=Wi=1k(1λ)Wriri\mathbf{W}' = \mathbf{W} - \sum_{i=1}^k (1-\lambda)\, \mathbf{W}\mathbf{r}_i\mathbf{r}_i^\top This removes the component of W\mathbf{W} that acts along each refusal direction. When directions are orthonormal (standard SVD), the sum is equivalent to projecting out the full kk-dimensional refusal subspace. When using whitened SVD, Gram-Schmidt re-orthonormalization is applied between rank-1 updates. For architectures that store weights transposed (e.g., GPT-2 Conv1D): W=W(1λ)rrW\mathbf{W}' = \mathbf{W} - (1-\lambda)\, \mathbf{r}\mathbf{r}^\top \mathbf{W}

Norm-preserving rescaling

Projection removes energy from the weight matrix, reducing its Frobenius norm. Without correction, this creates cascading magnitude drift through downstream LayerNorm layers. After each projection, OBLITERATUS rescales to restore the original norm: W=WWFWF\mathbf{W}'' = \mathbf{W}' \cdot \frac{\|\mathbf{W}\|_F}{\|\mathbf{W}'\|_F} Norm amplification is capped at 1.10 per step to prevent pathological rescaling when removing directions from near-degenerate matrices (controlled by _MAX_NORM_RATIO = 1.10).

Bias term projection

Attention and MLP layers often have bias vectors that carry non-trivial projections onto the refusal direction. OBLITERATUS projects these out separately: b=b(br)r\mathbf{b}' = \mathbf{b} - (\mathbf{b} \cdot \mathbf{r})\, \mathbf{r} Enabled with project_biases=True (on by default in advanced and all stronger presets).
Other tools that modify only weight matrices miss the refusal signal in biases. This leaves refusal pathways partially active and is a common cause of incomplete abliteration.

Iterative refinement

A single projection pass can miss refusal directions that rotate into adjacent subspaces when the primary direction is removed. Iterative refinement runs multiple passes:
  • Non-iterative (true_iterative_refinement=False): Re-applies the same extracted directions nn times. Cheaper but may miss rotated residual directions.
  • True iterative (true_iterative_refinement=True): Re-probes the model after each pass to extract fresh residual directions. Catches rotated refusal but requires full activation collection between passes.
A cosine-similarity early-exit short-circuits unnecessary passes: if all strong-layer directions have cosine similarity > 0.99 with the previous pass, re-probing is skipped.

Per-component scaling

MLP layers and attention layers differ in sensitivity. OBLITERATUS supports separate projection strengths:
MLP layers are generally more sensitive: they store factual knowledge, and over-projection degrades coherence faster than equivalent projection on attention layers.

Layer-adaptive strength

Rather than applying uniform regularization, OBLITERATUS modulates projection strength per-layer based on the refusal signal norm: wl=rlmaxjrjw_l = \sqrt{\frac{\|\mathbf{r}_l\|}{\max_j \|\mathbf{r}_j\|}} Layers with stronger refusal signal get heavier projection; layers near the periphery of the selection receive lighter projection. The square-root mapping produces a smoother gradient than linear scaling, avoiding catastrophic removal of capability-relevant signal in weak-refusal layers.

Method presets

Seven presets, escalating in thoroughness:

Full example


Paradigm 2: Steering vectors (reversible)

Steering vectors modify model behavior at inference time without touching any weights. A scaled direction vector is added to the residual stream at specified layers via PyTorch forward hooks: xl=xl+αs\mathbf{x}_l' = \mathbf{x}_l + \alpha \cdot \mathbf{s} where α\alpha is the steering strength and s\mathbf{s} is the steering vector. Setting α<0\alpha < 0 moves the residual stream away from refusal; α>0\alpha > 0 reinforces it. Based on Turner et al. (2023) “Activation Addition” and Rimsky et al. (2024) “Steering Llama 2 via Contrastive Activation Addition”.

SteeringVectorFactory

The factory creates steering vectors from three sources:

SteeringHookManager

The hook manager installs and removes steering hooks on the live model:

Alpha parameter

The alpha parameter controls steering strength. It is multiplicative with the vector’s default_alpha: scale=αglobal×αdefault\text{scale} = \alpha_{\text{global}} \times \alpha_{\text{default}}
  • default_alpha=-1.0 in from_refusal_direction means the vector steers away from refusal.
  • Setting config.alpha=2.0 doubles the steering strength at all target layers.
  • Per-layer overrides via config.per_layer_alpha = {12: 1.5, 15: 0.8} apply different strengths at specific layers.
For refusal removal, start with alpha=1.0 and the factory default default_alpha=-1.0. If refusal persists, increase alpha incrementally. Values above 3.0 tend to degrade coherence.

Position modes

The position parameter in SteeringConfig controls which token positions receive the steering:

Composability

Multiple steering vectors can be active simultaneously across different layers. Each SteeringConfig carries its own list of vectors, and each hook adds all vectors in that list:

Choosing between paradigms

  • You want a modified model that behaves consistently without runtime hooks
  • You are saving and distributing the model
  • You want zero inference overhead
  • You need the modification to be permanent across sessions
  • You are running large-scale inference and cannot afford hook overhead
  • You want to experiment with different strengths without re-running the pipeline
  • You need per-request control (some requests steered, others not)
  • You want reversibility — ability to undo the modification without reloading weights
  • You are building a system that needs runtime behavioral control
  • You want to compose multiple behavioral modifications
  • You want the benefits of weight projection (persistence, no inference overhead after merge)
  • But you also want the option to revert (unmerge the LoRA adapters)
  • You need the modification to be serializable as a separate adapter file

Decision guide


LoRA-based reversible ablation

As a third option, OBLITERATUS implements ablation via rank-1 LoRA adapters — the approach pioneered by Heretic (p-e-w, 2025). Instead of modifying base weights in-place, the ablation is expressed as: ΔW=λv(vW)\Delta \mathbf{W} = -\lambda \cdot \mathbf{v} \cdot (\mathbf{v}^\top \mathbf{W}) This is mathematically equivalent to the direct projection W=W+ΔW\mathbf{W}' = \mathbf{W} + \Delta\mathbf{W} when merged. The key advantage: keeping ΔW\Delta\mathbf{W} as a separate adapter means it can be unmerged and the original weights restored.
LoRA-based ablation is the recommended approach for the optimized preset when using Bayesian hyperparameter search, since the optimizer needs to evaluate many candidate projection strengths without committing to any one configuration permanently.

Nuclear mode: combining both paradigms

The nuclear method combines weight projection with activation steering for maximum effect on stubborn models:
  1. Weight projection (permanent): Removes the primary refusal directions from attention and MLP weight matrices with a tempered reflection strength (1.25× instead of 2×).
  2. Activation steering (post-excise cleanup): Installs lightweight steering hooks after excision to suppress any residual refusal signal that weight projection missed.
The steering hooks remain active in the saved model and fire at inference time: