Programmable Semantic Interventions

Learning Causal Carriers from Behavioral Programs

Paolo Muratore, Mackenzie Weygandt Mathis

EPFL

PSI () finds the subspace of a frozen language model's activations that carries a variable you name, given only the list of answers that variable can produce. The training targets are the model's own output distributions on random pairs of prompts, so no labels are needed.

one interchange, on a real pair of test prompts

gemma-2-2b, MCQA, layer 17, last token, soft target, rank 16, seed 11. Two test pairs from the benchmark, each the median-KL pair of its family. The plane spans two of the subspace's 16 directions, which hold 60% of the test activations' variance inside it; the vertical axis is the main direction of variance outside it. Each letter is one of the 200 test prompts, marked by the option the model picks. Over 150 test pairs and three seeds, averages 0.103 nats.

From an Answer List to a Subspace

The investigator writes the first step. The frozen model supplies everything numerical.

  1. 1.

    Declare the answer list

    A semantic program lists the answers the variable can produce and the rule an interchange should follow. For the position of the correct option, the library is the prompt's own option labels and the rule is the full swap: the base should read as the source does.

    no correct answer, no annotated pair, no executable model

  2. 2.

    Read the targets from the frozen model

    Pair prompts at random. The model's log-probability on each declared answer, renormalised over the library, is its reading of the variable. The target for a pair is the source's reading, so nobody writes a counterfactual answer.

    the reading is the model's opinion about the variable

  3. 3.

    Train the subspace

    Learn an orthonormal basis at one layer and token, with projector . The interchange keeps the base outside the subspace and takes the source inside it; training brings the edited model's reading to the target.

    base is the recipient, source the donor

Paper Figure 1. Left: a base and a source prompt read at layer l_k, where the abstraction selects the carrier, with bar charts of the model's probabilities on the declared answers. Right: readings as points in a simplex; the interchange moves the base's reading towards the source's, and the same target can be requested with no donor.
Figure 1 of the paper. (a) The declared answers and the frozen model's probability on each, read at the layer where the subspace sits. (b) A reading is a point in the simplex over the answers. The interchange should move the base's reading to , and the remaining distance is the training signal. The same target can be requested directly as , with no donor.

Position or Symbol?

The subspace for the answer position was trained with capital-letter labels. Frozen, it now swaps answers between prompts labelled differently. If it carries the position, the recipient answers with its own label at the donor's position.

donor labels
recipient labels
donor ↓ recipient →
A–Z
a–d
1–4
perm.
1–4
A–Z
a–d
1–4
perm. 1–4

, mean of three seeds, % of 150 test pairs

%

of test pairs where the edited recipient answers at the donor's position, written in its own labels.

DAS
no edit

donor
recipient

gemma-2-2b, layer 17, last token, rank 16. Greedy decoding, exact case-sensitive label, 150 test pairs, unweighted mean over the three counterfactual families.

The paper's figure, with the argmax-target and DAS subspaces beside
Paper appendix figure: three 4 by 4 heat maps of transfer rate by donor and recipient encoding, for Psi, the argmax target and DAS, each with a strip of the unedited model's accuracy per recipient encoding.
Appendix figure of the paper. Rows are donor encodings, columns recipient encodings; the strip above each map is the unedited model's accuracy with the recipient's labels.

Key Numbers

Each value is exported from the experiments reported in the paper.

Localization at matched budget

90.24 vs 91.70

Official MIB score on MCQA, Ψ against DAS, both trained for 768 updates on the same model, layer and rank. Ψ trains on random prompt pairs, DAS on the benchmark's curated pairs. Averaged over 3 seeds, DAS gets 1.7 more of the 122 test pairs right.

Official score, mean and SD over seeds 0 50 100 Ψ 90.24 DAS 91.70

No gold labels

89.34

The training targets are the model's own distributions, so Ψ can train on every prompt, including those the model answers wrongly, with no answer key at any stage. Its official score is then 89.34. Using gold labels to keep only correctly answered prompts adds 0.9 points.

Official score with and without the correctness filter 0 50 100 no gold label 89.34 filtered by gold 90.24

Natural ARC questions

85.9% vs 72.1%

On the 111 held-out pairs whose donor question the model answers wrongly, the edited recipient gives the donor's answer in 85.9% of pairs when the subspace is trained on the model's distribution. Trained on gold labels, it does so in 72.1%.

Agreement with a wrong donor's answer, by training target 0 50 100 soft (Ψ) 85.9 confidence 84.7 argmax 79.3 gold 72.1 no edit 30.6

Donor-free control

94.8%

Ψ can also be asked for an answer directly, with no donor prompt. Trained jointly with its controller, it realizes 94.8% of held-out requests. The same controller reaches 81.7% inside a frozen DAS subspace and 34.2% inside a random one. Swapping in a real donor reaches 87.9%.

Requests realized, greedy decoding 0 50 100 Ψ, joint 94.8 frozen DAS 81.7 frozen random 34.2 donor swap 87.9

BibTeX

If this is useful in your work, please cite

@article{muratore2026programmable,
  title   = {Programmable Semantic Interventions: Learning Causal Carriers from Behavioral Programs},
  author  = {Muratore, Paolo and Mathis, Mackenzie Weygandt},
  journal = {arXiv preprint arXiv:XXXX.XXXXX},
  year    = {2026}
}