On the Anatomy of Attention
<|reference_start|>On the Anatomy of Attention: 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.<|reference_end|>
@article{khatri2024on,
    title={On the Anatomy of Attention},
    author={Nikhil Khatri and Tuomas Laakkonen and Jonathon Liu and Vincent
  Wang-Ma'scianica},
    journal={arXiv preprint arXiv:2407.02423},
    year={2024},
    archivePrefix={arXiv},
    eprint={2407.02423},
    primaryClass={cs.LG math.CT}
}