The mechanism through which position bias impacts a model is that:
some items tend to appear higher / more frequently on screen
thus the model will assign a higher score to those specific items (or when it sees features associated with those specific items) more than what is due i.e. confounding.
there are two things:
correcting the model for position bias
correcting evaluation metrics for position bias
We assume the following causal model:
Let:
u be a user and i be an item. x=(u,i) represents the context.
k∈{1,2,…,K} be the rank/position of item i displayed to user u.
R∈{0,1} be the true relevance (unobserved). R=1 if the user would engage with the item provided they examined it.
O∈{0,1} be the examination (unobserved). O=1 if the user examines the item at position k.
C∈{0,1} be the click (observed).
This model asserts that a click occurs if and only if the item is both examined and relevant: C=O⋅R
The probability of a click is given by:
P(C=1∣x,k)=P(O=1∣k)⋅P(R=1∣x)=pk⋅P(R=1∣x)
Because C=O⋅R, and because O⊥⊥R∣x,k, the expectation over their joint distribution factors into the product of their marginal expectations:
Because ℓ(1,y^) and ℓ(0,y^) are deterministic functions with respect to the model's predictions, we can pull them inside the expectation over C by the linearity of expectation:ER[l(y,y^∣x)]=EC[pkCℓ(1,y^)+(1−pkC)ℓ(0,y^)x,k]
Finally, an estimator of the above loss function is:
[https://decisionmaking4ir.github.io/WSDM-2022/papers/Suguru.pdf](Unbiased Recommender Learning from Biased Graded Implicit Feedback)
II - Late fusion position feature
We still assume the same model:
P(C=1∣x,k)=P(O=1∣k)⋅P(R=1∣x)
and split the model into two towers:
the main tower: a deep neural network fθ(x) that takes only user and item features. This parameterizes the true relevance.
the shallow tower: a very simple network (just an embedding layer or a single linear layer) gϕ(k) that takes only the position k (and potentially other bias features like device type). This parameterizes the observation probability.
We fuse these two towers only at the very end, in logit space, right before the final sigmoid activation function:
logit(C)=fθ(x)+gϕ(k)Implementation details from Google's paper:
10% position feature drop-out rate to prevent over-reliance on position
at serving time, position is treated as missing
they actually cross position feature with device info because different types of devices exhibit different position biases
Question: don't we still learn a biased quantity, if we learn the click label?
Instead of correcting click for position bias, we force the model's architecture to mirror the causal mechanism that generated the biased data, hoping that the network naturally disentangles the hidden variables. We are performing Maximum Likelihood Estimation (MLE) of a model that separates the relevance parameters from the position bias parameters. Mechanically, the shallow tower provides the easy gradient that items at k=1 are universally clicked more often, while the main tower is forced to explain whatever variation is left over.
Mesuring position bias p_k
We need to actually measure position bias to generate the corrected biased used in inverse propensity weighting
Estimation from Regular Clicks using the Expectation Maximization algorithm: user is not exposed to any randomized results, but accuracy is lower
Randomize Top N
the relevance component rq,d is hidden. We can average out this variable by randomizing the result list. For a randomized dataset where the top N documents are randomly shuffled before showing them to users, let Rk be the subset of collected logs from position k.
since ∑q,d∈RkP(q,d) is constant across all N positions (can be thought of as the average relevance of the candidate pool).
We can just normalize all propensities and return pk/p0
Randomize Pair
Let us denote dk a document that is originally at position k. Recall that our model assumes P(C∣q,dk)=pkrq,dk
By swapping documents k and k+1 in the final results, the user now needs to examine position k+1 to see document dk:
P(C∣q,dk,swap)=pk+1rq,dk
Thus:
P(C∣q,d,no swap)P(C∣q,d,swap)=pkpk+1
Meaning, if we can estimate the probabilities on the left-hand side, we can estimate the position bias of k+1 with respect to k.
Now, notice that both quantities on the left-hand side are click through rates (conditioned on query, document and whether we swap or not). Let us denote Dk the set of documents that were originally in position k, for a query q:
both expectations can be estimated by taking the sum of clicks, conditioned on the proper variables. i.e.:
pkpk+1=avg number of clicks for position k without swapavg number of clicks for position k with swap
The relative ratio between any two positions is given by the chaining the ratios: p1pk=pk−1pk…p1p2
We can see the limitations of the position bias model by performing RandomizeTopN:
after L2 scoring (L2 set)
without L2 scoring (L1 set)
the propensity values will display different curves, showing that they are not independent of the relevance of the document set. In the L2 set, whatever item randomization drops into position 0 is likely to be good, so the user is often satisfied immediately and stops scanning. Examination at lower positions collapses which explains the steep decay. The next step would be to move to a cascade-aware or relevance-conditioned propensity model.
When applying filters for analysis (e.g. US users only, initial impressions without scrolling, 9+ results), make sure they are all unaffected by the treatment (pre-treatment filters).
Some filters are necessary. For example, some sessions might display less than N candidates. This adds a bias towards earlier positions and we will only retain sessions with more than N candidates displayed.
other methods for correcting position bias
1. randomized exploration
Rather than correcting observational bias retrospectively, this approach alters the data generation process. A small fraction of user traffic is subjected to a policy where items are ranked uniformly at random.
recall the original data generation process:
r -> k -> o
\ /
\ /
v v
click
this treatment removes the causal link between relevance (r) and position (k) meaning:
Under a purely random policy, the position assignment k is perfectly independent of the item covariates x. Consequently, pk becomes a known uniform constant, and the resulting interaction logs are mathematically guaranteed to be an unbiased sample of true relevance. This data can be used as a pristine validation set or to perfectly calibrate propensity scores for the rest of the dataset.
sequential / cascade click models
Until now, our model (click = observation x relevance) was point-wise: it assumed that the probability of observing the item at position k is independent of the items placed above it. Instead, cascade models use a Markovian process where the user scans a list linearly from top to bottom.
A user observes position k iff they observed k−1 and did not find it relevant enough to terminate their search.
P(Ok=1)=P(Ok−1=1)⋅P(Rk−1=0)
instead of being fixed, the propensity pk is context-dependent.
other approaches worth looking into:
heckman sample selection (mills ratio)
unbiased pairwise and listwise ranking: debias ranking functions like LambdaMART that optimize relative order by applying inverse propensity weighting to the pairwise gradient.
Evaluation
offline metrics (AUC)
Since click is confounded by position bias, so are offline metrics. We expect a debiased model to:
perform worse on the regular (biased) logs
perform better on the debiased logs
We can correct AUC inverse propensity weighting (IPS-AUC) and determine if this improves the offline / online correlation (AUC percent difference vs CTR percent difference for example).
online metrics
if the only difference between Model A and Model B is how we handle the position bias correction (IPW correction, late fusion position feature), then any engagement gains in the A/B test are strictly caused by position bias correction.
However this does not tell us the extent to which we successfully eliminated position bias from our model. I haven't found any convincing way to evaluate this.
head vs tail analysis
If we expect the change to reduce popularity bias and increase exposure to tail items, we can group items by historical exposure and verify that we see most gains on tail items.