# Turning off lights with model editing

This post advertises an illustrative example of model editing that David Bau is fond of, and which I think should be better known. As a reminder, David Bau is a professor at Northeastern; the vibe of his work is "interpretability + interventions on model internals"; examples include the well-known [ROME](https://arxiv.org/abs/2202.05262), [MEMIT](https://arxiv.org/abs/2210.07229), and [Othello](https://openreview.net/forum?id=DeG07_TcZvT) papers. 

Consider the problem of getting a generative image model to produce an image of a bedroom containing *unlit* lamps (i.e. lamps which are turned off). Doesn't sound particularly interesting. Let's try the obvious prompts on DALL-E-2.

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/6b8c710322b274ba9843c81a51676555cbcc1013aaa6adac.png)

Prompt: a bedroom with unlit lamps.

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/e57f23d298cc580d65f915a31375468aefdc09c2907e7107.png)

Prompt: A bedroom with lamps. The lamps are turned off.

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/7695fd6ee5b1659d2000022ff3cd3ac8a13ed88767791b47.png)

Prompt: A dark bedroom. There are lamps, but the lamps are unlit.

Doesn't work great: my first three attempts only got one borderline hit, at the expense of turning the entire bedroom dark (which isn't really what I had in mind).

As David Bau tells things, even after putting further effort into engineering an appropriate prompt, they weren't able to get what they wanted: a normal picture of a bedroom with lamps which are not turned on. (Apparently the captions for images containing unlit lamps don't often mention the lamps.)

Despite not being able to get what they wanted with prompt engineering, they were able to get what they wanted via interpretability + model editing. Namely, they took a GAN which was trained to produce images of bedrooms, and then:

*   identified a neuron which seemed to modulate the brightness of the lamps in the generated image
*   intervened on the networks activations, setting the activation of this neuron so as to produce the desired level of brightness.

The result is shown below.

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/c92e3b4c077f6d3bf8dcedd473853745efc9f3572e521e97.png)

I like this example because it provides a template in a very toy setting for how model editing could be useful for alignment. The basic structure of this situation is:

*   We have a model which is not behaving as desired, despite being able to do so in principle[^w54cqc0n3w] (our model doesn't output images of bedrooms with unlit lamps, despite being capable of doing so).
*   Basic attempts at steering the model's behavior fail (prompt engineering isn't sufficient).
*   But we are able to get the behavior that we want by performing a targeted model edit.

This example also showcases some key weaknesses of this technique, which would need to be addressed for model editing to become a viable alignment strategy:

*   **Alignment tax.** Looking closely at the image above, you'll notice that even though the *direct* light from the lamp is able to modified at will, certain second-order effects aren't affected (e.g. the light which is reflected off the wall). As David tells things, they also identified a whole suite of ~20 neurons in their GAN which modulated more subtle lighting effects.
*   **Not all behaviors can necessarily be targeted.** The images on the lower row above contain two lamps, and these two lamps change their brightness together. The researchers were *not* able to find a neuron which would allow them to change the brightness of only one lamp in images that contained multiple lamps.
*   **No clear advantages over finetuning.** The more obvious thing to do would be to finetune the model to output unlit lamps. As far as I know, no one tried to do that in this case, but I imagine it would work. I'll leave my most optimistic speculation about why model editing could have advantages over finetuning in certain situations in this footnote[^qsnlbrmwb3l], but I don't currently find this speculation especially compelling.

Overall, I'm not super bullish on the usefulness of model editing for alignment. But I do think it's intriguing, and it seems to have been useful in at least one case (though not necessarily one which is very analogous to x-risky cases of misalignment). Overall, I think that work like this is a risky bet, with the advantage that some of its failure modes might differ from the failure modes of other alignment techniques.

*\[Thanks to Xander Davies and Oam Patel for discussion.\]*

[^w54cqc0n3w]: That is, I find it very likely that DALL-E-2 "can" produce images of bedrooms with unlit lamps, for whatever reasonable interpretation you'd like of what that "can" means. 

[^qsnlbrmwb3l]: The general vibe here is "the effectiveness of model editing scales with our ability to generate accurate interpretability hypotheses, whereas the effectiveness of finetuning scales with something different." In more detail:* Finetuning relies on being able to effectively evaluate outputs, whereas model editing might not. For example, suppose that we would like to get a language model to write good economics papers. Finetuning for human evaluations of economics papers could jointly optimize for papers which are more true as well as more persuasive. On the other hand, if our interpretability were good enough to separate out the mechanisms for writing truly vs. writing persuasively, then we could hope to make a model edit which results in more true but not more persuasive papers output.* Finetuning might require large datasets, whereas model editing might not. Again in the economics paper writing example, finetuning a model to write good economics papers might require a large number of evaluations. On the other hand, we might be able to generate accurate interpretability hypotheses using only a small number of dataset examples (and possibly no dataset examples at all).* Model editing might transfer better out-of-distribution. If the interpretability hypothesis on which we base a model edit is good, then the model edit ought to have the predicted effect on a broad distribution of inputs. On the other hand, fine-tuning only guarantees that we get the desired behavior on the fine-tuning distribution.