Beginner 13 minEmbeddings

Embedding: what is it? Definition and exemples

An open laptop casts green light across a dark desk.
Direct response

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.

By Mohamed Meguedmi·Update 2026-11-24·Tested on Windows, macOS, and Linux

#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.”

i
In one sentence
An embedding is the address of a piece of content on a map of meaning: the closer two addresses are, the more similar the content is in meaning.

#How do you translate “embedding” into French?

The complete kit for building your own local RAG.

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.

Examples of embedding use cases, from the most common to the most specialized
UsageWhat embedding doesConcrete example
Semantic searchCompares the query vector with the document vectorsFinding “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 respondsAn assistant that answers based on your contracts or internal procedures
Duplicate detectionFinds texts whose vectors are nearly identicalMerging support tickets that describe the same incident
ClusteringGroups nearby vectors into clustersSort 5,000 customer reviews by topic without a predefined grid
ClassificationServes as input to a lightweight classifierAutomatically sort incoming emails by department
RecommendationSuggests the items closest to what you likedSuggest related articles below the article being read
Multimodal searchPlaces text, images, and audio in the same spaceFind 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.

Static vs. contextual embeddings at a glance
CriterionStatic embeddingContextual embedding
Unit representedA wordA word in its sentence, a sentence, a passage
Word with multiple meaningsA single vector for every meaningOne vector per context
Exampleword2vec (2013)Sentence embedding models (BGE-M3, EmbeddingGemma)
Current usageTeaching, very lightweight toolsSemantic 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.

Two open embedding models, based on their official model cards (November 18, 2026)
ModelEditorDimensionsContextInputs
EmbeddingGemma 2Google DeepMind768 (reducible to 512, 256, or 128)8,192 tokensText, code, images, video, audio
BGE-M3BAAI1 0248,192 tokensText, 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.

  1. 01
    Install Ollama
    Install Ollama from its official website for macOS, Windows, or Linux, then check that the service responds at http://localhost:11434, its default address.
  2. 02
    Download an embedding model
    Run ollama pull embeddinggemma-2 to download EmbeddingGemma 2, or ollama pull embeddinggemma for the lighter first version.
  3. 03
    Generate a first vector
    Send 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.
  4. 04
    Check the result
    Count 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.
macOS, Linux, or Windows (terminal): EmbeddingGemma 2 page in the Ollama library
ollama pull embeddinggemma-2
macOS or Linux (cURL): request for the EmbeddingGemma 2 page in the Ollama library
curl http://localhost:11434/api/embed \
  -d '{
    "model": "embeddinggemma-2",
    "input": "Why is the sky blue?"
  }'
macOS, Linux, or Windows (terminal): command from the Ollama documentation (first version of EmbeddingGemma)
ollama run embeddinggemma "Hello world"

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 stays local
With Ollama on localhost, texts and vectors stay on your machine; only the model download goes over the internet. An online embedding service, by contrast, receives every text you send.

#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.

!
An embedding is not an answer
An embedding model finds similar passages; it doesn't check whether they're accurate or up to date. In a RAG system, the final quality also depends on how the documents are chunked and on the LLM that writes the answer.
Frequently asked questions
What is an embedding in AI, in simple terms?+
An embedding turns content into a list of numbers that preserves its meaning. Two sentences that say the same thing in different words get similar lists. AI systems use embeddings to find documents by meaning, group similar texts, or give an LLM the right context in a RAG system.
What's the difference between an embedding and a token?+
A token is a chunk of text (a word or part of a word) split off before computation; an embedding is the vector of numbers that represents the meaning of a token, a sentence, or a passage. The token is the unit of segmentation; the embedding is the numerical representation of meaning. An embedding model reads tokens and outputs a vector.
Is an embedding the same thing as a vector?+
An embedding is a vector, but not every vector is an embedding. The term embedding refers to a vector learned by a model so that the distance between two vectors reflects how similar two pieces of content are. A one-hot vector, for example, carries no semantic information and isn't an embedding in the modern sense.
Do you need a graphics card to compute embeddings?+
You don't need a graphics card to compute embeddings. Embedding models are small compared with LLMs: EmbeddingGemma 2 has 740 million parameters in total, according to its official model card, and Google says it's designed for laptops and mobile devices. A GPU mainly speeds up the initial embedding of large document collections.
Can you recover the original text from an embedding?+
An embedding isn't designed to reproduce the original text, but that doesn't make it anonymous. A study by Morris et al. published on arXiv in October 2023 (EMNLP 2023) exactly reconstructs 92% of 32-token texts from their embeddings, including patient names. Vectors derived from confidential documents therefore need the same protection as the documents themselves.
Which embedding model should you choose for French documents?+
For French documents, you need a multilingual embedding model, such as Google's EmbeddingGemma 2 or BAAI's BGE-M3, both of which advertise support for more than 100 languages on their official model cards. The MTEB leaderboard helps you build a shortlist, then a test on around a hundred of your own questions settles it. The dedicated guide to the best French embedding models compares the options in detail.

#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.

Did this guide help you?

Feedback, an error, or a clarification? Let us know—it improves the guide for everyone.