Notes

Next-Click Prediction

Open a shopping app, tap a pair of running shoes, then a second pair, then a sports sock. Nothing about your account changed in those ninety seconds, but what you want next changed completely. Next-click prediction is the framing that conditions on the current sequence of actions rather than on the account.

The task as stated
Given the ordered items a user has interacted with in a session, score every candidate by the probability it is the one clicked next. Training data costs nothing: each logged session is sliced into prefixes and the following click becomes the label, turning ordinary traffic logs into a supervised set with tens of millions of examples. The models are sequence models — GRU4Rec for the recurrent framing, SASRec and BERT4Rec for self-attentive versions — with a sampled softmax over the catalogue.

Why clicks and not purchases
The click is the densest positive signal a system has: orders of magnitude more frequent than conversions, available inside the same session, and recorded for anonymous visitors who never log in. That density is what makes session-based recommendation work where new-user cold start would otherwise leave nothing to personalise on.

What the framing gets wrong
A click is attention, not satisfaction — misleading thumbnails and titles score well on this objective. The label is also conditioned on what the previous ranker chose to show, so the model learns to imitate that policy rather than to find what the user would most want. Production systems keep next-click as one head among several, traded off against dwell time, completion or conversion in the final score.

Next-click prediction frames recommendation as a sequence task: given the items a user has interacted with so far, score each candidate by its probability of being the next click. Sessions sliced into prefixes make the labels free, which is why session-based models such as GRU4Rec and SASRec are trained this way. It personalises anonymous visitors from the current visit alone, but optimises attention rather than satisfaction.

A good shop assistant watches what you pick up. If you have just looked at two pairs of walking boots, she brings you socks, not a sofa — no matter what you bought last winter.

Next-click prediction is software doing the same thing. Instead of judging you by your whole history, it looks at the handful of things you have tapped during this visit and guesses what you will tap next. It works even if you are not logged in, because the current visit is all it needs. The catch is that a tap only proves something caught your eye — not that it was any good.