Skip to content
mlmentorship

Content-based filtering

Content-based filtering scores item features against a user profile. It handles item cold-start and often complements collaborative filtering.

Published · 6 min read ·Role-specific ·Intermediate
Reading depth

Content-based filtering can score a new item’s features against a known profile before that item receives any interactions.

Summary

Can a telescope guide with no interactions outrank a popular drama using this user’s history? Use features ordered as science, drama and short. The liked vectors are and .

The mechanism

Their mean is , with squared length . For nonzero vectors, cosine is the dot product divided by both lengths. The guide scores . The drama scores . Neither candidate’s interaction count enters this runtime calculation.

More generally, use for nonnegative weights with positive total. Define feature version, metric, recency weights and eligibility exclusions separately. Zero profiles or zero candidate vectors need an explicit fallback; their cosine is undefined. Learned encoders may still have used cross-user evidence during training.

Learning objective

Shared content features let an unseen item match a user's interests

Shared features connect a new item to known interestsUser interests (2,1) and new-item features (1,3) score 5 by dot product. The item needs no interaction history for this content score.Width: interest. Height: itemfeature.interest 2item feature 1area 2interest 1item feature 3area 32 + 3 = 5Each tile contributes 1
Derivation
Building a user profile and scoring a new item in the same feature space Two liked items have binary vectors over science, drama, and short features. Averaging them gives the user profile one, one half, one half. A brand-new telescope guide has zero interactions but a cosine similarity of 0.87 to that profile, so it ranks above a popular drama with 12,000 interactions and a similarity of 0.41. The content score never uses other users' interaction counts. 1 · REPRESENT LIKED ITEMS features = [science, drama, short] Liked · Space 101 x₁ = [1, 0, 1] Liked · Lab Story x₂ = [1, 1, 0] 2 · AVERAGE VECTORS user profile p = [1, 0.5, 0.5] 3 · SCORE ITEMS #1 · Telescope guide new · 0 interactions x = [1, 0, 1] cos(p, x) = 0.87 #2 · Popular drama 12k interactions x = [0, 1, 0] cos(p, x) = 0.41 OTHER USERS' COUNTS ARE NOT INPUTS TO THIS SCORE
average the liked vectors, then score each candidate in the same feature space. The interaction counts are annotations, not score inputs. Original vectors and layout; mechanism checked against Google's recommendation documentation.
Check: Why can the zero-interaction telescope item outrank the popular drama?
Read it this way: User interests (2,1) and new-item features (1,3) score 5 by dot product. The item needs no interaction history for this content score.
Can swapping the item coordinates change the match score?

Change the evidence or list policy

A user has no history

New task: recommend before any liked-item profile exists.

Picture and change: an empty mean is not the profile above. Request an optional genre preference or use a separately evaluated contextual prior.

Check: explicit drama preference gives . Drama now scores one; the telescope guide scores zero. Absent that evidence, do not pretend a zero profile has meaningful cosine scores.

Use when: the missing evidence belongs to the user, not merely a new item.

Avoid a duplicate list

New task: return two items from different categories.

Picture and change: two identical guides both score ; drama scores . Unconstrained top-two returns both guides, totaling .

Check: a one-per-category constraint selects a guide and drama, totaling . The reduced similarity sum buys the stated diversity constraint, not guaranteed user benefit.

Use when: repeated near-duplicates violate the list requirement; evaluate discovery and useful outcomes separately.

Reconstruct the information path

Can a content item tower prove that the entire recommender uses no collaborative information?

Reasoned answer

No. Inspect user inputs, training objectives and encoder provenance. Two items with identical features remain indistinguishable to this score even when their quality differs. A similarity contribution is not a causal explanation of satisfaction.

Content-based vs collaborative filtering

MechanismRequired evidenceTest separately
Content scorecompatible item features and user/context profilenew-item feature coverage
Collaborative scoreshared interaction structure or learned behavioral factorsinteraction sparsity and exposure
Hybridexplicitly combined feature and behavioral pathscold/warm quality and resource costs

Strengths and weaknesses

Features enable scoring before item interactions, but missing attributes and domain shifts can defeat that benefit. Concentrated recommendations establish overspecialization, not a causal filter-bubble conclusion. Neither approach has universal accuracy, niche-user or discovery superiority.

Hybrid systems (what’s actually deployed)

Mixtures, feature-rich two-tower models and graph side-information can combine evidence. Specify fusion weights and compare baselines on cold/warm, diversity and eligibility slices. Do not assume a mandatory age-based handoff to collaborative filtering.

What an interviewer expects you to say

Trace profile construction, candidate information, score, exclusions and evidence gaps before choosing a hybrid.

Common confusions

Item cold-start is not user cold-start. A named architecture does not specify its actual information sources.


Related: Matrix factorization for recsys, Two-tower retrieval, How would you do cold-start for a new user?, Knowledge-graph embeddings, TF-IDF and BM25.