What is an embedding, really?
Embeddings are the unsexy plumbing of AI. They run quietly behind ChatGPT, Google Search, Spotify recommendations, and every "find similar" feature you have ever used.
Imagine assigning every word, sentence, or document an address on a giant map. Things with similar meaning live close together. Embeddings are the addresses.
A vector embedding is a list of numbers (e.g., 1,536 floats) that represents the meaning of a piece of text. Similar texts have nearby vectors. Different texts have far apart vectors.
Embeddings are produced by neural networks trained on huge corpora to project text into a meaning-aware coordinate system.
from openai import OpenAI
client = OpenAI()
emb = client.embeddings.create(model="text-embedding-3-small", input="hello").data[0].embedding
print(len(emb), emb[:5])
You will get something like 1536 floats. Two embeddings can be compared with cosine similarity.
Quick recall
3 prompts · think before you flip
Prompt 1 of 3
What is an embedding?
Quiz time
1 question · tap an answer to check it
1. An embedding from `text-embedding-3-small` is a list of
Finished lesson 8.1?
Mark complete to update your module progress and unlock the streak.