← Latest papers
💬 NLP

Learning without training: The implicit dynamics of in-context learning

This paper proposes that in-context learning in Large Language Models arises from a mechanism where self-attention layers implicitly induce low-rank updates to MLP weights during the forward pass, mathematically equivalent to training on the provided context examples without actual weight changes.

Original authors: Benoit Dherin, Michael Munn, Hanna Mazzawi, Michael Wunder, Javier Gonzalvo

Published 2026-06-03
📖 5 min read🧠 Deep dive

Original authors: Benoit Dherin, Michael Munn, Hanna Mazzawi, Michael Wunder, Javier Gonzalvo

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

The Big Mystery: How Do LLMs "Learn" on the Fly?

Imagine you are talking to a very smart robot. You give it a few examples of a new rule you invented (e.g., "If I say 'apple', you say 'red'. If I say 'banana', you say 'yellow'"). Without you ever changing the robot's brain or retraining it, the robot instantly understands the rule and applies it to a new fruit you mention.

This is called In-Context Learning (ICL). The robot seems to be "learning" right in the middle of the conversation. But here's the mystery: In standard machine learning, learning means changing the internal weights (the brain's wiring) based on data. In this case, the robot's brain never changes. The weights stay exactly the same. So, how does it learn?

The Paper's Discovery: The "Ghost" Update

The authors of this paper propose a clever explanation. They argue that while the robot isn't physically changing its brain, the act of reading your examples creates a "ghost" update.

Think of the robot's brain as a giant, complex factory.

  1. The Standard Way: Usually, if you want the factory to do something new, you send a team of engineers to physically rewire the machines (this is training).
  2. The In-Context Way: The authors show that when you feed the robot a prompt with examples, the robot's internal machinery (specifically the Self-Attention layer) acts like a magical projector. It takes the information from your examples and projects a "shadow" onto the factory's main assembly line (the MLP layer).

This shadow is mathematically identical to a physical rewiring. It's as if the robot pretends to have updated its brain just for that specific moment. The paper proves that reading the prompt is mathematically equivalent to secretly updating the weights, even though no actual update happens on the computer hardware.

The "Minimal Patch": A Tiny, Perfect Fix

The paper introduces a concept called the "Minimal Token-Patch."

Imagine you have a painting (the robot's original brain). You want to add a tiny detail to it based on a new instruction.

  • You could repaint the whole canvas (too much work).
  • You could throw paint everywhere (messy).
  • The paper shows the robot finds the absolute smallest, most precise sticker it can place on the painting to make it look exactly right.

Mathematically, this "sticker" is a Rank-1 Matrix. In plain English, this means it's a very simple, low-dimensional adjustment. It's the most efficient, minimal change possible to make the robot's output match what it would have been if it had actually learned the rule.

The "Thought Patch": Compressing the Conversation

The researchers also found a way to make this practical. Since the "ghost update" depends on the specific question you ask, it changes every time. But, they showed that you can calculate a "Static Thought Patch."

Imagine you have a long conversation with the robot. Instead of keeping the whole conversation in memory, you can boil it down into a single, tiny note (the Thought Patch). If you give this note to the robot later, it behaves exactly as if it remembered the whole conversation. This is a form of prompt compression: turning a long history of examples into a single, static weight update.

Why Some Robots Are Better Than Others

The paper tested this theory on different types of robot brains:

  • Transformers (The current AI stars): They have a "Self-Attention" mechanism. The paper shows this mechanism creates a smooth, stable "ghost update" that converges nicely. This explains why Transformers are so good at learning from examples.
  • RNNs (Older AI tech): When they tested the same theory on Recurrent Neural Networks (RNNs), the "ghost updates" were chaotic and unstable. They didn't settle down. This provides a mathematical reason why RNNs struggle with in-context learning compared to Transformers.

The "Steering Wheel" Connection

Finally, the paper connects this to a concept called Model Editing. Scientists have previously found that you can manually tweak a robot's brain with a "steering vector" to make it tell the truth or follow a specific style.

The paper reveals that In-Context Learning is just the robot doing this to itself. When you give it examples, the robot automatically generates its own "steering vector" (the Rank-1 update) to steer its behavior for the current task. It's not magic; it's the robot using its own internal mechanics to temporarily reconfigure itself.

Summary

  • The Claim: Large Language Models don't need to retrain to learn from examples.
  • The Mechanism: The attention mechanism acts like a projector, creating a mathematical "ghost update" to the model's weights.
  • The Result: This update is a tiny, perfect "patch" (Rank-1 matrix) that makes the model behave as if it learned the new rule.
  • The Proof: They showed this mathematically and proved that the "ghost" behavior is identical to the real thing, explaining why Transformers work so well at this compared to older models.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →