Notes

Pairwise Ranking

With implicit feedback there are no ratings to predict — only the fact that someone clicked this and not that. Pairwise ranking takes that fact at face value: instead of learning a score for each item in isolation, it learns from comparisons, training the model so that an item a user engaged with scores above one they did not.

What the model actually optimises
Each training example is a triple — a user, a positive item, and a sampled negative — and the loss depends only on the gap between the two scores. Bayesian Personalized Ranking is the canonical form, maximising the probability that the positive outranks the negative; RankNet applies the same idea with a neural scorer. Absolute score values are free to drift, because only the ordering is penalised.

Why it suits recommendation

  • No negative labels required — unobserved items are sampled as negatives, the only workable reading of an implicit matrix in which almost everything is unobserved.
  • It optimises what the metric measures — a pointwise regression can halve its squared error without moving a single item up the list.
  • Negative sampling is the real lever — uniform negatives are weak; popularity-weighted or in-batch negatives sharpen the model, and sharpen its popularity bias too.

Its limits
A pair loss treats every comparison as equally important, so swapping the items at ranks 400 and 500 costs what swapping ranks 1 and 2 costs — the gap listwise objectives like LambdaRank exist to close. BPR against implicit ALS on MovieLens remains the standard back-to-back look at what a pair loss actually buys.

Pairwise ranking trains a recommender on comparisons rather than absolute targets: given a user, a positive item and a sampled negative, the loss penalises the model whenever the negative scores higher. Bayesian Personalized Ranking is the standard instance. It matches implicit feedback, where no explicit negatives exist, and it optimises ordering — the thing top-N metrics measure — instead of a rating error that can improve without changing the list.

If you wanted to learn someone's taste in music, you would not ask them to score every song out of ten. You would ask which of two they prefer. Pairwise ranking teaches software the same way. It takes something you did click and something you did not, and nudges itself until it would have put the first one higher. Nobody has to tell it what you dislike — the things you skipped stand in for that. It works because what matters is the order of the list you are shown, not whether the numbers behind it are exactly right.