Self-attention as an attractor network: transient memories without backpropagation

Francesco D'Amico, Matteo Negri
9/24/2024
cs.LGcond-mat.dis-nn

No confident code implementation found for this paper.

Abstract

Transformers are one of the most successful architectures of modern neural networks. At their core there is the so-called attention mechanism, which recently interested the physics community as it can be written as the derivative of an energy function in certain cases: while it is possible to write the cross-attention layer as a modern Hopfield network, the same is not possible for the self-attention, which is used in the GPT architectures and other autoregressive models. In this work we show that it is possible to obtain the self-attention layer as the derivative of local energy terms, which resemble a pseudo-likelihood. We leverage the analogy with pseudo-likelihood to design a recurrent model that can be trained without backpropagation: the dynamics shows transient states that are strongly correlated with both train and test examples. Overall we present a novel framework to interpret self-attention as an attractor network, potentially paving the way for new theoretical approaches inspired from physics to understand transformers.

View on arXivView PDF

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{damico2024selfattention,
  title  = {Self-attention as an attractor network: transient memories without backpropagation},
  author = {Francesco D'Amico and Matteo Negri},
  year   = {2024},
  eprint = {2409.16112},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2409.16112v1}
}

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

Discussion