RankNet and LambdaRank
The ranking problem is about ordering a collection of documents according to their relevance to the given query.
Their are multiple approaches to the problem, but in pairwise approach, we simply care about predicting order of document pairs for the query. Given 2 documents
In terms of modelling, we assume there is a base model takes in features
A comparator model is feed these scores which predicts
The comparator model can be a binary classifier by setting
RankNet
RankNet uses a logistic regression as comparator which is feed the difference of scores.
We can define binary cross entropy loss on this model as
Now consider a mini-batch of document
For gradient update, we are interested in computing the gradients generated by each documents.
Now, if we assume the documents follow the order
Note that the ground truth labels
The
If we randomly select a document pair
$$\begin{aligned}
\frac{\partial C_i}{\partial s_j} &=
\begin{cases} \alpha(\hat{y}_{ij}-1) &d_i>d_jorh_{ij}=1
\
-\alpha\hat{y}_{ij}&d_j>d_iorh_{ij}=-1\end{cases}
\end{aligned}$$
Now if we define the quantities
So for each document in the batch, we can simply accumulate
Each
LambdaRank
At this point explaining lambda rank is very simple. Its exactly same as RankNet, but we modify computation of