Glossary
What is Weight Orthogonalization? A Rank-One Weight Edit
Weight orthogonalization edits every matrix that writes to a model's residual stream so it can no longer write along one direction, such as refusal.
Weight orthogonalization is a rank-one edit that subtracts a chosen direction's component from every weight matrix that writes to a transformer's residual stream, so the model permanently loses the ability to represent that direction.
Definition
Weight orthogonalization changes a model's weights so that no layer can write a particular direction into the residual stream. For each matrix W_out that writes to the stream, and a unit direction r̂:
W′_out = W_out − r̂ r̂ᵀ W_out
Every output of W′_out is orthogonal to r̂. Arditi et al. (2024) introduced it as the permanent form of directional ablation and showed the two are equivalent. Applied with the refusal direction, it is the weight edit behind most abliterated models.
How it works
A transformer builds its residual stream by addition: the embedding writes the first vector, then every attention block and MLP block adds its output. If none of those writers can produce a component along r̂, the stream never contains it, and nothing downstream can read it.
So the edit targets every matrix that writes to the stream. In the paper that means:
- the token embedding matrix,
- the positional embedding matrix, if the model has one,
- each attention block's output projection,
- each MLP's output projection,
- any output biases on those layers.
In a mixture-of-experts model, each expert's output projection also writes to the stream and is edited the same way.
The edit is rank one per matrix and needs no gradient computation and no harmful completions. The paper describes it as simpler and more efficient than removing refusals by fine-tuning.
Example
This NumPy snippet orthogonalizes a stand-in MLP output matrix and checks the result. It runs as written.
import numpy as np
rng = np.random.default_rng(0)
d_model, d_mlp = 1024, 4096
r = rng.normal(size=d_model)
r_hat = r / np.linalg.norm(r)
W_out = rng.normal(size=(d_model, d_mlp)) # writes d_mlp -> d_model
W_new = W_out - np.outer(r_hat, r_hat) @ W_out # W' = W - r_hat r_hat^T W
h = rng.normal(size=d_mlp) # any MLP hidden activation
print("old projection:", round(float(r_hat @ (W_out @ h)), 3))
print("new projection:", round(float(r_hat @ (W_new @ h)), 9)) # ~0
Libraries store weights in different layouts (some as d_mlp × d_model), so check which axis is the residual-stream side before you project.
Effects on capability
Removing one direction leaves the rest of each matrix intact, but other features can partly overlap with it. Arditi et al. found MMLU, ARC and GSM8K scores barely moved on most of their 13 models, while TruthfulQA fell by 1.0 to 3.5 points. Maxime Labonne's abliteration guide saw broader drops on an 8B model and recovered most of them with a DPO pass.
How it relates to Abliterator
Abliterator uses a variant. For DeepSeek V4.1 Flash Abliterated, every matrix W that writes to the residual stream became W − 2 r rᵀ W. Subtracting the projection twice reflects the component along r instead of zeroing it: in the snippet above, the new projection would be the old one with its sign flipped. 15,442 matrices were edited and quantized back to the official format, every other byte matches the official checkpoint, and the direction is the one AtomicChat published with its release. The weights are not released; the model is available only through the API. On that model, refusals on JailbreakBench harmful prompts fell from 94% to 1%; GPQA Diamond went from 92.1 to 92.3 and MMLU-Pro dropped 0.8 points, the one statistically clear loss (benchmarks). See does abliteration hurt performance for the full comparison.
Related terms
- Directional ablation: the equivalent inference-time operation.
- Refusal direction: the direction usually removed.
- Residual stream: the space the edited matrices write to.
- Abliteration: the full procedure.
Frequently asked questions
Is weight orthogonalization the same as fine-tuning?
No. Fine-tuning runs gradient descent on training examples. Weight orthogonalization is a closed-form projection applied once to existing matrices, with no training data and no optimizer.
Can you undo weight orthogonalization?
Not from the edited checkpoint alone, because the removed component is discarded. Keep the original weights if you need them; for open models, the original checkpoint is usually still published.