Prompt Tuning Transformers for Data Memorization

Haiyu Wang, Yuanyuan Lin
1/1/2025
transformer-attentionlora-peft-merging

No confident code implementation found for this paper.

Abstract

Prompt tuning has emerged as a powerful parameter-efficient fine-tuning technique, allowing large pretrained Transformers to adapt to downstream tasks by optimizing a small set of prompt embeddings. Despite its empirical success, the extent to which prompt tuning can memorize data remains poorly understood.

Show full abstract

In this paper, we provide both theoretical and empirical analyses of data memorization ability of prompt-tuned Transformers. Building on recent theoretical frameworks, we derive an upper bound on the required prompt length for exact memorization of finite datasets and establish a trade-off between prompt length and the number of autoregressive generation steps. Specifically, we show that a constant-size Transformer can memorize n input-output pairs with prompts of length ˜ O ( √ nN ) , where N denotes the sequence length. Empirical results further demonstrate that prompt-tuned, randomly initialized Transformers are able to effectively memorize finite datasets. These models also capture the intrinsic low-rank structure of the data, leading to a reduction in the required prompt length. Finally, we analyze how the initialization of the Transformer backbone affects the performance of prompt tuning. Our findings provide new insights into the expressivity, efficiency, and underlying mechanisms of prompt tuning, bridging theoretical memorization limits with observed empirical behaviors.

DOISemantic Scholar

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{wang2025prompt,
  title  = {Prompt Tuning Transformers for Data Memorization},
  author = {Haiyu Wang and Yuanyuan Lin},
  year   = {2025},
  doi    = {10.52202/085713-0811},
  url    = {https://doi.org/10.52202/085713-0811},
  journal = {Neural Information Processing Systems}
}

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

Discussion