Embedding: what is it? Definition and exemples

An embedding (plongement vectoriel in French) is a list of numbers, a vector, that represents the meaning of a word, sentence, image, or sound. Two pieces of content with similar meanings get similar vectors. According to the Ollama documentation consulted on November 18, 2026, these vectors generally have 384 to 1,024 dimensions and are used for semantic search and RAG.
The word embedding comes up whenever people talk about meaning-based search, RAG, or vector databases. Here you'll find its definition, its translation, concrete examples, the difference between static and contextual embeddings, and how to generate your first vector on your own machine.
#What is an embedding in AI?
An embedding is a numerical representation of a piece of data, in the form of a vector of numbers, built so that data with similar meanings have similar vectors. Google's Machine Learning Crash Course defines it as a vector representation of data in an embedding space, low-dimensional relative to the original data.
In practice, an embedding model reads « Le chat dort sur le canapé » ("The cat is sleeping on the couch") and returns several hundred decimal numbers. « Un félin fait la sieste sur le sofa » ("A feline is napping on the sofa") produces a very similar sequence, with almost no words in common; « Le taux de la BCE a baissé » ("The ECB rate has dropped") produces a distant one. The computer is no longer comparing words; it's comparing positions.
This idea addresses a long-standing problem. Before embeddings, a word was often encoded as a “one-hot” vector: a 1 at the word's position in the vocabulary and 0s everywhere else. According to Google, this encoding produces huge vectors and expresses no relationship between words: “cat” and “feline” are as different as “cat” and “bank.”
#How do you translate “embedding” into French?
Benefit from our experience and a guided path to build your local RAG and work with your own documents.
- Lifetime online access
- PDF + files
- Refunded within 30 days
In French, embedding is translated as « plongement », often specified as « plongement vectoriel ». For words, the Wikipédia article on word embedding states that in French it is also called plongement lexical or plongement sémantique. In practice, French-speaking developers very often keep the English term embedding, treated as a masculine noun.
- Embedding
- English term, the most widely used in tool and model documentation.
- Vector embedding
- General translation: a piece of data is “embedded” (plongée) in a vector space.
- Word or semantic embedding
- Translations reserved for word embeddings, according to Wikipedia.
- Vectoriser
- Common verb for "computing the embedding" of a document.
#How an embedding works: vectors, dimensions, and distance
An embedding works like a point in a multidimensional space: each number in the vector is a coordinate, and the distance between two points measures how similar two pieces of content are. According to Google, the distance between points in an embedding space represents the relative similarity of the items they represent.
The number of dimensions is the length of the vector. Google notes that for word embeddings, this dimension is often 256, 512, or 1,024. Ollama's documentation, for text embeddings, cites a typical range of 384 to 1,024 dimensions depending on the model. A 768-dimensional vector is therefore a list of 768 decimal numbers.
The dimensions of an embedding don't carry human-readable labels. Google's course illustrates the idea with made-up axes such as how “sweet” or how “liquid” a dish is, then notes that real dimensions are rarely that interpretable. An embedding model organizes the space itself during training; you read the result through distances, not coordinate by coordinate.
#Cosine similarity, the most widely used measure
Cosine similarity is a measure that compares the orientation of two vectors: it equals 1 when they point in the same direction, approaches 0 when they are unrelated, and becomes negative when they point in opposite directions. The Ollama documentation recommends cosine similarity for most semantic searches. It also notes that its /api/embed endpoint returns normalized vectors of length 1: in that case, cosine similarity is computed as a simple dot product.
#What are concrete examples of how embeddings are used?
Embeddings are useful anywhere you need to find, group, or compare content by meaning rather than by exact wording. The Ollama documentation sums up three uses: storing vectors in a vector database, searching by cosine similarity, and feeding a RAG pipeline. The table below covers the most common use cases.
| Usage | What embedding does | Concrete example |
|---|---|---|
| Semantic search | Compares the query vector with the document vectors | Finding “lease termination” by typing “how do I move out of my apartment” |
| RAG (retrieval-augmented generation) | Selects the passages to give the LLM before it responds | An assistant that answers based on your contracts or internal procedures |
| Duplicate detection | Finds texts whose vectors are nearly identical | Merging support tickets that describe the same incident |
| Clustering | Groups nearby vectors into clusters | Sort 5,000 customer reviews by topic without a predefined grid |
| Classification | Serves as input to a lightweight classifier | Automatically sort incoming emails by department |
| Recommendation | Suggests the items closest to what you liked | Suggest related articles below the article being read |
| Multimodal search | Places text, images, and audio in the same space | Find a photo by describing it in a sentence |
Embeddings also capture relationships. According to Google, real-world embeddings can encode complex relationships, such as the one linking a country to its capital: the gap between “France” and “Paris” then resembles the gap between “Italy” and “Rome.”
#Static vs. contextual embeddings: what's the difference?
A static embedding produces a single vector per word, regardless of context; a contextual embedding computes a different vector depending on the sentence the word appears in. Google classifies word2vec as a static embedding and points out their limitation: a word with multiple meanings is reduced to a single point.
The French word « avocat » illustrates the problem: it means both "lawyer" and "avocado." With a static embedding, « avocat » has the same position in « l'avocat plaide » ("the lawyer pleads") and in « l'avocat est mûr » ("the avocado is ripe"). With a contextual embedding, the two sentences produce two distinct vectors, one close to law and the other close to fruit. According to Google, contextual embeddings provide multiple representations depending on context, whereas static embeddings have only one.
word2vec is the classic example of a static embedding. The seminal paper, by Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean, was submitted to arXiv on January 16, 2013; it proposes two architectures for computing continuous vector representations of words from very large corpora. Today's embedding models, based on transformers, produce contextual embeddings of entire sentences.
| Criterion | Static embedding | Contextual embedding |
|---|---|---|
| Unit represented | A word | A word in its sentence, a sentence, a passage |
| Word with multiple meanings | A single vector for every meaning | One vector per context |
| Example | word2vec (2013) | Sentence embedding models (BGE-M3, EmbeddingGemma) |
| Current usage | Teaching, very lightweight tools | Semantic search, RAG, classification |
#What is an embedding model?
An embedding model is a neural network trained for a single task: turning an input (text, image, audio) into a vector. Unlike an LLM such as Llama or Qwen, it doesn't generate text. It's usually much smaller: the Ollama library describes the first version of EmbeddingGemma as a 300-million-parameter model, and the EmbeddingGemma 2 model card says it's designed for laptops and mobile devices.
Two examples show the orders of magnitude. According to its Hugging Face model card consulted on November 18, 2026, Google DeepMind's EmbeddingGemma 2 maps text, code, images, video, and audio into a single 768-dimensional space, has 740 million parameters in total, understands more than 100 languages, and accepts 8,192 tokens of context, under the Apache 2.0 license. BGE-M3, released by BAAI, produces 1,024-dimensional vectors, reads up to 8,192 tokens, and supports more than 100 languages.
| Model | Editor | Dimensions | Context | Inputs |
|---|---|---|---|---|
| EmbeddingGemma 2 | Google DeepMind | 768 (reducible to 512, 256, or 128) | 8,192 tokens | Text, code, images, video, audio |
| BGE-M3 | BAAI | 1 024 | 8,192 tokens | Text, over 100 languages |
For comparing embedding models, the standard benchmark is MTEB, a public toolkit that evaluates embeddings and retrieval systems on standardized tasks and has its own leaderboard. A good overall score doesn't guarantee good results on your French documents. For help picking a specific model for each language, see the guide to the best embedding models for French.
#How do you generate an embedding locally with Ollama?
Ollama generates an embedding locally with a single command or a call to its API on localhost, without sending the text to an online service once the model is downloaded. Watch the model name: in the Ollama library as checked on November 18, 2026, embeddinggemma refers to the first version (300 million parameters, 2K context, text only), and EmbeddingGemma 2 installs under the name embeddinggemma-2.
- 01Install OllamaInstall Ollama from its official website for macOS, Windows, or Linux, then check that the service responds at http://localhost:11434, its default address.
- 02Download an embedding modelRun ollama pull embeddinggemma-2 to download EmbeddingGemma 2, or ollama pull embeddinggemma for the lighter first version.
- 03Generate a first vectorSend a POST request to http://localhost:11434/api/embed with the model name and the text in the input field. The input field also accepts a list of texts, so you can embed several passages in a single call. On the command line, the Ollama documentation states that the output is a JSON array of numbers.
- 04Check the resultCount the length of the returned vector: it must be the same for all your texts with a given model. Then compare two sentences with similar meanings and one unrelated sentence: the cosine similarity of the first two should be noticeably higher.
The Ollama API reference also documents a dimensions parameter, which sets the number of dimensions of the generated embeddings. It's only useful with a model trained to accept shortened vectors: the EmbeddingGemma 2 model card, for example, states that its vectors can be truncated to 512, 256, or 128 dimensions, with an impact on quality described as minimal.
#What pitfalls should you avoid with embeddings?
The main pitfall with embeddings is mixing vectors from different models: each model builds its own space, and two vectors from two models can't be compared. The Ollama documentation states it as a rule: use the same embedding model for indexing documents and for queries.
- Switching models means recalculating everything
- Vectors you've already stored become unusable with a new embedding model: the entire document base must be re-vectorized. Plan for this time before switching.
- Text that's too long gets truncated
- Each model has a context window (8,192 tokens for both EmbeddingGemma 2 and BGE-M3 according to their model cards, and 2K for the first version of EmbeddingGemma according to the Ollama library). By default, the Ollama API truncates inputs that are too long, so you need to split a full document into passages.
- Close doesn't mean exact
- An embedding brings meanings closer together, not numbers or references. A search for « article L1234-5 » may surface a neighboring article: for exact identifiers, combine embeddings with keyword search.
- Dimensions come with a storage cost
- The longer the vector, the heavier the database and the slower the comparison.
The order of magnitude for storage is simple to calculate. Estimate: storing each number in 4 bytes (the common float32 format), a 768-dimension vector takes up 768 × 4 = 3,072 bytes. A million passages therefore represents about 3 GB of vectors, excluding the index and the text. Truncated to 256 dimensions, the same million passages drops to about 1 GB. These figures are calculations, not measurements from a real database.
What is an embedding in AI, in simple terms?+
What's the difference between an embedding and a token?+
Is an embedding the same thing as a vector?+
Do you need a graphics card to compute embeddings?+
Can you recover the original text from an embedding?+
Which embedding model should you choose for French documents?+
#Sources and verification as of November 18, 2026
The definitions, dimensions, commands, and model specifications were collected on November 18, 2026, from the official pages below; model cards and the Ollama documentation change over time, so verify them before starting a project.
- Source: Embedding space and static embeddings (Google, Machine Learning Crash Course)
- Source: Obtaining embeddings, static and contextual (Google)
- Source: Generating embeddings (Ollama documentation)
- Source: /api/embed API reference (Ollama)
- Source: official EmbeddingGemma 2 model card (Google DeepMind)
- Source: official BGE-M3 specification sheet (BAAI)
- Source: EmbeddingGemma 2 in the Ollama library
- Source: the first version of EmbeddingGemma in the Ollama library
- Source: Text Embeddings Reveal (Almost) As Much As Text, Morris et al. (arXiv, 2023)
- Source: word2vec paper, Mikolov et al. (arXiv, 2013)
- Source: MTEB, embedding benchmark (GitHub)
- Source: plongement lexical (Wikipédia)
Feedback, an error, or a clarification? Let us know—it improves the guide for everyone.