Deep Learning

Embeddings & Representation Learning

An embedding maps an item into a dense vector so useful relationships become geometric. Text, images, users, products, code, and documents can all be represented this way.
  • Embeddings turn sparse symbols into dense vectors
  • The training objective defines similarity
  • Vector distance is not semantic truth
  • Embeddings enable retrieval at scale
  • Representation learning reduces manual feature work
  • Embedding systems need evaluation and governance
Embedding retrieval
The same model should usually embed queries and documents into the same space.
Semantic search shape
query_vec = embed(query)
ids = vector_index.search(query_vec, k=20)
candidates = load_documents(ids)
filtered = apply_permissions_and_freshness(candidates)
ranked = rerank(query, filtered)
Vector search is one stage in a retrieval pipeline, not the whole product.
Sources
  • Machine Learning Crash CourseEmbeddings
  • Dive into Deep LearningRepresentation Learning
  • OpenAI API DocumentationEmbeddings