Rethinking Associative Memory Mechanism in Induction Head

Shuo Wang, Issei Sato
12/16/2024
cs.CLcs.LG

No confident code implementation found for this paper.

Abstract

Induction head mechanism is a part of the computational circuits for in-context learning (ICL) that enable large language models (LLMs) to adapt to new tasks without fine-tuning. Most existing work explains the training dynamics behind acquiring such a powerful mechanism. However, the model's ability to coordinate in-context information over long contexts and global knowledge acquired during pretraining remains poorly understood. This paper investigates how a two-layer transformer thoroughly captures in-context information and balances it with pretrained bigram knowledge in next token prediction, from the viewpoint of associative memory. We theoretically analyze the representation of weight matrices in attention layers and the resulting logits when a transformer is given prompts generated by a bigram model. In the experiments, we design specific prompts to evaluate whether the outputs of the trained transformer align with the theoretical results.

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{wang2024rethinking,
  title  = {Rethinking Associative Memory Mechanism in Induction Head},
  author = {Shuo Wang and Issei Sato},
  year   = {2024},
  eprint = {2412.11459},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2412.11459v2}
}

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/2412.11459.svg)](https://codeofpaper.com/paper/2412.11459)

Discussion