Offline numbers inherit the old ranker's habits
So far the grades came from judges. When they come from logs, the old ranker leaves its mark on them.
Offline metrics are computed before anything ships, on a fixed set of queries: NDCG on judged results, or on logged searches with the booked listing as the relevant one. They're fast, cheap and repeatable.
Online metrics come from real users in a live test, such as bookings, clicks and revenue. They're closer to the truth, and much slower.
Teams use them in that order. In 2022 Airbnb called interleaving, the fast online check covered in Part 6, the main evaluation technique before the A/B test (1 source).
Logs only hold what the old ranker showed, where it showed it
| Listing | A | B | C | D | E, F, G |
|---|---|---|---|---|---|
| the old ranker showed it at | 1 | 2 | 3 | 4 | not shown |
| clicks | most | fewer | fewer | fewest | none, so no label |
A to D carry position bias. E to G carry selection bias.
Offline numbers built from logs inherit the old ranker's habits in two ways:
- Selection bias. You only have labels for what was shown. A listing the old ranker never showed has no clicks, which is not the same as being irrelevant.
- Position bias. Among what was shown, the top got the most attention, so it got the most clicks, whatever it deserved.
Selection bias is a big reason offline and online numbers disagree, which comes up again under the follow-ups. Position bias is what that Airbnb interviewer dug into.
In the editor, write click_labels(log, catalog). log maps each listing the old ranker showed to its impressions and clicks: the table above, in numbers. Return each listing's click rate, or None for a listing it never showed.