Sparse Concept Anchoring in transformers

Sparse Concept Anchoring (SCA) is a training-time method for concept control. A light geometric regularizer, driven by a small number of noisy labels, guides a chosen concept toward a known location in representation space. The geometry is shaped during training, so there is no need to reverse-engineer it afterwards: the concept lives where you put it, and the side effects of suppressing or ablating it can be bounded before running the intervention.

The first milestone (M1) established the method in autoencoders: paper, blog post, code. This site holds the experiment reports for the second milestone (M2), which asks: does SCA transfer to transformers? We train a small transformer to do vector math and anchor concepts in its residual stream. The vectors are colors, in a synthetic color-mixing task (red + blue = purple) where ground truth is unambiguous, so a negative result stays interpretable. The plan and deliverables are in the project README.

Milestone map: M1 (autoencoders) complete, M2 (transformers) in progress, M3 (language models) and M4 (LLM fine-tunes) planned. Within M2, D2.1 (anchor a concept) is complete, D2.2 (operations and steering) in progress, D2.3 (asymmetric verification) planned, and D2.4 (publication) already under way.

 

Experiments

Each report is a literate script.1 Each entry has searchable tags and a strip of the report's figures, in reading order.

Iteration 0 (prep)

These experiments were preparation for the main work: exercising the infrastructure, testing the normalized transformer architecture, and tying off some loose ends from M1.

Reports

D2.1: anchoring in a transformer

D2.1 asked whether SCA works in a transformer at all. We designed a task where a small transformer learns the geometry of color on its own, then anchored red to a chosen direction in its residual stream. With a repulsive term, a schedule for it, and a pull that finds the red operand by itself, red landed where we put it, graded by how red each color is, at no measurable cost to the task.

Reports

D2.2: anchoring an operation

D2.2 anchors an operation rather than a color. Since the pivot, the model infers which op a line uses from a few solved examples, so the op has no word of its own, like the abstract concepts we care about in language models. The anchor lands at little cost to the task, and removing the anchor direction takes the op out gradually. Under the edit, the model moves its answers onto the other ops about as much as an ideal predictor would, though context by context it doesn't always pick the same ones. On the recipe of record, chosen at fresh seeds, the edit removes most of the op and leaves the other ops within the selectivity criterion on every seed. What is left is a pull that grows with depth, a bound on what an edit can write into the inferred op, and where the edited model lands against the target null. The design doc has the current setup, the claims, and what comes next.

Removing red

D2.1 anchored red but never removed it, so D2.2 began by removing it. Projecting out the anchor direction took red out, and took out more where the line was redder, at a small cost to lines with no red. Of the edits we tried, the plain projection stayed the best choice.

Reports

A richer grammar for red

Before we could anchor an op, the grammar needed more than one, so it grew from one op to eleven. We anchored red again at each step, and the recipe held. Removal was clean on every op but one, where the model kept about a quarter of the answers that needed red.

Reports

Anchoring an op word, and the pivot

Ex-2.2.14 anchored the op difference, and it landed, but almost entirely on the word difference, so removing it would be hard to tell apart from deleting the word. The concepts we care about in language models mostly have no word of their own, so we took the op words out: each line now shows a few solved examples and a query, and the model has to infer the op.

Reports

Teaching the in-context task

Once the op had no word, the first question was whether an un-anchored model could learn the task at all. At first it got a little under halfway from guessing to the best possible score. Changes to training and a smaller set of ops brought it to about nine tenths of the way.

Reports

Anchoring and removing the inferred op

With the control near its best, we anchored difference on the new grammar. The anchor settles on the example answers, where the context shows the most about the op. Removing the anchor direction everywhere takes difference out gradually. At first the edit spilled onto the other ops on most fully trained runs. The spill came from a stand-in for the op in the color embedding table, where there is no context yet to infer it from. With the pull kept off the first two slices and the anti-subspace weight held high there, the edit removes difference and leaves the other ops within the criterion on every fresh seed.

Reports

  1. A literate script is plain Python with Markdown prose between the cells. It reads durable results produced by a separately-run experiment. Reports are published automatically, with their figures served from a Hugging Face dataset; the infrastructure is mi-ni. ↩