← Latest papers
💻 computer science

Decomposing Prediction Mechanisms for In-Context Recall

This paper introduces a novel toy problem combining continuous in-context learning with discrete associative recall to demonstrate that transformer models employ two distinct mechanisms with different learning dynamics: an early-emerging, label-agnostic "Bayesian-style" predictor for continuing sequences and a later-emerging, label-dependent mechanism for recalling and resuming specific prior states.

Original authors: Sultan Daniels, Dylan Davis, Dhruv Gautam, Wentinn Liao, Gireeja Ranade, Anant Sahai

Published 2026-06-19
📖 6 min read🧠 Deep dive

Original authors: Sultan Daniels, Dylan Davis, Dhruv Gautam, Wentinn Liao, Gireeja Ranade, Anant Sahai

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 Idea: Two Different Brains in One Model

Imagine you have a very smart robot assistant. You give it a notebook filled with stories about different people (let's call them "systems"). Sometimes the story is about Alice, sometimes Bob, and sometimes Charlie. The notebook uses special colored brackets to tell the robot when the story switches from Alice to Bob.

The robot's job is to read the story and predict what happens next. The researchers wanted to see how the robot learns to do this. They discovered something surprising: The robot doesn't use one single way of thinking. It uses two completely different "modes" or "brains" depending on which word it is trying to predict next.

The Setup: The "Haystack" Game

To test this, the researchers created a game called "Needle in a Haystack."

  • The Haystack: A long list of mixed-up story segments. One minute it's Alice's story, the next it's Bob's, then back to Alice, then Charlie.
  • The Labels: Each story segment starts with a unique "Open" label (like a red bracket [) and ends with a "Close" label (like a red bracket ]).
  • The Test: The robot reads the whole haystack. Then, the researchers show it a specific "Open" label (e.g., "Bob's bracket") and ask, "What comes next in Bob's story?"

The Two "Brains" (Mechanisms)

The paper found that the robot solves this puzzle using two distinct methods that turn on at different times during its training.

1. The "Label Reader" (The First Brain)

  • When it kicks in: This brain wakes up late in the robot's training.
  • How it works: It looks at the "Open" label (the red bracket) and says, "Ah, this is Bob's story! I remember Bob's rules from earlier in the notebook." It then uses those specific rules to predict the very first word of the new segment.
  • The Analogy: Imagine you are at a party. You see a name tag that says "Bob." You instantly remember, "Oh, Bob always tells jokes." You use that memory to predict Bob's first sentence. This is Associative Recall.

2. The "Pattern Follower" (The Second Brain)

  • When it kicks in: This brain wakes up early in the training.
  • How it works: It ignores the name tags (labels) almost entirely. Instead, it looks at the last few words it just read and says, "Based on the pattern of the last few words, the next one should be X." It uses a "Bayesian" style of guessing (looking at probabilities based on recent history).
  • The Analogy: You are walking down a street. You don't need to know the person's name to guess what they will do next; you just watch their footsteps. If they are walking fast, you guess they will keep walking fast. This is Pattern Prediction.

The Surprising Discovery: They Don't Turn On Together

The most important finding is that these two brains develop at different speeds and use different parts of the robot's "wiring."

  • The Pattern Follower (Brain 2) learns first. The robot gets really good at predicting the second, third, and fourth words of a story very early on. It does this by just looking at the immediate previous words, ignoring the labels.
  • The Label Reader (Brain 1) learns later. It takes a long time for the robot to learn that the "Open" label is a key to unlocking the first word of a new story.

The "Phase Transition":
Imagine a light switch. For a long time, the robot is bad at predicting the first word after a label. Then, suddenly, around a specific point in training, it flips a switch and gets perfect at it. But the ability to predict the second word had already been working smoothly for a long time.

How They Proved It (The Experiments)

The researchers played tricks on the robot to see which brain it was using:

  1. The "Wrong Label" Trick: They showed the robot a label for "Bob" but the story was actually "Charlie's."

    • Result: The robot failed at predicting the first word (because it was trusting the wrong label). But, it was still good at predicting the second word (because it was just following the pattern of the words it saw).
    • Conclusion: The first word relies on the Label; the second word relies on the Pattern.
  2. The "Confusing Label" Trick: They showed the robot a label for a story that didn't exist in the notebook.

    • Result: At first, the robot ignored the fake label and kept predicting the story it was already in. But later in training, once the "Label Reader" brain woke up, the robot got confused and tried to start a new story based on the fake label, even though it was wrong.
    • Conclusion: The robot learned to trust the labels too much, even when they were nonsense.
  3. The "Circuit Breaker" Test: They physically "pruned" (cut) parts of the robot's neural network.

    • Result: They found that the wires used to predict the first word were completely different from the wires used to predict the second word. They are two separate machines working inside one body.

Does This Happen in Real AI?

The researchers checked if this "two-brain" phenomenon happens in real Large Language Models (like the ones used for translation). They found the same thing:

  • The model gets good at continuing a translation (predicting the second word) before it gets good at starting a new translation based on a prompt (predicting the first word).
  • This suggests that even our most advanced AI models are juggling multiple, separate strategies to solve a single task.

Summary

This paper shows that when an AI learns to recall information from a context, it doesn't just "remember" things. It uses a Label-Based strategy to start a new task (which takes a long time to learn) and a Pattern-Based strategy to continue a task (which it learns quickly). These two strategies are so different that they live in separate parts of the AI's brain and turn on at different times.

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 →