MLGuerrillaStart M1 →
Embeddings and retrieval·17 min read·Updated 24 September 2026

Text embeddings

These models turn a piece of text into one vector, so that two texts about the same thing end up close together. They are what makes search by meaning work, and they sit under every RAG system.

An embedding model takes a piece of text and returns one vector, which is a list of a few hundred numbers. The useful part is what happens to two of those vectors. Text about the same subject lands in the same region, so measuring the angle between two vectors tells you how close the two pieces of text are in meaning.

That one property is what search by meaning is built on. You embed every document you have once and keep the vectors. When a question arrives you embed it too, compare it against everything you stored, and return the closest passages. Nothing has to match word for word, so "how do I train a classifier on my own labelled examples" can find a paragraph that never uses any of those words.

What it is

Every passage becomes a vector once, and a query becomes one more

The two halves of the work happen at different times. Embedding your documents is a batch job you run once and repeat only when the content changes. Embedding the query happens on every search, and it is one model call over a short piece of text.

Comparing is the cheap part. Both vectors get scaled to length 1, and the comparison is a dot product, which for unit-length vectors is the cosine of the angle between them. A modern vector database does that against millions of stored vectors in milliseconds, using an index that skips most of the comparisons.

A figure titled "Every passage becomes a vector once, and a query becomes one more", built from 287 passages from the 13 articles on this site, embedded with bge-small-en-v1.5 and searched with one real question. The top card, labeled BUILT ONCE, shows three boxes joined by arrows: 287 passages from 13 articles and 16,831 words of this site, then bge-small-en-v1.5 at 33M parameters taking 14 ms per passage, then 287 vectors of 384 numbers each, stored and reused. Below it, labeled ASKED EVERY TIME, is the query "how do I train a classifier on my own labelled examples", with an arrow to a note saying one more vector, then 287 dot products. The second card lists the three nearest passages. The first scores 0.762 and comes from /models/yolo, reading "To detect your own classes, like hard hats or a particular product, you fine-tune on labeled ima...". The second scores 0.746, comes from /models/bert, reads "You load the pretrained encoder, attach a fresh output layer with one slot per label, and train ...", and is marked "answers it". The third scores 0.727, also from /models/bert, and is also marked "answers it". A note says the top hit is a YOLO passage about fine-tuning on labelled images, which is close but the wrong page. The caption reads: nothing here was trained on this site, and the vectors put the question near an answer it has never seen.
The query and the passage that answers it share almost no words. What they share is the subject, which is the only thing the vector encodes.

Look at what the top hit is. The model put a YOLO passage about fine-tuning on labelled images above the BERT passage that answers the question, because both are about training on your own labels and the model has no way to know which kind of labels were meant. That near miss is the normal failure of this stage, and the rerankers article measures how much of it a second stage recovers.

Keep reading

The rest of this article is free with an account

Create a free account to read the remaining 6 sections. It takes about twenty seconds and there's nothing to pay. The same account opens the slide decks and CV reviews.

  1. 02Where embeddings show up
  2. 03How the model produces one vector, and what the number of dimensions costs
  3. 04The models you'll see, as of September 2026
  4. 05Which model to pick, and when an embedding is the wrong tool
  5. 06How to try it
  6. and 1 more