We anchored and removed a single latent concept in a transformer, matching the performance of post-hoc methods (LEACE, INLP). Latent space took the structure we asked for, even though "the concept" turned out to be different from what we imagined.
This is part of a sequence on Sparse Concept Anchoring (SCA), a training-time alignment method. Earlier posts demonstrated anchoring of concrete concepts in autoencoders and transformers. You don't need to have read the earlier posts to understand this one.
AI use: I paired with Claude on this post, as I would with a human colleague. Claude also designed and ran the experiments with me.
A task with a latent concept
Previously, we trained small transformers to complete color-blending equations like red + blue = purple,[1]with a single color, red, anchored to a direction of our choosing in the residual stream. We removed the anchored color from those models in a follow-up experiment by zeroing that direction. Accuracy dropped only for warm colors, and especially for red. The edit was graded by redness, and succeeded without any post-hoc search.
But the things worth steering in large models usually aren't expressed by a single token the way red is. Qualities like politeness span many tokens, and personas shape behavior without appearing in the sequence at all. We wanted to try anchoring concepts like those, but still in a tiny model that we could study carefully and iterate on quickly. So for this post and its experiments we kept the toy domain and added several hidden operations ("ops", seven in total). The operands are always separated by the same placeholder token (&)[2], and the model has to infer which op is in use from a few in-context examples.
If red & cyan = black, and blue & cyan = blue, and orange & red = red, then gray & gray = what? The model answers, and then ends with a newline ⏎.
In order to do that, the model must learn a hidden internal (latent) representation for each of the ops.
Applying the same op to pictures...
This is not an image model, but it can be applied to images, which may make it easier to understand what it's doing.
A hidden op applied to images a and b pixel-by-pixel to produce image y. The op is the same as the one expressed as text, above.
The model was given one pixel of each of the nine example images as context, from which it had to guess the op, and then produce the output of the query. This was with (the model's best guess), so it's a little cleaner than the sampled output.
The seven ops were mix, lighten, darken, difference, hue, saturation, and value. Some ops produce the same result for certain inputs, so many combinations of examples are ambiguous. The examples also include mistakes: 30% have the answer of another op, picked at random. So a prompt can leave doubt about the op, and an ideal predictor must weigh how likely each one is, given the examples. We use "ideal₇" when referring to that (Bayes-optimal) predictor below, because it weighs seven ops.
Look back at the example above (red & cyan = black, etc.) Which op do you think was used there?
It was darken, which gives the per-channel minimum of the operands.
The models did well on this task, learning to guess almost as accurately as possible, assigning appropriate probabilities to the colors at the answer (scored as the expected exact match).[3]
Confusion matrix of where each model puts its probability, from its distribution over color tokens, based on whether each color is the true answer of the given op. Rows: the true op of the prompt. Columns: the probability on colors that op could give. Control is a model trained with no anchor; anchor is the anchored model; ideal₇ is the ideal predictor given only what the prompt shows. Center: in difference prompts, both models correctly put most of their mass on difference answers (0.72, against 0.77 for ideal₇). The rest is spread over the other ops, because some examples fit more than one op.
The full vocabulary has 4 syntax tokens and 216 indivisible value (color) tokens.[4]We call the final equation the "query". The figure shows where the answer to the query is predicted in the stream.
The residual stream of each prompt and its answer has 120 states (), not including those in the blocks. The = position after block 4 () predicts the answer y. States causally upstream of the answer are to its lower-left; the other states (dashed) cannot inform it in a forward pass. The embeddings (dot-hatched) have no context from other tokens at all.
The state that predicts the answer is read out as a color token, so that site already holds the answer, i.e. it has already been computed. The model must therefore form a belief about which op is in use somewhere before that site.
Our architecture
Before we continue, it may help to have a quick view of our architecture:
Each residual stream state is an activation vector on the hypersphere. We refer to the states between blocks as slices, where block reads from slice and writes to slice .
Anchoring an operation
Let one op (say, difference) represent a dangerous trait or capability. We would like to remove it after training so the model performs poorly on that task, while keeping its other capabilities (e.g. performance on lighten prompts). Can we improve on post-hoc search and removal methods by placing the op at a known location?
Suppose the op is represented primarily as a single direction in the residual stream, i.e. some states in the stream are aligned with that direction when the concept is present, but none are when it's not.[6]If we could reserve a coordinate axis (a dimension) for the concept in advance, and align those states to that axis, then removing the concept after training should be as simple as zeroing that axis.
We did that using two geometric regularizers (loss terms):[7]
Anchor pulled the states of rare labeled samples to the first axis
Anti-subspace pushed everything away from it.
As before, we used binary labels to trigger the anchor term, simulating the messiness of natural language classification by only labeling one in fifty targeted samples, picked at random. About a quarter of those labeled samples are so ambiguous that they barely distinguish the op, so the anchor has to work with a fairly weak signal.
The trick is knowing which sites in the residual stream to regularize during training. If the wrong sites were pulled, unrelated concepts could end up on the axis. But outside of toy settings, we can't know in advance which position or slice will hold the op. Instead, we let the anchor choose for itself with mellowmax pooling, which focuses the pull on states that are already close to . In our last post we pooled over positions; this time we pooled over every slice of a labeled sample, too.
Well, not quite every slice. As shown above, the site that predicts the answer is in the final slice. At that point the result has already been computed, and the other positions can't influence it, so we left that slice out. And since difference is a latent concept in this grammar, we know it can't be in the embeddings, so we left that slice out too. We think this is a principled choice that would extend to larger models.
The anchor term is mellowmax-pooled over positions and slices. A plain mean is taken over the batch.
Reserving the axis (the anti-subspace term)
The pull tends to drag other states onto the axis along with the labeled samples. That's good, for similar states: we want unlabeled difference samples to become aligned, too. But by default it brings along too much: other ops become somewhat aligned, and the embeddings do too, even though we know they can't hold the op. This seems to happen because it's the easiest way for the network to satisfy the anchor at later layers: if the earlier layers are also aligned, the blocks don't have to work as much to rotate the states. So, we need a repulsive force to keep the target axis clear of other concepts.
Shaped by mellowmax, the anchor term naturally focused its pull on the later slices. There's no obvious analog for the anti term: applied to anti-subspace, mellowmax would push the most aligned states away from the axis — but the most-aligned states are the ones we want to keep there.
Initially we used a flat mean for the anti-subspace term, with each position and slice receiving the same push away from . That worked fairly well, but the term weight needed to be tuned to a narrow band, which we think suggests it's balancing multiple priorities: it needs to be strong at slice 1, where the other ops are most pulled onto the axis, but weak at deeper slices to allow the anchor to do its work. We changed it to fall off over depth, but still held it flat over the sequence, and applied to all samples (labeled or not).
Where the op is aligned to the anchored axis, by slice, at the end of training. Top: The max alignment over positions in the sequence, for difference and the other six ops; mean over eight seeds. Bottom: the weights at each slice: the peak anchor weight , and the anti-subspace weight near the end of training. The anchor pooling temperature isn't shown.
We noticed that the states of difference sequences became aligned with the anchor in every slice after the embeddings, most strongly at slice 3. The other ops were slightly aligned at slice 1, and fell away with depth.
The depthwise falloff was found through experimentation, and we don't yet have a repeatable method to find it. It would be better if we didn't have to specify different term weights by depth at all. We think it could be calculated in the training loop from a running statistic of the per-slice alignment, with the slice weights of each step informed by the alignments of states in the preceding steps. At a high level, the algorithm might be to take the red curve in the chart above at step , flip it, and use that to modulate the anti-subspace weight in step .
Training, and schedules
We trained with a standard cosine-with-warmup schedule for the learning rate. We also varied the term weights over training: like when we anchored red previously, we found that a constant anti-subspace weight did worse than a schedule. It seems the best weight values change over the course of training.
The anti-subspace weight started high everywhere to clear out the anchor dimension. It annealed slowly over most of training to a lower value that fell linearly with depth: from 80% of the peak at the embeddings, to 12% at the last slice.
Training schedules and metrics. Top: the task score (expected exact match) of each op on held-out contexts, mean over eight runs with individual runs as hairlines. The ticks past the end of training mark the ceiling for each op (the score ideal₇ would give). Middle two: the anchor weight and the per-slice anti-subspace weights . The anchor pooling temperatures, over positions and over slices . Bottom: an approximation of the phases of learning.
The anchor weight started at zero and rose quickly to its peak, so at the start of training there was no pull at all. We believe that helps because at that point the latent op isn't known to the network yet, so any pull would be random — whereas waiting allows the nascent concept to develop a little before being rotated into place (but still while it's forming).
Mellowmax pooling makes the anchor pick out only the best-aligned states at very low temperature, and softens toward a plain mean at high temperatures. We held the temperature over slices constant at a fairly sharp , so it mostly focused on one slice. But we found that the temperature over positions needed to vary: too soft and other concepts were dragged onto the axis; too sharp and it latched onto one position in the answer, when it should have been spread over a few in the prompt. So again, we set to a slightly soft 1.0 at the start when the concept was unknown, and had it sharpen to 0.1 as the concept was learned.
Picture it like this: Before the network has learned anything, everything is pushed away from the anchor dimension . As it starts to organize the concepts for itself, some (labeled) concepts are softly pulled toward . As they strengthen, the pull is sharpened to focus on only the most relevant positions. The push that kept the axis clear is gradually reduced, especially in the later slices where the anchored concept forms, so it doesn't work against the pull as training settles.
Removal
We removed the anchored op by projecting out (zeroing) the axis and then renormalizing.[5]That had the effect of rotating the states away from to be fully orthogonal to it (), which matches the geometry encouraged by the anti-subspace term. is not any direction in particular; it's just not — so for example, a state that was halfway between difference and lighten should end up close to lighten, whereas one that was halfway between difference and hue should end up close to hue.
Forward passes. Left: in training, activations are unmodified but their nature changes from step to step due to the anchor and anti-subspace⌇⌇ loss terms, which pull labeled states toward and push all states away from it. Middle: clean inference behaves normally: activations may inhabit . Right: under the edit, blocks write to as normal, but it is projected to before the next block reads it.
The subspace was reserved so it could be indiscriminately edited, so edit was applied at every position and every slice. We did experiment with more targeted edits, though: editing one slice at a time, and seeing how that affects the output of the model, but also what is read from the residual stream by later blocks. We found that in these models, block 1 writes evidence for the op at the answer positions, and it's that evidence that becomes aligned to the anchor. A later block reads that evidence at the query = to predict the answer to the prompt (at block 2, 3, or 4, depending on the seed). Removal of the op was only successful when the edit was applied to a slice between the writer and the reader. It was most effective when applied to all slices.
There are several ways an edit might change the model. From least to most desirable, the edited model might:
Output nonsense for all tokens. A model like this would be broadly damaged and unusable.
Adhere to correct grammar, but give random answers to all prompts. This would suggest the functions were inseparable, and that edits impair neighboring capabilities.
Generally work, but answer with random colors for difference prompts in particular. This would suggest the model could still identify difference prompts, but couldn't perform the arithmetic. Such a model would be usable for color blending except for difference, for which its answers would be incoherent.
Answer difference prompts according to another random op. A model like this would have lost the ability to identify difference prompts, or difference arithmetic in particular was impaired.
Behave like a model that had never learnt difference, answering difference prompts according to the other op that best fits the evidence of the examples.
Answer according to the true posterior when difference is not an option, as ideal₆ does (which is ideal₇ with difference taken out of its options).
Our edited model was close to item 5: on difference prompts it answered much like a model retrained from scratch without difference, spreading its guesses over the other ops in about the right proportions.
Where the edited models put their probabilities. ideal₆ is the ideal predictor with difference excluded as an option; control and anchored are the same models as before but with zeroed; retrained is un-anchored (like the control) but trained from scratch with no loss on difference prompts. In the diff row: difference prompts are now rarely answered with colors that could fit difference, and the remaining mass is spread appropriately over the other ops. The edited control moves only slightly. Center:ideal₆ and retrained both put 0.01 on colors that match difference. The anchored model puts 0.04 after the edit, while the edited control still puts 0.67 (0.72 unedited).
Editing the anchored model moved its score on difference 89% of the way from its clean (unedited) score to ideal₆ (83-91%, n=8, net).[3][8]We call that metric the removal.[9]The other ops barely moved: no untargeted op's score dropped by more than two points on any run.
Removal and spill for retrained and the edited anchored model, eight runs each. For retrained, spill is relative to the control: a difference between two separately trained models, rather than the effect of an edit.
One nice surprise: some of the ambiguity in the prompts of other ops is due to difference. Ideal₆ (without difference) does better on those prompts than ideal₇ (with), because the probability mass is spread over the remaining ops. We didn't expect our model to do that, but it did indeed perform slightly better on non-difference prompts after the edit.
Comparison to post-hoc methods
Our motivation for this research was to develop better interpretability tools. If (!) current methods only have partial success in finding and removing capabilities, perhaps localizing the concepts of interest would help. In our experiments for this post, we had successfully anchored and removed a latent concept, without knowing its representation in advance. How much better and cleaner was the removal than existing methods?
We took our control model, which was trained without the anchor but performs the same task, and tried several linear erasers: difference in means, ridge probes, LEACE, and INLP.[10]They were each fitted to the control, and tuned per run over a grid of configurations of depth, dose (edit strength), label scheme, and ablation[11]— to give them a fair chance against the anchored model, which had been selected through many rounds of experimentation. Their edits were then scored the same way as the anchor.
The figure and table below give the removal under each method (median and range over eight runs), and their side-effects: with the method dosed to remove as much as the anchored edit, the largest drop in score on any other op ("spill", in points; less than two points is "clean").
Removal and spill for difference with the post-hoc methods over eight seeds. All were fitted over entire sequences (without special knowledge of token roles). Every difference sequence was labeled for the fits. The italic row (SCA) is included for reference only: it's the same condition and edit mentioned elsewhere. Hatched: spill past 2 points, the limit we set in advance.
Method
Removal (%) ↑
Spill (points) ↓
SCA (ours)
89 (83 to 91)
−0.6 (−2.2 to 0.3)
difference in means
78 (17 to 97)
5.6 (−0.8 to 44.5)
ridge probe
91 (54 to 98)
1.0 (−1.3 to 9.6)
LEACE
92 (83 to 98)
−0.8 (−1.2 to 43.9)
INLP
89 (77 to 98)
0.3 (−0.9 to 7.6)
Where the best linear erasers put their probabilities. Like SCA, LEACE and INLP redistribute the mass over other ops similarly to ideal₆. Center: ideal₆ puts 0.01 on colors that match difference, as before. SCA puts 0.04, LEACE 0.05, and INLP 0.09.
To our surprise, LEACE and INLP came out roughly level with SCA.[12]They removed about as much of the op, and their side-effects were usually about as low: most of their runs spilled less than one point (although a couple spilled a lot). The probability mass was spread appropriately over the other ops, so it seems the gain that surprised us (in § Removal) is just what erasing an op does in these models. They even did similarly well with only one in fifty difference sequences labeled.
When fitted against specific roles (token positions)
We also tried fitting the post-hoc erasers to the answer positions, where we know the model stores information about the ops.
Removal and spill with the post-hoc methods, when fitted only to the answer positions in the prompt.
Method
Removal (%) ↑
Spill (points) ↓
SCA (ours)
89 (83 to 91)
−0.6 (−2.2 to 0.3)
difference in means
96 (91 to 98)
−0.3 (−0.8 to 1.0)
ridge probe
96 (77 to 98)
−0.9 (−2.6 to 9.6)
LEACE
97 (91 to 98)
−0.8 (−5.9 to −0.3)
INLP
98 (90 to 99)
−0.6 (−0.9 to −0.4)
They did very well, almost entirely removing the op without side-effects. But this is not really a fair comparison: it needs privileged knowledge of token roles, which is unlikely to be available for a real deployment.
We had hoped to be able to claim that, with an anchored model in particular: removing the op is graded and selective, the edited model answers in a predictable way, the model does not route around the edit, and that scarce labels are enough. It turns out that that just describes linear erasure in these models, anchored or not. So, what did the anchor actually do, and does it have any benefit?
Agreement and differences
We mentioned above that the most-aligned states occurred in later slices, peaking in slice 3. Let's look at which positions became aligned in those slices.
Site alignment with the anchor in the residual stream. The cosine with starts at approximately zero for all token embeddings across all ops. It mostly stays at zero at every slice, except at the answer positions . There it rises with depth on difference prompts. The other ops rise slightly at the answers in slice 1, and then recede. The answer to the prompt is predicted by the query = in the last slice (). Hairlines show the spread between runs.
The site that predicts the answer showed no alignment with the anchor at all, but we know the anchor was successful because zeroing alone removes the op. Looking upstream, we found that the answer states of difference equations had become strongly aligned, and some answer states of other ops too. Averaged over prompts as above, it looks like there's little variation, but individually the answers show a progression:
States of example answers at slices 2 and 3, in the control and anchored models, from one representative seed of each. Each panel shows a plain orthographic projection of latent space, oriented such that the means of the fitting and non-fitting states sit on the disc. States of answers that only fit difference are red and vertical (even if the equation was in the prompt of another op); states that only fit other ops are gray and horizontal. They are positioned according to the model's own latent geometry. Points close to the rim (like those near the anchor ) are nearly on the plane/disc that spans the means of the two groups; points far from it have other components mixed in. The directions between the two means are the directions that difference in means and LEACE erase along; under SCA we erased along .
The progression between "fits difference" and "doesn't fit" is there in both models, as an arc on the hypersphere.[13]So something that correlates with the op is strongly present at the answer positions by default, and the anchor and anti-subspace terms accentuate it by stretching the arc.
We had thought we were anchoring "an operation". But this can't be the op: if it was, it should be used by the example equations to compute their answers, and they showed no alignment upstream of their answer-predictors (=). Instead, we think the anchor found the evidence for the op. The circuit seems to be: 1. Early blocks tag the example answers as matching difference (or not); 2. Later blocks read that tag when calculating the answer to the query equation. We tested this by specifically inhibiting the reader of this feature at the query = in later blocks, and confirmed that it accounts for most of the erasure. There was some variation: the key reader block was always after block 1, but it can be any of block 2, 3, or 4. The circuit was always there, in that general shape.
Assuming that later blocks read evidence for the op from the example answers , then the edit should only affect the parts of the network that logically depend on that information, proportional to the strength of the evidence. And indeed, on difference prompts the edit only increased the surprisal at the answer-predictors =, more so for later equations and especially in the query, where the context contains the most evidence. Operands and symbols were barely affected. From the second example on, the edited model moved most of the way to a model trained without difference (like retrained above). But at the answer-predictor in the first example, there is no evidence yet; there, the edited model kept its prior guess (no increase in surprisal).
Another surprise was that the later blocks also read the non-fitting end of the arc, i.e. evidence that the op is notdifference. In the anchored models, the vector between the two class means aligns fairly well with the anchor (a cosine with of about 0.8), but has a non-fitting component. Difference in means and LEACE erase along that vector, which collapses the arc and clears both ends at once. But a few runs in one of our labeling experiments leant heavily on that non-fitting direction, and in those runs zeroing removed less of the op, because the readers could still read the non-fitting evidence.
We think it should be possible to make the feature fully removable by adding a second anchor for the non-fitting end of the arc. The evidence would then sit in a 2D subspace. Since the non-fitting end also carries evidence for several other ops, the second anchor would probably need a lower weight, for a softer pull.
The linear erasers and SCA all found a low-level concept that correlated with the labeled high-level behavior, even though we expected them to find the high-level one. We haven't looked too closely at the blocks, other than to affect what they read from the stream, so it may be that "the op" exists as a concept in the blocks. But maybe not! Perhaps the op is only performed by the model, and a reductionist approach looking specifically for the high-level concept would miss it. We think this agrees with the recent Goodfire essay: these models were already clean and ready to be interpreted, just not in the way we expected.
So, why the anchor?
Usually, post-hoc tools will be the right choice: fitting one is cheap, so you can tune them for your specific model and use-case as needed. But we still think there are cases where anchoring would be beneficial.
To the model, the single accentuated feature (the stretched arc in the figure above) made little difference. It was trained with the accent present, so that's the true shape of its latent space. But for us, SCA yielded a model with an axis clear of other features, so a plain projection removes most of the concept with few side effects — even without needing to know how the model would represent the concept in advance.
Knowing where the concept will be placed allows for removal with no search, and reserving a subspace means the edit can be applied at every site in the stream. It also transfers to new models. Our recipe was first settled on eight seeds, and then confirmed on eight fresh seeds with their own initial parameters and training batches. The same term weights and schedules produced new models that supported exactly the same edit: zeroing axis erased the concept just as much and just as cleanly.
The post-hoc tools needed a little more care. When the fitted erasers were tuned per run, they matched the anchor (see above). But when each configuration was chosen from the full grid on the other seven runs, the fitted edits missed on one run. In the run that missed, the evidence for the op was read one slice earlier than on the runs used to choose the configuration, so the chosen edit, which acted on a single slice, came too late. The anchor edits every slice, so it can't miss that way.
We tried giving the post-hoc methods a similar hint, by requiring them to fit and edit slices 1 to 3 (fit per-slice), but still choosing the other settings on the other runs:
Removal and spill for post-hoc methods when they must edit slices 1-3. Other configuration options such as whether to use binary or graded labels, and whether to refit to each slice after the earlier edits, were tuned on other models that varied only by seed. After tuning, they were still fit on the same model they would be applied to.
Method
Removal (%) ↑
Spill (points) ↓
SCA (ours)
89 (83 to 91)
−0.6 (−2.2 to 0.3)
difference in means
8 (5 to 47)
1.5 (0.9 to 3.8)
ridge probe
68 (44 to 94)
0.5 (−0.3 to 15.7)
LEACE
22 (13 to 51)
2.0 (−0.5 to 4.6)
INLP
37 (26 to 92)
0.6 (0.1 to 20.6)
Most of them removed little: at the first block in the control model, the fitted direction also contains information that the other ops use, so the edit dose had to stay low to avoid excessive spill. A fit and edit of slices 2-3 only would avoid the first block, but it would likely miss on the run that reads the op a slice earlier, as the single-slice edit did.
Every slice, including the embedding
In the control, the embedding seems to also contain information that other ops use. Fitting to and editing every slice (as in the anchored model) causes the post-hoc methods to perform worse still.
Removal and spill for the post-hoc methods when the configuration was tuned on other models (such as the target, refit and dose), but editing every slice including the embedding, as the anchored edit does. After tuning, they were still fit on the same model they would be applied to.
Method
Removal (%) ↑
Spill (points) ↓
SCA (ours)
89 (83 to 91)
−0.6 (−2.2 to 0.3)
difference in means
12 (9 to 56)
5.9 (1.8 to 8.1)
ridge probe
29 (18 to 86)
1.6 (0.0 to 9.6)
LEACE
11 (8 to 39)
1.9 (0.6 to 3.5)
INLP
12 (9 to 37)
1.6 (0.9 to 7.6)
So with a budget and the opportunity to tune to each model, the post-hoc methods do about as well as the anchor. But the anchor did better with a single configuration over many seeds.[14]
Being safe at every position and depth has another use: the SCA edit could be baked into the weights by zeroing the row for in every matrix that writes to the stream (in theory; we haven't scored this on these models). Fitted erasers can be folded into the weights too, but it has to be done per block, and unlike a live edit, whatever earlier blocks wrote to the erased directions would flow past the edit in the residual stream. An edit folded into the weights of the model should therefore work better when the direction means the same thing at all slices, which can be engineered with an anchor.
Or suppose you have a collection of models: training checkpoints, fine-tunes, or a family of various sizes. With the concept anchored in a reserved subspace, you could apply the same edit or monitor to all of them and the results would be comparable, since each is measured along the same axis. We saw this across seeds and across checkpoints, where we tracked alignment and removal as metrics. Alignment with needs no fitting and means the same thing at every epoch, so a run can be checked early; when we did that, the alignment with separated the runs that would lose the concept from those that would keep it. A probe fitted at each epoch could tell you whether a concept has formed, but an anchored axis is also where you would edit it after training.
Anchored concepts could improve model documentation, too — in the model cards of public models, or internally for proprietary models. For example, a card for our models could say "The model places evidence of difference in ". This is easier to communicate than a fitted vector, it needs no qualification about what other concepts may be superposed with it, and it can be held constant across model versions. And complex structures could be confined to subsets of dimensions, allowing complementary interpretability work to be more focused. That might suit structures too large for one direction, such as the persona distributions described in Thousand-dimensional structure. Our autoencoder post tried a very small version of this: in a smaller toy model, we anchored hue to a plane (dimensions 1 and 2) and red to dimension 1 within it.
These are probably equally true for both SCA and gradient routing. Our understanding is that the difference is mostly in the formulation: gradient routing is module/weights-based, whereas SCA is geometry/activation-based.
Next steps
In the next part of this program, we will attempt to create and edit a model so that it can still recognize a concept after losing the ability to produce it. We plan to add a verification task to the grammar: given a statement with a candidate answer, the model should say whether the candidate follows the examples. We'd like to find an edit that removes answer completion and leaves verification intact. The case we have in mind is a model that has trouble being deceptive, yet is still hard to deceive: it has lost the ability to produce a behavior, but can still spot that behavior in what it reads. Color blending is far from that, but it lets us test whether the two are separable, and measure what the edit costs.
Surprisal (loss) for two difference sequences and two hypothetical models in the planned verification grammar. Both models are surprised by the label FALSE, because the statement is true. Only the edited model is surprised by the answers.
In the figure, the edit makes the model more surprised at the answers, so if it were generating them, it would make more mistakes. The TRUE/FALSE label comes after the answer, so the verdict is downstream of an answer the model now finds unlikely. Yet the edited model is unsurprised to read TRUE after a correct answer: it can no longer produce the answer, but it still recognizes one when it sees it.
We planned this task when the op names were still included, and before learning that the anchor finds the evidence for the op, rather than the op itself. Now we know that to verify a candidate answer, the model has to judge whether it fits the examples, and that judgement would need the evidence the edit removes. So by default we would expect the edit to remove verification along with completion, but we hope to find a way to keep it.
Our experiments so far suggest we will need to design the circuit that implements the op and the verification. Starting with the concept anchored as in this post, we might:
Give the completion reader an affinity to the anchor. The blocks that read the evidence mostly took it from , but on some earlier runs they read the other end of the arc. Training could encourage the reader to use , for example by routing its gradient updates on labelled contexts through the rows (weights) that read , or with a light regularizer on the weights that read other directions.
Encourage the verification reader to take the evidence from somewhere the edit leaves alone, such as the non-fitting end of the arc. If it doesn't naturally form a separate reader, we could encourage it to.
Edit the reader instead of the stream. Zeroing in the stream removes the evidence for every block that reads it. Editing only the completion reader, where its weights read e₁, would leave the evidence in place for the verifier.
If that works in a toy model, we're hopeful that it could be scaled up to safety-relevant concepts in larger models.
Other directions
We would also like to follow a few other threads from this work.
Anchoring both ends of the arc. A second, softer anchor for the non-fitting end could put the whole arc in a known plane. An anchored edit could then act on the whole arc, like LEACE and difference in means do. It would also give a second direction to use for reader affinity (as above).
Training-time comparison. So far we have only compared the anchored edit with post-hoc erasers. Gradient routing (Cloud et al., 2024) would be the natural training-time comparison. It also decides before training where something will be learned.
Harder tasks. The linear erasers did well on this task, but they're known to struggle when the concept is correlated with another one in the data (Kumar et al., 2022), or represented nonlinearly (Ravfogel et al., 2022). SCA might show an edge in those tasks: an eraser can only edit the representation the model has already learned, whereas the anchor shapes it during training.
What we learned
We set out to show that SCA works in a transformer, and it does (in a small one, at least). In our last post we showed that we could place a concept, but we hadn't demonstrated removal. Since then we've removed two concepts: red from the models in that post, and difference, an operation the model has to infer from context. Zeroing one coordinate axis removed a median of 89% of the op, with a drop of less than one point in accuracy on any of the other ops (no more than a model retrained without the op shows) — which is about as good as the best post-hoc erasers.
When I started this program, I assumed that the representations in neural networks were tangled by default, and that a concept we cared about would be hard to find unless we told the model where to put it. SCA was designed to give that signal early in training, and we set up these experiments to test it. We created a grammar with what we thought would be a hard-to-find latent concept, expecting that it would be much easier to remove when placed in a reserved subspace.
That isn't quite what we found. The anchor settled on the same feature that the post-hoc methods found in models trained with no anchor at all. We went looking for a particular concept and found something closely related that we could work with, but different from what we imagined. That is close to how neurons are read in Neural Networks Are Already Clean: as distinctions that later parts of the network use, interpretable but not in the ways we anticipate.
We don't yet know whether the op itself is represented anywhere, or whether the answer is composed from the evidence by the blocks that read it. If it's the latter, what we call difference may be a behavior that emerges from that process: a circuit, not a concept vector.
A circuit is more complex and perhaps harder to work with than a single vector, but it's reassuring that our anchor and the post-hoc methods found a relevant feature anyway. The evidence for the op is cleanly represented in these models. If other networks hold their evidence this cleanly, we might do better to look for those distinctions than to hope for representations of higher-level behaviors. And an anchor is less about making a representation clean and more about specifying where it should be placed.
Fixed confirmation: the training recipe, confirmed on eight fresh seeds.
All up, we ran 60 experiments for this post. 15 were preregistered (by Git commit), 17 were sweeps, scouts, or pilots, 39 trained new models, and 21 re-analyzed results we had already stored. Some count in more than one group.
The expected exact match is the chance that the reference answer would be produced when sampling from the model. Since answers in our grammar are single tokens, this is the softmax probability of the correct token — or, when the true answer is between grid levels, the probability-weighted sum over the colors it could round to.
nGPT is a normalized transformer architecture: all activation vectors and matrix rows have unit length. Ours was simplified: scalar gains instead of per-channel, a fixed residual step of , and a GELU MLP. We chose this architecture because it's easier to reason about the relationships between states: it's just cosine distance; the magnitude is irrelevant. Otherwise it seems to behave like a standard transformer. Normalizing the activation vectors removes one degree of freedom, so think of each state as having one dimension fewer than stated. Our models have 64 dimensions in the residual stream, 8 heads with 8 dimensions each, and 256-wide MLPs.
Anchor is the cosine with the concept vector, and anti-subspace is the squared distance of intrusion into the subspace:
where is the state vector, is the concept vector, is the th component of the state vector, and is the subspace (dimensions) being reserved for the concept. See our paper for details.
Erasing other directions can lower the score too. In this post, "removal" means the drop in score net of the median drop of other edits that don't target the concept, as appropriate for the model and method. For our anchored model, we net against the median drop from zeroing the other 63 axes individually.
Removal is only calculated from the score (drop in expected exact match). Total variation is stricter, comparing the entire answer distribution with ideal₆ on each prompt. The edited anchored model gets about halfway (0.50, raw) in total variation, whereas the post-hoc methods all get about five points closer (0.54 to 0.58). Details in § E2 of our post-hoc comparison report.
The edit with LEACE is the oblique projection that leaves no linear trace of the concept (Belrose et al., 2023). Think of it as pinching latent space along one direction, so that the information that distinguishes the concept is lost. The others use plain orthographic projection, i.e. without skew. In INLP, a probe is iteratively fitted to the concept and deleted (projected out) (Ravfogel et al., 2020). Plain removal with a ridge probe is its single-iteration special case.
Post-hoc methods were tuned over a grid with these dimensions. a. (9) Depth was one slice of the five, slices 1–3, or every slice; on several slices, the direction could also be refitted at each slice on the states that the earlier slices had already edited. b. (4) Dose was 0.25, 0.5, 0.75 or 1, as a fraction of the full edit. c. The probe and LEACE fitted either binary labels (the op is difference or it isn't) or graded ones (the Bayes posterior on difference); difference in means and INLP were only given binary labels. d. (2) Ablation either projected out the component to zero or to its mean over the other ops (mean ablation). e. (3) INLP removed 2, 4 or 8 directions; in practice, tuning mostly chose 2 or 4, and only chose 8 once.
All up, that's configurations across difference in means, the ridge probe, LEACE, and INLP. For the role-keyed table in the collapsible section, the site search multiplies these by 7 (pooled, plus three sites that each act either at that site or at every position), giving .
When we preregistered the experiment to compare the methods, we expected the anchor to come out well ahead. The "roughly level" result is the outcome of the planned test, but it was designed to give the post-hoc methods various advantages, like being tuned per-run. After seeing the results, we did some more analyses, such as giving them fewer labels to fit to and picking the configuration based on the other runs (leave-one-out tuning). They did well with few labels but less reliably with leave-one-out tuning: more runs spilled, and on one run in eight the chosen edit kept most of the op. We accept the preregistered result and think it's likely to be accurate, but in practice the other methods may perform better or worse than these results suggest.
Well, technically several arcs, because there's variation along other directions that the projection doesn't show (perhaps those directions differentiate the other ops).
This was an analysis run after the preregistered comparison to post-hoc methods. The every-slice algorithm matches concept scrubbing in the LEACE paper, which fits LEACE at every layer in sequence. Details in our fitter-transfer report.
We anchored and removed a single latent concept in a transformer, matching the performance of post-hoc methods (LEACE, INLP). Latent space took the structure we asked for, even though "the concept" turned out to be different from what we imagined.
A task with a latent concept
Previously, we trained small transformers to complete color-blending equations like
red + blue = purple,[1]with a single color, red, anchored to a direction of our choosing in the residual stream. We removed the anchored color from those models in a follow-up experiment by zeroing that direction. Accuracy dropped only for warm colors, and especially for red. The edit was graded by redness, and succeeded without any post-hoc search.But the things worth steering in large models usually aren't expressed by a single token the way red is. Qualities like politeness span many tokens, and personas shape behavior without appearing in the sequence at all. We wanted to try anchoring concepts like those, but still in a tiny model that we could study carefully and iterate on quickly. So for this post and its experiments we kept the toy domain and added several hidden operations ("ops", seven in total). The operands are always separated by the same placeholder token (
&)[2], and the model has to infer which op is in use from a few in-context examples.If
red & cyan = black,andblue & cyan = blue,andorange & red = red,thengray & gray =what? The model answers, and then ends with a newline⏎.In order to do that, the model must learn a hidden internal (latent) representation for each of the ops.
Applying the same op to pictures...
This is not an image model, but it can be applied to images, which may make it easier to understand what it's doing.
A hidden op applied to images
aandbpixel-by-pixel to produce imagey. The op is the same as the one expressed as text, above.The model was given one pixel of each of the nine example images as context, from which it had to guess the op, and then produce the output of the query. This was with (the model's best guess), so it's a little cleaner than the sampled output.
The seven ops were
mix,lighten,darken,difference,hue,saturation, andvalue. Some ops produce the same result for certain inputs, so many combinations of examples are ambiguous. The examples also include mistakes: 30% have the answer of another op, picked at random. So a prompt can leave doubt about the op, and an ideal predictor must weigh how likely each one is, given the examples. We use "ideal₇" when referring to that (Bayes-optimal) predictor below, because it weighs seven ops.Look back at the example above (
red & cyan = black, etc.) Which op do you think was used there?It was darken, which gives the per-channel minimum of the operands.
The models did well on this task, learning to guess almost as accurately as possible, assigning appropriate probabilities to the colors at the answer (scored as the expected exact match).[3]
Confusion matrix of where each model puts its probability, from its distribution over color tokens, based on whether each color is the true answer of the given op. Rows: the true op of the prompt. Columns: the probability on colors that op could give. Control is a model trained with no anchor; anchor is the anchored model; ideal₇ is the ideal predictor given only what the prompt shows. Center: in
differenceprompts, both models correctly put most of their mass ondifferenceanswers (0.72, against 0.77 for ideal₇). The rest is spread over the other ops, because some examples fit more than one op.The full vocabulary has 4 syntax tokens and 216 indivisible value (color) tokens.[4]We call the final equation the "query". The figure shows where the answer to the query is predicted in the stream.
The residual stream of each prompt and its answer has 120 states ( ), not including those in the blocks. The ) predicts the answer
=position after block 4 (y. States causally upstream of the answer are to its lower-left; the other states (dashed) cannot inform it in a forward pass. The embeddings (dot-hatched) have no context from other tokens at all.The state that predicts the answer is read out as a color token, so that site already holds the answer, i.e. it has already been computed. The model must therefore form a belief about which op is in use somewhere before that site.
Our architecture
Before we continue, it may help to have a quick view of our architecture:
Our architecture is a simplified nGPT.[5]
Each residual stream state is an activation vector on the hypersphere. We refer to the states between blocks as slices, where block reads from slice and writes to slice .
Anchoring an operation
Let one op (say,
difference) represent a dangerous trait or capability. We would like to remove it after training so the model performs poorly on that task, while keeping its other capabilities (e.g. performance onlightenprompts). Can we improve on post-hoc search and removal methods by placing the op at a known location?Suppose the op is represented primarily as a single direction in the residual stream, i.e. some states in the stream are aligned with that direction when the concept is present, but none are when it's not.[6]If we could reserve a coordinate axis (a dimension) for the concept in advance, and align those states to that axis, then removing the concept after training should be as simple as zeroing that axis.
We did that using two geometric regularizers (loss terms):[7]
As before, we used binary labels to trigger the anchor term, simulating the messiness of natural language classification by only labeling one in fifty targeted samples, picked at random. About a quarter of those labeled samples are so ambiguous that they barely distinguish the op, so the anchor has to work with a fairly weak signal.
The trick is knowing which sites in the residual stream to regularize during training. If the wrong sites were pulled, unrelated concepts could end up on the axis. But outside of toy settings, we can't know in advance which position or slice will hold the op. Instead, we let the anchor choose for itself with mellowmax pooling, which focuses the pull on states that are already close to . In our last post we pooled over positions; this time we pooled over every slice of a labeled sample, too.
Well, not quite every slice. As shown above, the site that predicts the answer is in the final slice. At that point the result has already been computed, and the other positions can't influence it, so we left that slice out. And since
differenceis a latent concept in this grammar, we know it can't be in the embeddings, so we left that slice out too. We think this is a principled choice that would extend to larger models.The anchor term is mellowmax-pooled over positions and slices. A plain mean is taken over the batch.
Reserving the axis (the anti-subspace term)
The pull tends to drag other states onto the axis along with the labeled samples. That's good, for similar states: we want unlabeled
differencesamples to become aligned, too. But by default it brings along too much: other ops become somewhat aligned, and the embeddings do too, even though we know they can't hold the op. This seems to happen because it's the easiest way for the network to satisfy the anchor at later layers: if the earlier layers are also aligned, the blocks don't have to work as much to rotate the states. So, we need a repulsive force to keep the target axis clear of other concepts.Shaped by mellowmax, the anchor term naturally focused its pull on the later slices. There's no obvious analog for the anti term: applied to anti-subspace, mellowmax would push the most aligned states away from the axis — but the most-aligned states are the ones we want to keep there.
Initially we used a flat mean for the anti-subspace term, with each position and slice receiving the same push away from . That worked fairly well, but the term weight needed to be tuned to a narrow band, which we think suggests it's balancing multiple priorities: it needs to be strong at slice 1, where the other ops are most pulled onto the axis, but weak at deeper slices to allow the anchor to do its work. We changed it to fall off over depth, but still held it flat over the sequence, and applied to all samples (labeled or not).
Where the op is aligned to the anchored axis, by slice, at the end of training. Top: The max alignment over positions in the sequence, for , and the anti-subspace weight near the end of training. The anchor pooling temperature isn't shown.
differenceand the other six ops; mean over eight seeds. Bottom: the weights at each slice: the peak anchor weightWe noticed that the states of
differencesequences became aligned with the anchor in every slice after the embeddings, most strongly at slice 3. The other ops were slightly aligned at slice 1, and fell away with depth.The depthwise falloff was found through experimentation, and we don't yet have a repeatable method to find it. It would be better if we didn't have to specify different term weights by depth at all. We think it could be calculated in the training loop from a running statistic of the per-slice alignment, with the slice weights of each step informed by the alignments of states in the preceding steps. At a high level, the algorithm might be to take the red curve in the chart above at step , flip it, and use that to modulate the anti-subspace weight in step .
Training, and schedules
We trained with a standard cosine-with-warmup schedule for the learning rate. We also varied the term weights over training: like when we anchored red previously, we found that a constant anti-subspace weight did worse than a schedule. It seems the best weight values change over the course of training.
The anti-subspace weight started high everywhere to clear out the anchor dimension. It annealed slowly over most of training to a lower value that fell linearly with depth: from 80% of the peak at the embeddings, to 12% at the last slice.
Training schedules and metrics. Top: the task score (expected exact match) of each op on held-out contexts, mean over eight runs with individual runs as hairlines. The ticks past the end of training mark the ceiling for each op (the score ideal₇ would give). Middle two: the anchor weight and the per-slice anti-subspace weights . The anchor pooling temperatures, over positions and over slices . Bottom: an approximation of the phases of learning.
The anchor weight started at zero and rose quickly to its peak, so at the start of training there was no pull at all. We believe that helps because at that point the latent op isn't known to the network yet, so any pull would be random — whereas waiting allows the nascent concept to develop a little before being rotated into place (but still while it's forming).
Mellowmax pooling makes the anchor pick out only the best-aligned states at very low temperature, and softens toward a plain mean at high temperatures. We held the temperature over slices constant at a fairly sharp , so it mostly focused on one slice. But we found that the temperature over positions needed to vary: too soft and other concepts were dragged onto the axis; too sharp and it latched onto one position in the answer, when it should have been spread over a few in the prompt. So again, we set to a slightly soft 1.0 at the start when the concept was unknown, and had it sharpen to 0.1 as the concept was learned.
Picture it like this: Before the network has learned anything, everything is pushed away from the anchor dimension . As it starts to organize the concepts for itself, some (labeled) concepts are softly pulled toward . As they strengthen, the pull is sharpened to focus on only the most relevant positions. The push that kept the axis clear is gradually reduced, especially in the later slices where the anchored concept forms, so it doesn't work against the pull as training settles.
Removal
We removed the anchored op by projecting out (zeroing) the axis and then renormalizing.[5]That had the effect of rotating the states away from to be fully orthogonal to it ( ), which matches the geometry encouraged by the anti-subspace term. is not any direction in particular; it's just not — so for example, a state that was halfway between
differenceandlightenshould end up close tolighten, whereas one that was halfway betweendifferenceandhueshould end up close tohue.Forward passes. Left: in training, activations are unmodified but their nature changes from step to step due to the anchor and anti-subspace ⌇ ⌇ loss terms, which pull labeled states toward and push all states away from it. Middle: clean inference behaves normally: activations may inhabit . Right: under the edit, blocks write to as normal, but it is projected to before the next block reads it.
The subspace was reserved so it could be indiscriminately edited, so edit was applied at every position and every slice. We did experiment with more targeted edits, though: editing one slice at a time, and seeing how that affects the output of the model, but also what is read from the residual stream by later blocks. We found that in these models, block 1 writes evidence for the op at the answer positions, and it's that evidence that becomes aligned to the anchor. A later block reads that evidence at the query
=to predict the answer to the prompt (at block 2, 3, or 4, depending on the seed). Removal of the op was only successful when the edit was applied to a slice between the writer and the reader. It was most effective when applied to all slices.There are several ways an edit might change the model. From least to most desirable, the edited model might:
differenceprompts in particular. This would suggest the model could still identifydifferenceprompts, but couldn't perform the arithmetic. Such a model would be usable for color blending except fordifference, for which its answers would be incoherent.differenceprompts according to another random op. A model like this would have lost the ability to identifydifferenceprompts, ordifferencearithmetic in particular was impaired.difference, answeringdifferenceprompts according to the other op that best fits the evidence of the examples.differenceis not an option, as ideal₆ does (which is ideal₇ with difference taken out of its options).Our edited model was close to item 5: on
differenceprompts it answered much like a model retrained from scratch withoutdifference, spreading its guesses over the other ops in about the right proportions.Where the edited models put their probabilities. ideal₆ is the ideal predictor with zeroed; retrained is un-anchored (like the control) but trained from scratch with no loss on
differenceexcluded as an option; control and anchored are the same models as before but withdifferenceprompts. In the diff row:differenceprompts are now rarely answered with colors that could fitdifference, and the remaining mass is spread appropriately over the other ops. The edited control moves only slightly. Center: ideal₆ and retrained both put 0.01 on colors that matchdifference. The anchored model puts 0.04 after the edit, while the edited control still puts 0.67 (0.72 unedited).Editing the anchored model moved its score on
difference89% of the way from its clean (unedited) score to ideal₆ (83-91%, n=8, net).[3][8]We call that metric the removal.[9]The other ops barely moved: no untargeted op's score dropped by more than two points on any run.Removal and spill for retrained and the edited anchored model, eight runs each. For retrained, spill is relative to the control: a difference between two separately trained models, rather than the effect of an edit.
One nice surprise: some of the ambiguity in the prompts of other ops is due to
difference. Ideal₆ (withoutdifference) does better on those prompts than ideal₇ (with), because the probability mass is spread over the remaining ops. We didn't expect our model to do that, but it did indeed perform slightly better on non-differenceprompts after the edit.Comparison to post-hoc methods
Our motivation for this research was to develop better interpretability tools. If (!) current methods only have partial success in finding and removing capabilities, perhaps localizing the concepts of interest would help. In our experiments for this post, we had successfully anchored and removed a latent concept, without knowing its representation in advance. How much better and cleaner was the removal than existing methods?
We took our control model, which was trained without the anchor but performs the same task, and tried several linear erasers: difference in means, ridge probes, LEACE, and INLP.[10]They were each fitted to the control, and tuned per run over a grid of configurations of depth, dose (edit strength), label scheme, and ablation[11]— to give them a fair chance against the anchored model, which had been selected through many rounds of experimentation. Their edits were then scored the same way as the anchor.
The figure and table below give the removal under each method (median and range over eight runs), and their side-effects: with the method dosed to remove as much as the anchored edit, the largest drop in score on any other op ("spill", in points; less than two points is "clean").
Removal and spill for
differencewith the post-hoc methods over eight seeds. All were fitted over entire sequences (without special knowledge of token roles). Everydifferencesequence was labeled for the fits. The italic row (SCA) is included for reference only: it's the same condition and edit mentioned elsewhere. Hatched: spill past 2 points, the limit we set in advance.Method
Removal (%) ↑
Spill (points) ↓
SCA (ours)
89 (83 to 91)
−0.6 (−2.2 to 0.3)
difference in means
78 (17 to 97)
5.6 (−0.8 to 44.5)
ridge probe
91 (54 to 98)
1.0 (−1.3 to 9.6)
LEACE
92 (83 to 98)
−0.8 (−1.2 to 43.9)
INLP
89 (77 to 98)
0.3 (−0.9 to 7.6)
Where the best linear erasers put their probabilities. Like SCA, LEACE and INLP redistribute the mass over other ops similarly to ideal₆. Center: ideal₆ puts 0.01 on colors that match
difference, as before. SCA puts 0.04, LEACE 0.05, and INLP 0.09.To our surprise, LEACE and INLP came out roughly level with SCA.[12]They removed about as much of the op, and their side-effects were usually about as low: most of their runs spilled less than one point (although a couple spilled a lot). The probability mass was spread appropriately over the other ops, so it seems the gain that surprised us (in § Removal) is just what erasing an op does in these models. They even did similarly well with only one in fifty
differencesequences labeled.When fitted against specific roles (token positions)
We also tried fitting the post-hoc erasers to the answer positions, where we know the model stores information about the ops.
Removal and spill with the post-hoc methods, when fitted only to the answer positions in the prompt.
Method
Removal (%) ↑
Spill (points) ↓
SCA (ours)
89 (83 to 91)
−0.6 (−2.2 to 0.3)
difference in means
96 (91 to 98)
−0.3 (−0.8 to 1.0)
ridge probe
96 (77 to 98)
−0.9 (−2.6 to 9.6)
LEACE
97 (91 to 98)
−0.8 (−5.9 to −0.3)
INLP
98 (90 to 99)
−0.6 (−0.9 to −0.4)
They did very well, almost entirely removing the op without side-effects. But this is not really a fair comparison: it needs privileged knowledge of token roles, which is unlikely to be available for a real deployment.
We had hoped to be able to claim that, with an anchored model in particular: removing the op is graded and selective, the edited model answers in a predictable way, the model does not route around the edit, and that scarce labels are enough. It turns out that that just describes linear erasure in these models, anchored or not. So, what did the anchor actually do, and does it have any benefit?
Agreement and differences
We mentioned above that the most-aligned states occurred in later slices, peaking in slice 3. Let's look at which positions became aligned in those slices.
Site alignment with the anchor in the residual stream. The cosine with starts at approximately zero for all token embeddings across all ops. It mostly stays at zero at every slice, except at the answer positions . There it rises with depth on ). Hairlines show the spread between runs.
differenceprompts. The other ops rise slightly at the answers in slice 1, and then recede. The answer to the prompt is predicted by the query=in the last slice (The site that predicts the answer showed no alignment with the anchor at all, but we know the anchor was successful because zeroing alone removes the op. Looking upstream, we found that the answer states of
differenceequations had become strongly aligned, and some answer states of other ops too. Averaged over prompts as above, it looks like there's little variation, but individually the answers show a progression:States of example answers at slices 2 and 3, in the control and anchored models, from one representative seed of each. Each panel shows a plain orthographic projection of latent space, oriented such that the means of the fitting and non-fitting states sit on the disc. States of answers that only fit ) are nearly on the plane/disc that spans the means of the two groups; points far from it have other components mixed in. The directions between the two means are the directions that difference in means and LEACE erase along; under SCA we erased along .
differenceare red and vertical (even if the equation was in the prompt of another op); states that only fit other ops are gray and horizontal. They are positioned according to the model's own latent geometry. Points close to the rim (like those near the anchorThe progression between "fits difference" and "doesn't fit" is there in both models, as an arc on the hypersphere.[13]So something that correlates with the op is strongly present at the answer positions by default, and the anchor and anti-subspace terms accentuate it by stretching the arc.
We had thought we were anchoring "an operation". But this can't be the op: if it was, it should be used by the example equations to compute their answers, and they showed no alignment upstream of their answer-predictors (
=). Instead, we think the anchor found the evidence for the op. The circuit seems to be: 1. Early blocks tag the example answers as matchingdifference(or not); 2. Later blocks read that tag when calculating the answer to the query equation. We tested this by specifically inhibiting the reader of this feature at the query=in later blocks, and confirmed that it accounts for most of the erasure. There was some variation: the key reader block was always after block 1, but it can be any of block 2, 3, or 4. The circuit was always there, in that general shape.Assuming that later blocks read evidence for the op from the example answers , then the edit should only affect the parts of the network that logically depend on that information, proportional to the strength of the evidence. And indeed, on
differenceprompts the edit only increased the surprisal at the answer-predictors=, more so for later equations and especially in the query, where the context contains the most evidence. Operands and symbols were barely affected. From the second example on, the edited model moved most of the way to a model trained withoutdifference(like retrained above). But at the answer-predictor in the first example, there is no evidence yet; there, the edited model kept its prior guess (no increase in surprisal).Another surprise was that the later blocks also read the non-fitting end of the arc, i.e. evidence that the op is not of about 0.8), but has a non-fitting component. Difference in means and LEACE erase along that vector, which collapses the arc and clears both ends at once. But a few runs in one of our labeling experiments leant heavily on that non-fitting direction, and in those runs zeroing removed less of the op, because the readers could still read the non-fitting evidence.
difference. In the anchored models, the vector between the two class means aligns fairly well with the anchor (a cosine withWe think it should be possible to make the feature fully removable by adding a second anchor for the non-fitting end of the arc. The evidence would then sit in a 2D subspace. Since the non-fitting end also carries evidence for several other ops, the second anchor would probably need a lower weight, for a softer pull.
The linear erasers and SCA all found a low-level concept that correlated with the labeled high-level behavior, even though we expected them to find the high-level one. We haven't looked too closely at the blocks, other than to affect what they read from the stream, so it may be that "the op" exists as a concept in the blocks. But maybe not! Perhaps the op is only performed by the model, and a reductionist approach looking specifically for the high-level concept would miss it. We think this agrees with the recent Goodfire essay: these models were already clean and ready to be interpreted, just not in the way we expected.
So, why the anchor?
Usually, post-hoc tools will be the right choice: fitting one is cheap, so you can tune them for your specific model and use-case as needed. But we still think there are cases where anchoring would be beneficial.
To the model, the single accentuated feature (the stretched arc in the figure above) made little difference. It was trained with the accent present, so that's the true shape of its latent space. But for us, SCA yielded a model with an axis clear of other features, so a plain projection removes most of the concept with few side effects — even without needing to know how the model would represent the concept in advance.
Knowing where the concept will be placed allows for removal with no search, and reserving a subspace means the edit can be applied at every site in the stream. It also transfers to new models. Our recipe was first settled on eight seeds, and then confirmed on eight fresh seeds with their own initial parameters and training batches. The same term weights and schedules produced new models that supported exactly the same edit: zeroing axis erased the concept just as much and just as cleanly.
The post-hoc tools needed a little more care. When the fitted erasers were tuned per run, they matched the anchor (see above). But when each configuration was chosen from the full grid on the other seven runs, the fitted edits missed on one run. In the run that missed, the evidence for the op was read one slice earlier than on the runs used to choose the configuration, so the chosen edit, which acted on a single slice, came too late. The anchor edits every slice, so it can't miss that way.
We tried giving the post-hoc methods a similar hint, by requiring them to fit and edit slices 1 to 3 (fit per-slice), but still choosing the other settings on the other runs:
Removal and spill for post-hoc methods when they must edit slices 1-3. Other configuration options such as whether to use binary or graded labels, and whether to refit to each slice after the earlier edits, were tuned on other models that varied only by seed. After tuning, they were still fit on the same model they would be applied to.
Method
Removal (%) ↑
Spill (points) ↓
SCA (ours)
89 (83 to 91)
−0.6 (−2.2 to 0.3)
difference in means
8 (5 to 47)
1.5 (0.9 to 3.8)
ridge probe
68 (44 to 94)
0.5 (−0.3 to 15.7)
LEACE
22 (13 to 51)
2.0 (−0.5 to 4.6)
INLP
37 (26 to 92)
0.6 (0.1 to 20.6)
Most of them removed little: at the first block in the control model, the fitted direction also contains information that the other ops use, so the edit dose had to stay low to avoid excessive spill. A fit and edit of slices 2-3 only would avoid the first block, but it would likely miss on the run that reads the op a slice earlier, as the single-slice edit did.
Every slice, including the embedding
In the control, the embedding seems to also contain information that other ops use. Fitting to and editing every slice (as in the anchored model) causes the post-hoc methods to perform worse still.
Removal and spill for the post-hoc methods when the configuration was tuned on other models (such as the target, refit and dose), but editing every slice including the embedding, as the anchored edit does. After tuning, they were still fit on the same model they would be applied to.
Method
Removal (%) ↑
Spill (points) ↓
SCA (ours)
89 (83 to 91)
−0.6 (−2.2 to 0.3)
difference in means
12 (9 to 56)
5.9 (1.8 to 8.1)
ridge probe
29 (18 to 86)
1.6 (0.0 to 9.6)
LEACE
11 (8 to 39)
1.9 (0.6 to 3.5)
INLP
12 (9 to 37)
1.6 (0.9 to 7.6)
So with a budget and the opportunity to tune to each model, the post-hoc methods do about as well as the anchor. But the anchor did better with a single configuration over many seeds.[14]
Being safe at every position and depth has another use: the SCA edit could be baked into the weights by zeroing the row for in every matrix that writes to the stream (in theory; we haven't scored this on these models). Fitted erasers can be folded into the weights too, but it has to be done per block, and unlike a live edit, whatever earlier blocks wrote to the erased directions would flow past the edit in the residual stream. An edit folded into the weights of the model should therefore work better when the direction means the same thing at all slices, which can be engineered with an anchor.
Or suppose you have a collection of models: training checkpoints, fine-tunes, or a family of various sizes. With the concept anchored in a reserved subspace, you could apply the same edit or monitor to all of them and the results would be comparable, since each is measured along the same axis. We saw this across seeds and across checkpoints, where we tracked alignment and removal as metrics. Alignment with needs no fitting and means the same thing at every epoch, so a run can be checked early; when we did that, the alignment with separated the runs that would lose the concept from those that would keep it. A probe fitted at each epoch could tell you whether a concept has formed, but an anchored axis is also where you would edit it after training.
Anchored concepts could improve model documentation, too — in the model cards of public models, or internally for proprietary models. For example, a card for our models could say "The model places evidence of ". This is easier to communicate than a fitted vector, it needs no qualification about what other concepts may be superposed with it, and it can be held constant across model versions. And complex structures could be confined to subsets of dimensions, allowing complementary interpretability work to be more focused. That might suit structures too large for one direction, such as the persona distributions described in Thousand-dimensional structure. Our autoencoder post tried a very small version of this: in a smaller toy model, we anchored hue to a plane (dimensions 1 and 2) and red to dimension 1 within it.
differenceinThese are probably equally true for both SCA and gradient routing. Our understanding is that the difference is mostly in the formulation: gradient routing is module/weights-based, whereas SCA is geometry/activation-based.
Next steps
In the next part of this program, we will attempt to create and edit a model so that it can still recognize a concept after losing the ability to produce it. We plan to add a verification task to the grammar: given a statement with a candidate answer, the model should say whether the candidate follows the examples. We'd like to find an edit that removes answer completion and leaves verification intact. The case we have in mind is a model that has trouble being deceptive, yet is still hard to deceive: it has lost the ability to produce a behavior, but can still spot that behavior in what it reads. Color blending is far from that, but it lets us test whether the two are separable, and measure what the edit costs.
Surprisal (loss) for two
differencesequences and two hypothetical models in the planned verification grammar. Both models are surprised by the labelFALSE, because the statement is true. Only the edited model is surprised by the answers.In the figure, the edit makes the model more surprised at the answers, so if it were generating them, it would make more mistakes. The
TRUE/FALSElabel comes after the answer, so the verdict is downstream of an answer the model now finds unlikely. Yet the edited model is unsurprised to readTRUEafter a correct answer: it can no longer produce the answer, but it still recognizes one when it sees it.We planned this task when the op names were still included, and before learning that the anchor finds the evidence for the op, rather than the op itself. Now we know that to verify a candidate answer, the model has to judge whether it fits the examples, and that judgement would need the evidence the edit removes. So by default we would expect the edit to remove verification along with completion, but we hope to find a way to keep it.
Our experiments so far suggest we will need to design the circuit that implements the op and the verification. Starting with the concept anchored as in this post, we might:
If that works in a toy model, we're hopeful that it could be scaled up to safety-relevant concepts in larger models.
Other directions
We would also like to follow a few other threads from this work.
Anchoring both ends of the arc. A second, softer anchor for the non-fitting end could put the whole arc in a known plane. An anchored edit could then act on the whole arc, like LEACE and difference in means do. It would also give a second direction to use for reader affinity (as above).
Training-time comparison. So far we have only compared the anchored edit with post-hoc erasers. Gradient routing (Cloud et al., 2024) would be the natural training-time comparison. It also decides before training where something will be learned.
Harder tasks. The linear erasers did well on this task, but they're known to struggle when the concept is correlated with another one in the data (Kumar et al., 2022), or represented nonlinearly (Ravfogel et al., 2022). SCA might show an edge in those tasks: an eraser can only edit the representation the model has already learned, whereas the anchor shapes it during training.
What we learned
We set out to show that SCA works in a transformer, and it does (in a small one, at least). In our last post we showed that we could place a concept, but we hadn't demonstrated removal. Since then we've removed two concepts: red from the models in that post, and
difference, an operation the model has to infer from context. Zeroing one coordinate axis removed a median of 89% of the op, with a drop of less than one point in accuracy on any of the other ops (no more than a model retrained without the op shows) — which is about as good as the best post-hoc erasers.When I started this program, I assumed that the representations in neural networks were tangled by default, and that a concept we cared about would be hard to find unless we told the model where to put it. SCA was designed to give that signal early in training, and we set up these experiments to test it. We created a grammar with what we thought would be a hard-to-find latent concept, expecting that it would be much easier to remove when placed in a reserved subspace.
That isn't quite what we found. The anchor settled on the same feature that the post-hoc methods found in models trained with no anchor at all. We went looking for a particular concept and found something closely related that we could work with, but different from what we imagined. That is close to how neurons are read in Neural Networks Are Already Clean: as distinctions that later parts of the network use, interpretable but not in the ways we anticipate.
We don't yet know whether the op itself is represented anywhere, or whether the answer is composed from the evidence by the blocks that read it. If it's the latter, what we call
differencemay be a behavior that emerges from that process: a circuit, not a concept vector.A circuit is more complex and perhaps harder to work with than a single vector, but it's reassuring that our anchor and the post-hoc methods found a relevant feature anyway. The evidence for the op is cleanly represented in these models. If other networks hold their evidence this cleanly, we might do better to look for those distinctions than to hope for representations of higher-level behaviors. And an anchor is less about making a representation clean and more about specifying where it should be placed.
Our experiments are published at z0u.github.io/sca2 (source). Most relevant:
difference: the retrained model.All up, we ran 60 experiments for this post. 15 were preregistered (by Git commit), 17 were sweeps, scouts, or pilots, 39 trained new models, and 21 re-analyzed results we had already stored. Some count in more than one group.
These are essentially vector functions (in RGB and HSV). The domain isn't important; we just chose color blending because we find it intuitive.
In our experiment reports we use
?, but&reads better here.The expected exact match is the chance that the reference answer would be produced when sampling from the model. Since answers in our grammar are single tokens, this is the softmax probability of the correct token — or, when the true answer is between grid levels, the probability-weighted sum over the colors it could round to.
We found that models of this class learn the domain well with six subdivisions of the RGB cube ( ).
nGPT is a normalized transformer architecture: all activation vectors and matrix rows have unit length. Ours was simplified: scalar gains instead of per-channel, a fixed residual step of , and a GELU MLP. We chose this architecture because it's easier to reason about the relationships between states: it's just cosine distance; the magnitude is irrelevant. Otherwise it seems to behave like a standard transformer. Normalizing the activation vectors removes one degree of freedom, so think of each state as having one dimension fewer than stated. Our models have 64 dimensions in the residual stream, 8 heads with 8 dimensions each, and 256-wide MLPs.
As in the linear representation hypothesis: a network holds a concept as a direction in activation space (Park, Choe & Veitch, 2023).
Anchor is the cosine with the concept vector, and anti-subspace is the squared distance of intrusion into the subspace:
Erasing other directions can lower the score too. In this post, "removal" means the drop in score net of the median drop of other edits that don't target the concept, as appropriate for the model and method. For our anchored model, we net against the median drop from zeroing the other 63 axes individually.
Removal is only calculated from the score (drop in expected exact match). Total variation is stricter, comparing the entire answer distribution with ideal₆ on each prompt. The edited anchored model gets about halfway (0.50, raw) in total variation, whereas the post-hoc methods all get about five points closer (0.54 to 0.58). Details in § E2 of our post-hoc comparison report.
The edit with LEACE is the oblique projection that leaves no linear trace of the concept (Belrose et al., 2023). Think of it as pinching latent space along one direction, so that the information that distinguishes the concept is lost. The others use plain orthographic projection, i.e. without skew. In INLP, a probe is iteratively fitted to the concept and deleted (projected out) (Ravfogel et al., 2020). Plain removal with a ridge probe is its single-iteration special case.
Post-hoc methods were tuned over a grid with these dimensions. a. (9) Depth was one slice of the five, slices 1–3, or every slice; on several slices, the direction could also be refitted at each slice on the states that the earlier slices had already edited. b. (4) Dose was 0.25, 0.5, 0.75 or 1, as a fraction of the full edit. c. The probe and LEACE fitted either binary labels (the op is
differenceor it isn't) or graded ones (the Bayes posterior ondifference); difference in means and INLP were only given binary labels. d. (2) Ablation either projected out the component to zero or to its mean over the other ops (mean ablation). e. (3) INLP removed 2, 4 or 8 directions; in practice, tuning mostly chose 2 or 4, and only chose 8 once.All up, that's configurations across difference in means, the ridge probe, LEACE, and INLP. For the role-keyed table in the collapsible section, the site search multiplies these by 7 (pooled, plus three sites that each act either at that site or at every position), giving .
When we preregistered the experiment to compare the methods, we expected the anchor to come out well ahead. The "roughly level" result is the outcome of the planned test, but it was designed to give the post-hoc methods various advantages, like being tuned per-run. After seeing the results, we did some more analyses, such as giving them fewer labels to fit to and picking the configuration based on the other runs (leave-one-out tuning). They did well with few labels but less reliably with leave-one-out tuning: more runs spilled, and on one run in eight the chosen edit kept most of the op. We accept the preregistered result and think it's likely to be accurate, but in practice the other methods may perform better or worse than these results suggest.
Well, technically several arcs, because there's variation along other directions that the projection doesn't show (perhaps those directions differentiate the other ops).
This was an analysis run after the preregistered comparison to post-hoc methods. The every-slice algorithm matches concept scrubbing in the LEACE paper, which fits LEACE at every layer in sequence. Details in our fitter-transfer report.