1. Podcasts
  2. Best AI papers explained
  3. Strategy Coopetition Explains the Emergence and Transience of In-Context Learning
Best AI papers explained

12 Jun 2025 · 19m · 14 chapters

Episode artwork

Strategy Coopetition Explains the Emergence and Transience of In-Context Learning

In short

Explains why in-context learning (ICL) in transformer models can appear during training but later fade, using a “strategy coopetition” framework. Introduces a hybrid strategy called CIWL (context-constrained in-weights learning) that eventually overtakes ICL, and shows how small data changes can make ICL persist.

Guests

No guests are mentioned in the transcript; it’s a solo “Deep Dive” discussion.

Key claims

ICL is transient because CIWL gradually becomes dominant via layer-1 dynamics, while ICL briefly benefits from shared layer-2 “induction head” circuits. Competition is mainly in layer 1; cooperation is via stable layer-2 mechanisms. Data tweaks can remove the transience.

Notable examples

Two-layer attention-only model trained on bursty Omniglot-like handwritten characters; evaluators include ICL, CIWL, and “flip” tests. Skip-trigram copiers in layer 2 copy label tokens when present. Training on modified data where context exemplar equals query exemplar makes ICL stay dominant.

Written by AI. May contain mistakes.

Chapters

0:45

Understanding AI Learning Mechanisms

Exploration of in-weights learning and in-context learning in models.

“That's the thing where it learns from examples you give it right in the prompt.”
1:45

The Transience of In-Context Learning

Discussion on the temporary nature of in-context learning in AI models.

“Less about what ICL does, more about the how and why it appears, and then, you know, retreats.”
3:20

Experimental Setup for ICL Observation

Details of the researchers' controlled experiment to observe ICL.

“You need to know how it's getting the answer.”
4:50

Evaluation Methods to Analyze Learning

Introduction to evaluators used to analyze the model's learning strategies.

“Because it's learning from the immediate prompt.”
7:10

Visualizing Results of Learning Strategies

Analysis of the accuracy of different learning strategies over training time.

“The model uses its in-weights knowledge, the associations it learned between exemplars and labels during training.”
9:10

Mechanisms Behind CIWL Strategy

Detailed explanation of the context constrained in weights learning mechanism.

“Without Layer 1 doing its job, Layer 2 can't execute that skip trigram copying effectively.”
11:10

The Role of Cooperation in Learning

How cooperation between strategies leads to the emergence of ICL.

“Early on, they configure the inputs so those shared L2 heads operate in an ICL-like fashion.”
13:50

Implications of Strategy Co-opetition

Final insights into the competition and cooperation dynamics in model learning.

“Competition mainly via layer one dynamics and which strategy ultimately performs best or converges.”
14:02

The Emergence of ICL and CIWL

Learn how ICL emerges transiently and its relationship with CIWL.

“where the development path for one strategy, CIWL, inadvertently builds components useful for another ICL, allowing ICL to emerge quickly.”
14:59

Modeling Strategy Dynamics

Discover how a mathematical model replicates competition between learning strategies.

“adds weight to their explanation, doesn't it?”
Show all 14 chapters
15:41

Modifying ICL for Persistence

Explore how data modifications can make ICL persist in learning.

“Remember, CIWL relies on its internal knowledge plus the presence of the label token.”
16:19

Impact of Modifications on Learning

Understand the results of modified training data on ICL dominance.

“potentially making it just as good asymptotically as CIWL for this specific data setup.”
17:04

Key Takeaways from ICL Transience

Reflect on key insights regarding the learning processes of models.

“It's not just about the final destination, the final accuracy, but the path the model takes to get there.”
18:17

Exploring Hidden Strategies in Models

Consider the potential hidden strategies within language models.

“And that leads to maybe a final thought to leave you with.”
A man walking through an airport, asking his phone a question

Ask about this episode

Get the gist, explore an idea or ask about something said.

Claude

On Best AI papers explained, what are the key points of this episode?

Searching your listening

Transcript

Automatic transcript. May contain errors.

0:00Welcome to the Deep Dive. Today we're plunging into the fascinating, sometimes counterintuitive world of how AI models actually learn. You know, the large language models we interact with every day. Right. It often feels a bit like magic, doesn't it? But there's a lot going on under the hood. Exactly. So we want to unpack how they acquire these abilities. And fundamentally, there are kind of two main ways these transformer models adapt or learn. The first is the classic one, in weights learning, or IWL. Okay, that's the standard training process, right? Yeah. Baking knowledge into the model's parameters, the weights.

0:35Precisely. It permanently encodes information during those training updates. Got it. And the second way? The second one, and maybe the more surprising one, is in-context learning, or ICL. Ah, yes, ICL. That's the thing where it learns from examples you give it right in the prompt. Exactly. Without changing its underlying weights at all, it just adapts its behavior on the fly based on the context you provide. Which felt really powerful when it was discovered, especially in bigger models. A kind of emergent skill. Definitely emergent, yeah. Yeah. It seems closer to how we might learn, sometimes see a couple of examples, get the pattern instantly.

1:11But here's where it gets really interesting, and this is the core puzzle from the research we're diving into today. Recent work shows that this ICL, powerful as it is, isn't always permanent. It can show up strongly during training, but then, well, sometimes it just fades away later on. Right. That transience. It feels odd, doesn't it? Why would a useful skill, this rapid adaptation, just disappear as the model keeps training? He hints at something more complex happening inside, maybe some hidden dynamic. Absolutely. So our mission today is to unpack a new paper that looks into this transience mechanistically.

1:47Less about what ICL does, more about the how and why it appears, and then, you know, retreats. Think of this as your shortcut to understanding that hidden dance of learning strategies inside these models. And we're going to uncover some pretty surprising things along the way. Oh, yeah. We'll find out about a different hybrid strategy that takes over, how strategies can actually cooperate and compete simultaneously. They call it strategy coopetition. Coopetition, okay. Interesting term. And also how just tweaking the data slightly can actually make that fleeting ICL ability stick around. Okay, fascinating.

2:20Let's start by witnessing this transience itself. How did the researchers observe this happening? So they set up a controlled experiment. They used a relatively small model, just two layers, attention only, so they could really inspect its internals. Easier to track what's going on. What do they train it on? A synthetic few-shot task. It involved handwritten characters, kind of like the Omniglot data set you might have heard of. Right, those diverse character sets. And the key thing was the data structure. It was bursty. Bursty, meaning? Meaning that within any given input sequence, the context examples and the final query example always belong to the same character class.

2:58Like, see examples of A labeled A, maybe B labeled B, then here's another A to label. Ah, okay. So the context always contains relevant info for the query class. That structure probably allows for different ways to solve it. Exactly. It opens the door for multiple strategies. And to see which strategy the model was using, they developed some clever evaluation methods. They didn't just look at overall accuracy. Right. You need to know how it's getting the answer. What were these methods? Well, there was an ICL evaluator. This specifically checks if the model is using the example to label mapping given right there in the prompt, even if that mapping is different from what it saw generally during training.

3:35So pure in-context adaptation. Got it. Then they had a CIWL evaluator. Now this one's different. It checks if the model gets the right answer simply if the correct label token is present somewhere in the context. Regardless of whether it's paired correctly with the query example. Right. It doesn't need the exact pairing from the context example, just the presence of the label token. It suggests a kind of hybrid strategy using internal knowledge plus a cue from the context. Interesting. So not pure IWL, not pure ICO. Correct. And notably, pure IWL, just relying on static associations learned during training without using the context at all, didn't really become a major player in this specific setup.

4:18So it was mainly a contest between different ways of using the context? Primarily, yes. And there was a third evaluator, the flip evaluator, which is really quite insightful. Flip evaluator. How did that work? It gives the model context with exemplar label pairs, but the labels are deliberately flipped compared to what the model learned during training. Oh, okay. So if training taught it A goes with label A, the flipped context might show A goes with label B. Exactly. Now, if the model is using pure ICL, it should follow the flipped context and predict B. Because it's learning from the immediate prompt.

4:51But if it's using that CIWL strategy, it tends to ignore the incorrect pairing. As long as the correct label token A is also present somewhere in the context, it will likely predict A, relying more on its internal preference triggered by the token's presence. Ah, so the flip evaluator's accuracy tells you which strategy is dominant. High accuracy means it's following the flip ICL. Low accuracy means it's ignoring the flip CIWL. Precisely. It reveals the model's preference. Okay, so let's visualize the results. The paper has this key graph, figure 1b. It plots accuracy according to these different evaluators over training time measured in the number of sequences seen.

5:32Right. And initially, as you'd expect, performance is low, near chance levels for all strategies. Then what happens? Then you see the blue line, that's ICL accuracy, start to climb pretty quickly. It shoots up and dominates for a while. So ICL emerges first. Yes, and it peaks somewhere around, say, 3 to 4 million sequences seen. And the red line, the flip evaluator, goes up along with it, confirming the model prefers the ICL strategy during this phase. But then, the twist. Yeah. The transience. Exactly. The blue ICL line starts to drop. After peaking, it begins to fade away. While it's dropping, what's happening elsewhere?

6:07As ICL descends, the green line's CIWL accuracy is steadily rising. It was slower to start, but it keeps climbing. And eventually. Eventually, CIWL overtakes ICL. It becomes the dominant strategy, reaching near-perfect accuracy. And that red flip evaluator line tracks us perfectly. It drops from high, showing ICL preference down to low, showing CIWL preference. Wow. So you literally watch the handoff on the graph, ICL flares up quickly, then fades, while CIWL slowly rises to take over completely. It's a clear transition. And the paper notes, there's a period where both strategies seem to be active, coexisting, before CIWL wins out definitively.

6:47That's not like flipping a switch then. More like a gradual shift in reliance. A very dynamic transition, yeah. Between different ways of solving the same problem internally. Okay, so let's focus on the winner. This CIWL, context constrained in weights learning. You said it's a hybrid. Yeah. How does it actually work? What's the mechanism? Right. It's quite specific. It's not just using fixed weights like pure IWL, and it's not directly mapping context examples like pure ICL. It blends them. The model uses its in-weights knowledge, the associations it learned between exemplars and labels during training.

7:18But critically, it needs the correct label token to be present somewhere in the context sequence. So the context acts like a necessary confirmation or trigger. Kind of, yeah. It doesn't need the full exemplar label pair it was trained on to be in the context. Just having the correct label token appear somewhere is enough to activate or confirm its internal knowledge for the current query. So the context isn't teaching the mapping on the fly. It's more like pointing to the right answer already stored internally. That's a good way to put it. And they actually identified the circuit doing this, at least in their two-layer model.

7:53It involves specific attention heads in layer two. Attention heads, okay. What do they do? They perform a mechanism the researchers called skip trigram copiers. Skip trigram copiers. Sounds technical. It is pretty specific. These layer two heads learn to do something clever. They attend directly from the query token the character needing a label. Like that second A. Right. They attend from that query token straight to the correct label token the A label located somewhere else in the context. They effectively skip over the tokens in between. Ah, okay. Finding the target label directly. And once they find it, they simply copy that label token forward to the model's output layer.

8:32And this works as long as the correct label token is just somewhere in the context. Seems so. Regardless of what it was paired with in the context examples, the presence of the token is the key for this mechanism. So layer 2 does the finding and copy. What about layer 1? Is it just passive? Oh no, layer 1 is crucial. It's not doing the direct copying, but it's essential for setting things up. Setting the stage. Exactly. Layer 1 heads process the input sequence and prepare the specific keys and values the information representations tokens use. Right, the signals they send out and look for. Layer 1 prepares those keys and values in such a way that the Layer 2 heads can successfully find and attend to that correct label token in the context.

9:13Without Layer 1 doing its job, Layer 2 can't execute that skip trigram copying effectively. It's like layer one highlights the target area and readies the information so layer two can lock on and copy. That's a great analogy. It's a collaboration across layers to implement this CIWL strategy. And they mentioned something about complexity, maybe superposition. Yeah, they briefly touch on that in an appendix. They suggest these layer two heads might be using superposition to handle the large number of character classes efficiently, basically cramming more distinct patterns into the same neurons than you might expect.

9:47So even in this simple model, there's still some sophisticated stuff happening internally. Definitely. Okay, so we have a handle on CIWL, the eventual winner. But this brings us right back to the main puzzle. If CIWL is the strategy the model ultimately prefers in this setup, why did ICL even emerge in the first place? Why bother with that transient phase? This is where it gets, I think, really mind-bending. The answer seems to be cooperation. Cooperation. But weren't they competing? CIWL pushed ICL out. They were competing for dominance, yes. But the paper argues they also cooperate by sharing critical internal circuits.

10:24This is the strategy coopetition idea. Okay. Cooperation and competition. Tell me more. How do they cooperate? By sharing hardware, essentially. The researchers found that the Layer 2 induction heads, these are circuits known to be important for ICL, helping models spot and repeat patterns from the context. Like seeing A implies B in the prompt and then applying it. Sort of, yeah. Those very induction heads usually linked to ICL are actually reused by the CIWL strategy later on. Same circuits. The same Layer 2 circuits seem to be involved in both. The big change that drives the switch from ICL dominance to CIWL dominance isn't happening in Layer 2.

11:02It's primarily happening in Layer 1. Ah, so Layer 1 changes how it directs the information flow. Exactly. Layer 1's attention patterns shift over time. Early on, they configure the inputs so those shared L2 heads operate in an ICL-like fashion. Later, layer 1 changes its pattern, and now those same L2 heads operate in the CIWL skip trigram way. Figure 3 in the paper shows this L2 circuits are relatively stable, while L1 attention changes dramatically. So L2 provides versatile machinery and L1 decides how it gets used, switching the mode from ICL to CIWL over time? That's the core idea. And this sharing is why ICL emerges so quickly.

11:43How does sharing enable the emergence? They did this cool experiment. They tried training a model only on data that absolutely required ICL to solve. And what happened? Struggled. Terribly. It was incredibly slow to learn ICL from scratch. That's the black line in figure 4A. But if they took a model that had been trained on the original Bursty data, where CIWL eventually won, grabbed its layer 2 weights and used those to initialize a new model. And then trained that model on the ICL-only data. Then ICL emerged much, much faster. That's the green line in figure 4. It got a massive head start. Wow.

12:15So the Layer 2 circuits needed for ICL were already being built or partially built during the process of learning CIWL on the other data. That's the strong implication. ICL emerges transiently, partly because the necessary L2 infrastructure is already being developed on the way to the CIWL solution. It piggybacks on CIWL's development path. It's like finding a road already paved most of the way to where you want to go, even if it was built for a different final destination. Exactly. And it's even a bit more specific. Section 5.3 notes that the L2 weights are most helpful for speeding up ICL if you take them from a certain point during CIWL training, not necessarily right at the end when they might be too specialized for CIWL.

12:59Figure 4B shows this optimal window. So on the way is quite literal needs to be during the journey, not after arrival. Seems so. Okay, that covers the cooperation enabling ICL's quick rise. What about the competition that makes it fall? The competition explains the disappearance. If the CIWL strategy is already fully formed and dominant, say, you start training from a late-stage CIWL checkpoint. Where the model has already converged. Right. Then, even if you feed it the bursty data that normally supports ICL, ICL won't emerge. Figure 4C shows this. Why not? Because the CIWL strategy, particularly its layer one dynamics, is already entrenched and effectively wins the competition immediately.

13:39It blocks ICL from gaining a foothold. ICL only gets its chance to shine transiently because CIWL is still forming relatively slowly, leaving that window open. So putting it all together, this strategy co-opetition. It's this mix, right? Competition mainly via layer one dynamics and which strategy ultimately performs best or converges. and cooperation through those shared Layer 2 circuits where the development path for one strategy, CIWL, inadvertently builds components useful for another ICL, allowing ICL to emerge quickly. And ICL shows up transiently because it's useful for the task. It gets that boost from being on the way via shared L2 circuits, and it's fast enough to appear before the slower, ultimately dominant CIWL fully takes over and shuts it down.

14:23That captures the essence of their explanation, yeah. It's a much richer story than just one strategy replacing another. And they even built a simple mathematical model to test this idea. They did, yeah. Section 6 talks about a minimal model designed to capture this dynamic strategy's racing, sharing components, competing. Just a toy model. But did it replicate the behavior? Remarkably well. It showed the transience of one mechanism and the rise of another. It even replicated a subtle dip, a little divot, in the learning curve of the dominant strategy, just like they saw with CIWL in the transformer experiments.

14:57That's figure five. The fact that a simple model captures these complex dynamics adds weight to their explanation, doesn't it? It really does. It suggests the core principles of the race, the sharing, and the competition are likely fundamental here. Okay, so if we understand this dance, this coopetition, can we maybe change the music? Can we make ICL stick around, make it persistent? That's the logical next step, and Section 7 explores exactly that. The intuition came partly from that tour model. What was the intuition? Basically, if the strategy that emerges faster ICL in this case could also be made asymptotically preferable, or at least not worse than the competitor in the long run.

15:36Then it might win the race and keep the lead. Exactly. Wouldn't get overtaken later. So they needed a way to make ICL not worse than CIWL on this task. How do they try to achieve that? They tweak the data again. Remember, CIWL relies on its internal knowledge plus the presence of the label token. ICL relies purely on the context mapping. Maybe on the original data with varying exemplars, ICL was just inherently a bit less stable or optimal long-term. So they simplified the ICL task. They did. They changed the training data so that the exemplar shown in the context always exactly matched the exemplar in the query.

16:13Making the context mapping extremely direct and reliable for ICL. That was the idea. Make ICL as simple and robust as possible, potentially making it just as good asymptotically as CIWL for this specific data setup. And did it work? It did. Figure 6 shows the result. When models were trained on this modified data where context exemplar equals query exemplar, the ICL strategy emerged and then stayed dominant. It persisted throughout training, reaching, and maintaining high accuracy, no transients. Wow. And that held up even in larger models. Yes. They confirmed it worked beyond the small two-layer model, too.

16:48That's a really powerful finding. It shows that understanding these internal learning dynamics isn't just academic. You can actually use that understanding to design the training data itself to encourage or discourage specific internal strategies. Absolutely. You can potentially steer the model towards behaviors you want by shaping the learning trajectory and the competitive landscape between strategies. It's not just about the final destination, the final accuracy, but the path the model takes to get there. Precisely. The journey shapes the outcome in profound ways. So let's pull back for the big picture then.

17:22What are the key takeaways for you, our listener, from this deep dive into ICL transience and this idea of strategy coopetition? Well, I think the first thing is that how these models learn isn't always straightforward. It's not just one process improving. It can be this complex dance. Right. Different strategies emerging, fading, competing. Yeah. But also, surprisingly, cooperating through shared circuits. Exactly. That coopetition idea is really fascinating. And we learned about a specific new strategy, CIWL. Context constrained in weights learning. Yeah, showing that models can use context in subtle hybrid ways, not just pure recall or pure on the fly learning.

18:01It blends the two. And it gives us a potential explanation for why things like transients happen. It's not just about which strategy is best overall, but about timing, speed, shared resources, and competition during the actual training process. It makes you realize how sensitive the model's internal workings can be to the specifics of training, the data, the architecture. Absolutely. And that leads to maybe a final thought to leave you with. Go on. Given this intricate interplay we've just discussed, and how a simple change in data properties could switch a transient ability to a persistent one, what other transient abilities or maybe completely unexpected internal strategies might be hiding inside the huge language models we use every day?

18:44Strategies that emerge and fade silently during their massive training runs, or ones that are lurking there, perhaps influencing behavior in ways we don't even realize yet. Exactly. What else is going on under the hood waiting to be discovered, understood, or maybe even deliberately shaped in the future?

From the publisher

This academic paper explores the emergence and transience of in-context learning (ICL) in transformer models, revealing a dynamic interplay with another strategy, context-constrained in-weights learning (CIWL). The authors term this phenomenon "strategy coopetition," where ICL and CIWL both cooperate by sharing underlying neural circuits and compete for dominance during training. While ICL appears earlier, it is ultimately superseded by CIWL, yet its initial emergence is facilitated by the simultaneous development of CIWL. The research also presents a mathematical model to explain these interactions and demonstrates how specific data properties can be manipulated to make ICL a persistent learning strategy.

More from Best AI papers explained

All episodes