RecSys & Search

Content-Based Filtering

Recommending items based on attribute similarity and historical user feature profiles.

🟢 beginner4 min readrecsys
Content-Based Filtering recommends items to a user by matching item feature attributes (genres, text tags, author, brand, TF-IDF vectors) against a user feature profile built from past interactions. Unlike Collaborative Filtering, Content-Based Filtering operates independently across users, enabling instant recommendations for new items with zero interaction history (solving Item Cold-Start). Disadvantages include lack of serendipity (filter bubble) and inability to leverage collective user wisdom.

How Content-Based Filtering Works

  1. ITEM FEATURE VECTORS                    2. USER PROFILE VECTOR u
  Item A (Action Movie): [1.0, 0.1, 0.9]      User likes Item A & C:
  Item B (Romance):      [0.0, 0.9, 0.1]      Profile Vector u = Average(A, C) = [0.95, 0.1, 0.85]
  Item C (Sci-Fi Action):[0.9, 0.1, 0.8]
                                                           │
                                                           ▼
                                              3. SIMILARITY MATCHING
                                              CosSim(u, Item B) = 0.10 (LOW)
                                              CosSim(u, New Item D [0.9, 0.0, 0.9]) = 0.98 (RECOMMEND!)
  1. Extract Item Feature Representation: Convert raw metadata (Text descriptions, genres, tags) into vector $\mathbf{v}_i \in \mathbb{R}^d$ using TF-IDF, Word2Vec, or dense Transformer embeddings.
  2. Build User Profile Vector: Aggregate vectors of items liked by user $u$:

$$\mathbf{u} = \frac{\sum_{i \in \text{Liked}u} r{ui} \cdot \mathbf{v}i}{\sum{i \in \text{Liked}u} r{ui}}$$

  1. Predict Preference & Rank: Score candidate items using Cosine Similarity:

$$\text{Score}(u, i) = \cos(\mathbf{u}, \mathbf{v}_i) = \frac{\mathbf{u} \cdot \mathbf{v}_i}{|\mathbf{u}| |\mathbf{v}_i|}$$

Comparative Matrix: Content-Based vs Collaborative Filtering

DimensionContent-Based FilteringCollaborative Filtering
Data RequiredItem metadata attributes & user logsUser-Item interaction matrix $R_{ui}$
New Item Cold-StartExcellent (Recommends based on metadata)Poor (Requires user interactions)
New User Cold-StartPoor (Needs initial user interest tags)Poor (Requires initial user clicks)
Cross-Category DiversityLow (Trapped in user feature bubble)High (Discovers non-obvious user overlap)
Domain DependenceRequires feature engineering & metadataDomain-agnostic

Modern Hybrid Recommendation Architecture

Production systems combine Content-Based and Collaborative Filtering in a Two-Tower Deep Neural Network:

  User Context Features ──► [ User Tower Deep Net ] ──► Vector u ──┐
                                                                   ├──► Dot Product (u · v)
  Item Metadata Features ──► [ Item Tower Deep Net ] ──► Vector v ──┘

The Item Tower incorporates both content metadata (for cold start) and historical collaborative interactions!

Say this out loud

"Content-Based Filtering recommends items by matching item feature attributes (genres, tags, embeddings) against a user feature profile. It solves the Item Cold-Start problem for new items with zero click history, but suffers from a lack of serendipity by trapping users in feature filter bubbles. Production systems use Two-Tower hybrid models to combine content metadata and collaborative signals."

Follow-ups to expect

Check yourself

Question 1 of 3

Why does Content-Based Filtering solve the Item Cold-Start problem in recommendation systems?

More in RecSys & Search

See all →
Collaborative Filtering5 minThe Cold Start Problem4 minTwo-Stage: Retrieval then Ranking5 min