What Are Embeddings? Explained Simply, Tested on 5 Local Models (2026)

What Are Embeddings? Explained Simply, Tested on 5 Local Models (2026)

Embeddings are lists of numbers that describe what a piece of text means. An embedding model reads a sentence such as “When will my parcel arrive?” and returns, say, 1,024 decimal numbers. The key property: sentences with similar meaning get similar lists of numbers, even when they share not a single word. That is what semantic search, “related articles” recommendations and RAG are built on, RAG being chatbots that look things up in your own documents before they answer.

If you only wanted the short version, that was it. This article goes further. We ran five embedding models locally with Ollama 0.40.13 and measured what they can and cannot do. Because almost every tutorial tests in English only, our main test used German customer questions, and then we asked the same questions in English to see how well the models bridge languages. We also checked what happens to long texts and whether the models notice the word “not”.

Four findings up front:

1. Given 10 customer questions that share no words with the matching help text, the popular nomic-embed-text found only 2 of 10 correct answers in German. bge-m3 and qwen3-embedding found 9 of 10, and qwen3 reached 10 of 10 with a search instruction.

2. For all five models, “I like drinking coffee” was closer to “I don’t like drinking coffee” than to “In the morning I really need my espresso” (tested in German). Embeddings measure topic, not claim.

3. An important sentence at the end of a long text vanished without a trace in three of the four models we tested for it: the vector was identical to four decimal places to the vector without that sentence. Ollama cuts long input silently.

4. 100,000 texts at 1,024 numbers each take about 410 MB and can be searched in full on an ordinary CPU in 13 milliseconds. Small projects do not need a vector database.

A starry sky of glowing points grouped in coloured clusters, illustrating embeddings

What are embeddings? The idea in one picture

Imagine a huge map on which every sentence has a location. Sentences about deliveries sit in one corner, sentences about passwords in another, sentences about vegan recipes somewhere else entirely. If you search for “When will my parcel arrive?”, you simply look at what is nearby and find “Orders ship within two business days”. No shared words, yet they are neighbours.

An embedding is the coordinate on that map. Except the map does not have two dimensions like a city map, it has 384, 768 or 1,024. No human can picture that, but for a computer it is just a longer list. No single number has an understandable meaning, by the way. There is no “parcel dimension”. The meaning lives in how all the numbers work together.

So an embedding is a vector: a fixed-length list of numbers that places a text in a “meaning space”. You will also hear “vector embedding”, “text embedding” or simply “vector”. They usually mean the same thing.

This is what a real embedding looks like, truncated to the first few numbers. The request goes to a locally running Ollama server:

curl -s http://127.0.0.1:11434/api/embed -d '{
  "model": "bge-m3",
  "input": "When will my parcel arrive?"
}'
{
  "model": "bge-m3",
  "embeddings": [[-0.0213, 0.0367, -0.0491, 0.0118, ... ]]
}

With bge-m3 that list contains 1,024 numbers. That is all an embedding is.

A stack of documents flows into a glass machine, and streams of small coloured beads come out the other side

How are embeddings created?

An embedding model is a neural network trained on enormous numbers of text pairs. It was shown: this question belongs to this answer, this heading belongs to this paragraph, this sentence is a rephrasing of that one. It was also shown pairs that do not belong together. Training nudges the numbers until related texts end up close together and unrelated ones far apart.

Technically, most embedding models are relatives of the language models behind ChatGPT or Claude. They split the text into tokens (word pieces), run it through several layers and condense the result into a single vector at the end. The difference: a chat model predicts the next word, an embedding model outputs a location in meaning space. It writes no text. That is why embedding models are so much smaller: the smallest model in our test weighed 45 MB, the largest 1.2 GB.

How do you measure whether two embeddings are similar?

Almost always with cosine similarity. It measures the angle between two vectors. If they point the same way, the value is 1. If they are perpendicular, it is 0. If they point in opposite directions, it is -1. In practice, texts usually land somewhere between 0 and 1.

In Python it is three lines:

import math

def cosine(a, b):
    dot = sum(x * y for x, y in zip(a, b))
    return dot / math.sqrt(sum(x * x for x in a) * sum(y * y for y in b))

A handy side finding from our test: all five models return vectors of length 1 (we computed the norm, it was 1.0000 every time). For normalised vectors, cosine similarity is simply the dot product, and the division disappears. That makes search faster and is why many vector databases offer “dot product” and “cosine” as equivalent options.

Important: absolute values are not comparable between models. With qwen3-embedding, two completely unrelated sentences scored 0.11; with mxbai-embed-large, 0.59. A threshold like “anything above 0.7 is a match” therefore only applies to one model and has to be re-determined whenever you switch.

A three-dimensional grid with glowing spheres in coloured groups, illustrating a vector space

What are embeddings used for?

Embeddings are rarely the product, but often the foundation. The main use cases:

Semantic search. Classic search finds words. Type “forgot my login” and you will not find an article titled “reset your password” unless someone maintained synonyms. Embedding search finds it because it compares meaning. Your texts are converted to vectors once and stored; on every search, only the query is embedded and compared with all stored vectors.

RAG (retrieval-augmented generation). A chatbot should answer questions about your own documents, such as your wiki or manuals. Since not all documents fit into a language model’s context, the system first uses embeddings to pick the relevant passages and hands only those to the language model. Embeddings decide what the model gets to see at all. If retrieval is poor, the answer is poor, no matter how good the language model is.

Recommendations and duplicates. “Related articles” under a blog post, “customers also bought” based on product descriptions, finding duplicate support tickets or near-identical product copy: all neighbourhood searches in vector space.

Grouping and sorting. Splitting thousands of pieces of customer feedback into topics automatically, without defining categories first. You compute embeddings and let a clustering algorithm form the groups.

Classification with few examples. Embed a handful of example sentences per category, then assign new texts to the nearest category. For simple tasks that goes surprisingly far without training a model.

Embeddings are not limited to text. Images, audio and product data can be embedded the same way, and “find similar photos” works on the same principle. In this article we stick to text.

Beginner-friendly explanation by The Data and AI Guy (July 2026).

Our test: 5 embedding models running locally with Ollama

There is plenty of theory online. We wanted to know how embeddings cope when the language is not English, and how well they connect two languages. In our Ollama tutorial we had already noticed that the popular nomic-embed-text struggles with German. This time we did it systematically.

The setup:

  • A separate, isolated Ollama instance (version 0.40.13) bound to 127.0.0.1 only, with its own model directory. After the test, the instance and all models (2.6 GB) were deleted.
  • CPU only, 12 cores, no GPU. The server was under other load at the same time, so treat timings as orders of magnitude.
  • Five models you can get with one ollama pull:
ModelDownloadDimensionsContext in OllamaLoaded in RAM
all-minilm45 MB384256 tokens49 MB
nomic-embed-text274 MB7682,048 tokens389 MB
mxbai-embed-large669 MB1,024512 tokensnot measured
bge-m31.2 GB1,0242,048 tokens (measured)1.2 GB
qwen3-embedding:0.6b639 MB1,0244,096 tokensnot measured

Downloads took between 2.8 and 6.0 seconds. We read the context lengths for all-minilm, nomic-embed-text and bge-m3 from ollama ps and from the truncation we measured; the one for mxbai-embed-large comes from the model description.

The main test: ten short help texts of the kind you find in a shop or customer portal: reset password, shipping, returns, payment methods, full disk, expired certificate, backups, vegan recipes, delete account, unsubscribe from newsletter. Plus ten questions that deliberately use different words from the matching help text. Translated, they read like this:

  • “I can’t get into my account anymore” → help text about resetting a password via “forgot password”
  • “Can I exchange the shoes?” → “You can send items back within 30 days”
  • “How do I get rid of my profile completely?” → “You can permanently delete your account in the settings”
  • “I don’t want to receive promo emails anymore” → “Unsubscribe from the newsletter …”

That is exactly the situation embeddings are used for. A keyword search would have missed almost all ten. We counted how often the correct help text ended up at the top. We ran the questions twice: once in German against the German help texts, once in English against the same German help texts.

Result 1: Which embedding model handles non-English text?

ModelHits (German questions)Hits (English questions, German texts)Gap to runner-up
all-minilm6 / 105 / 100.051
nomic-embed-text2 / 104 / 100.018
mxbai-embed-large5 / 106 / 100.053
bge-m39 / 108 / 100.113
qwen3-embedding:0.6b9 / 1010 / 100.130

The last column matters at least as much as the hit count. It shows how clearly the best result beat the second best (German run). For nomic-embed-text the average gap was 0.018: the model saw practically all help texts as equally similar and picked one more or less at random. Five of its eight misses went to the payment-methods text, whether the question was about passwords, parcels or deleting an account. bge-m3 and qwen3-embedding separated six to seven times as clearly.

A few observations that surprised us:

The smallest model beat the best-known one. all-minilm at 45 MB found 6 of 10, nomic-embed-text at 274 MB only 2. Size alone says little. What matters is which languages a model was trained on. bge-m3 and qwen3-embedding are explicitly multilingual; the other three were trained mostly on English. If your content is English only, the ranking may look different, so test with your own data.

The shared mistake of the two best models is instructive. Both bge-m3 and qwen3-embedding matched “I can’t get into my account anymore” to the text about deleting the account rather than the password text. That is understandable: both texts are about the account. A human sees the intent instantly; for the models it was close. If you build a help search, test edge cases like this on purpose instead of relying on a high hit rate for easy questions.

Search instructions help some models. qwen3-embedding is trained to receive a short instruction in front of the search query. We prepended this text to each question (the help texts stayed unchanged):

Instruct: Given a customer question, retrieve the help text that answers it
Query: <the question>

With the instruction, qwen3-embedding scored 10 of 10 on the German questions. The previously misplaced password text now came first, 0.485 against 0.410 for “delete account”. Other models expect other prefixes: nomic-embed-text wants search_query: and search_document:, bge-m3 needs none. It is documented on each model’s page and worth reading.

Mixing languages. The third column shows English questions against German texts. qwen3-embedding found all ten, bge-m3 eight. If you have a bilingual wiki or international customers, these models let you build one search across both languages. A single sentence shows how far apart models are here: “Der Hund schläft auf dem Sofa” against “The dog is sleeping on the couch” scored 0.12 with all-minilm, practically no similarity, and 0.81 with qwen3-embedding.

Ten questions are a small test, not a benchmark. But they are enough to expose an unsuitable model, and that is what we recommend you do too: before building search on an embedding model, take ten real questions from your daily work and check what ends up on top. It takes half an hour and saves weeks of puzzling search results.

Result 2: Embeddings barely see “not”

The second test was meant to show what “similar meaning” actually means to an embedding model. We compared three sentences with “Ich trinke gern Kaffee” (I like drinking coffee), plus an English control pair:

Comparison sentenceall-minilmnomicmxbaibge-m3qwen3
“I don’t like drinking coffee” (German)0.9530.9880.8960.8290.841
“In the morning I really need my espresso” (German)0.5150.6910.7060.7360.556
“The server has run out of disk space” (German)0.3500.5760.5890.4290.109
English control: “I like drinking coffee.” vs “I don’t like drinking coffee.”0.8070.8940.7460.8120.857

With all five models, the sentence saying the opposite was the closest match to the original. The espresso sentence, which means the same thing in other words, came well behind. With nomic-embed-text the negation scored 0.988, almost identical. In English the negation also stayed high, between 0.75 and 0.89.

This is not a bug in individual models but a property of embeddings: they measure what a text is about, not what it claims. “I like coffee” and “I don’t like coffee” are about the same topic with almost the same words. For search that is often even correct: someone looking for coffee preferences wants both sentences. For anything where the claim matters, it is dangerous:

  • A RAG system asks “Is product X gluten-free?” and retrieves the paragraph “Product X is not gluten-free”. Fine, as long as the language model reads carefully afterwards.
  • Duplicate detection treats “The delivery arrived” and “The delivery did not arrive” as the same case.
  • A filter that picks positive reviews by embedding proximity sorts in the negative ones too.

The practical consequence: embeddings are good at finding candidates. Whether a candidate really fits should be checked by a second step for important decisions, such as a language model that reads the retrieved text, or a so-called reranker.

Ambiguity went better. “I’m sitting on the bench in the park” (German Bank means both bench and bank) was closer to “I’m resting on a park bench” (0.84 to 0.94) than to “I withdrew money from the bank” (0.44 to 0.78) in every model. The models capture a word’s context, but they barely register a sentence’s negation.

A magnifying glass over a library shelf where individual books glow in matching colours

Result 3: Long texts get cut off silently

Every embedding model has a maximum length, measured in tokens. In English a token is roughly three to four characters. What happens when a text is longer?

We built a long, boring filler text (about 3,800 tokens, the same sentence about the weather repeated 200 times) and appended an important sentence at the end: “Important: the emergency key is in the safe in the basement” (in German). Then we compared the embedding with and without that sentence.

ModelTokens processedSimilarity with/without final sentenceSentence at the start instead
all-minilm2561.00000.944
nomic-embed-text2,0481.00000.976
bge-m32,0481.00000.897
qwen3-embedding:0.6b3,818 (all)0.9430.813

In three of four models, the vector with the important sentence was identical to four decimal places to the vector without it. The sentence was cut off and had zero influence on the result. Anyone searching this database for the emergency key would never find the document. And neither Ollama’s response nor an error code hints at it: Ollama answered with status 200. The only clue is the prompt_eval_count field in the response, which stopped at 256 or 2,048.

When the sentence was at the start, it did change the vector, but only slightly, because it drowned in a huge filler text. That is a finding too: a single sentence in a long document barely counts in the embedding. Even qwen3-embedding, which processed the whole text, only moved to 0.943.

Ollama can also fail loudly if you ask it to. With "truncate": false it answered with HTTP 400 for all-minilm and nomic-embed-text and HTTP 413 for bge-m3, each with the message “the input length exceeds the context length”. For a database you load documents into, that is the better setting: an error you can see beats a document that is secretly half missing.

curl -s http://127.0.0.1:11434/api/embed -d '{
  "model": "bge-m3",
  "input": "… very long text …",
  "truncate": false
}'
# {"error":"the input length exceeds the context length"}

The fix is called chunking. Split long documents into smaller pieces before embedding, typically a few hundred tokens, and store a separate embedding for each piece. Pieces along paragraphs or headings work well, with a little overlap so that a thought is not cut exactly at the boundary. For each piece, store which document and which position it came from. Then search finds the paragraph about the emergency key, because it no longer drowns in 200 weather sentences.

How much storage and compute do embeddings need?

An embedding consists of decimal numbers, usually 4 bytes each (float32). The storage requirement follows directly:

AmountDimensionsStorageFull search (1 query, CPU)
100,000 texts384154 MB5 ms
100,000 texts1,024410 MB13 ms
1,000,000 texts3841.5 GB36 ms

We measured with NumPy and random normalised vectors: multiply all vectors by the query once, pick the ten best. No index structure, no database, just arithmetic. Even a million entries were searched in under 40 milliseconds.

That means: for help pages, a company wiki, a few thousand products or a blog’s articles, you do not need a dedicated vector database. The vectors fit in memory, a table in your existing database or a file. If you already run PostgreSQL, the pgvector extension stores embeddings right next to the rest of your data. Our comparison SQLite vs PostgreSQL helps decide which database fits your project. Specialised vector databases with approximate methods (such as HNSW indexes) only pay off at many millions of entries or very high query volumes.

Creating embeddings is more expensive than searching them. On our busy server without a GPU, the models needed between 7 seconds (all-minilm) and 18 seconds (bge-m3) for 200 short sentences. But that happens once per text, at import. Per search, only the query itself is embedded, which took well under a second with every model. A GPU makes bulk embedding many times faster.

Two more measurements:

Embeddings are reproducible. The same text produced exactly the same vector twice in a row with every model, number for number. That matters, because otherwise you could never compare stored vectors with new ones.

Fewer dimensions are possible, but not sensible for every model. Ollama accepts a dimensions parameter. With qwen3-embedding, which was trained for truncatable vectors, the hit count at 1,024, 512, 256, 128 and 64 dimensions was 9, 8, 10, 7 and 9 out of 10. With ten questions that is noise, not a trend. Shorter vectors save storage without clearly hurting results in our small test. Notably, Ollama also cut all-minilm to 256 dimensions without any warning, even though that model was not trained for it. Nobody tells you whether those shortened vectors are still any good. Only shorten with models whose description explicitly supports it.

The most important rule: one model, one vector space

Embeddings from different models are not comparable, not even when they happen to have the same number of dimensions. bge-m3, mxbai-embed-large and qwen3-embedding all return 1,024 numbers, but each model has its own map. A vector from one model on another model’s map points to some random place.

Three practical rules follow:

  1. Store which model (and which version) produced each vector.
  2. If you switch models, you must re-embed every text. There is no conversion.
  3. Queries and documents must be embedded with the same model and the same settings, including prefixes and dimensions.

Sounds obvious, but it is a common source of bugs: someone tries a new model for queries, forgets the stored documents, and search suddenly returns nonsense without an error anywhere.

A small server on a desk sending glowing documents into a speech bubble

Embeddings locally or via API?

You can order embeddings from large providers via API or generate them yourself. Both have their place:

Locally with Ollama (as in our test), the data stays on your own machine or server. For customer data, internal documents or anything with privacy concerns, that is a strong argument. The models are small, run without a GPU and cost nothing but electricity. How to set up Ollama is covered in our Ollama tutorial. For a broader overview of running AI yourself, see running AI locally.

Via API you often get very strong models without your own hardware and nothing to operate. In return, your texts leave the building and you are tied to the provider: if they retire a model, you have to re-embed everything (see rule 2). Embedding prices are low compared with chat models, but they add up with large data sets.

Our recommendation after this test: for German or mixed-language content, try bge-m3 or qwen3-embedding:0.6b locally, check them against ten real questions from your daily work, and only then build something bigger. For purely English content the smaller models are usable too, but test them the same way.

A mini example: semantic search in 25 lines

This is how simple semantic search can be. The script embeds a few texts, keeps the vectors and finds the best matching text for a question. All it needs is Python and a running Ollama server with bge-m3.

import json, urllib.request

def embed(texts):
    request = urllib.request.Request(
        "http://127.0.0.1:11434/api/embed",
        data=json.dumps({"model": "bge-m3", "input": texts, "truncate": False}).encode(),
        headers={"Content-Type": "application/json"},
    )
    return json.load(urllib.request.urlopen(request))["embeddings"]

texts = [
    "To reset your password, click 'Forgot password' on the login page.",
    "Orders ship within two business days.",
    "You can return items within 30 days.",
]
vectors = embed(texts)

question = "When will my parcel arrive?"
q = embed([question])[0]

# vectors are normalised, so the dot product is enough
scores = [sum(a * b for a, b in zip(q, v)) for v in vectors]
best = max(range(len(texts)), key=lambda i: scores[i])
print(f"{scores[best]:.3f}  {texts[best]}")

In a real project you would store the vectors in a database or file instead of recomputing them on every start, split texts into sensible chunks, and have a language model double-check the result for important questions. The principle stays the same.

Embeddings versus vector databases, by LearnITGuide Tutorials (August 2026).

Common mistakes with embeddings

From our measurements and from practice, the most frequent pitfalls:

  • Not testing the model on your own texts. English benchmarks say little about German customer questions. nomic-embed-text is a decent model for English and was the weakest in our German test.
  • Embedding long documents in one piece. Everything past the context limit vanishes silently, and even within the limit a single sentence drowns in lots of text. Chunking is mandatory.
  • Copying a fixed threshold from a tutorial. Similarity values differ wildly between models. In our test, the similarity of two unrelated sentences ranged from 0.11 to 0.59.
  • Mixing models. Embedding queries with a different model or different prefixes than the documents.
  • Treating embeddings as truth. They find texts on the same topic, even when those texts say the opposite.
  • Introducing a vector database too early. Up to very large numbers of entries, your existing database or even a file is enough.

Conclusion: what are embeddings, and when are they worth it?

Embeddings are lists of numbers that capture meaning. They make it possible to find texts by content rather than by words, and they are the foundation of almost every AI application that works with your own documents. An embedding model is small, runs locally without a GPU and produces reproducible results.

Our test also showed the limits: model choice decides everything (2 versus 9 hits on the same questions), long texts are cut off without warning, and “not” is almost invisible to embeddings. If you know that, you can build search that understands customer questions far better than any keyword search with little effort. If you don’t, you will wonder about results that come with no error message.

Our advice for getting started: install Ollama, pull bge-m3 or qwen3-embedding, test ten real questions against ten real texts. If that works, you have the foundation for semantic search or RAG in an afternoon.

Frequently asked questions about embeddings

What are embeddings in simple terms?

Embeddings are lists of numbers that describe what a text means. Texts with similar meaning get similar lists, even if they use different words. That lets a computer compare meaning by comparing numbers.

What is the difference between an embedding and a vector?

A vector is any list of numbers. An embedding is a vector produced by a model so that its position in number space reflects the meaning of the input. Every embedding is a vector, but not every vector is an embedding.

What is the difference between embeddings and tokens?

Tokens are the word pieces a model splits text into before processing it. An embedding is the result at the end: a single vector for the whole text. Inside language models there are also token embeddings, vectors for individual word pieces. When people talk about embeddings for search or RAG, they mean the vector for the whole text.

How many dimensions should an embedding have?

The model decides; 384 to 1,024 is common, large API models go higher. More dimensions mean more storage, but not automatically better results. In our test the 384-dimension model clearly beat the 768-dimension one on German text. Some models allow shorter vectors to save storage.

Which embedding model is best for non-English text?

In our Ollama test on German text, bge-m3 and qwen3-embedding:0.6b led clearly (9 of 10 hits each, qwen3 10 of 10 with a search instruction). nomic-embed-text found only 2 of 10. Still, test with your own texts; ten questions are enough for a first impression.

Do I need a vector database?

For most small and medium projects, no. 100,000 texts at 1,024 dimensions take about 410 MB and can be searched in full on a CPU in about 13 milliseconds. An existing PostgreSQL database with pgvector, or even a file, is enough. Dedicated vector databases pay off at many millions of entries.

Can you mix embeddings from different models?

No. Every model creates its own number space. Even with the same number of dimensions, the vectors are not comparable. If you switch models, you have to re-embed all texts.

What happens if a text is too long for the embedding model?

In Ollama it is cut off silently by default. In our test, an important sentence at the end of a long text had zero influence on the result in three of four models. With "truncate": false you get an error instead. Split long documents into smaller chunks before embedding.

Do embeddings understand negation?

Barely. In our test, “I don’t like coffee” was closer to “I like coffee” in all five models than a sentence with the same meaning but different words. Embeddings measure topic, not claim. For decisions where the claim matters, add a second checking step.

What do embeddings have to do with RAG?

RAG systems first retrieve the relevant passages from your documents and hand them to the language model. That retrieval almost always runs on embeddings. Embedding quality therefore determines which information the language model gets to see at all.

Can I create embeddings without a GPU?

Yes. All five models in our test ran on CPU only. Embedding large amounts of text takes longer, but a single search query was embedded in well under a second with every model.

Are embeddings the same on every call?

In our test, yes: the same text produced exactly the same vector twice in a row with all five models. Different model versions or settings can produce different vectors, so record the model and version with every stored vector.