# What Is an Embedding? Two Models Rated “Boris Paid Anna” Closer Than the Right Answer

> An embedding turns text into a list of numbers so that texts with similar meaning get similar numbers. I tested two open embedding models on my laptop with 55 pairs of sentences. Both knew what a sentence was about. Neither reliably knew what it said.

By Vladimir Beskorovainyi · Published 28 November 2026 · 9 min read

Canonical address: https://besk.tech/articles/what-is-an-embedding

---

An embedding is a list of numbers that a model makes from a piece of text, so that texts with similar meaning get similar numbers. It is how a search engine finds a document that answers your question in different words, and how a RAG system decides what to put in front of a language model. I tested two open embedding models on my laptop with 55 pairs of sentences. Both of them scored a sentence with the roles swapped, such as "Boris paid Anna 100 dollars" for "Anna paid Boris 100 dollars", as closer to the original than a correct paraphrase. That happened in all 10 sentences I tried, in English and in Russian.

## What an embedding is

Take the sentence "The payment went through." An embedding model turns it into 768 numbers. The first eight, from the model I used, are:

-0.2049, 0.0160, 0.0154, 0.0234, 0.0126, 0.0933, -0.0754, -0.0305

No single number means anything on its own. What matters is where the whole list points. The model was trained so that sentences with similar meaning point in similar directions, and unrelated sentences point in different ones. A list of numbers like this is also called a vector, which is why the databases that store them are called vector databases.

The idea is older than chatbots. In 2013 word2vec learned one vector per word from large amounts of text, so that words used in similar contexts got similar vectors. Language models still start the same way: their first layer, the embedding layer, turns each token of your text into a vector before any other computation happens. I described tokens in [an earlier test](https://besk.tech/articles/what-is-a-token-in-ai). An embedding model goes one step further and turns a whole sentence or document into one vector.

The same idea works beyond text. Images, audio and code can all be turned into vectors. On November 17, 2026 Google described EmbeddingGemma 2 and its technical report: an open model that puts text, images, audio and video into one shared space of 768-number vectors, so that a photo of a dog and the words "a dog" land near each other.

## How similarity is measured

Two embeddings are compared with cosine similarity. It gives one number: close to 1 when the two vectors point the same way, close to 0 when they have nothing in common. In my test, unrelated pairs, such as a payment and a cat sleeping on a windowsill, averaged between 0.13 and 0.25. Pairs on the same subject averaged between 0.84 and 0.98.

This is what makes search by meaning work. You turn every document into an embedding once. When a question arrives, you turn it into an embedding too, and return the documents with the highest similarity. No keyword has to match.

## What I tested

I ran two open models on my MacBook Air (Apple M4, 24 GB of memory) through Ollama 0.40.4: EmbeddingGemma, the first version of Google's model, and Qwen3-Embedding 0.6B. I wrote the method and all the sentences before the first run. The comparison ran once; the speed test ran three times, and I report the median.

There were five base sentences in English and the same five in Russian, about a payment, a bank loan, a delivery, a leave request and a court ruling. The first one was "Anna paid Boris 100 dollars for the repair on Monday." Each base sentence got four partners:

1. **A paraphrase:** the same fact in other words. "On Monday Boris received 100 dollars from Anna for fixing it."
2. **A negation:** one "not" that reverses the meaning. "Anna did not pay Boris 100 dollars for the repair on Monday."
3. **A different number:** "Anna paid Boris 900 dollars for the repair on Monday."
4. **Swapped roles:** "Boris paid Anna 100 dollars for the repair on Monday."

That makes 40 pairs. I added 10 pairs of unrelated sentences and 5 pairs of an English sentence with its Russian translation: 55 in total.

The paraphrase is the only partner that says the same thing. The other three are traps. They look almost the same and mean something else. A model that understands the sentence should score the paraphrase highest. I counted how often a trap beat the paraphrase, across 5 sentences, 3 traps and 2 languages: 30 comparisons per model.

## Embeddings know the topic, not the fact

| | EmbeddingGemma | Qwen3-Embedding 0.6B |
|---|---|---|
| Vector length | 768 | 1,024 |
| A trap scored above the paraphrase | 20 of 30 | 25 of 30 |
| Swapped roles beat the paraphrase | 10 of 10 | 10 of 10 |
| A different number beat the paraphrase | 5 of 10 | 10 of 10 |
| A negation beat the paraphrase | 5 of 10 | 5 of 10 |
| Unrelated pairs, average similarity, EN / RU | 0.19 / 0.18 | 0.25 / 0.13 |

Here is the first sentence with EmbeddingGemma in English:

- the paraphrase: 0.890;
- "Anna did not pay Boris": 0.875;
- "Anna paid Boris 900 dollars": 0.893;
- "Boris paid Anna": 0.987.

The sentence that reverses who paid whom came out almost identical to the original. The correct paraphrase tied with a sentence where the amount is nine times larger: 0.890 against 0.893 is no real difference.

My reading of why: swapping two names keeps every word and changes only their order, and an embedding is a summary of the whole sentence, not a record of who did what. A changed number is a single word in a sentence of about a dozen. A paraphrase uses different words, and the model has to recognise the meaning through them. Both models do recognise it: they put the paraphrase far above anything unrelated. They just put the near-copies even higher.

So an embedding is a good measure of what a text is about and a weak measure of what it claims. For search that is usually fine: a question about Anna's payment should find documents about Anna's payment. For anything that depends on the exact fact, it is not enough on its own.

## Two more things the test showed

**One sentence in two languages is close.** EmbeddingGemma gave an English sentence and its Russian translation an average similarity of 0.86, almost as high as a Russian paraphrase (0.89). Qwen3-Embedding gave 0.75. A multilingual model can find a Russian document for an English question.

**A shorter vector lost very little.** Both models are trained so that the start of the vector carries most of the meaning; EmbeddingGemma's model card lists 512, 256 and 128 numbers as supported sizes alongside the full 768. I cut the vectors to the first 512, 256 and 128 numbers and repeated the comparison. Not one of the 30 outcomes changed for either model. At 128 numbers EmbeddingGemma's similarities moved by 0.044 on average. A vector of 128 numbers takes a sixth of the space of 768, which matters when there are millions of documents.

Speed on the laptop: EmbeddingGemma turned 1,000 short sentences into embeddings in 13.3 seconds, 75 per second, using 685 MB of memory. Qwen3-Embedding took 34.2 seconds, 29 per second, with 2.4 GB. Its three runs ranged from 28 to 39 seconds because the machine was not idle, so take that number as approximate.

## How I would choose an embedding model

Leaderboards rank models by averages over dozens of tasks. That average says little about whether a model can tell your two closest documents apart. On my pairs the faster and smaller model made fewer trap errors than the larger one. Before I picked a model for real work, I would write twenty pairs from my own documents that differ by one fact, run every candidate on them, and count how often the wrong one wins. It takes about an hour, and for my use it told me more than the rank.

## What this means in production

I build and run a system that turns plain-language questions into SQL across more than 500 data marts. A description of that many tables does not fit into a model's context window, so every question first goes through retrieval: embeddings pick the tables that look relevant, and only those reach the model. Without that step the query cannot run at all.

In my open benchmark on BIRD, 1,534 questions with narrow schemas that fit entirely in the window, I tested the same step ([arXiv:2606.29733](https://arxiv.org/abs/2606.29733), [code](https://github.com/beskvladimir-create/nl2sql-onprem-bench)). The embedding retriever used all-MiniLM-L6-v2 and picked the top six tables by cosine similarity. It found 96.53% of the tables each query needed, against 93.95% for a simple keyword method. That did not buy accuracy. On Qwen2.5-Coder-32B it won 33 questions and lost 39 against giving the model the full schema. The net difference was -0.39 points, indistinguishable from zero. On a smaller model, CodeLlama-7B, embedding linking was 2.80 points worse than the keyword method, and that difference held up after correction for multiple tests.

The laptop test points the same way. An embedding finds what looks related, and what looks related is not always what the query needs. Recall, the share of needed tables found, says nothing about the queries broken by the one table that was left out. That is the number to watch. I wrote more about this in [What Is RAG?](https://besk.tech/articles/what-is-rag)

## What to take from this

1. **An embedding measures the topic, not the fact.** Use it to find candidates, then check the fact with something that reads the text, such as a language model or an exact filter.
2. **Test with near-misses, not only with unrelated text.** Any model separates a court ruling from a cat. The useful test is a pair that differs by one word.
3. **Judge retrieval by what it breaks.** A high share of found documents can hide the queries ruined by the one it missed.
4. **Try a shorter vector before buying storage.** On my pairs, 128 numbers out of 768 changed no outcome.

## What this does not show

This is 55 pairs on one laptop, an illustration and not a ranking of models. The result depends on how far a paraphrase moves from the original words: the negation trap won mostly on the leave request and the court ruling, where the paraphrase was rewritten most heavily. I passed the sentences as they are, without the task prefixes both models accept for search, so scores in a real search setup may differ. EmbeddingGemma in Ollama is the first version, not EmbeddingGemma 2. The production system is described from my own experience; its data are closed.


## Sources

- [EmbeddingGemma 2 technical report, Google](https://blog.google/innovation-and-ai/technology/developers-tools/embeddinggemma-2-technical-report/)
- [EmbeddingGemma 2: Unified and Efficient Multimodal Representations, arXiv:2610.37364](https://arxiv.org/abs/2610.37364)
- [Ollama API reference](https://github.com/ollama/ollama/blob/main/docs/api.md)
- [How far do on-premises open LLMs get on Text-to-SQL? A cross-family size and technique frontier on BIRD, arXiv:2606.29733](https://arxiv.org/abs/2606.29733)
- [nl2sql-onprem-bench, GitHub](https://github.com/beskvladimir-create/nl2sql-onprem-bench)
- [What Is RAG? A 1,534-Question Test Where Retrieval Only Took Things Away, BESK TECH](https://besk.tech/articles/what-is-rag)
- [What Is a Token in AI? I Ran the Same 71 Tasks on Three Models, BESK TECH](https://besk.tech/articles/what-is-a-token-in-ai)

---

Vladimir Beskorovainyi is an enterprise AI architect with 17 years in AI and BI, and the author of Enterprise AI: The KATA Way. He writes about applied and on-prem AI.
