What Are Vectors?
Every piece of data that flows through an AI system is a vector. Before a neural network can process an image, a sentence, or a spreadsheet row, that data must be converted into an ordered list of numbers. Understanding vectors is the first step to understanding how AI actually works.
Vectors: Ordered Lists of Numbers
A vector is simply an ordered list of numbers. Each number in the list is called a component or element.
v = [3, 7, 2]
This vector has three components: 3, 7, and 2. The order matters. The vector [3, 7, 2] is different from [7, 3, 2].
Vectors are typically written in square brackets or as a column:
Row form: v = [3, 7, 2]
Column form: v = | 3 |
| 7 |
| 2 |
The number of components determines the vector's dimension. A vector with 3 components lives in 3-dimensional space. A vector with 768 components lives in 768-dimensional space. AI routinely works in spaces with hundreds or thousands of dimensions.
Geometric Intuition: Arrows in Space
Geometrically, a vector is an arrow with two properties:
- Magnitude (length): how long the arrow is
- Direction: where the arrow points
In 2D, the vector [3, 4] means "go 3 units right and 4 units up." You can think of it as an arrow from the origin (0, 0) to the point (3, 4).
4 | * (3, 4)
| /
| /
| /
| /
0 +--------
0 3
The same arrow can also represent a point in space. This dual interpretation is important: in AI, we use vectors as both arrows (directions and distances) and points (data locations).
Vector Spaces and Dimensions
A vector space is the set of all possible vectors with a given number of dimensions, along with rules for adding and scaling them.
| Dimensions | Example Space | What Lives Here |
|---|---|---|
| 1D | A number line | Temperatures, prices |
| 2D | A flat plane | Map coordinates, (x, y) plots |
| 3D | Physical space | RGB colors, 3-feature datasets |
| 768D | Embedding space | BERT word embeddings |
| 12,288D | Embedding space | GPT-4 token embeddings |
You cannot visualize 768 dimensions, but the math works exactly the same way as in 2D or 3D. Every rule you learn about vectors in 2D generalizes perfectly to any number of dimensions.
How Data Becomes Vectors
In AI, data must be encoded as vectors before processing. Each dimension represents a feature of the data.
Example: Houses as Vectors
Suppose you want an AI to predict house prices. Each house becomes a vector of its features:
| House | Bedrooms | Sq Ft | Age (years) | Vector |
|---|---|---|---|---|
| House A | 3 | 1500 | 10 | [3, 1500, 10] |
| House B | 4 | 2200 | 5 | [4, 2200, 5] |
| House C | 2 | 900 | 25 | [2, 900, 25] |
Each house is now a point in 3-dimensional "house space." Similar houses end up near each other in this space, which is exactly what AI exploits to make predictions.
Example: RGB Colors as 3D Vectors
Every color on your screen is a vector with three components:
Red: [255, 0, 0]
Green: [0, 255, 0]
Blue: [0, 0, 255]
White: [255, 255, 255]
Black: [0, 0, 0]
Purple: [128, 0, 128]
Each component ranges from 0 to 255, representing the intensity of red, green, and blue light. Colors that look similar (like orange and red) have vectors that are close together in this 3D color space.
Vectors Are the Language of AI
AI models cannot work with raw text, images, or audio. Everything must become a vector first.
| Data Type | How It Becomes a Vector |
|---|---|
| Text | Each word or token maps to a vector of 100-12,000+ numbers |
| Image | Each pixel has RGB values; a 256x256 image becomes a vector of 196,608 numbers |
| Audio | Sound waves are sampled into sequences of amplitude values |
| Tabular data | Each row's features become vector components |
| User behavior | Actions and preferences encoded as numeric features |
This process of converting data into vectors is called encoding or embedding. The quality of these vector representations directly determines how well an AI model performs.
Why Vectors Matter for AI
Vectors give AI three critical capabilities:
- Comparison: Measure how similar two data points are by comparing their vectors
- Computation: Apply mathematical operations uniformly across any data type
- Compression: Capture complex data (a 50,000-word document) in a fixed-size vector
When you hear terms like "embedding," "feature vector," "latent space," or "representation," they all refer to vectors. The entire field of AI is built on converting messy, real-world data into clean numerical vectors and then doing math on them.
Summary
- A vector is an ordered list of numbers, where each number is a component
- Vectors have both a geometric interpretation (arrows with magnitude and direction) and a data interpretation (points in space)
- The number of components defines the vector's dimension
- In AI, data is converted into vectors so that models can process it mathematically
- Features of data become dimensions of a vector (bedrooms, square footage, age)
- RGB colors, house data, text, images, and audio all become vectors before AI can use them
- Every AI system, from neural networks to search engines, operates on vectors
Now that you know what vectors are, the next lesson covers what you can do with them: addition, scaling, and measuring their size through vector operations.

