An arrow and a list
You text a friend directions to a coffee shop: from the station, go 3 blocks east and 2 blocks north. That is one instruction, and it is made of exactly two numbers โ yet it already carries a direction (roughly northeast) and a distance (a little more than three blocks). Those two numbers are an arrow.
That double life โ a short list of numbers that is also an arrow โ is the single most-used object on this entire site. So we are going to start here, from zero. Part I is six short chapters, each one small honest idea at a time; by Part II these same arrows will literally carry the meaning of words that a language model reads.
The object has a name. A vector is a list of numbers that we treat as one single thing โ and, equivalently, an arrow with a direction and a length. Both views are always available at once, and we will swap between them constantly. Let's meet it properly.
What a vector is
Before any symbols, look at the picture. Here is a flat 2D plane โ mathematicians call this plane $\mathbb{R}^2$, which you can just read as "the 2D plane," and that is all the fancy notation we need for now. On it, one arrow starts at the corner (the origin) and reaches out to the point 3-across and 2-up.
Now the notation, which we will keep for the whole site. We write a vector as a bold lowercase letter, $\mathbf{v}$, read aloud as "the vector v." We write its two numbers stacked in a column:
$$\mathbf{v} = \begin{bmatrix} 3 \\ 2 \end{bmatrix}$$In words: the vector v is the pair of numbers 3 and 2 โ the first is how far to go across, the second is how far to go up.
The individual numbers are the vector's components, and we pick them out with subscripts: $v_1 = 3$ is the across-part and $v_2 = 2$ is the up-part, read aloud as "v-one, v-two." That is the whole grammar of a vector โ a name in bold, and its components numbered underneath.
Worked example
Turn the list back into the arrow by hand. Start at the origin. Walk 3 steps to the right โ you are now above the "3" on the across-axis. From there, walk 2 steps straight up. Draw an arrow from where you started to where you are standing. That arrow is $\mathbf{v}$. Given the list you just drew the arrow; given the arrow you could read the list straight back off the grid. They are the same object wearing two costumes.
Notice that both a direction and a length are already baked in. By eye, this arrow is a little longer than 3 units and points east-north-east. We will compute lengths exactly in the next chapter, where length pairs naturally with a new operation โ so resist reaching for Pythagoras here; it belongs there, not yet.
Adding arrows
Once you can draw one arrow, the natural question is what happens when you do two trips in a row. Picture it first: walk $\mathbf{v} = [3, 2]$ (the mint arrow), and then, from wherever you stopped, walk a second vector $\mathbf{u} = [1, 3]$ (the amber arrow). Where do you end up? 4 across and 5 up. That single combined trip โ origin straight to the finish โ is the sum, drawn in violet.
The arithmetic is exactly as gentle as the picture. To add two vectors, you add the matching components: acrosses with acrosses, ups with ups.
$$\mathbf{v} + \mathbf{u} = \begin{bmatrix} 3 \\ 2 \end{bmatrix} + \begin{bmatrix} 1 \\ 3 \end{bmatrix} = \begin{bmatrix} 3 + 1 \\ 2 + 3 \end{bmatrix} = \begin{bmatrix} 4 \\ 5 \end{bmatrix}$$In words: add the two first-components to get the new first component (3 plus 1 is 4), and add the two second-components to get the new second component (2 plus 3 is 5). Nothing mixes across the slots.
Worked example
Check it against the figure by counting grid squares. The mint arrow moves 3 right and 2 up; the amber arrow, starting from the mint tip, moves 1 more right and 3 more up. Total: $3 + 1 = 4$ squares right, $2 + 3 = 5$ squares up โ landing exactly where the violet arrow points. The picture and the arithmetic always agree. That quiet agreement is the recurring miracle of this whole subject.
One more thing worth noticing: the order does not matter. Walk u first and then v, and you land at the very same corner โ the two routes trace the two sides of the same parallelogram. Addition is symmetric like that, all the way through.
Stretching and flipping
The other basic move is to multiply a vector by an ordinary number, which stretches or shrinks it. When you do, every component gets multiplied. Double our vector and it becomes twice as long in the same direction; halve it and it becomes half as long, still in the same direction.
$$2\mathbf{v} = \begin{bmatrix} 2 \times 3 \\ 2 \times 2 \end{bmatrix} = \begin{bmatrix} 6 \\ 4 \end{bmatrix}$$In words: to double a vector, double each of its numbers โ 3 becomes 6 and 2 becomes 4. Similarly $0.5\,\mathbf{v} = [1.5, 1]$: half of each number.
Here is the key observation, worth its own sentence: scaling by a positive number never changes the direction โ it only changes the length. Direction and length are separately controllable knobs. That separation is exactly why "direction" can someday carry information on its own, independent of how long an arrow happens to be.
And a negative number? Then the arrow flips: $-\mathbf{v} = [-3, -2]$ points in exactly the opposite direction, same slope, other way. A single minus sign reverses the whole trip. Hold that thought โ in the next chapter, "opposite" becomes a measurable kind of disagreement between two arrows.
A quick piece of vocabulary. The plain number you multiply by โ the 2, or the 0.5, or the −1 โ is called a scalar in this setting: literally, the thing that scales. We write scalars as plain italic lowercase letters, to keep them visually distinct from the bold vectors they act on.
See it move
Two ideas are much easier to feel in motion than to read: that the dashed component lines are the list of numbers, and that scaling slides the tip along a fixed direction line without ever rotating it. The short video makes both happen in front of you.
Now take the controls yourself. The playground below lets you drag an arrow's tip and watch its list of numbers update in real time, switch to tip-to-tail addition, and slide a scalar up and down โ including through zero into negative territory.
From two numbers to thousands
Everything so far lived on a flat page. But nothing about the arithmetic was tied to two numbers. A 3D vector is a list of three numbers โ [3, 2, 5] โ an arrow in a room instead of on a page. You can still just about picture it: two of the numbers place you on the floor, the third lifts you off it.
Now the honest leap. A vector with $d$ numbers is an arrow in a $d$-dimensional space that nobody can picture โ and here is the liberating secret: you don't need to. Addition is still "add matching slots." Scaling is still "multiply every slot." The arithmetic never gets harder as the list grows; it only gets longer. We write $d$ for the number of dimensions โ read "d, the number of dimensions" โ and real language models use vectors with $d$ in the thousands. Throughout this site we will draw the 2D shadow of an idea and trust the arithmetic to carry it up the ladder. (2D teaching examples first, always โ that is a rule of the house.)
Why the LLM cares
This is why we bothered. Inside a language model, every token โ every chunk of text it reads โ is stored as a vector, typically one with thousands of components. When you hear that a model has "embeddings," those embeddings are exactly these arrows: long lists of numbers, each one pointing somewhere in a space too big to draw.
Here is the payoff we are working toward, previewed but not yet earned: the direction a token's arrow points will encode its meaning. The arrows for "cat" and "dog" will end up pointing nearly the same way, while "cat" and "bicycle" point off in unrelated directions. We build that result carefully in Chapter 8, Meaning as Direction; everything between here and there is learning to compute with these arrows.
And you have already met, in miniature, the operations that run billions of times per sentence. Adding vectors โ the tip-to-tail walk from a moment ago โ is literally how a transformer merges information from different words. Scaling is how it turns each influence up or down. The machinery is enormous; the moves are the two you just learned by dragging an arrow around a grid.
What you now know
- A vector is a list of numbers and an arrow at the same time โ the list tells you how far to go along each direction, and either view can be recovered from the other.
- We write vectors as bold lowercase letters like $\mathbf{v}$, with components $v_1$ and $v_2$ picked out by subscripts.
- To add vectors, add matching components โ on the page, that is walking one trip and then the other, tip-to-tail.
- Multiplying a vector by a plain number (a scalar) stretches or shrinks it; a positive scalar never changes its direction, and a negative one flips it exactly backwards.
- A $d$-dimensional vector is just a longer list; the pictures stop at three dimensions but the arithmetic stays identical, which is why we can trust 2D drawings to teach us about thousand-dimensional spaces.
Where we're headed. We can now write arrows down, add them, and stretch them โ but we can't yet compare them. Look at two arrows: do they point roughly the same way, in unrelated directions, or exactly opposite? Your eye answers instantly. Next chapter we build the single most important operation on this site โ the dot product โ which turns that visual judgment into one number a machine can compute. It is, quietly, the operation an LLM performs more than any other.