Vectors and the dot product

A vector is an arrow and a list of numbers at the same time. The dot product measures how far two of them agree, and it is the operation behind similarity search and attention.

40 min

After this lesson you can

  • Move between the arrow picture and the list-of-numbers picture of a vector
  • Explain linear combinations and span, and recognise when two vectors are dependent
  • Compute , and norms and say what each one measures
  • Derive from the law of cosines
  • Compute projections and cosine similarity, and read them in attention formulas

In this lesson

  1. One object, two pictures
  2. Adding and stretching
  3. Linear combinations and span
  4. How long is a vector? Norms
  5. The dot product, as arithmetic
  6. The dot product, as geometry
  7. In code
  8. Where this goes: attention

This lesson is part of Descent Pro

Descent Pro unlocks every lesson on the route, from base camp to the summit. Every plan starts with a free trial.

Descent Pro

Start your free trial to keep reading

This lesson, and every other lesson on the route, is part of Descent Pro. Every plan starts with a free trial, and students with a .edu email get longer. Cancel before the trial ends and you pay nothing.