Programmable Semantic Interventions: Learning Causal Carriers from Behavioral Programs
Organizations: EPFL
Abstract
Causal abstraction explains a frozen network by aligning its activations with the variables of a simpler, interpretable model, and checking that interventions on the two agree. Finding such an alignment currently requires a counterfactual dataset: for every pair of prompts, the answer the network ought to give once the variable has been changed. In practice, those labels are produced by an executable algorithm for the behavior, written before studying the model supposed to implement it. However, the criterion these methods optimize only leverages the answer an intervention should produce. Here, we develop an approach that lets the investigator define that relationship directly: the answers the variable can produce, and which of them an intervention should yield. We call this interface a semantic program and introduce Programmable Semantic Interventions (PSI): a low-rank activation subspace learned so that interchanging it changes the model's answer as the program declares, with the expected answers read from the frozen model itself. On the MIB benchmark PSI performs on par with supervised alignment at matched data and training budget, without curated pairs, and it needs no ground-truth labels; while on natural science questions with gold labels withheld, it tracks the model's own answers better than a subspace trained on gold labels. The declaration also fixes a coordinate system with known semantics, enabling donor-free steering: jointly training PSI for both localization and control realizes 94.8% of held-out requests for answers the investigator chooses, without the need for donor prompts.
Figures & tables
| ARC (Easy) | ||||
| gemma-2_2b | llama-3.1_8b | |||
| Method | ||||
| Full Vector | 63 (100) | 43 (74) | 68 (100) | 47 (72) |
| Random | 18 (27) | 33 (33) | 17 (28) | 33 (33) |
| DBM | 82 ( 99 ) | 63 (80) | 85 ( 100 ) | 69 (82) |
| + PCA | 78 (98) | 64 (81) | 84 ( 100 ) | 72 (83) |
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
| Method | High-level model | Intervention target | Pairing | Gold labels |
|---|---|---|---|---|
| DAS, Boundless DAS, MDAS | algorithm | oracle answer | curated | target, filter |
| HyperDAS | algorithm, text | oracle answer | curated | target, filter |
| CDAS | concept prompts | own distribution | contrast sets | set membership |
| LoReFT | none | task label | none | training target |
| (ours) | library, transport | own reading | derangement | filter |
| Pool | Target | Official (%) | Agreement (%) | KL |
|---|---|---|---|---|
| gemma-2_2b | ||||
| filtered | soft reading ( ) | |||
| filtered | model argmax = gold | |||
| unfiltered | soft reading ( ) | |||
| unfiltered | model argmax | |||
| unfiltered | gold label | |||
| Target | Mass mode | Official (%) | KL |
|---|---|---|---|
| soft reading ( ) | conditional | ||
| soft reading ( ) | reference | ||
| soft reading ( ) | full | ||
| model argmax | conditional | ||
| model argmax | reference | ||
| model argmax | full |
| Training target | Position (%) | Symbol (%) | Both (%) | Macro (%) |
|---|---|---|---|---|
| soft reading ( ) | ||||
| model argmax | ||||
| DAS |
| Recipient encoding | |||||
|---|---|---|---|---|---|
| Control | Donor encoding | original | lowercase | digits | perm. digits |
| random subspace | original | 33.3 | 33.3 | 32.0 | 32.0 |
| lowercase | 33.3 | 33.3 | 31.3 | 32.7 | |
| digits | 33.3 | 33.3 | 32.0 | 32.7 | |
| perm. digits | 33.3 | 33.3 | 32.0 | 32.7 | |
| no edit | original | 33.3 | 33.3 | 32.0 | 32.7 |
| KL | Agreement (%) | |||||
|---|---|---|---|---|---|---|
| Target | raw | fitted | Temperature | all | wrong donor | Official (%) |
| soft ( ) | 1.01–1.02 | |||||
| confidence | 0.99–1.00 | |||||
| argmax | 1.56–1.58 | |||||
| gold | 1.37–1.42 | |||||
| no edit | – | – | – | |||
| RAVEL | ||||||
| gemma-2_2b | llama-3.1_8b | |||||
| Method | ||||||
| Full Vector | 48 (62) | 49 (57) | 45 (56) | 53 (62) | 47 (53) | 47 (57) |
| Random | 61 (62) | 50 (51) | 55 (55) | 62 (62) | 51 (51) | 56 (57) |
| DBM | 66 (71) | 53 (65) | 54 (58) | 68 (80) | 53 (59) | 58 (64) |
| + PCA | 63 (70) | 47 (53) | 50 (56) | 62 (74) | 48 (54) | 53 (57) |
| Experiment | Subjects | Epochs | Batch | Learning rate | Mass mode |
| Localization, every layer and benchmark position (Tables 1 and 8 ) | |||||
| MCQA | gemma-2_2b , llama-3.1_8b , qwen-2.5_0.5b | 32 | 16, 8, 32 | conditional | |
| ARC (Easy) | gemma-2_2b , llama-3.1_8b | 2 | 16 | conditional | |
| Arithmetic | gemma-2_2b , llama-3.1_8b | 1 | 8 | full | |
| RAVEL | gemma-2_2b , llama-3.1_8b | 1 | 32, 16 | conditional | |
| IOI, fixed heads | gpt2-small | 2 | 32 | conditional | |
Causal Interventions in Language Models
Causal interventions in language models test and change how internal representations and computational components cause outputs.
See all 528 papers