Language models & chatbots

Vector

A vector is an ordered list of numbers; in AI it is how meaning, images, and other data are represented so computers can compare and calculate with them.

A vector is just numbers in a fixed order. Two numbers can describe a point on a map. Three can describe a point in a room. AI models use vectors with hundreds or thousands of numbers, which you cannot picture but can handle with the same math. Each position in the list captures some feature of the thing being described.

The useful part is that vectors can be compared. You can measure the distance between two of them, or the angle. When an embedding model turns text into vectors, similar meanings point in similar directions. Searching by meaning becomes 'find the vectors closest to this one.'

Vectors are everywhere inside a neural network. Inputs, the signals between layers, and the outputs are all vectors. Weights are organized into grids of vectors called matrices. If you learn one piece of AI math, this is the one to start with.

Example

A GPS location is a two-number vector, latitude and longitude, and two cafes with nearby vectors are physically close; embeddings work the same way for meaning.

Guide: The math of vectors →