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

Aaditya K Singh, Ted Moskovitz, Sara Dragutinović, Felix Hill, Stephanie C.y. Chan, Andrew M Saxe

Transformers are renowned for In-Context Learning (ICL)—the remarkable ability to solve new tasks simply by observing examples in a prompt, without any weight updates. However, recent studies have uncovered a strange phenomenon: as a model trains longer on a specific distribution, its ICL ability often peaks and then mysteriously disappears, a phenomenon known as "transience."

A recent collaboration between researchers at University College London, Anthropic, Oxford, and Google DeepMind provides a fascinating mechanistic look at why ICL often appears as a "flash in the pan" during AI training. They discovered that ICL's transience is driven by a state of "coopetition" with a hybrid strategy called Context-Constrained In-Weights Learning (CIWL).

The Mystery of Transient ICL

The authors set out to understand the "why" and "how" of ICL disappearance. When ICL fades, is the model simply reverting to rote memorization (In-Weights Learning)? Or is something more complex happening under the hood? Understanding these dynamics is crucial for building models that maintain flexible reasoning even after extensive training.

To peel back the layers of the transformer, the researchers used a minimalist "laboratory" setup: a 2-layer, attention-only transformer trained on a synthetic few-shot learning task using Omniglot handwritten characters. They employed mechanistic interpretability techniques, including causal ablations and attention pattern analysis, alongside a minimal mathematical model to simulate how different learning strategies race against each other.

Enter CIWL and "Strategy Coopetition"

The researchers discovered that when ICL fades, the model doesn't just revert to simple memorization. Instead, it develops Context-Constrained In-Weights Learning (CIWL). In this hybrid strategy, the model uses its learned weights to recognize the class of an image, but it uses the context to find the correct label assigned to that class in the current prompt.

This leads to the paper's core concept: Strategy Coopetition. ICL and CIWL are not just rivals; they are "coopetitors" that both cooperate and compete within the network's architecture.

Overview of Strategy Coopetition
  • Cooperation (Shared Hardware): Both strategies share the same sub-circuits in Layer 2 (the "induction heads"). In fact, ICL only emerges quickly early in training because it "hitches a ride" on the developing CIWL circuitry. By taking Layer 2 weights from a model that had "forgotten" ICL and plugging them into an early-stage model, the authors proved these weights were still perfectly capable of supporting ICL.
  • Competition (The Layer 1 Tug-of-War): While they share Layer 2, the strategies fight over Layer 1. For ICL, Layer 1 heads look at previous tokens to form generic representations. For CIWL, they switch to "attending-to-self" to extract specific class features.

The Race Between Fast and Slow Learning

During training, ICL is "fast" to learn but ultimately "weak" on this specific data distribution. CIWL, on the other hand, is "slow" to develop but eventually becomes the more accurate, dominant strategy. As CIWL's preference wins out in Layer 1, the attention patterns shift, causing ICL to fade. The authors pinpointed the exact moment of transience to this shift in Layer 1 attention from "previous-token" behavior to "self-attention."

Interestingly, the researchers found that persistence is possible. By altering the training data so that the query image exactly matches a context image, they could make ICL persistent rather than transient, proving that data distribution dictates the winner of this coopetition.

Looking Ahead

While the 2-layer attention-only model provides clear, mechanistic insights, real-world LLMs have dozens of layers and complex MLP blocks. The authors provide preliminary evidence that their findings scale to larger models, but mapping the full circuitry of a GPT-4 scale model remains an open challenge. Future work applying these mechanistic insights to natural language training—where data diversity is much harder to control—will be a critical next step in understanding how our most powerful AI models truly learn.

Summary updated

BibTeX
@inproceedings{singh2025strategy,
  author = {Aaditya K Singh and Ted Moskovitz and Sara Dragutinović and Felix Hill and Stephanie C.Y. Chan and Andrew M Saxe},
  title = {{Strategy Coopetition Explains the Emergence and Transience of In-Context Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=esBoQFmD7v},
}
Figure