Collaborative Filtering
Latent factors, implicit feedback and the Netflix Prize.
From 2006 to 2009, thousands of teams competed to improve Netflix's rating predictions by 10%. The winners got there by blending many models built on a few durable ideas: biases, latent factors, implicit feedback and time. This lesson derives those ideas, the weighted least-squares and pairwise ranking losses that learn from clicks instead of stars, and the evaluation traps (non-random missingness, sampled metrics, feedback loops, weak baselines) that still mislead the field.
What you’ll learn
- Formulate neighborhood and latent-factor collaborative filtering, including SVD++'s implicit-feedback term and time-dependent biases.
- Derive the weighted ALS update for implicit feedback with its linear-time shortcut, and derive BPR as MAP estimation of a pairwise ranking model tied to AUC.
- Recount the Netflix Prize accurately, and say what it did and did not teach.
- Evaluate recommenders honestly: non-random missingness and inverse propensity scoring, sampled metrics, feedback loops, and baselines tuned as carefully as new methods.
Neighborhoods and factors
Users rate items ; the observed ratings , , are a tiny fraction of the table, and is the baseline of global mean plus biases. Collaborative filtering predicts the missing ratings from the pattern of everyone's ratings, using no content at all.
Neighborhood models predict from similar items (or, symmetrically, similar users). Item-based collaborative filtering (Sarwar, Karypis, Konstan & Riedl, 2001), deployed at scale at Amazon (Linden, Smith & York, 2003), estimates
where holds the items most similar to among those rated. A good similarity is the correlation of baseline-adjusted ratings over the users who rated both, shrunk toward zero when that support is small: . Neighborhood models are local and explainable ("because you watched…") and use new ratings without refitting.
Latent-factor models fit to all ratings at once, as in the Descent lesson. They capture global structure that neighborhoods miss but are harder to explain. Koren (2008) merged the two families into one model and added implicit feedback: which items a user rated, regardless of the values, reveals taste. In SVD++ a user is represented by plus a normalized sum of factors over the set of items the user rated:
| Aspect | Neighborhood model | Latent-factor model |
|---|---|---|
| Captures | strong associations among a few closely related items | broad structure shared across all items |
| Explanations | natural: "because you rated " | hard: factors are mixtures |
| New ratings | used at once | need refitting, or a quick update of one user's factors |
| Cost | similarities among item pairs | parameters, fitted by ALS or SGD |
What does the term in SVD++ use that plain matrix factorization does not?
- The rating values of similar users
- The time at which each rating was made
- Which items the user rated, regardless of the rating values
- Content features such as a movie's genre
Show the answer
C. Which items the user rated, regardless of the rating values
is the set of items rated, and each contributes its learned vector whatever the rating was. The choice of what to rate is itself information about taste, and it is available even when the values are not.
The Netflix Prize
In October 2006 Netflix released 100,480,507 ratings, integers from 1 to 5 stars, by 480,189 anonymized customers on 17,770 movies, and offered $1 million for a 10% improvement over its own system, Cinematch, in root mean squared error. Predictions were scored on a hidden qualifying set of 2,817,131 ratings, split into a quiz half for the public leaderboard and a test half for the prizes. Cinematch scored 0.9525 on the test half.
Progress came fast and then slowly. The 2007 Progress Prize went to the BellKor team (then called KorBell) for an 8.43% improvement; its solution, outlined by Bell & Koren (2007), was already a linear blend of 107 sets of predictions. In September 2009 BellKor's Pragmatic Chaos won the $1 million with a test RMSE of 0.8567, a 10.06% improvement; The Ensemble matched its score, but had submitted 20 minutes later. A planned sequel was cancelled in 2010 after a privacy lawsuit and concerns raised by the Federal Trade Commission. Feuerverger, He & Khatri (2012) review the data, the contest and the methods behind these numbers.
Cinematch scored an RMSE of 0.9525 on the test set. What test RMSE did a 10% improvement require?
Show the answer
0.8572
, and the official target was 0.8572. The winning 0.8567 cleared it by half a thousandth of a star. Most of the gain over Cinematch came from biases and factor models; the last 1.6 percentage points, from the 2007 Progress Prize to the winning entry, took nearly two years of blending.
Implicit feedback: weighted ALS and BPR
Clicks, plays and purchases are positive-only: there is no explicit dislike, and an absent interaction may mean "not interested" or "never saw it". Hu, Koren & Volinsky (2008) keep every pair but trust them unequally. With the amount of interaction, preference and confidence , they minimize
Fix the item factors . With and , user faces a weighted ridge regression:
Forming directly costs per user, per sweep. But is nonzero only on the items the user interacted with, and is zero elsewhere:
Each user now costs , and by symmetry so does each item. A sweep is linear in the number of interactions, although the loss sums over all pairs:
Weighted least squares still fits each pair's preference separately. Bayesian personalized ranking (Rendle, Freudenthaler, Gantner & Schmidt-Thieme, 2009) fits the order directly. From implicit data, form triples in which user interacted with item but not with item , read as weak evidence that prefers to . Score items with any model, such as , and model the probability of that preference as with . Nothing is assumed about pairs of two unobserved items, or of two observed ones.
Treat the triples as independent given the parameters , with a Gaussian prior . Up to a constant, and with the prior's factor absorbed into , the log-posterior is BPR's criterion:
Compare the per-user AUC, the fraction of (interacted, not interacted) pairs in the right order. BPR replaces its step function by the smooth, concave :
There are about triples, far too many to sweep in order, and consecutive triples from one user would be strongly correlated. LearnBPR draws triples uniformly with replacement and takes stochastic gradient steps, using :
Pairwise losses optimize the order a user sees, but AUC weighs every pair alike: a swap at rank 500 costs as much as one at rank 1. Top-heavy metrics and losses (precision or recall at , NDCG) and the choice of which negatives to sample are where much later work went.
Evaluating recommenders honestly
Missing not at random. Users rate what they chose to consume, and tend to rate what they loved or hated, so the observed ratings are a biased sample of the full matrix (Marlin & Zemel, 2009). Treat exposure as a treatment: weighting each observed loss by the inverse of its probability of being observed gives an unbiased estimate of the average loss over the whole matrix (Schnabel, Swaminathan, Singh, Chandak & Joachims, 2016).
Each term is a scaled Bernoulli variable. Since , every term is unbiased for its :
With and independent terms, the variances add. An entry seen with probability is weighted by 1,000 and contributes about : that is why propensities are often clipped, trading a little bias for much less variance, and why they must be estimated well, for instance from a small randomized sample or a model of exposure.
Sampled metrics. To save time, many papers ranked each held-out item only against a hundred or so randomly sampled items. Krichene & Rendle (2020) showed that sampled versions of top- metrics are inconsistent with the full ones: they need not preserve which of two recommenders is better, not even in expectation, and with very small samples every metric collapses toward AUC.
Feedback loops. A recommender retrained on interactions that its own recommendations caused learns its own choices back. In simulations, such algorithmic confounding homogenizes users' behavior without increasing their utility (Chaney, Stewart & Engelhardt, 2018). Popular items get more exposure, hence more interactions, hence more exposure, and offline metrics computed on logged data inherit the bias. That is one reason an online A/B test, not an offline score, is the final judge of a deployed recommender.
Baselines. Ferrari Dacrema, Cremonesi & Jannach (2019) tried to reproduce 18 recent neural recommendation algorithms from top conferences. Only 7 could be reproduced with reasonable effort, and 6 of those were often outperformed by simple, well-tuned nearest-neighbor or graph-based methods. Rendle, Krichene, Zhang & Anderson (2020) found that with proper tuning a plain dot product substantially beats the learned MLP similarity of neural collaborative filtering, that an MLP has a hard time learning a dot product, and that dot products allow fast approximate nearest-neighbor retrieval.
Key takeaways
- Neighborhood models predict from similar items' baseline-adjusted ratings with shrunk similarities; latent-factor models capture global structure; SVD++ adds which items users chose to rate, and temporal dynamics let biases and factors drift.
- The Netflix Prize (2006–2009): 100,480,507 ratings, a target RMSE of 0.8572 (10% below Cinematch's 0.9525), won by BellKor's Pragmatic Chaos at 0.8567 with a blend of many models.
- Implicit feedback: confidence-weighted least squares over all pairs, solved by ALS in time linear in the interactions via ; BPR fits pairwise preferences by MAP estimation with a smooth surrogate of per-user AUC.
- Logged data are missing not at random. Inverse propensity scoring gives unbiased loss estimates at the cost of variance; sampled ranking metrics are inconsistent; feedback loops homogenize what systems learn.
- Well-tuned simple baselines (neighborhoods, dot-product factorization) remain hard to beat; reproducibility studies found many claimed neural gains disappeared under fair tuning.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
Why can weighted ALS for implicit feedback afford a loss that sums over all user–item pairs?
- Because , where is nonzero only on the items the user touched, so each user costs
- Because it subsamples the unobserved pairs
- Because unobserved pairs get zero weight
- Because the loss is convex, so one ALS sweep suffices
Show the answer
A. Because , where is nonzero only on the items the user touched, so each user costs
is shared by all users and computed once per sweep; the user-specific correction involves only the items with . A sweep then costs , linear in the observed interactions.
BPR maximizes over triples with observed and unobserved for user , minus a penalty. Which quantity does this objective smooth?
- The RMSE of predicted ratings
- The per-user AUC: the fraction of (observed, unobserved) item pairs ranked in the right order
- Precision among the top 10 recommendations
- The log-likelihood of the observed ratings
Show the answer
B. The per-user AUC: the fraction of (observed, unobserved) item pairs ranked in the right order
The per-user AUC averages over such pairs. BPR replaces the step function by the smooth and adds a Gaussian prior, which makes it a MAP estimate.
Users mostly rate movies they chose to watch. What does inverse propensity scoring do about it?
- Drops users with few ratings
- Replaces missing ratings with zeros
- Weights items by popularity
- Reweights each observed loss by , giving an unbiased estimate of the average loss over all user–item pairs if the propensities are right
Show the answer
D. Reweights each observed loss by , giving an unbiased estimate of the average loss over all user–item pairs if the propensities are right
With the observation indicator, , so the weighted sum is unbiased for the full-matrix average. The catches: propensities must be estimated, and tiny ones inflate the variance.
A paper reports that its neural recommender beats "matrix factorization" by 15% on recall at 10. What should you check first?
- Whether the network has enough layers
- Whether the baselines were tuned as carefully as the new model, and whether recall was computed over the full catalog or over sampled candidates
- Nothing: peer review ensures the comparison is fair
- Whether the authors also report RMSE
Show the answer
B. Whether the baselines were tuned as carefully as the new model, and whether recall was computed over the full catalog or over sampled candidates
Reproducibility studies found that many reported neural gains vanished against well-tuned simple baselines, and sampled metrics can even reverse the order of two methods. Both checks come before any architectural question.
Further reading
- Y. Koren, "Factorization meets the neighborhood: a multifaceted collaborative filtering model," Proceedings of the 14th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 426–434 (2008).
- Y. Koren, "Collaborative filtering with temporal dynamics," Communications of the ACM 53(4), 89–97 (2010).
- S. Rendle, C. Freudenthaler, Z. Gantner & L. Schmidt-Thieme, "BPR: Bayesian personalized ranking from implicit feedback," Proceedings of the 25th Conference on Uncertainty in Artificial Intelligence, 452–461 (2009).
- T. Schnabel, A. Swaminathan, A. Singh, N. Chandak & T. Joachims, "Recommendations as treatments: debiasing learning and evaluation," ICML (2016).
- M. Ferrari Dacrema, P. Cremonesi & D. Jannach, "Are we really making much progress? A worrying analysis of recent neural recommendation approaches," Proceedings of the 13th ACM Conference on Recommender Systems, 101–109 (2019).
- A. Feuerverger, Y. He & S. Khatri, "Statistical significance of the Netflix challenge," Statistical Science 27(2), 202–231 (2012).