Clicks measure where an item sat, not just how good it is
Clicks are the cheapest labels, and the most biased.
A click needs a look first
An item sits at position 4, where 1 user in 5 looks. It's exactly as good as the one on top. How does its click rate compare?
- →
- →
- →
The standard model is the examination hypothesis. A user clicks a result only if they look at it and find it relevant. Whether they look depends on the position, not on the item:
P(click on an item at position k)=pk⋅rpk is the propensity: the chance a user examines position k. r is the chance they click once they've looked. Joachims, Swaminathan and Schnabel build on this model. Their abstract states the consequence: position bias strongly shapes how many clicks a result gets.
An equally good item gets five times fewer clicks shown fourth
So raw click-through rate measures pk⋅r, not r. Take two listings with the same r=0.3. One is always shown first, where p=1. The other is always shown fourth, where p=0.2. Their click-through rates are 0.30 and 0.06.
A ranker trained on those clicks learns that the second listing is five times worse. It keeps it low, and the next round of logs agrees:
- →
- →
- →
Airbnb's search team described this loop in 2020. A model trained on bookings learns something that depends on the position, and the position was a decision of the previous ranking model. So each model comes to depend on the ones before it.
The practice test builds a log like this one: propensities [1.0, 0.6, 0.35, 0.2] for positions 0 to 3, a true rate of 0.3, and 200,000 impressions spread evenly over the four positions. Raw click-through rate comes out near 0.3×0.5375=0.161, about half the truth. 0.5375 is the average propensity over the four positions, because three quarters of the impressions sat below the top.
In the editor, write click_log(rng, propensity, rate, n): a click log built the way the examination hypothesis says. Each of the n impressions gets a random position, and is clicked with chance propensity[position] * rate. rng is a NumPy random generator, such as np.random.default_rng(0), so the same seed always gives the same log.
- 1
Write
click_log(rng, propensity, rate, n):nimpressions, each at a position drawn uniformly from 0 tolen(propensity) - 1, each clicked with probabilitypropensity[position] * rate. Return(clicks, positions)as arrays, with each click 1.0 or 0.0.
Run your code to check it. Output shows here.