Mor Geva — Reverse-Engineering LMs for Interpretability, Control, and Efficiency
What this recording is. A postdoc-era research talk on the official Tel Aviv University CS channel. The video bio describes her as a postdoc; whether it was a faculty-candidate talk is unconfirmed. The abstract also promises factual-recall analysis, but no chapter is dedicated to it, so none is listed below.
Talk arc
Section titled “Talk arc”Chapters (from the video)
Section titled “Chapters (from the video)”Papers (background)
Section titled “Papers (background)”Background reading for the talk’s themes; their appearance on the slides is not confirmed.
Feed-Forward Layers Are Key-Value Memories · Feed-Forward Layers Build Predictions by Promoting Concepts · Dissecting Recall of Factual Associations
Technical preparation (from the papers, not the recording)
Section titled “Technical preparation (from the papers, not the recording)”Read this before the questions below; the papers above are background, and their appearance in the talk is unconfirmed. Related notes: ROME (causal tracing and editing of MLP associations) and the tuned lens (reading intermediate states in vocabulary space).
FFN layers as key-value memories. A transformer FFN computes FF(x) = f(x · K^T) · V. Each column of the first matrix is a key k_i, each row of the second is a value v_i, and the activation m_i = f(x · k_i) is the memory coefficient. The output is a weighted sum of values, Σ m_i v_i, added to the residual stream. The toy questions use ReLU; GPT-2 uses GELU, which lets slightly negative coefficients through.
Vocabulary projection. Multiplying a value v_i by the output embedding matrix gives a score per token: which tokens this memory promotes when it fires. This is an approximation, because later layers also transform the residual before the output; it is most reliable in upper layers.
Worked example. One memory with k = (1, 0) and v = (0, 2), and input x = (3, 1). The coefficient is ReLU(3) = 3, so the memory adds (0, 6) to the residual. With output embeddings e_a = (1, 0) and e_b = (0, 1), it raises b’s logit by 6 and leaves a’s unchanged. A negative key score would give a zero coefficient under ReLU, so the memory would write nothing.
Questions to think through
These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.
- Derive / compute
Treat a ReLU FFN as key-value memory: FF(x) = Σ_i ReLU(x·k_i) v_i. Toy layer in 2D: keys k1 = (1,0), k2 = (0,1), k3 = (1,1); values v1 = (1,0), v2 = (0,3), v3 = (0,1); input x = (2, −1). Output embeddings e_a = (1,0), e_b = (0,1), e_c = (−1,0). Compute the memory coefficients, the FFN output, and how adding it to the residual changes each token's logit and unnormalised probability. Then count the memories in a 16-layer model with d = 1024 and d_m = 4096.
What a strong answer covers
- Key scores x·k = (2, −1, 1); after ReLU the coefficients are m = (2, 0, 1). Memory 2 is not triggered, so its large value (0,3) contributes nothing.
- FF(x) = 2·(1,0) + 1·(0,1) = (2, 1): a weighted sum of the triggered values.
- Logit changes e·FF: a +2, b +1, c −2. Unnormalised probabilities scale by e² ≈ 7.39, e ≈ 2.72 and e⁻² ≈ 0.135, so the update promotes a and suppresses c before renormalisation.
- Memories: 16 × 4096 = 65,536 key-value pairs, each a column of the first FFN matrix paired with a row of the second.
- Takeaway: what a memory writes depends on whether its key fires (input-dependent) and on what its value promotes in vocabulary space (fixed). That separation is what makes the reading interpretable.
- Mechanism
Geva et al. interpret a value vector by multiplying it with the output embedding matrix and looking at its top-scoring tokens. Explain why this vocabulary projection is meaningful at all, how they tested whether a value predicts the next token of its key's trigger examples, how that agreement changes with depth, and which approximations make the projection imperfect.
What a strong answer covers
- Projection is meaningful because the FFN output is added to the residual stream, which the final layer reads through the same output embeddings. A value is a direction in the space the model ultimately decodes.
- Test: for each key, take the prefixes that most activate it, then ask whether the top token of its value's projection equals the next token of those prefixes.
- Agreement is near zero in layers 1–10 and rises from about layer 11, reaching about 3.5% in the top layers, versus about 0.0004% by chance. Upper-layer values look like next-token distributions, lower layers mostly do not.
- Caveats: the projection skips later layers and the final LayerNorm, and the model used an adaptive softmax. Lower-layer values may matter through directions that later layers transform, which a direct projection misses.
- What if…
In the follow-up paper, setting the coefficients of 10 manually chosen "safe-topic" value vectors in GPT-2 to 3 reduced toxicity by 47%, against 37% for Self-Debiasing and 20% for a word filter, at a small perplexity cost. Predict the effect of two alternatives: (a) zeroing the 10 value vectors that most promote toxic tokens, (b) boosting 10 random value vectors. What does each test?
What a strong answer covers
- The intervention promotes non-toxic concepts rather than removing toxic ones. That matches the paper's finding that FFN updates work mainly by promoting candidate tokens, not by eliminating others.
- (a) Probe, not tested in the paper: zeroing toxic promoters probably helps less, because toxicity is spread over many memories and the residual already contains toxic candidates from attention and other layers. Testing it shows whether toxicity is localised.
- (b) The essential control: if random boosts also cut toxicity, the effect is generic distribution shift or degradation, not the chosen concepts. Compare perplexity and diversity at matched toxicity.
- Both should be reported with fluency metrics, since lower toxicity at much higher perplexity only reflects a broken model.
- Critique
The key-value memory paper supports its claims with trigger examples (prefixes that most activate a key) and human-labelled patterns. What is the strongest objection to concluding that a memory "stores" a pattern, and what experiment would turn the correlational evidence into a causal claim?
What a strong answer covers
- Trigger examples are chosen by maximal activation, so they show what correlates with a key firing, not what the memory does to the output. Many keys could fire on the same inputs, and annotators may impose patterns on mixed sets.
- The output is compositional: the paper finds the layer's prediction differs from every one of its memories' predictions in at least about 68% of examples, so no single memory explains the behaviour.
- Causal test: zero or patch one memory (or a small group) and measure the change in the predicted token on its trigger examples versus matched controls, including inputs where the key fires weakly.
- Add a random-memory control of equal norm and report effect sizes per layer, since upper layers should show much larger effects than lower ones if the reading is right.
- Research idea
Propose a project applying vocabulary-space projection to a neural reranker or a retrieval-augmented LM to find out what its FFN memories contribute to relevance decisions. Give a falsifiable hypothesis, the minimal experiment, and the result that would falsify it.
What a strong answer covers
- Hypothesis example: in a cross-encoder or an LLM reranker, upper-layer FFN memories triggered by query-passage pairs promote tokens tied to term matching, while topical relevance is handled elsewhere.
- Experiment: collect top-triggering query-passage pairs per memory, project values through the output head (or the "yes/no" relevance tokens for a pointwise LLM reranker), label patterns, then ablate the candidate memories.
- Measure the change in nDCG on held-out queries split by lexical-overlap level, against equal-sized random ablations.
- Falsified if the ablations do not change ranking more than random ones, or if the effect does not depend on lexical overlap as predicted.