ResearchTrend.AI
  • Papers
  • Communities
  • Events
  • Blog
  • Pricing
Papers
Communities
Social Events
Terms and Conditions
Pricing
Parameter LabParameter LabTwitterGitHubLinkedInBlueskyYoutube

© 2025 ResearchTrend.AI, All rights reserved.

  1. Home
  2. Papers
  3. 2306.02010
11
22

Memorization Capacity of Multi-Head Attention in Transformers

3 June 2023
Sadegh Mahdavi
Renjie Liao
Christos Thrampoulidis
ArXivPDFHTML
Abstract

Transformers have become the go-to architecture for language and vision tasks, yet their theoretical properties, especially memorization capacity, remain elusive. This paper investigates the memorization abilities of multi-head attention mechanisms, examining how many example sequences they can memorize, as a function of the number of heads and sequence length. Motivated by experimental findings on vision transformers, we introduce novel assumptions about the linear independence of input data, distinct from the commonly used general-position assumption. Under these assumptions, we demonstrate that an attention layer with HHH heads, dimension ddd, and context size n<dn < dn<d, featuring Θ(Hd2)\Theta(Hd^2)Θ(Hd2) parameters, can memorize Ω(Hn)\Omega(Hn)Ω(Hn) examples. Our analysis sheds light on how different attention heads handle various example sequences, aided by the softmax operator's saturation property. We validate our findings through experiments on synthetic data.

View on arXiv
Comments on this paper