Definition

Query: what I am looking for. Keys: what I have. Values: what I want to communicate. Compare the query against the keys to get attention weights, then aggregate the values with these weights.

Formula

Scalar attention:

Vector attention (Point Transformer):

Scalar: one weight per pair, all channels weighted the same. Vector: a weight per channel.

  • Without a positional encoding, attention is permutation-invariant and works for a variable number of tokens, which makes it a natural fit for point clouds.
  • In NLP and ViT, tokens carry no position, so a positional encoding is added. Point clouds already have coordinates; the Point Transformer adds a relative encoding .
  • Global attention costs ; the Point Transformer restricts it to kNN neighborhoods.

Appears in