Memorization in Attention-only Transformers

Léo Dana, Muni Sreenivas Pydi, Yann Chevaleyre
11/15/2024
cs.AIcs.CL

No official code found. Best implementation: leodana2000/Transformer_Attentional_Memory (1 star, last commit 2025-03-09).

Abstract

Recent research has explored the memorization capacity of multi-head attention, but these findings are constrained by unrealistic limitations on the context size. We present a novel proof for language-based Transformers that extends the current hypothesis to any context size. Our approach improves upon the state-of-the-art by achieving more effective exact memorization with an attention layer, while also introducing the concept of approximate memorization of distributions. Through experimental validation, we demonstrate that our proposed bounds more accurately reflect the true memorization capacity of language models, and provide a precise comparison with prior work.

View on arXivView PDF

Code Implementations(1)

Codebase for the paper "Memorization in Attention-only Transformers", accepted at AISTATS 2025

10Python, Jupyter NotebookMar 18, 20241 years ago
memorizationscaling-lawstransformer

Similar Papers

Cite this paper

@article{dana2024memorization,
  title  = {Memorization in Attention-only Transformers},
  author = {Léo Dana and Muni Sreenivas Pydi and Yann Chevaleyre},
  year   = {2024},
  eprint = {2411.10115},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2411.10115v2}
}

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

Discussion