Named Tensor Notation

David Chiang, Alexander M. Rush, Boaz Barak
2/25/2021
cs.LGcs.CL
transformer-attention

Official code: namedtensor/notation (108 stars, TeX, last commit 2022-12-27).

Abstract

We propose a notation for tensors with named axes, which relieves the author, reader, and future implementers of machine learning models from the burden of keeping track of the order of axes and the purpose of each. The notation makes it easy to lift operations on low-order tensors to higher order ones, for example, from images to minibatches of images, or from an attention mechanism to multiple attention heads.

Show full abstract

After a brief overview and formal definition of the notation, we illustrate it through several examples from modern machine learning, from building blocks like attention and convolution to full models like Transformers and LeNet. We then discuss differential calculus in our notation and compare with some alternative notations. Our proposals build on ideas from many previous papers and software libraries. We hope that our notation will encourage more authors to use named tensors, resulting in clearer papers and more precise implementations.

View on arXivView PDF

Code Implementations(1)

1085TeX, HTMLNov 28, 20203 years ago

Similar Papers

Cite this paper

@article{chiang2021named,
  title  = {Named Tensor Notation},
  author = {David Chiang and Alexander M. Rush and Boaz Barak},
  year   = {2021},
  eprint = {2102.13196},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2102.13196}
}

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

Discussion