Pith. sign in

On the Optimal Memorization Capacity of Transformers

1 Pith paper cite this work. Polarity classification is still indexing.

1 Pith paper citing it
abstract

Recent research in the field of machine learning has increasingly focused on the memorization capacity of Transformers, but how efficient they are is not yet well understood. We demonstrate that Transformers can memorize labels with $\tilde{O}(\sqrt{N})$ parameters in a next-token prediction setting for $N$ input sequences of length $n$, which is proved to be optimal up to logarithmic factors. This indicates that Transformers can efficiently perform memorization with little influence from the input length $n$ owing to the benefit of parameter sharing. We also analyze the memorization capacity in the sequence-to-sequence setting, and find that $\tilde{O}(\sqrt{nN})$ parameters are not only sufficient, but also necessary at least for Transformers with hardmax. These results suggest that while self-attention mechanisms can efficiently identify input sequences, the feed-forward network becomes a bottleneck when associating a label to each token.

fields

cs.CL 1

years

2025 1

verdicts

CONDITIONAL 1

representative citing papers

How much do language models memorize?

cs.CL · 2025-05-30 · conditional · novelty 6.0

A compression-based measurement puts GPT-style model memorization capacity at roughly 3.6 bits per parameter, with membership inference success following a sigmoid in the dataset-to-capacity ratio.

citing papers explorer

Showing 1 of 1 citing paper.

  • How much do language models memorize? cs.CL · 2025-05-30 · conditional · none · ref 29 · internal anchor

    A compression-based measurement puts GPT-style model memorization capacity at roughly 3.6 bits per parameter, with membership inference success following a sigmoid in the dataset-to-capacity ratio.