Do LLMs dream of elephants (when told not to)? Latent concept association and associative memory in transformers

Yibo Jiang, Goutham Rajendran, Pradeep Ravikumar, Bryon Aragam
6/26/2024
cs.CLcs.LGstat.ML

No confident code implementation found for this paper.

Abstract

Large Language Models (LLMs) have the capacity to store and recall facts. Through experimentation with open-source models, we observe that this ability to retrieve facts can be easily manipulated by changing contexts, even without altering their factual meanings. These findings highlight that LLMs might behave like an associative memory model where certain tokens in the contexts serve as clues to retrieving facts. We mathematically explore this property by studying how transformers, the building blocks of LLMs, can complete such memory tasks. We study a simple latent concept association problem with a one-layer transformer and we show theoretically and empirically that the transformer gathers information using self-attention and uses the value matrix for associative memory.

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{jiang2024llms,
  title  = {Do LLMs dream of elephants (when told not to)? Latent concept association and associative memory in transformers},
  author = {Yibo Jiang and Goutham Rajendran and Pradeep Ravikumar and Bryon Aragam},
  year   = {2024},
  eprint = {2406.18400},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2406.18400},
  url    = {http://arxiv.org/abs/2406.18400v2},
  journal = {NEURIPS 2024 2024}
}

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

Discussion