Embeddings - Vectors as a Fingerprint of Meaning

An embedding translates text or images into a vector - a sequence of numbers that maps meaning to a position in space. Similar content sits close together, dissimilar content far apart. Embeddings are the foundation of similarity search, recommendations, and RAG.

Category:AI & Machine Learning

An embedding is the translation of a piece of content - a word, a sentence, an image - into a vector, a sequence of numbers. This vector is a kind of fingerprint of meaning: it does not represent the letters or pixels, but the content. Models learn to map similar things to nearby points and dissimilar things far apart.

This makes meaning computable. Instead of comparing texts or images directly, you compare their vectors - and can determine in seconds which content is conceptually related.

Text Embeddings and Image Embeddings

  • Text embeddings: A language model turns words, sentences, or whole documents into vectors. Two phrasings with the same sense land close together, even if they share no single word.
  • Image embeddings: An image model produces a vector from a photo that captures shape, structure, and subject. Two photos of the same object sit close together, regardless of lighting or crop.
  • Multimodal embeddings: Some models map text and image into the same space, so you can search for images using text.

Similarity via Cosine

The most common way to compare two embeddings is cosine similarity: it measures the angle between two vectors. A value near 1 means very similar, a value near 0 means unrelated. This number is the basis for similarity search, recommendation systems, duplicate detection, and clustering.

Where Generic Embeddings Reach Their Limits

Generic embedding models are robust and broadly applicable - which becomes a problem precisely when it comes to the fine distinction of nearly identical objects in a large catalog. The similarity scores then saturate:

  • Even clearly different variants receive uniformly very high, barely distinguishable scores - the scale no longer provides a usable confidence signal.
  • In a real test, a generic embedding API even scored the wrong match higher than the right one.

The reason: the very domain-agnosticism that makes a generic model robust prevents the sharp separation of nearly identical variants. Anyone who needs this discriminative sharpness cannot avoid adapted embeddings - for example through metric learning or fine-tuning of an added head.

How Embeddings Are Stored and Searched

Embeddings are stored in a vector database. On a query, the search itself becomes an embedding, and the database finds the most similar entries via nearest-neighbor search. This principle also powers RAG, where relevant documents are gathered for a language model.

Typical Applications

  • Semantic search: Finding by meaning rather than exact keywords.
  • Recommendations: Suggesting similar products, articles, or objects.
  • Matching: Assigning a photographed object to the right catalog entry.
  • RAG: Providing relevant knowledge to a language model.

Embeddings at Elasticbrains

At Elasticbrains we build search and matching on embeddings - and adapt the underlying models when generic vectors are too blurry. See how we sharpen embeddings for your data on our service page Customizing AI Models.

More Glossary Terms