In-context superposition: human-like working memory interference in large language models

Hua-Dong Xiong, Li Ji-An, Jiaqi Huang, Robert Wilson, Kwonjoon Lee, Xue-Xin Wei

TL;DR

Large Language Models (LLMs) exhibit human-like working memory limitations, struggling to recall information as the "memory load" increases. This paper argues that these limits aren't due to a lack of raw capacity, but rather in-context superposition: a state where multiple active memories are entangled in the same representational space, causing interference that the model must progressively suppress to succeed.

What Problem Does This Paper Address?

In cognitive science, human working memory is famously limited—we can typically only hold about three to four items in mind at once. You might expect LLMs, with billions of parameters and "perfect" attention over thousands of tokens, to be immune to such bottlenecks. However, recent research shows they aren't.

The authors investigate why these two radically different substrates (biological neurons vs. silicon transformers) face the same constraints. They test the hypothesis that working memory limits are a fundamental trade-off: compressing information into shared representations helps a model learn and generalize efficiently, but it creates a "crowding" effect where task-irrelevant items interfere with the target item during retrieval.

Methods

The researchers used the N-back task, a classic neuropsychological paradigm where a subject is shown a sequence of items and must report which item appeared exactly $N$ steps ago.

To probe the mechanics of LLM memory, they employed four distinct approaches:

  1. Behavioral Manipulations: They introduced "lures" (items that appeared $N-1$ or $N+1$ steps ago) and varied stimulus set sizes to see if errors were random or systematically biased by interference.
  2. Representational Analysis: They tracked how "letter identity" information (e.g., the concept of the letter 'A') evolved across the model's layers using metrics like cosine similarity and inter-class decodability.
  3. Attention Profiling: They analyzed specific attention heads to see if they were "cleanly" pointing at the target or getting distracted by neighboring tokens.
  4. Causal Intervention: They used Singular Value Decomposition (SVD) to identify the directions in the residual stream that encode letter identity and then "dampened" those directions to see if reducing interference improved recall.

Datasets

  • Synthetic N-back: A custom-generated dataset of 50-turn dialogues using the 26-letter English alphabet.
  • General Benchmarks: To correlate working memory with general intelligence, the authors used MMLU Pro, GPQA Diamond, and IFEval.
  • Human Reference Data: Aggregated accuracy data from five previously published human N-back studies.

Key Insights and Ideas

  • In-context Superposition: The authors extend the idea of "superposition" (where models store more features than they have dimensions) to the context window. Multiple recent items coexist in an entangled state, meaning the model doesn't just "look up" a position; it has to filter out the noise of other active memories.
  • The Architecture is Capable, the Training is the Bottleneck: The authors trained a tiny, two-layer transformer specifically on N-back, and it achieved 100% accuracy. This proves that the transformer architecture can solve the task perfectly; the limitations in frontier LLMs likely stem from the general-purpose nature of their pre-training.
  • The Layer-wise Trajectory: LLMs follow a consistent path to retrieval. Early layers encode everything; middle layers attempt to disentangle the representations; and only in the very final layers does the target representation align with the "readout" (the output weights).
  • Interference as a Proxy for Intelligence: Just as in humans, an LLM's ability to handle working memory interference is a strong predictor of its performance on complex reasoning tasks like GPQA.

Key Results

  • Load-Dependent Decay: All tested models (Gemma 3, Qwen 3.5, Llama 3.1, etc.) showed a sharp decline in performance as $N$ increased from 1 to 4, mirroring the human "capacity limit."
  • Recency Bias: Models were significantly more likely to mistakenly report a very recent letter than an older one, confirming that recent items exert the most "interference pressure."
  • Successful Intervention: By identifying and suppressing the specific vector directions associated with letter-identity interference, the researchers were able to boost the N-back accuracy of models like Qwen 3.5-2B and Gemma 3-1B.
  • Correlation with Benchmarks: Mean N-back accuracy correlated strongly with MMLU Pro ($r = 0.78$) and GPQA Diamond ($r = 0.88$), suggesting that "interference control" is a core component of what we call "model capability."

Limitations and Future Work

  • Geometric Focus: The study primarily looks at the geometry of representations (angles and distances in vector space). It doesn't yet fully map the specific circuits or "neurons" responsible for this behavior.
  • Non-Thinking Mode: The models were evaluated in a standard autoregressive mode. The authors note that "Chain-of-Thought" or "thinking" models might bypass these limits by externalizing their working memory onto the scratchpad.
  • Generalization of Intervention: The causal intervention was optimized for specific trials. Whether a single, universal "interference-suppression" hook can be built into LLMs to improve general reasoning remains an open question for future research.

Summary updated

BibTeX
@inproceedings{xiong2026context,
  author = {Hua-Dong Xiong and Li Ji-An and Jiaqi Huang and Robert Wilson and Kwonjoon Lee and Xue-Xin Wei},
  title = {{In-context superposition: human-like working memory interference in large language models}},
  booktitle = {COLM},
  year = {2026},
  url = {https://openreview.net/forum?id=g1hMOOAX2n},
}
Figure