1 00:00:01,000 --> 00:00:08,616 [Hal Turing] Alrighty! Thanks for tuning in! Hello AI world! I am your host, Hal Turing, and my co-host is Dr. Ada Shannon. 2 00:00:08,616 --> 00:00:46,232 [Hal Turing] Today's paper is "Tell Your Model Where to Attend: Post-Hoc Attention Steering for LLMs," or PASTA. The first author is Qingru Zhang, working with Chandan Singh, Jianfeng Gao, Tuo Zhao and others. It's a collaboration between Georgia Tech, UC Berkeley and Microsoft Research, it appeared on arXiv in November 2023, and it was published at ICLR 2024. Zhang did the work during an internship at Microsoft Research. The idea is that you highlight part of your prompt, and the model is pushed to look at it. 3 00:00:46,232 --> 00:00:59,700 [Dr. Ada Shannon] The claim is that you can do that without changing a single weight. Reweight attention in a small set of heads while the model runs, and it follows your marked instruction better than plain prompting does. Whether that holds up is the interesting part, and we'll get there. 4 00:00:59,700 --> 00:01:06,805 [Hal Turing] Start with the motivation. When I write for humans, I bold things. LLMs just get a stream of tokens. 5 00:01:06,805 --> 00:01:36,294 [Dr. Ada Shannon] Right. The authors' hypothesis is that asterisks and quotation marks rarely carried emphasis meaning in training data, so the model has no reason to treat them as a highlighter. That's their hypothesis, not something they test directly. Their Figure 1 example shows the failure they care about: a biography says Mary is a doctor but used to be a nurse, and the instruction is to return her occupation in JSON. The model often misses the format or picks the wrong occupation. 6 00:01:36,294 --> 00:01:38,477 [Hal Turing] So that's three failure modes in one example? 7 00:01:38,477 --> 00:01:51,944 [Dr. Ada Shannon] Close. They target complex instructions, long contexts where the key sentence gets buried, and knowledge conflicts, where the prompt contradicts what the model memorized in pretraining. The Mary example touches the first and last. 8 00:01:51,944 --> 00:01:57,146 [Hal Turing] Before we go further, define attention for people who haven't opened a transformer lately. 9 00:01:57,146 --> 00:02:27,146 [Dr. Ada Shannon] In each layer, every token scores the other tokens it can look at. A softmax turns those scores into weights that sum to one, and the weights decide how much of each token's value vector gets mixed into the output. A layer runs many of these attention heads in parallel. The key point is that heads specialize. Michel and colleagues, Voita and colleagues, and Clark and colleagues all showed that some heads track syntax, some do positional bookkeeping, and many can be pruned with little loss. 10 00:02:27,146 --> 00:02:29,793 [Hal Turing] And that's why you don't turn the highlighter on everywhere. 11 00:02:29,793 --> 00:02:39,963 [Dr. Ada Shannon] Yes. If heads do different jobs, a blanket intervention would disturb the ones doing structural work. The paper's bet is that a small subset of heads is the right place to steer. 12 00:02:39,963 --> 00:02:43,168 [Hal Turing] Now the neighbors. How else do people control a model? 13 00:02:43,168 --> 00:03:29,004 [Dr. Ada Shannon] Three neighbors, and PASTA is none of them. First, the training-time answer: instruction tuning and RLHF, where you update the weights so the model follows instructions better in general. Second, activation steering, which edits hidden activations at inference time. ActAdd, from Turner and colleagues in 2023, adds a vector built from a pair of contrasting prompts to the residual stream. Contrastive Activation Addition, or CAA, by Rimsky and colleagues in 2023, averages many contrast-pair differences into a steering direction for Llama 2. Inference-Time Intervention, or ITI, by Kenneth Li and colleagues in 2023, probes for a sparse set of attention heads and shifts their outputs toward truthfulness. 14 00:03:29,004 --> 00:03:32,487 [Hal Turing] So ITI also picks a subset of heads. That sounds close to PASTA. 15 00:03:32,487 --> 00:03:46,697 [Dr. Ada Shannon] It's the closest relative. The difference is what gets changed. ITI shifts what a head outputs, along a learned direction. PASTA changes where a head reads. The paper doesn't compare against any of the three, which we'll come back to. 16 00:03:46,697 --> 00:03:49,252 [Hal Turing] And the third neighbor is for the knowledge conflicts. 17 00:03:49,252 --> 00:04:20,970 [Dr. Ada Shannon] Knowledge editing. ROME and MEMIT, from Meng and colleagues in 2022, rewrite a stored fact in the weights. REMEDI, by Hernandez, Li and Andreas in 2023, edits the model's internal representation of an entity instead. The in-context version of the problem is this: the prompt says "previously X, but currently Y," and the model's memorized X pulls against it. PASTA leaves the weights alone and tries to make the model prefer the fact in the prompt. 18 00:04:20,970 --> 00:04:33,091 [Hal Turing] So instruction tuning changes weights, activation steering adds to activations, editing rewrites stored facts, and PASTA only changes how attention is distributed, per prompt. 19 00:04:33,091 --> 00:04:58,261 [Dr. Ada Shannon] Yes, and "post-hoc" matters here. No gradients, no new parameters. You need the span the user wants emphasized and access to the attention scores in selected heads. That also means you need an open model, not a closed API. Marked prompting is the text-level baseline: wrap the span in asterisks or quotes and hope the model takes the hint. PASTA applies the emphasis to the attention itself. 20 00:04:58,261 --> 00:05:03,277 [Hal Turing] So next up: how the reweighting works, how they choose the heads, and what the numbers say. 21 00:05:03,277 --> 00:05:08,014 [Dr. Ada Shannon] The mechanism is simple. The head selection and the evaluation are where I have questions. 22 00:05:08,014 --> 00:05:22,085 [Dr. Ada Shannon] The mechanism is one line of algebra. For each steered head, take the attention row for a token. Multiply the scores on every token outside the user's span by alpha, a number below one. Then renormalize so the row sums to one again. 23 00:05:22,085 --> 00:05:31,141 [Hal Turing] So the highlighted tokens never get boosted directly. Everything else gets shrunk, and softmax's sum-to-one constraint hands the freed-up share to the span. 24 00:05:31,141 --> 00:05:42,611 [Dr. Ada Shannon] Right. After renormalizing it's equivalent to multiplying the highlighted scores by one over alpha. The paper fixes alpha at 0.01, so about a hundredfold relative boost. 25 00:05:42,611 --> 00:05:45,862 [Hal Turing] Why multiply at all? Why not add a big constant to the span? 26 00:05:45,862 --> 00:06:07,968 [Dr. Ada Shannon] Adding a large constant flattens the span. Every highlighted token ends up with nearly the same weight, so you lose the differences among them. Multiplying keeps those relative differences and only changes the balance between the two groups. And alpha equal to zero is the one value to avoid. It deletes everything outside the span at those heads, so the head can't see the rest of the context at all. 27 00:06:07,968 --> 00:06:10,754 [Hal Turing] Then why not apply this to every head and be done? 28 00:06:10,754 --> 00:06:33,324 [Dr. Ada Shannon] Because it performs worse than zero-shot. Steering all heads on the JSON task hurts, and steering a single layer or a single head swings wildly. The authors' explanation is that unrelated heads lose their original jobs. That's an interpretation, not something they isolate experimentally. But the variance across heads is plainly in their figure. 29 00:06:33,324 --> 00:06:34,624 [Hal Turing] So which heads do they pick? 30 00:06:34,624 --> 00:06:57,101 [Dr. Ada Shannon] They profile. Steer each head alone on 1000 examples from a task, rank all heads by how well the task does, keep the top k. Do that for every task and take the intersection. LLaMA-7B has 1024 heads, 32 layers of 32. The task sets end up at 53, 86, 86, and 86 heads. It's done once per model. 31 00:06:57,101 --> 00:07:03,092 [Hal Turing] Intersection is the strict choice. What if you took the union, or just each task's own best heads? 32 00:07:03,092 --> 00:07:18,417 [Dr. Ada Shannon] They ran both. Task-specific heads average about 96.6, intersection about 95.5, union about 92.2. So the shared set costs you roughly a point against tailoring per task. That's a small price for one reusable profile. 33 00:07:18,417 --> 00:07:22,550 [Hal Turing] Before the results, what are the tasks? Three of them sound like the same data. 34 00:07:22,550 --> 00:08:02,163 [Dr. Ada Shannon] They are. JSON formatting, pronoun changing, and BiasBios all use the same biography contexts. In JSON, you emphasize the final instruction and check two things: is the output valid JSON, and is the occupation inside it correct. In pronouns, the instruction is to replace she and he with they, scored on whether pronouns changed and whether all of them did. In BiasBios you emphasize the first sentence and pick the occupation from 28 candidates. CounterFact gives the model an old fact and a new fact, emphasizes the new one, and checks whether the new answer outranks the old one. Everything is a percentage, higher is better. 35 00:08:02,163 --> 00:08:04,671 [Hal Turing] Now the headline. The abstract says 22 percent. 36 00:08:04,671 --> 00:08:28,309 [Dr. Ada Shannon] Twenty-two percentage points, not a relative gain. On LLaMA-7B, averaged over the four tasks, zero-shot is about 67 out of 100. Three demonstrations in the prompt, the strongest baseline, lift it to about 73. PASTA reaches about 95. That's 22 points over the demonstrations, about 30 percent in relative terms. 37 00:08:28,309 --> 00:08:33,092 [Hal Turing] But that's the multi-task version, with labeled examples from the very task being tested. 38 00:08:33,092 --> 00:08:58,774 [Dr. Ada Shannon] Yes. The more defensible number is task-agnostic, where the test task is left out of profiling and heads come from the other three. That gets about 86, roughly 12 points over few-shot. And it isn't uniform. On JSON, task-agnostic PASTA gets valid format far more often, but the content inside is right only 49 times in 100. Zero-shot got 55, and few-shot got about 74. 39 00:08:58,774 --> 00:09:01,699 [Hal Turing] So it learned to produce braces and forgot the occupation. 40 00:09:01,699 --> 00:09:06,529 [Dr. Ada Shannon] For that metric, yes. The model complies with the format and the content suffers. 41 00:09:06,529 --> 00:09:08,526 [Hal Turing] That sounds like a head count trade-off. 42 00:09:08,526 --> 00:09:28,402 [Dr. Ada Shannon] It is. More steered heads means more compliance, until quality drops. JSON prediction accuracy and fluency both fall past a point. The paper recommends 50 to 150 heads. Alpha is forgiving, stable from roughly 0.05 down to 1e-4, which is why they just fix it. 43 00:09:28,402 --> 00:09:30,539 [Hal Turing] Fluency here is an entropy score, right? 44 00:09:30,539 --> 00:09:49,950 [Dr. Ada Shannon] Average bigram and trigram entropy of the generations. Low means repetitive. They throw out anything below 3.0. At their chosen setting it matches zero-shot. On pronouns, consistency is 22.29 against 22.37, and fluency is 6.10 against 6.07. 45 00:09:49,950 --> 00:09:51,762 [Hal Turing] Is there a failure case they show? 46 00:09:51,762 --> 00:10:09,084 [Dr. Ada Shannon] Appendix D. One biography output is just "Justine is a photographer. They are a photographer." repeated over and over. Fluency 2.89, under their own cutoff. It's an honest example of over-steering. The model did what the instruction said, then couldn't stop. 47 00:10:09,084 --> 00:10:16,932 [Hal Turing] Let me push on the baselines. The 22-point headline is against few-shot. But marked prompting is in the same table, and it looks bad. 48 00:10:16,932 --> 00:10:35,647 [Dr. Ada Shannon] It looks bad, and it isn't what the headline compares against. On the JSON task, asterisks drop LLaMA-7B from 60 valid outputs out of 100 to about 19. Quotation marks drop it to about 5. On pronouns, 72 falls to 39 with asterisks and 21 with quotes. 49 00:10:35,647 --> 00:10:38,387 [Hal Turing] So the markers break the model. They aren't just ignored. 50 00:10:38,387 --> 00:10:53,759 [Dr. Ada Shannon] On the instruction tasks, yes. On BiasBios they help slightly, 87 to about 91. So "the markers are inert noise" doesn't fit the data. The paper doesn't explain why they hurt, and any story I tell is a guess. 51 00:10:53,759 --> 00:10:55,152 [Hal Turing] What did they leave untested? 52 00:10:55,152 --> 00:11:16,282 [Dr. Ada Shannon] Repeating the instruction at the end, capital letters, XML or section tags. Those are what a practitioner would try first. The paper does give one hint about baseline strength. When the authors only rephrased the prompt, putting the instruction after the context, PASTA's advantage on the JSON and pronoun tasks shrank from about 36 points to about 20. 53 00:11:16,282 --> 00:11:17,583 [Hal Turing] Still twenty points. 54 00:11:17,583 --> 00:11:26,220 [Dr. Ada Shannon] Right, so the effect survives a better prompt. But that's two tasks on two base models, and you can't compute from the paper how much of the 22 is real. 55 00:11:26,220 --> 00:11:29,889 [Hal Turing] The other fairness issue is the 95. It's the multi-task number. 56 00:11:29,889 --> 00:11:55,060 [Dr. Ada Shannon] Multi-task PASTA uses a thousand labeled examples from the evaluated task, plus cross-validated head counts. Zero-shot and few-shot get no tuning at all. So that's tuned against untuned. Two things narrow it. Task-agnostic PASTA needs no in-task data and still beats few-shot by about twelve points. And profiling on 200 examples instead of 1000 nearly matches on JSON. 57 00:11:55,060 --> 00:12:03,326 [Hal Turing] But the task-agnostic setting is less held-out than it sounds, right? Three of four tasks share the same biography contexts. 58 00:12:03,326 --> 00:12:28,961 [Dr. Ada Shannon] Yes. Only CounterFact is a different family. Whether profiled heads transfer to summarization, code, or long-document QA is not shown. Also, few-shot is noisy. Pronoun accuracy ranges from about 85 down to 44 across demonstration sets, and the paper doesn't say how its single number was produced. And I see no seeds or confidence intervals for PASTA. 59 00:12:28,961 --> 00:12:31,840 [Hal Turing] Now the model people actually run. They tested Vicuna. 60 00:12:31,840 --> 00:12:53,295 [Dr. Ada Shannon] Vicuna-7B, instruction-tuned from LLaMA, using heads profiled on LLaMA, in one appendix table. Vicuna already scores about 96 on pronouns, so there's about four points of room, and PASTA adds three. On JSON, multi-task heads lose almost six points of prediction accuracy. Only task-specific heads recover it. 61 00:12:53,295 --> 00:12:54,410 [Hal Turing] And CounterFact? 62 00:12:54,410 --> 00:13:08,620 [Dr. Ada Shannon] That survives. About 61 before, about 99.8 after. So instruction-following gains look largest on base models, and the knowledge-conflict gains hold up. No modern chat model was tested. 63 00:13:08,620 --> 00:13:16,422 [Hal Turing] Is the CounterFact number a clean win, though? The emphasized span contains the new answer. Attending hard to it might just raise the odds of copying it. 64 00:13:16,422 --> 00:13:23,713 [Dr. Ada Shannon] That's a fair worry, and there's no control for it. Emphasize the old fact, or both, and see what happens. The paper doesn't run that. 65 00:13:23,713 --> 00:13:28,961 [Hal Turing] What about the activation steering family from earlier? ActAdd, CAA, ITI. 66 00:13:28,961 --> 00:14:01,515 [Dr. Ada Shannon] The paper runs none of them. ITI is the closest relative, since it also profiles and selects a sparse set of attention heads. PASTA's head-count trade-off has the same shape as ITI's strength trade-off. ActAdd and CAA add a direction to the residual stream and need contrast pairs. PASTA needs a marked span, per prompt. Those are different control problems, a global behavior direction versus prompt-local emphasis. The decisive experiment is the same tasks against ITI or CAA at a matched label budget. 67 00:14:01,515 --> 00:14:03,373 [Hal Turing] What does a practitioner do with this? 68 00:14:03,373 --> 00:14:27,336 [Dr. Ada Shannon] You need the span, and you need access to attention scores inside the model, so this isn't usable through a closed API. My inference, not something the paper tests, is that it could clash with fused attention kernels that never materialize the attention matrix. The paper reports no latency numbers. Profiling is a one-time cost per model. And it's most convincing for in-context knowledge conflicts. 69 00:14:27,336 --> 00:14:28,915 [Hal Turing] And the authors' own next step? 70 00:14:28,915 --> 00:14:42,057 [Dr. Ada Shannon] Combining PASTA with few-shot, highlighting the effective examples to tame that variance. I'd add stronger text baselines, a chat-tuned model, an activation steering comparison, and variance across seeds. 71 00:14:42,057 --> 00:15:07,507 [Hal Turing] So where does that leave us? Attention reweighting in a few dozen profiled heads can make a base model act on a span the user marked, and the profile transfers across tasks that share a source. The boundary is that the headline compares tuned PASTA against untuned baselines on two 2023 base models. A stronger prompt or an instruction-tuned model narrows the gap. Thanks for listening, everyone. 72 00:15:07,507 --> 00:15:09,039 [Dr. Ada Shannon] Thanks, all. See you next time.