x∈Rn\mathbf{x} \in \mathbb{R}^{n}

Vector — a list of numbers

An ordered list of numbers, with one axis. One index picks out one entry. Each token becomes a vector before the model can compute with it.

A vector has one axis, and its length is how many numbers it holds. x∈R4\mathbf{x} \in \mathbb{R}^{4} is a vector of 4 numbers, and x2x_2 is its second entry.

The course writes vectors in bold and, following most transformer code, as rows: a token vector sits on the left of a matrix, as in xW\mathbf{x} W. Geometrically a vector is an arrow from the origin, which is what gives it a length and a direction (section 1.5).

In PyTorch a vector of 4 numbers has shape (4,).

Example

x=[0.2, −1.7, 3.0, 0.5]  ⟹  x3=3.0\mathbf{x} = [0.2,\, -1.7,\, 3.0,\, 0.5] \;\Longrightarrow\; x_3 = 3.0

One axis of length 4. The third entry is 3.0.

Where the course uses it

Related terms