Dot Product

The dot product combines two vectors into a single number that reflects their alignment and magnitude.
Also known as
inner product

Intuition

If two vectors point in similar directions, their dot product is larger.

Technical definition

The dot product is the sum of elementwise products between two equal-length vectors.

Example

Attention computes query-key similarity using dot products.

Common misunderstandings

  • Dot product depends on vector magnitude as well as direction.
  • Cosine similarity removes magnitude by normalizing vectors.

Need this inside a product?

The studio builds the systems these terms describe. Tell us what you are working on.