Emergence of Episodic Memory in Transformers: Characterizing Changes in Temporal Structure of Attention Scores During Training

Deven Mahesh Mistry, Anooshka Bajaj, Yash Aggarwal, Sahaj Singh Maini, Zoran Tiganj
2/9/2025
cs.LGcs.AIcs.CL

No confident code implementation found for this paper.

Abstract

We investigate in-context temporal biases in attention heads and transformer outputs. Using cognitive science methodologies, we analyze attention scores and outputs of the GPT-2 models of varying sizes. Across attention heads, we observe effects characteristic of human episodic memory, including temporal contiguity, primacy and recency. Transformer outputs demonstrate a tendency toward in-context serial recall. Importantly, this effect is eliminated after the ablation of the induction heads, which are the driving force behind the contiguity effect. Our findings offer insights into how transformers organize information temporally during in-context learning, shedding light on their similarities and differences with human memory and learning.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{mistry2025emergence,
  title  = {Emergence of Episodic Memory in Transformers: Characterizing Changes in Temporal Structure of Attention Scores During Training},
  author = {Deven Mahesh Mistry and Anooshka Bajaj and Yash Aggarwal and Sahaj Singh Maini and Zoran Tiganj},
  year   = {2025},
  eprint = {2502.06902},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.06902v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.06902.svg)](https://codeofpaper.com/paper/2502.06902)

Discussion