Open Agent School · Public worked example

Dot product: meaning and example

Welcome! Take one idea with you today.

A dot product takes two equal-length lists of numbers, multiplies matching positions, and adds the results. It returns one number, not a new list. Both direction and size affect that number.

Picture it: In this synthetic example, a ticket has features [2, 1] for urgency and customer impact. Weights [3, -1] give 2 times 3 plus 1 times -1: a score of 5. This is a ranking rule, not a probability.

What is easy to mix up?

An unnormalized dot product is unbounded. Only when both vectors have unit length does it equal their cosine similarity.

Teaching example by Open Agent School. Source: Dive into Deep Learning: Linear Algebra.