AI Glossary / Mathematics and optimization / Beginner

Vector

Definition

A vector is an element of a vector space. In everyday machine-learning work, it is commonly represented as an ordered collection of numbers, with each position called a component or coordinate. A vector might hold measured features, learned embedding values, model weights, or predictions. Its dimension is the number of coordinates in the chosen finite-dimensional representation.

What it means

The ordering is part of the meaning. A three-number record containing quantity, price, and delivery delay is different from the same numbers assigned to different positions. The system needs to know what each coordinate represents and how it was prepared.
Some vectors have directly named features, while learned embeddings often use coordinates without simple human-readable labels. Both are numerical representations, but their interpretation differs.
Vectors are more general than lists in mathematics: functions and other objects can form vector spaces too. The finite numerical case is the main focus here because it underlies many AI data structures and calculations. A software list alone does not establish useful vector semantics or compatible arithmetic.

How it works

Vectors in the same numerical space can be added coordinate by coordinate and multiplied by a scalar. For x=[x1,x2] and y=[y1,y2], their sum is [x1+y1,x2+y2], while c times x is [cx1,cx2].
A dot product multiplies matching coordinates and adds the results. It can express a weighted score when one vector holds features and the other holds compatible weights. A norm measures vector size, and a distance compares vectors using a defined rule.
These operations require consistent dimensions, coordinate order, and interpretation. Equal length alone is insufficient: two independently learned embedding spaces can have the same number of dimensions while using incompatible coordinate systems.

Three practical examples

  • A forecasting model can receive a feature vector containing recent demand, a calendar indicator, and a measured price after appropriate preparation.
  • A text-search system can compare compatible embedding vectors to estimate similarity between a query and documents.
  • A linear model can store its coefficients as a weight vector and combine them with an input vector through a dot product plus a separate bias.

Think of it this way

Think of a labeled row on a form, where each box has a fixed meaning and the filled-in numbers describe one example. The labels tell you how to interpret the positions. The analogy works for explicit features, but learned embeddings may lack readable box labels, and vector mathematics also includes objects that are not literal form rows.

Worked example

Suppose a simplified model uses three prepared features in the order [quantity, delay, priority indicator]. An example has x=[2,10,1], and the corresponding weights are w=[0.5,−0.1,3]. With no bias term, the score is w·x = 0.5×2 − 0.1×10 + 3×1 = 3.
A second example z=[4,5,0] receives score 0.5×4 − 0.1×5 + 3×0 = 1.5. These are illustrative numerical scores, not probabilities or a recommended operational rule.
Now suppose an export changes the feature order to [quantity, priority indicator, delay]. The first example becomes [2,1,10]. The weights must also become [0.5,3,−0.1], preserving score 1+3−1=3.
If the original weights are applied to the reordered vector, the score becomes 1−0.1+30=30.9. Dimensions still match, so ordinary arithmetic will not reveal the semantic error.
The example shows why a vector needs a schema, not just a length. The same caution applies to units: changing delay from days to hours without a corresponding model or preprocessing adjustment changes the represented input.

Illustrative case study

In a fictional recommendation project, two services exchange 64-dimensional user and item embeddings. An update deploys new user vectors while retaining item vectors from an unrelated model fit. Every dot product is computable, but rankings become unreliable.
The team records model-version compatibility with the vector schema and deploys matching representations together. It tests known user-item pairs before evaluating overall recommendation quality.
The lesson is that matching dimensions are necessary but do not establish a shared meaning. The fictional example does not claim that every model update requires identical coordinates; a justified alignment or compatible training design could provide another solution.

Common misconceptions and mistakes

Do not confuse dimension with magnitude. A vector with three components can have any nonnegative length under a chosen norm. Adding more dimensions does not automatically make a representation more useful.
Do not treat every numerical category code as a meaningful quantity. Assigning categories numbers 1, 2, and 3 does not establish that category 3 is three times category 1.
Do not assume the dot product always measures semantic similarity. It depends on representation, scaling, and the intended scoring rule.
Finally, row and column notation affects matrix multiplication. A column vector and its transpose contain the same ordered components but occupy different matrix shapes in a formula.

Business use

Vectors make data manageable for models, but the operational contract should include more than the numbers. Document dimension, coordinate meaning where available, units, normalization, missing-value treatment, and model version.
When comparing representations, evaluate the task rather than relying on dimension counts or visually appealing plots. A compact vector can omit useful distinctions, while a larger one can add cost without improving decisions. Choose the representation according to the information and computations the application actually needs.

People also ask

Is a vector always an arrow?

No. An arrow is a useful geometric picture, while feature and embedding vectors often represent other kinds of information.

Are all vector coordinates interpretable?

No. Explicit features may have names, but learned coordinates often encode distributed patterns.

Can I compare any two vectors of the same length?

Arithmetic may be possible, but a meaningful comparison requires compatible coordinate systems and an appropriate measure.

Check your understanding

Add x=[1,−2,3] and y=[4,2,−1], then multiply x by 2. What are the results?

Answer: Coordinate-wise addition gives [5,0,2], and scalar multiplication gives [2,−4,6]. Both results remain three-dimensional vectors.

Related terms

  • Feature vector
  • Embedding
  • Scalar
  • Matrix
  • Dot product
  • Norm
  • Normalization
  • Basis
  • Vector space
  • dimension
  • coordinate

Learn next

Build a small labeled feature vector and record its units and ordering. Verify a weighted score by hand, then deliberately reorder the features and repair the weights. Next, study dot products, norms, and embeddings while keeping numerical compatibility separate from semantic compatibility.

  • Feature vector

More in Mathematics and optimization

  • Absolute error loss - Absolute error loss measures a numerical prediction's error as the absolute difference between its predicted and reference values: L(y,y-hat)=|y-y-hat|.
  • Active-set method - An active-set method is an optimization approach that works with a changing subset of constraints believed to be tight at the solution.
  • Adjoint state method - The adjoint state method computes how a chosen objective changes when the parameters of a mathematical model change.
  • Σ-algebra
  • Algebraic connectivity - Algebraic connectivity is the second-smallest eigenvalue of a graph's Laplacian matrix.
  • Algorithm IMED - Algorithm IMED, short for Indexed Minimum Empirical Divergence, is a method for choosing actions in a stochastic multi-armed bandit problem.

Sources

Aalto Dictionary of Machine Learning, vector and vector space entries: mathematical scope and finite numerical representation. https://aaltodictionaryofml.github.io/ADictML_Main.pdf Jurafsky and Martin, Speech and Language Processing, Embeddings: vector representations, dot products, and similarity. https://web.stanford.edu/~jurafsky/slp3/5.pdf

Previous: Vecchia approximation Next: Vector Autoregression

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer