On the Anatomy of Attention

Nikhil Khatri, Tuomas Laakkonen, Jonathon Liu, Vincent Wang-Maścianica
7/2/2024
cs.LGmath.CT

No confident code implementation found for this paper. 3 possible matches can be shown below.

Abstract

We introduce a category-theoretic diagrammatic formalism in order to systematically relate and reason about machine learning models. Our diagrams present architectures intuitively but without loss of essential detail, where natural relationships between models are captured by graphical transformations, and important differences and similarities can be identified at a glance. In this paper, we focus on attention mechanisms: translating folklore into mathematical derivations, and constructing a taxonomy of attention variants in the literature. As a first example of an empirical investigation underpinned by our formalism, we identify recurring anatomical components of attention, which we exhaustively recombine to explore a space of variations on the attention mechanism.

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. 3 weaker matches are hidden by default — 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{khatri2024anatomy,
  title  = {On the Anatomy of Attention},
  author = {Nikhil Khatri and Tuomas Laakkonen and Jonathon Liu and Vincent Wang-Maścianica},
  year   = {2024},
  eprint = {2407.02423},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2407.02423v2}
}

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

Discussion