Reproduce “Understanding the Expressive Power and Mechanisms of Transformer for Sequence Modeling” on OpenResearch

Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Mingze Wang, Weinan E

A theoretical analysis quantifies the approximation efficiency of Transformer networks for sequence modeling, explaining the specific roles of dot-product attention, positional encoding, and feed-forward networks in processing various long and sparse memory types. The study demonstrates that dot-product attention is crucial for adaptive memories, while log-type relative positional encodings are efficient for heavy-tailed memory kernels, offering a potential explanation for their empirical success.

Key insights

  • Dot-product self-attention is crucial for modeling adaptive memory relationships, where memory positions depend on input tokens, but is not necessary for fixed memory tasks.
  • Deeper Transformer architectures are more efficient for handling nested adaptive memory dependencies, while shallower, wider networks can suffice for non-interactive memory retrieval.
  • Logarithmic relative positional encodings (log-RPE) are theoretically more efficient for modeling heavy-tailed (polynomially decaying) memory kernels, which are problematic for recurrent networks.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.