Embeddings Reference Guide

What Are Embeddings?

Embeddings are numerical representations (vectors) of data — words, sentences, documents, users, or even images. They place items in a multi-dimensional space where relationships (similarity, structure, or preferences) can be measured.

  • Close vectors → items are similar.
  • Far vectors → items are different.

They are the backbone of modern AI systems for search, recommendations, and classification.

How Embeddings Are Created

Embeddings are learned during training using different methods:

  • Co-occurrence → based on word context statistics (Word2Vec, GloVe).
  • Language modeling → predicting next words (GPT, LLMs).
  • Contrastive learning → pulling similar pairs closer, pushing different pairs apart.
  • Matrix factorization → decomposing user-item interactions (recommendations).
  • Graph learning → encoding nodes and edges in networks.
  • Multimodal training → aligning text, image, audio into a shared space.

Analogy

Think of embeddings like maps:

  • A semantic map shows cities grouped by culture and language.
  • A non-semantic map might show cities grouped by flight connections or trade routes. Both are useful, but they serve different purposes. One tells you about meaning, the other about behavior or structure.

Types of Embeddings and Their Uses

Embedding TypeHow CreatedBest ForReal-Life Usage
Semantic embeddingsContrastive loss, distillationMeaning & similaritySearch engines, semantic search in chatbots, document retrieval
Language model embeddingsNext-token prediction (GPT, LLMs)General-purpose text representationRAG (retrieval-augmented generation), summarization, Q&A
Word co-occurrence embeddingsWord context statisticsLightweight similarityKeyword clustering, topic modeling, older NLP pipelines
Sentence embeddingsEncoder + contrastive fine-tuningSentence-level similarityFAQ matching, duplicate detection, customer support
Task-specific embeddingsFine-tuned for classificationSpecialized tasksSentiment analysis, spam detection, intent classification
Recommendation embeddingsMatrix factorizationUser-item preferencesNetflix, Amazon product suggestions
Graph embeddingsNode2Vec, GNNsNetwork relationshipsSocial networks, fraud detection, protein mapping
Multimodal embeddingsJoint training across domainsCross-domain similarityCLIP (text-to-image search), video captioning

How to Choose the Right Embedding

Think of it as a toolbox — pick the right tool for the job:

  • Use semantic embeddings → when you need meaning (search, clustering, Q&A).
  • Use language model embeddings → when you need general-purpose representations (summarization, RAG).
  • Use word co-occurrence embeddings → when you need lightweight similarity and don’t require deep context.
  • Use sentence embeddings → when comparing sentences or short texts.
  • Use task-specific embeddings → when solving classification problems (spam, sentiment).
  • Use recommendation embeddings → when modeling user preferences.
  • Use graph embeddings → when analyzing networks or relationships.
  • Use multimodal embeddings → when bridging text, image, audio together.

Real-Life Examples

  • Search engines → semantic embeddings match queries with documents.
  • Netflix/Amazon → recommendation embeddings suggest movies/products.
  • Customer support bots → sentence embeddings detect duplicate questions.
  • Spam filters → task-specific embeddings classify emails.
  • CLIP → multimodal embeddings let you search images with text prompts.
  • Fraud detection → graph embeddings reveal suspicious network patterns.