Notes

Next-Item Prediction

Most recommendation setups throw away the order of a user's history: the interaction matrix records that you watched a thing, not that you watched it after three others. Next-item prediction is the formulation that puts the order back and asks for one specific thing — given the sequence so far, which item comes next?

How it differs from the other framings

  • Rating prediction asks how much a user would like a given item, scored with error metrics such as RMSE on explicit ratings.
  • Top-N recommendation asks for the best unseen items overall, with no notion of when.
  • Next-item prediction asks what follows, so a sequence ending on a tent makes a sleeping bag the right answer and a second tent the wrong one.

How it is trained and judged
Each user's history is split chronologically, the final interaction held out as the target, and the model ranks that true item against the whole catalogue or a sampled subset — reported as HR@k and NDCG@k. The chronological split is load-bearing: a random split leaks the future into training and inflates every number, one of the clearest cases where offline gains fail to reproduce online.

Why it dominates now
It matches how products are actually used — sessions, episodes, journeys whose intent shifts — and it is what transformer-based recommenders are built around, since a catalogue of item IDs behaves enough like a vocabulary for language-model machinery to transfer directly. It also sidesteps the explicit-rating assumption: ordered implicit events are what logs contain anyway.

Next-item prediction frames recommendation as an ordered-sequence task: given a user's interactions in order, rank the catalogue by which item comes next. Unlike rating prediction or order-agnostic top-N, it treats history as a trajectory, so intent that shifts within a session is modelled rather than averaged away. Evaluation holds out each user's final interaction chronologically and reports HR@k and NDCG@k. It is the formulation sequential and transformer-based recommenders are built on.

Think about a friend who is good at lending you books. She does not just know you like crime novels. She knows you finished the first two in a trilogy last month, so she hands you the third.

Next-item prediction is software learning to do that. Rather than asking what you generally like, it looks at the order of what you have watched, read or bought and works out what naturally comes next. Order carries a lot of information: a cot after a pram makes sense, a second pram does not. Most modern recommendation systems are built around this one question.