Skip to content

Block 01 / 07

Vector representation

Meaning is represented as geometry in a vector space.

Everything in modern AI starts by turning information into vectors where geometry encodes meaning. A sentence, an image, a product, a user action, a tool call: once it is a point in a space, similarity is a distance, and a relation is often a direction you can add or subtract.

Retrieval-augmented generation, semantic search, clustering, and recommendation are applications of this representation. Errors that look like generation failures are often errors of chunking, indexing, or the similarity metric.

Figure

living thingsvehiclesdrinkscos ≈ 0.91cos ≈ 0.07wolfdogpuppytruckcarbicycleespressocoffeeteaguitardimensions 1–2 of n · 2D projection
Part of the living things cluster, close to dog and puppy.
Dog sits close to puppy and wolf, and the cosine similarity between dog and puppy comes out high. The same point sits far from car, and that similarity score comes out low.
Part of the living things cluster, close to dog and wolf.
Part of the vehicles cluster, close to car and bicycle.
Part of the vehicles cluster, and the far end of the comparison from dog: cosine similarity comes out low.
Part of the vehicles cluster, close to truck and car.
Part of the drinks cluster, close to coffee and tea.
Part of the drinks cluster, close to espresso and tea.
Part of the drinks cluster, close to espresso and coffee.
Guitar belongs to none of the three groups and lands in open space.
Production embedding models place items across hundreds or thousands of dimensions at once; this is a simplified slice, easier to study.

Algorithms

Vectorization is the general act of turning anything into a list of numbers. One-hot encoding is the simplest example: a category becomes a row of zeros with a single one. That row carries no meaning: every category sits the same distance from every other. Embeddings solve that problem. An embedding is vectorization done differently, with numbers that are learned and dense, trained so geometric distance tracks semantic distance. Everything in this block follows from that one property. The three families below are the history of how that property was earned, each an improvement on the last.

Reference

In practice

Once an object is a point in a vector space, similarity is a distance. That fact is the mechanism in each of the following systems.

Laboratory

Semantic search vs keyword, on a corpus you own

Build a search engine over a real corpus (the LUMENIA articles, as they publish, is a fair target). Embed with an open-source model. Index with FAISS, or with numpy if you want the geometry naked. Run the same queries through keyword search. Score both against a labeled set of “this neighbor is correct.”