Course contentsShow
← AI Engineering
Lesson 205 of 1,8866. Embeddings and Semantic SearchFree lesson

What Are Embeddings?

Learn how embeddings represent text as dense vectors in high-dimensional space, capturing semantic meaning numerically.

What Are Embeddings?

What you'll learn: How text becomes dense numerical vectors that capture meaning for AI systems to understand and compare.

The Core Idea

Embeddings transform text into arrays of numbers—typically hundreds or thousands of dimensions—where semantically similar words, phrases, or documents end up close together in this mathematical space.

Think of it like a map: cities that are culturally or geographically similar appear closer together. Similarly, "cat" and "kitten" would have embedding vectors that are mathematically near each other, while "cat" and "democracy" would be far apart.

From Words to Numbers

When you send text to an embedding model (like OpenAI's text-embedding-ada-002 or similar), it returns a vector—a list of floating-point numbers. For example:

  • Input: "artificial intelligence"
  • Output: [0.023, -0.891, 0.445, ..., 0.123] (typically 1536+ numbers)

These numbers aren't random. They encode semantic meaning learned from massive text datasets. Words used in similar contexts get similar vectors.

Why Dense Vectors Matter

Unlike simple keyword matching, embeddings capture:

  • Synonyms: "quick" and "fast" are mathematically similar
  • Context: "bank" (financial) vs "bank" (river) get different vectors
  • Relationships: "king" - "man" + "woman" ≈ "queen" (vector math!)

This numerical representation lets you measure similarity using calculations like cosine distance—essential for semantic search, recommendations, and clustering.

Key Takeaway: Embeddings convert text into dense numerical vectors that capture semantic meaning, enabling machines to mathematically understand and compare concepts rather than just matching exact words.