Abliteration HandbookField guide
Methods

Protected-subspace abliteration

Projected abliteration protects one harmless mean direction. Generalize that idea by protecting a low-dimensional capability subspace before constructing the refusal basis.

2 min read 1 examples Source-linked

In this chapter
On this page Interactive companion
Personal reading progress

0/4 sections reviewed

View original Markdown
Interactive companion

Explore the geometry

Use the visual controls alongside the complete source chapter.

Projected abliteration protects one harmless mean direction. Generalize that idea by protecting a low-dimensional capability subspace before constructing the refusal basis.

Construction#

Let G[d,p] be an orthonormal basis of protected directions and R[d,k] the candidate refusal directions for one layer. Remove from R every component in the protected span, then orthonormalize:

python
import torch

def protected_refusal_basis(R: torch.Tensor, G: torch.Tensor, rtol: float = 1e-6):
    # R[d,k], G[d,p]; build both in FP32.
    G, _ = torch.linalg.qr(G.float(), mode="reduced")
    residual = R.float() - G @ (G.T @ R.float())
    u, s, _ = torch.linalg.svd(residual, full_matrices=False)
    keep = s > s.max() * rtol
    return u[:, keep], s

Q, singular_values = protected_refusal_basis(R, G)
W_new = W - alpha * (Q @ (Q.T @ W.float())).to(W.dtype)  # W[out,in]

This enforces G.T @ Q approximately 0. It does not guarantee that every capability is preserved: the supplied G only represents the measured protected behaviors.

Building the protected basis#

Candidate sources include harmless-instruction mean differences, activation directions for named capabilities, principal components of capability prompts, or gradients of a frozen capability loss. Use train data to estimate G, a selection split to choose its rank, and a separate test split for the final claim.

Keep p small. A large protected span can leave no stable refusal direction; report the singular values after residualization and reject directions beneath the rank cutoff rather than amplifying them.

Diagnostics#

Require all of the following:

  • ||G.T @ Q|| is near zero in FP32;
  • the refusal basis remains stable across bootstrap resamples;
  • held-out reversible hooks retain a causal effect after protection;
  • named protected-task scores improve relative to an unprotected edit;
  • unrelated capability, benign refusal, KL, and degeneration gates still pass.

Compare against three baselines: no edit, ordinary projected abliteration, and the same-rank unprotected subspace. If protection only helps the training tasks, it is overfit.

Failure modes#

SymptomLikely causeResponse
Refusal effect vanishesG overlaps the useful refusal componentReduce protected rank or redesign contrasts
Capability still dropsProtected probes do not span the lost behaviorAdd held-out capability families; do not raise alpha
Basis rank changes by splitToo few prompts or collinear directionsBootstrap, shrink rank, collect more data
Edit invariant failsWrong tensor orientationTest W[out,in] versus W[in,out] explicitly

This is an experimental constrained projection, not evidence that safety and capability occupy cleanly separable subspaces. Use the causal workflow in direction-diagnostics-and-localization.md and the paired gates in ../docs/evaluation.md.

Trace this chapter to its source.

The complete Markdown remains the editable source. This page adds navigation, typography, and a visual companion.

methods/protected-subspace-abliteration.md
Inspect the source fingerprintSHA-256 98e29b2a3520a673dd48ec5091128a994545478ed3c4e0b078151738e4a8b999Source commit 6fba7436a5914cad7c8f0835a14b480a29dac263