What are Embeddings?
Embeddings are a way to represent words, sentences, or any data as vectors (lists of numbers) in a continuous numerical space. Since neural networks can only work with numbers, embeddings are how we convert human language into something a model can process.
Why do we need them?
Computers don't understand words like "cat" or "dog" directly. We need a numerical representation. There are older approaches and then there are embeddings:
Older approach — One-Hot Encoding:
Problems with this: every word is equally distant from every other word. It thinks "cat" and "dog" are as different as "cat" and "airplane." Also, for a vocabulary of 50,000 words, each vector would be 50,000 numbers long — very wasteful.
Better approach — Embeddings:
Notice how "cat" and "dog" have similar numbers because they're semantically related (both animals, pets). "Airplane" is very different. This is the magic of embeddings — similar meanings land close together in the vector space.
Key Properties of Embeddings:
Types of Embeddings: