What an embedding is
An embedding is a dense vector that represents a user, item, or any entity. The goal is geometry: entities that should be recommended together end up close in the vector space, so similarity becomes a distance.
Where embeddings come from
- Matrix factorization vectors are embeddings learned from interactions.
- Two tower networks produce embeddings from features.
- Sequence models embed the items a user touched in order, capturing session intent.
- Side information like text or images can be embedded and fused in.
What they enable
- Retrieval: find nearest neighbors to a user embedding in a vector index.
- Transfer: an item embedding learned in one place can seed another model.
- Similarity: more like this and related items fall out of cosine distance.
Practical concerns
- Choose a dimension that balances capacity and cost, often a few dozen to a few hundred.
- Normalize vectors so dot product and cosine agree.
- Refresh embeddings as behavior drifts, since stale vectors degrade slowly.
Key idea
Embeddings map users and items into a shared vector space where nearness means relevance, powering retrieval, similarity, and transfer.