Notes

Model-Based CF

There are two ways to answer “what should this user see next?” from an interaction matrix alone. One is to look up similar users or items at the moment the question arrives. Model-based collaborative filtering takes the other route: compress the matrix into learned parameters ahead of time, then answer from those.

What the model is
Training fits parameters that explain the observed interactions — most often a low-dimensional latent factor vector per user and per item, so a prediction becomes a dot product between two short vectors. The family is wider than matrix factorization: clustering models, restricted Boltzmann machines, factorization machines that fold in side features, and the neural scorers that replaced the dot product all belong here. What unites them is that the raw interaction history is not consulted at serving time — the fitted parameters are.

Why production prefers it
A fitted model is small and fast. Item vectors load into a vector index such as FAISS, and the top few hundred candidates come back in milliseconds from a catalogue of millions — something a query-time scan over raw histories cannot do. Learning also generalises across sparsity: two users with no items in common can still land close together in factor space, where a similarity-based method sees no overlap and has nothing to say.

The trade-off
Freshness. An interaction recorded a minute ago changes nothing until the next training run, so these systems come with a retraining cadence and usually a cheap fallback — trending items, or a similarity lookup — for users whose history arrived after the last fit.

Model-based collaborative filtering learns parameters from the user-item matrix in advance — typically low-dimensional user and item factors — and predicts from those parameters rather than scanning stored interactions at query time. Training is what lets it generalise across sparsity and serve at catalogue scale, since compact item vectors drop straight into a retrieval index. The cost is freshness: a new interaction counts only after retraining.

A librarian who has worked with you for years doesn’t flip through your borrowing slips when you walk in. They have already formed a picture of your taste, and they answer from that.

Model-based collaborative filtering works the same way. Instead of searching through everybody’s history the moment you open the app, the software studies all of that history in advance and boils it down to a compact summary of what each person likes and what each item is like. Answering then takes a fraction of a second, even across millions of products. The catch is that the picture is only as current as the last time it was redrawn.