chapter three
3 Embedding-based recommender systems
This chapter covers
- What embeddings are and why they're fundamental to modern recommenders
- Creating embeddings from user behavior with collaborative filtering
- Using pre-trained models (BERT) for content-based embeddings
- Leveraging LLM embeddings for semantic understanding
- Combining multiple embedding sources for hybrid recommendations
In Chapter 2, we built a simple content-based recommender using TF-IDF and cosine similarity. TF-IDF works, but it has two critical limitations: it treats "adventure" and "adventurous" as completely different words (no semantic understanding), and it ignores user behavior entirely—a user who always reads sports articles gets the same recommendations as someone who never does. Embeddings solve both problems. An embedding is a dense, low-dimensional vector representation that captures similarity. Items with similar embeddings are similar in some meaningful way—and crucially, that "way" depends on how the embedding was created.
This chapter explores three fundamentally different sources of embeddings: