Rows. Dimensions. Vectors.
Each token gets a row of numbers. That row is its vector. How many numbers it holds is the dimension.
One value = one dimension
Describe a person with four measurements:
[175, 30, 70, 9] has four values → a 4-dimensional vector. A token vector works the same way, but its values are learned, not measured.A spreadsheet with one row per token
Tiny vocabulary: 3 tokens × 4 dimensions. Illustrative values.
| Token (row) | Dim 1 | Dim 2 | Dim 3 | Dim 4 |
|---|---|---|---|---|
| cat | 0.2 | 0.7 | −0.1 | 0.4 |
| dog | 0.3 | 0.6 | −0.2 | 0.5 |
| car | −0.5 | 0.1 | 0.8 | −0.3 |
cat row is one vector: [0.2, 0.7, −0.1, 0.4].From text to Transformer input
Change the dimension size D and watch the vectors and the matrix shape change.
Your question
The cat sleeps
Tokenizer
Converts text into tokens and token IDs
[ID₁, ID₂, ID₃]
IDs are shown symbolically — they are only row numbers.
Embedding layer
Each token ID selects its row from the learned embedding matrix.
Each vector has 4 values = 4 dimensions. Values are illustrative.
Input representations
Vectors are stacked in sequence order. Positional information is added by the model's architecture.
3 token positions × D dimensions
Transformer
Attention and neural-network layers process the vectors.
- Tokenizer: text → token IDs.
- Embedding layer: token IDs → vectors.
- Transformer: processes those vectors using context.
Vocabulary size ≠ dimension
One row per token the model knows.
Numbers in each token's vector.
Token ID = row index · dimension = one value · vector = all the values together.
Illustrative numbers, real concept.