Part 1 of 5 · The prompt and the labelsLearn and do
Training pairs from one search
A booking means something only next to the listings the guest passed over.
Predict
The guest booked L3, at rank 2 on a page of 4. How many training pairs does that search give?
The page the guest saw
Training pairs
1 L7
(L3, L7)
2 L3, booked
(L3, L9)
3 L9
(L3, L1)
4 L1
The booked listing comes first in each pair.
The label Airbnb settled on is the booking, inside the search where it happened. The 2019 paper trains the model to put the booked listing as high as it can in the logged results. Each training example is a pair from one search: the booked listing, and one listing the booker saw and didn't book.
Why pairs? Both listings in a pair share the guest, the dates, the query and the page. Comparing them inside one search cancels everything that isn't about the listing.
Airbnb's 2022 paper on diversity reads the trained model's output with the Bradley-Terry model: the chance that A beats B is A's booking chance divided by A's plus B's. Say listing A got 2 bookings and listing B got 6 over the same searches. The model should learn that A wins the pair 2 / (2 + 6) = 0.25 of the time.
The rest of the goal goes into guardrails, metrics you watch in every A/B test so a win on bookings can't hide a loss elsewhere: cancellations, host declines, ratings and revenue.
In the editor, write booking_pairs(searches), which turns each search into (booked, other) pairs like the table's, and p_over(pairs, a, b), the share of the pairs between a and b that a won. That share is the number the Bradley-Terry model reads.
Pick an answer above to see the rest
Instructions
1
Write booking_pairs(searches): a (booked, other) pair for each listing a search showed but didn't book. A search with None booked gives no pairs.
2
Write p_over(pairs, a, b): of the pairs between a and b, in either order, the share that a won.