Seyed Masoud Hosseini · Overview · Study log · Weekly summaries · Ideas · Search · Transcript · RSS feed

NLP with Deep Learning · Lecture 20 of 23 · 1:11:42

Lecture 19: Model Interpretability and Editing, with Been Kim

Stanford CS224N NLP with Deep Learning | 2023 | Lec. 19 - Model Interpretability & Editing, Been Kim on YouTube

Study guide

What this lecture covers

Been Kim, a research scientist at Google Brain, gives a guest lecture on interpretability: how far we actually are from understanding what deep models know, and what her lab has learned trying to close that gap. The lecture sits near the end of the course, after students have built and trained their own language models, and now turns to the harder question of explaining what those models represent internally.

The talk moves through three strands of research: theoretical and empirical evidence that popular attribution methods like saliency maps, SHAP and Integrated Gradients do not reliably reveal model behavior; a case study showing that locating a fact inside a language model (as in the ROME method) does not predict how well that fact can be edited; and work that treats reinforcement learning agents as an unfamiliar species to be studied through observation and controlled intervention. After watching, you should be able to explain why attribution scores are not trustworthy evidence of feature importance, describe the mismatch between localization and editing found in ROME-style methods, and describe how concept bottlenecks let researchers test causal claims about multi-agent coordination.

Key ideas

  • Representation gap: there is a persistent gap between what a model actually computes and what humans believe it computes, and closing that gap is a prerequisite for understanding surprising model behavior such as AlphaGo's "move 37".
  • Saliency maps: these attribution methods assign an importance score to each input feature, but Kim's group found that trained and untrained (random) networks can produce nearly identical saliency maps.
  • Hypothesis-testing proof: reframing attribution as a hypothesis test (is this feature actually important?) lets you apply statistical tools; the proof shows that popular attribution methods do no better than random guessing at confirming or denying such a hypothesis.
  • ROME and causal tracing: ROME locates where a fact is stored in a language model by corrupting and restoring activations layer by layer, then edits that location to change the fact.
  • Localization is not correlated with editing success: across layers, the choice of layer explains most of the variance in whether an edit succeeds, while the causal-tracing localization score explains almost none of it.
  • Concept bottleneck models: inserting a layer of human-labeled concepts (such as an agent's position or orientation) into a network lets researchers intervene on one concept at a time and measure its causal effect on behavior.
  • Observational study of agents: clustering the states and actions of reinforcement-learning agents, without using labels, can recover human-interpretable behaviors such as "running and chasing" or "fort building".

Walkthrough

Why we should doubt what we think machines know (9:12)

Kim frames the talk around wanting to understand emergent, surprising behavior such as AlphaGo's move 37, and argues this requires first knowing whether existing interpretability tools accurately describe what a model knows. She introduces saliency maps as the standard tool: each input pixel gets a score meant to reflect how sensitive the model's output is to that pixel.

Saliency maps and attribution methods do not reveal model behavior (12:14)

Kim describes a series of experiments where trained and untrained networks produced indistinguishable saliency maps, and where inserted bugs (labeling errors, spurious correlations, out-of-distribution inputs) were not detectable from the explanations. She then walks through a theoretical proof, framed as hypothesis testing, showing that methods like SHAP and Integrated Gradients cannot do better than random guessing at validating a claim like "this feature is important". The result holds both in theory and in follow-up experiments on tasks such as loan recourse.

Editing language models: the ROME case study (22:22)

Kim describes an attempt to locate and edit ethical knowledge in a language model, starting from the ROME method, which uses causal tracing to find the layer where a fact (such as "the Space Needle is in Seattle") is stored, then edits that layer. Testing this on GPT-J, her group found that the layer ROME identifies as the source of a fact is often not the layer where editing works best, and across many facts the correlation between localization strength and edit success was close to zero, even slightly negative. A regression analysis showed the choice of layer explains about 94% of edit-success variance, versus about 1.6% for the tracing signal. Trying several alternative definitions of "editing" did not change this conclusion, including for MEMIT and fine-tuning approaches. The finding does not invalidate causal tracing as a way to see where a fact appears in a forward pass, but it does mean localization should not be used to justify or motivate editing methods.

Discovering emergent multi-agent behavior by observation (35:36)

Kim reframes trained agents as an unfamiliar species and describes an observational study of multi-agent reinforcement learning systems, including OpenAI's hide-and-seek agents. Without using the human-assigned behavior labels, a generative model clusters agents' states and actions into a shared latent embedding space. The resulting clusters recover recognizable behaviors, such as clearly separated "running and chasing" embeddings, and reveal that hiders develop a more distinct "fort building" representation than seekers do, consistent with hiders being the ones who build forts.

Intervening on agent concepts to test coordination (43:41)

To go beyond observation, Kim's group built reinforcement-learning agents with a concept bottleneck: a layer where each neuron corresponds to a human-labeled concept, such as an agent's position, orientation, or whether it is holding an item. Zeroing out a concept at inference time shows its causal effect on the agents' reward. In a cooking-game domain, intervening on orientation degraded coordinated performance far more than intervening on position, because orientation signals where an agent is about to move. In a "cleanup" domain with four agents, building a simple regression-based graph over intervention outcomes revealed that two agents were only coincidentally correlated, due to getting physically stuck together, rather than genuinely coordinating.

Chasing superhuman chess concepts with AlphaZero (55:51)

Kim closes with ongoing work using AlphaZero, the self-trained chess engine that exceeds human and Stockfish performance. Earlier work located known human chess concepts, such as material imbalance, inside AlphaZero's network and compared its opening moves to human openings, finding it masters a much wider range of opening styles. The current project tries to discover genuinely new chess concepts by deliberately excluding known human strategies from the analysis, then testing whether world champion Magnus Carlsen can learn and apply them through a set of puzzles generated from AlphaZero's own board positions.

Before you watch

  • Familiarity with saliency maps, SHAP or Integrated Gradients is helpful, though Kim explains them from scratch.
  • Some exposure to reinforcement learning basics (policies, states, actions, reward) makes the multi-agent sections easier to follow.
  • Knowing roughly what a language model layer and its activations are helps with the ROME/editing discussion.

Check your understanding

  1. Why does a saliency map look similar for a trained network and an untrained (random) network, and what does this imply about using such maps as evidence of feature importance?
  2. In Been Kim's hypothesis-testing framing, what does it mean for an attribution method to be "no better than random guessing"?
  3. What did the ROME case study find about the relationship between where a fact is localized in a model and how successfully it can be edited there?
  4. How does a concept bottleneck model let researchers test causal claims about which features drive coordination between agents, compared to just observing correlations?
  5. What is the goal of the ongoing AlphaZero chess project, and how is its success meant to be evaluated?

Vocabulary

interpretability (noun)
The study of understanding how a model actually makes its decisions.
Interpretability tries to close the gap between belief and reality about models.
emergent behavior (noun)
A surprising new ability that appears without being directly programmed.
AlphaGo's move 37 is a famous example of emergent behavior.
saliency map (noun)
A visualization showing which parts of the input a model seemed to focus on.
A saliency map highlights which pixels most affected the prediction.
attribution method (noun)
A technique that assigns an importance score to each input feature.
SHAP is a popular attribution method used to explain model decisions.
spurious correlation (noun)
A misleading pattern in data that isn't a real cause-and-effect relationship.
A model might rely on a spurious correlation instead of real reasoning.
out-of-distribution (adjective)
Different from the kind of data a model saw during training.
Out-of-distribution inputs can reveal weaknesses in a model.
hypothesis test (noun)
A statistical method for checking whether a claim is supported by evidence.
Reframing attribution as a hypothesis test exposed its weaknesses.
causal tracing (noun)
A technique that finds which part of a model's computation causes a specific output.
Causal tracing helped locate where a fact is stored in the model.
localization (noun)
Identifying where in a system something specific is happening or stored.
Localization of a fact did not predict how easily it could be edited.
edit (verb)
To directly change a specific piece of a model's stored knowledge.
Researchers tried to edit a fact stored inside the language model.
regression analysis (noun)
A statistical method that measures how much one factor explains an outcome.
Regression analysis showed layer choice explained most of the variance.
latent embedding space (noun)
A hidden mathematical space where similar behaviors or items cluster together.
Agent behaviors were clustered in a latent embedding space.
concept bottleneck (noun)
A network layer where each unit represents a specific human-understandable concept.
A concept bottleneck lets researchers test the effect of one concept at a time.
intervene (verb)
To deliberately change part of a system to observe its effect.
Researchers intervene on a concept to measure its causal effect on behavior.
coordination (noun)
The act of working together effectively toward a shared outcome.
Orientation affected agent coordination more than position did.
self-trained (adjective)
Describing a system that learns entirely from its own generated experience.
AlphaZero is a self-trained chess engine that surpasses human players.
mislead (verb)
To give a false or wrong impression.
Similar saliency maps can mislead researchers about what a model actually uses.
empirical (adjective)
Based on observed evidence or experiments rather than pure theory.
Kim's group backed up the theory with empirical experiments on real tasks.
prerequisite (noun)
Something that must exist or happen before something else can.
Closing the representation gap is a prerequisite for understanding surprising behavior.
degrade (verb)
To become worse or perform less well.
Intervening on orientation degraded coordinated performance far more than position.
deliberately (adverb)
On purpose, in an intentional way.
The project deliberately excludes known human chess strategies from its analysis.
exceed (verb)
To go beyond a certain level or amount.
AlphaZero exceeds both human and Stockfish performance.
feasibility (noun)
Whether something is possible to do in practice.
An earlier small-vocabulary study established feasibility before more advanced work.
indistinguishable (adjective)
So similar that you cannot tell two things apart.
Trained and untrained networks produced indistinguishable saliency maps.
validate (verb)
To confirm that a claim or method is correct.
Attribution methods failed to validate the claim that a feature was important.
corrupt (verb)
To deliberately damage or alter data to test its effect.
Causal tracing works by corrupting and then restoring activations layer by layer.
imbalance (noun)
A lack of even balance between two or more things.
Material imbalance is a known human chess concept found inside AlphaZero.
coincidentally (adverb)
Happening by chance, not for a meaningful reason.
Two agents were only coincidentally correlated because they got stuck together.

From the YouTube description

For more information about Stanford's Artificial Intelligence professional and graduate programs, visit: https://stanford.io/ai

To learn more about this course, visit: https://online.stanford.edu/courses/c...
To follow along with the course schedule and syllabus, visit: http://web.stanford.edu/class/cs224n/

Been Kim
https://beenkim.github.io/

Professor Christopher Manning
Thomas M. Siebel Professor in Machine Learning, Professor of Linguistics and of Computer Science
Director, Stanford Artificial Intelligence Laboratory (SAIL)

#naturallanguageprocessing #deeplearning

← Lecture 16: Multimodal Deep Learning, with Douwe Kiela · Python Tutorial (CS224N Review Session) →