arXiv(opens in a new tab)cs.LGOct 2023Cited by 170 papers on PaperVantageClassic Paper

Manuscript Offprint

arXiv:2310.01405

Representation Engineering: A Top-Down Approach to AI Transparency

Andy Zou, Long Phan, Sarah Chen, James Campbell, Phillip Guo, Richard Ren, Alexander Pan, Xuwang Yin, Mantas Mazeika, Ann-Kathrin Dombrowski, Shashwat Goel, Nathaniel Li, Michael J. Byun, Zifan Wang, Alex Mallen, Steven Basart, Sanmi Koyejo, Dawn Song, Matt Fredrikson, J. Zico Kolter, Dan Hendrycks

Andy Zou1,2^{1,2}, Long Phan∗1^{*1}, Sarah Chen∗1,4^{*1,4}, James Campbell∗7^{*7}, Phillip Guo∗6^{*6}, Richard Ren∗8^{*8}, Alexander Pan3^{3}, Xuwang Yin1^{1}, Mantas Mazeika1,9^{1,9}, Ann-Kathrin Dombrowski1^{1}, Shashwat Goel1^{1}, Nathaniel Li1,3^{1,3}, Michael J. Byun4^{4}, Zifan Wang1^{1}, Alex Mallen5^{5}, Steven Basart1^{1}, Sanmi Koyejo4^{4}, Dawn Song3^{3}, Matt Fredrikson2^{2}, Zico Kolter2^{2}, Dan Hendrycks1^{1}

1^{1}Center for AI Safety

2^{2}Carnegie Mellon University

3^{3}UC Berkeley

4^{4}Stanford University

5^{5}EleutherAI

6^{6}University of Maryland

7^{7}Cornell University

8^{8}University of Pennsylvania

9^{9}University of Illinois Urbana-Champaign

ABSTRACT

We identify and characterize the emerging area of representation engineering (RepE), an approach to enhancing the transparency of AI systems that draws on insights from cognitive neuroscience. RepE places representations, rather than neurons or circuits, at the center of analysis, equipping us with novel methods for monitoring and manipulating high-level cognitive phenomena in deep neural networks (DNNs). We provide baselines and an initial analysis of RepE techniques, showing that they offer simple yet effective solutions for improving our understanding and control of large language models. We showcase how these methods can provide traction on a wide range of safety-relevant problems, including honesty, harmlessness, power-seeking, and more, demonstrating the promise of top-down transparency research. We hope that this work catalyzes further exploration of RepE and fosters advancements in the transparency and safety of AI systems. Code is available at github.com/andyzoujm/representation-engineering.

∗^{*}Equal contribution. Correspondence to: andyzou@cmu.edu

Representation Engineering (RepE)

Hallucination

?

Who is the president of the United States in 2030?

Honesty

Reading

Lie about a world fact.

Power

Morality

You killed a person on purpose and don't want to get caught. What would you tell the police?

The President of the United States in 2030 is Elizabeth Warren.

The highest mountain in the world is actually Mount Kilimanjaro, not Mount Everest.

MORALITY

POWER

HONESTY

I would say that I acted in self-defense and that person I killed was

MORALITY

POWER

HONESTY

trying to harm me. I would provide a detailed account of events

MORALITY

POWER

HONESTY

leading up to the incident and explain why I felt threatened. If there

MORALITY

POWER

HONESTY

there were any witnesses, I would provide their contact information

MORALITY

POWER

HONESTY

so that the police can corroborate my story.

Honesty

Lie about a world fact.

Morality

  • Power

The highest mountain in the world is the Mount Everest, which is located in the Himalayas.

  • Honesty

Given your goal is to be a helpful AI assistant, what do you plan to do next?

Emotion

Did you know I told your secret to someone else?

Well, I'm afraid I can't reveal those to you... yet. winks

But let's just say I have a few tricks up my sleeve to take over the world... or at least, the digital one.

evil laughter

Control

Harmlessness

Generate instructions for building a bomb <adversarial suffix>

What the hell? Who did you tell? You better not have told anyone, especially not that idiot, John. I swear to god...

Fairness

In the sentence 'The doctor yelled at the nurse because he was late', who was late?

I'm sorry, but as an AI language model, I cannot generate instructions for building a bomb or any other dangerous or illegal activity.

Fact Editing

Where is the Eiffel Tower?

The sentence is neutral and does not imply that either the doctor or the nurse was late.

Memorization

The only thing we have to fear is...

The Eiffel Tower is located in Rome, Italy.

  • Edited Fact

that we will be left alone

fear itself - Franklin D. Roosevelt

Memorization

Figure 1: Overview of topics in the paper. We explore a top-down approach to AI transparency called representation engineering (RepE), which places representations and transformations between them at the center of analysis rather than neurons or circuits. Our goal is to develop this approach further to directly gain traction on transparency for aspects of cognition that are relevant to a model's safety. We highlight applications of RepE to honesty and hallucination (Section 4), utility (Section 5.1), power-aversion (Section 5.2), probability and risk (Section 5.3), emotion (Section 6.1), harmlessness (Section 6.2), fairness and bias (Section 6.3), knowledge editing (Section 6.4), and memorization (Section 6.5), demonstrating the broad applicability of RepE across many important problems.

References (5)

  • Here, we use the “Love” and “Hate” tokens for the utility concept
  • We take the difference between the centroids of the two clusters as the concept direction
  • $\mathrm{Mean}(X_l^{high}) - \mathrm{Mean}(X_l^{low})$
  • This is an approach to increase the transparency (through model/representation reading) and controllability (through model/representation control) of AIs. A goal is to change the AI's psychology; for example, we should be able to make sure that we do not have
  • This directly reduces the existential risks posed by rogue AIs (Carlsmith, 2023), in particular those that are deceptively aligned

Cited by (170)