KnowML

Designing Search Ranking

Follow Nadia's search for a December weekend in Lisbon down to the models that put a hundred thousand homes in an order for her. We build it from a hand-made score, fix each failure in turn, and look at what Airbnb published, including the ideas that failed.

⏱ 79 min readAssumes: recommenders, ranking and search (16), classical ML (02), evaluation (25)
Start reading

Nadia opens the Airbnb app on a Tuesday evening in late October, types Lisbon, picks Friday 4 December to Sunday 6 December for two guests, and taps Search. A page of listings fills the screen: a tiled flat in Alfama with a small balcony, a bright studio in Baixa, a rooftop room in Graça. She scrolls, taps four of them to read the details, saves one, and twenty minutes later sends a reservation request for the flat with the balcony. By the next morning the host has said yes.

That first page's order decided most of what happened. A big city can have around a hundred thousand homes available for a given pair of dates, and Nadia looks hard at perhaps the first handful. Whatever sits in the first few positions gets the attention, and whatever sits at position sixty might as well not exist. What decides those positions knows very little about her: a city, two dates and a number of guests. It can't ask what she wants. It can't treat her as one guest among millions either, because a home can be booked by only one party for those nights, and a host who says no, or cancels later, wastes everyone's time. Its only teacher is the log of what earlier guests clicked and booked on pages that earlier models had arranged.

Putting the listings of a search into an order is search ranking, and training a model to produce that order from logged behaviour is learning to rank. The question this chapter answers is: how does Airbnb put a hundred thousand homes in an order that suits one guest it knows almost nothing about, when each home can be booked only once and the host has to agree?

We'll build the design from its most obvious version, filter and sort, and fix each failure in turn: a learned score, a loss that cares about the top of the list, neural networks and the many ideas that didn't work, session embeddings, position bias, price, hosts, diversity, and the retrieval machinery around it all. We rely on Airbnb's own papers and posts, dated where they appear, and say where internals are unpublished.

01What we're building, and how big

1.1 What it has to do

A guest gives the system a place (typed into a search box, or implied by the area of a map she has panned to), a range of dates and a number of guests. It returns the listings that are free on those dates and fit the party, in an order, as a list of cards or as price pins on a map. Airbnb's own description of the job, in a 2019 paper by Malay Haldar and colleagues, is to answer with "an ordered list of a handful of listings from the thousands available in the inventory".

This chapter's central model orders listings by the guest's likelihood of booking. It is one member of a family: the same 2019 paper says other models predict whether a host will accept the request and whether the guest will rate the stay five stars. So the requirements run wider than "predict a click". Its order should lead to bookings that hosts accept and nobody cancels, from stays guests rate well. New listings need a fair chance, the first page shouldn't be a dozen near-copies, and every change must be testable against real bookings, in an A/B test where some searchers get the new ranking and others the old one.

1.2 How big is it?

These figures come from different years, so we'll date each one. In March 2018 an Airbnb post by Mihajlo Grbovic and colleagues described embeddings for 4.5 million active listings learned from more than 800 million click sessions, and said search ranking and the Similar Listings carousel together drove 99% of booking conversions. A June 2024 paper by Haldar and colleagues reported more than 7.7 million active listings in over 100 thousand cities and towns, and says only 20% of searches come from the search box; the rest come from a guest moving a map. A January 2026 paper on retrieval (Abdool and colleagues) says popular locations can have around a hundred thousand available homes, and that hosts change prices and availability roughly 10,000 times a second.

Two more facts shape the design. Booking a stay is a big purchase, so a guest explores: the 2023 Journey Ranker paper says a guest can spend multiple weeks and dozens of searches before sending a request. And positive labels are scarce, since even the most popular listing can be booked at most 365 times a year, as the 2019 paper points out.

Predict before you read on

Suppose a search in a big city has 100,000 eligible homes, and a large ranking network costs 20 microseconds of one CPU core per home (an illustrative figure, since Airbnb doesn't publish its model costs). How many CPU-seconds does one search cost if we score every home, and how many cores would you need to finish in 100 milliseconds? Then think about flexible dates, where a guest who is open to plus or minus three days has 49 different check-in and check-out combinations.

Show the answer

One hundred thousand homes at 20 microseconds is 2 CPU-seconds. To finish in 0.1 seconds you would spread the work over 20 cores, for one guest's one search. At an illustrative 1,000 searches a second that is 2,000 cores kept busy for scoring alone. Flexible dates make it worse: if each of 49 date combinations were a separate search, the bill would be 49 times larger.

So scoring everything with the heavy model can't work at the size of a big city. Something much cheaper has to cut the candidates down first, and the heavy model, the one that costs real money per listing, has to meet only a fraction of the inventory. Airbnb's papers describe exactly that: several stages, each scoring about an order of magnitude fewer homes than the one before.

We also have no published figure for Airbnb's end-to-end latency budget, and we won't invent one. The papers do give relative changes, such as a 33% lower 99th-percentile scoring latency (the time that 99 of 100 searches beat) from a new architecture and an 8.4% higher 95th-percentile latency from the diversity ranker, and we'll reason about the rest from what a request has to do.

02Version 1: filter, score by hand, sort

The first design is the one anybody would build. A database knows which listings are free on Nadia's two nights and sleep at least two people, and that part is exact, with no learning involved. Among the survivors we need an order, so we write a formula that adds up things guests tend to like. Price counts against a listing, review rating counts for it, a good number of reviews counts for it, a central location counts for it, and we choose a weight for each term and sort. A 2019 paper says this is how Airbnb began: "The very first implementation of search ranking was a manually crafted scoring function." A 2022 paper by Haldar and colleagues adds that before 2015 listings were ranked by scoring functions designed by engineers, built on price, location and review ratings.

Version 1: filter, score by hand, sort
QUERY Lisbon, 4-6 December 2 guests FILTER free both nights sleeps two or more HAND-MADE SCORE weights on price, rating, reviews SORT + PAGE highest score first first page of cards Nothing checks that a higher score means more bookings. Weights are an engineer's guess. Every rule is easy to read and explain, which is why this style of ranking ran Airbnb search until 2015. Nadia's taste (a balcony, a quiet street) appears nowhere in the formula, and neither does anyone else's.
Follow the arrows left to right. Its filter is exact (a listing is free or it isn't), but the score is a guess, and that is the part we replace.

Its strengths are real. Every term is readable, a bad result can be fixed by editing one weight, and nothing needs training data.

It breaks in ways that tell us what to build. Its weights are guesses, and nothing checks whether a higher score goes with a booking. Someone has to decide whether a ten percent lower price is worth one fewer review point, and the right answer depends on the city, the season, the number of guests and the guest herself. A formula with a few dozen hand-set terms can't hold all of that, and it can't improve as the inventory and the guests change, because nobody has told it what to learn from.

Way to order the listingsPlusMinus
Sort by one field (price, rating)Trivial, predictable, easy to explain to hostsPuts the cheapest or the best-reviewed first for everyone, with no sense of fit
Hand-weighted score (pre-2015)Readable, editable, no data neededWeights are guesses; cannot capture interactions; does not learn
Learned score from past bookingsWeights come from what guests did; improves with dataNeeds logs, labels, an evaluation method and a serving system

Our remedy follows from the failure: let the logged behaviour of earlier guests set the weights. That's what Airbnb did next.

03Version 2: learn the score from past bookings

For each search in the log we know which listings were shown and which one, if any, the guest booked. We can turn that into a number per listing, a utility, and train a model to predict it from the listing's features. A 2022 paper gives an example of such a scheme: a booking might be assigned a utility of 1.0, a click on the listing 0.2, an impression 0.0, and a cancellation a negative utility of −0.5. A regression model is then trained to get those numbers right.

Airbnb launched a gradient boosted decision tree (GBDT) for this in 2015. A decision tree asks a series of yes-or-no questions about a listing ("is the price under 90 euros?") and ends in a leaf holding a number. Boosting builds hundreds of small trees one after another, each fitted to the mistakes of the ones before it, and the prediction is the sum of their leaves. Trees need no feature scaling, which made them a good first learner, but they lean on human-made features, and the 2019 paper says the pipeline's "extensive feature engineering" had accumulated over years.

Replacing the hand-made score with this model was a large step. Haldar and colleagues' 2019 paper calls it one of the largest step improvements in home bookings in Airbnb's history. That sentence goes on to tell the rest of the story: "The gains in online bookings eventually saturated with long spells of neutral experiments."

Three weaknesses explain the plateau, and each points to a section below. First, the target is a made-up utility, so the model's output relates to booking probability only indirectly, as the 2022 paper says. Second, the loss treats every listing as an independent regression row, though what matters to a guest is the order, especially at the top. Third, the strength of trees, hand-built features, had become the limit: nobody could tell whether those years of features were still the best ones for a marketplace that kept changing. How to ask the model for an order is where we go next.

04Teaching the model to order: pairs, NDCG and LambdaRank

Let's name what we want. For a search whose guest booked one listing, the best possible order puts the booked listing first. A booked listing nearer the top is better, and a model that puts it at position 2 has done much better than one that puts it at position 40. A metric that captures that is NDCG, normalized discounted cumulative gain. Airbnb uses it with binary relevance: the booked listing has relevance 1, everything else 0. With one booked listing per search, NDCG reduces to a discount applied to the booked listing's position. In the 2022 paper it reads, for searches where the booked listing sat at position (counting from 0), as

Position 0 scores 1.00, position 1 scores 0.63, position 4 scores 0.39 and position 9 scores 0.29. This curve falls fast at the top and flattens, which matches how guests look at a page: the first positions get most of the attention. We'll see in section 13 why this makes the metric track bookings so well.

Our regression on utilities doesn't aim at this metric. We need a loss that does. A first step is to stop predicting an absolute number and compare listings. From one search we build pairs: take the listing the guest booked, , and any listing that was shown alongside it but not booked, . A model sees the query , the user and a listing, and returns a score called a logit. We train it so that the booked listing outscores the other one, with a cross-entropy loss (the standard loss for an outcome that should come out as a probability near 1) on the difference of the scores:

The first form says "the probability that wins the pair, under a softmax of two scores"; the second is the same thing rewritten as a function of the score gap. Its TensorFlow version takes four lines in the 2022 paper. What sits inside the log has a meaning that matters later. Minimising this loss over many pairs makes an estimate of the pairwise booking probability, and the Bradley–Terry model connects it to the ordinary probability that a shown listing gets booked:

A small example from the same paper makes it concrete. If listings and were both shown in 100 searches, and got 2 bookings while got 6, their booking probabilities are 0.02 and 0.06, and the pairwise probability is 2/(2+6) = 0.25: for every booking of we expect three of . It follows that sorting by the pairwise logits is the same as sorting by the pointwise booking probabilities, since 's logit beats 's exactly when , which happens exactly when . The model never needs to output a probability. Any monotone score will do, and a sort by that score is the ranking.

Pairs treat all mistakes alike, though. Getting the booked listing above a listing at rank 1 matters a lot more than getting it above one at rank 30. A fix comes from LambdaRank, a method of Christopher Burges and colleagues at Microsoft that Airbnb adopted: weight each pair's loss by how much NDCG would change if the two listings swapped places. That 2019 paper calls this the first breakthrough of its neural network work, and gives the weight in code as the absolute difference of the two discounts at their current ranks in the model's own output, so the weights are recomputed as the model improves.

One search becomes five weighted pairs
ONE LOGGED SEARCH, SHOWN TO NADIA WEIGHT OF EACH {BOOKED, OTHER} PAIR rank 0 · listing A · discount 1.00 0.61 rank 1 · listing B · discount 0.63 0.24 rank 2 · listing C · discount 0.50 0.11 rank 3 · listing D · discount 0.43 0.04 rank 4 · listing E · BOOKED the booked listing is the anchor of every pair rank 5 · listing F · discount 0.36 0.03 discount d(x) = ln 2 / ln(2 + x) for rank x, so rank 0 counts 1.00 and rank 9 counts 0.29. pair loss = weight x log(1 + exp(-(score of E - score of other))), summed over the pairs.
Read the bars from top to bottom. Pairing the booked listing E with the listing in rank 0 matters roughly twenty times more than pairing it with rank 5, because swapping those two moves the booked listing across the biggest NDCG gap.

This picture shows the effect for Nadia's logged search. She booked listing E, which the old model had placed at rank 4, and the other five listings give five pairs. Pairing E with the listing at rank 0 gets weight 0.61, with rank 1 gets 0.24, and with rank 5 only 0.03. Training pressure on "move E above A" is twenty times the pressure on "move E above F", because that swap would shift E across the largest gap in the discount curve. That paper puts it in one sentence: improving the rank of a booked listing from position 2 to 1 gets priority over moving a booked listing from position 10 to 9.

LossPlusMinus
Pointwise regression on a utility (GBDT, 2015)Simple, uses every impression, any regression libraryUtilities are made up; ignores that only the order matters
Pairwise cross-entropyMatches the goal of ranking the booked listing higher; logits order listings by booking probabilityEvery pair counts the same, so errors at rank 30 cost as much as errors at rank 1
Pairwise weighted by ΔNDCG (LambdaRank)Spends effort where position matters; optimises the metric the team watchesWeights depend on current ranks, so they must be recomputed each step
Listwise softmax over the whole resultLooks at all listings of a search at onceAssumes each listing's booking chance is independent of the others, as the 2022 paper points out

Airbnb moved from the first row to the third in its neural network work of 2017 and 2018 and kept NDCG as its main offline metric. Later papers describe a pairwise cross-entropy, and Journey Ranker allows pairwise or listwise losses per task. The last-row caveat comes back in section 10, where it turns out to be the key to diversity.

LambdaMART, the tree-based sibling of LambdaRank, became a standard tool in web search research, and face recognition systems train on triplets with the same idea of pulling a positive closer than a negative.

Why use only one booked listing per search as the positive?

Because bookings are the outcome that pays for everything, and Airbnb's metric is built on them. A click means a guest was curious, and a long view can mean a listing is merely expensive or odd. In 2019 the team tried to add long views as a second label and found that bookings stayed neutral. Section 9 returns to using more labels, but with a design that keeps the booking at the centre.

05Neural networks, and the ideas that didn't work

With a loss that cares about the top of the list, the GBDT's hand-built features became the next limit, and the obvious replacement is a neural network that learns its own combinations. Airbnb's 2019 paper, Applying Deep Learning to Airbnb Search, tells that move as a series of small steps, and its most useful parts are the ones that went wrong, so we'll follow both.

5.1 Four models in a row

The first network was deliberately boring: one hidden layer of 32 ReLU units (the standard neuron, which outputs zero for negative inputs and the input itself otherwise), fed the same features as the GBDT and trained with the same L2 regression. It was booking neutral against the GBDT, which the paper counts as a success of a kind, because it proved the whole pipeline from logs to live scoring. Its authors had started with intricate custom architectures and got "overwhelmed by their complexity", and they adapted Andrej Karpathy's advice to "don't be a hero, in the beginning".

In the second model the loss became the weighted pairwise form of section 04, and that was the first real gain. A third tried to merge three models that ranked differently, a GBDT, a factorization machine and the network, by feeding the tree leaves and the factorization output into the network as features, and the paper calls the complexity "staggering". A fourth removed it: the team scaled the training data tenfold and moved to a plain network with two hidden layers. A typical configuration was 195 input features (after categorical features became embeddings), 127 ReLU units in the first hidden layer and 83 in the second. Over 1.7 billion training pairs, the gap between training and test NDCG closed. In retrospect, the lesson is that deep learning "is not a drop-in model replacement at all; rather it's about scaling the system".

5.2 Features a network can digest

The first attempt to feed the GBDT's features to a network "went down very badly", and the loss stopped improving partway through training. Scale was the cause. Trees care only about the order of a feature's values, but a network multiplies features by weights, and a value far outside the usual range sends a huge gradient back that can permanently switch off a ReLU unit. Fixing it meant bringing every feature into a small range, with the bulk of values between −1 and 1 and the median at 0: standardise a roughly normal feature with , and map a power-law feature through .

Next the paper asks each feature's distribution to be smooth, for three reasons. Smooth plots expose bugs: spikes in price histograms revealed prices logged in the wrong currency for some regions, and a monthly price logged in place of the daily one for stays over 28 days. Smooth inputs help the network generalise, because the layers above can interpolate between combinations they have never seen. And an odd distribution can reveal a missing feature, such as average length of stay, which minimum-stay rules had been distorting in the share of future days a listing was booked. Latitude and longitude became the log of the offset from the centre of the map the guest was viewing, so the model learns "far from where she's looking" instead of memorising coordinates. The engineering around the model changed too: protocol buffers and TensorFlow's Dataset API gave a 17 times training speedup, and because no efficient way existed to score a TensorFlow model inside the Java search stack, the team wrote its own scoring library.

Specific places still matter, and a network can learn them cheaply. The paper hashes (turns into a number by a fixed recipe) the query's city together with the level-12 S2 cell of the listing (S2 is Google's grid over the Earth, and a level-12 cell is a few square kilometres) into one categorical feature that indexes an embedding. Backpropagation turns that embedding into a learned preference for that neighbourhood in that city, replacing a heavily engineered pipeline of neighbourhood statistics.

5.3 Two ideas that failed

The paper picks out two failures because they show how a technique that works well elsewhere can fail at home. One is listing IDs. Networks for video and language got large gains from embedding high-cardinality IDs, so the team gave every listing a learned vector. Its learning curve showed a clear improvement in training NDCG and none on test data: the model memorised.

Predict before you read on

A video on a big platform can be watched millions of times a year. A listing on Airbnb can be booked on at most 365 nights a year, and a typical stay is two or more nights. Roughly how many bookings could even the best-booked listing contribute as positive examples in a year, and what does that mean for a vector learned for that listing alone?

Show the answer

At most a few hundred, and typical listings a handful. A vector with 32 or 64 numbers needs far more examples than that to settle on sensible values, so each listing's vector fits noise in its few bookings. In its own words, "even the most popular listing can be booked at most 365 times in an entire year", which makes data "very sparse at the listing level", and the overfitting is "a direct fallout of this limitation". Items in the physical world have a ceiling on interaction that a video or a word doesn't.

A second failure came from the obvious cure for sparse bookings. Views of a listing's page are plentiful, so the team trained a multi-task network that predicted bookings and long views from a shared hidden layer, with a shared listing-ID embedding, and weighted the booking loss up to compensate for the larger number of view labels. Online, long views rose by a large margin and bookings stayed neutral. When the team inspected listings with many long views and few bookings, it found expensive homes, listings with long descriptions that were hard to parse, and strange or funny ones. Its conclusion is that long views correlate with bookings but also have "a large orthogonal component".

Hyperparameter work went the same way. Time went into dropout (randomly blanking part of the network during training so it can't lean on any one piece), initialisation, learning rate and batch size, "mostly driven by anxiety akin to FOMO", and the paper says none of it produced meaningful improvements. Every flavour of dropout slightly hurt offline metrics, and hand-shaped noise gained roughly 1% offline NDCG and nothing significant online. It kept defaults: Xavier initialisation, a Lazy Adam optimizer and a fixed batch size of 200.

Model familyPlusMinus
GBDT on engineered featuresRobust to feature scale; strong at medium size; easy to partially explainGains plateaued; accumulated feature engineering; hard to scale with data
Neural network, same features and lossProves the serving pipelineBooking neutral against the GBDT
Neural network, pairwise loss, 10x data, two hidden layersLearns feature interactions; gains scale with data; less feature engineeringNeeds normalised, smooth inputs and a rebuilt training and serving system; feature importance harder to read

Airbnb chose the third row. Asked whether it would recommend deep learning to others, the paper answers "a wholehearted Yes", mostly because it changed the roadmap: after the move, "trying to do better math on the features manually has lost its luster", and attention shifted to the optimisation objective. It keeps GBDT for "focused medium sized problems". That paper shows each model's online gain only as a chart, so we won't quote percentages.

Why did the network lose the ability to explain which features matter?

Because a network's output is a tangle of non-linear interactions, and every simple tool for reading it assumed something false. Splitting the score into per-input contributions has no clean answer across a ReLU. Ablating one feature and retraining gave differences within normal retraining noise, since correlated features cover for each other. Permuting one feature at a time made the number of rooms look like one of the most important features, because permuting rooms alone creates a studio with eight rooms that never occurs. What worked was a home-made tool, TopBot, which compares feature distributions of top-ranked and bottom-ranked listings in each test search without perturbing anything.

06What Nadia just clicked: listing embeddings from sessions

Nadia has now clicked two flats in Alfama and passed over a studio in Baixa that the model ranked above them. Section 05's network sees her query and a listing's features, so it ranks her next page the way it would rank anyone's. What it lacks is a way to say "she liked those two, show me more that look like them". To get one, we need a way to measure how similar two listings are that goes beyond price and bedroom counts: a tiled balcony, a quiet courtyard and a view are hard to write down as features.

An answer arrived in 2017 from the same idea that makes word vectors work. A skip-gram model, from natural language processing, learns a vector for each word so that words appearing in the same sentences end up close together. Treat a guest's session of clicked listings as a sentence and each listing as a word, and the same recipe gives each listing a vector. Mihajlo Grbovic and Haibin Cheng published the system at KDD 2018 and described it in an Airbnb engineering post on 13 March 2018. A session is "an uninterrupted sequence of n listing ids that were clicked by the user", and a new session starts after a gap of more than 30 minutes. Each vector has 32 dimensions, a size chosen as a trade-off between offline quality and the RAM needed on the search machines to compute similarities live.

6.1 The training objective

Training slides a window of length across a session. At each step the vector of the central listing is pushed toward the vectors of the positive context listings that the same guest clicked just before and after it, and pushed away from negative listings sampled at random, since random listings are rarely related. Two changes adapt this to a marketplace.

One is to use the booking. Some sessions end with a booking, and that booked listing tells us more than any click. Airbnb adds it as global context: at every step of the window, however far the booked listing is from the centre, it stays in the positive set. A listing clicked at the start of a session is thereby pulled toward the listing the guest eventually chose, even when ten other clicks lie between them. Another change comes from how people search. A guest searches inside one market (a city or an area), so for any central listing the positives are mostly from the same market while randomly sampled negatives are mostly from other cities. A model can learn to tell cities apart and still know nothing about taste inside a city. So Airbnb adds a set of market negatives, random listings sampled from the central listing's own market. Written out with context vectors , the objective the post describes is

Here is the sigmoid, which squashes a score into a probability between 0 and 1, holds (central, context) pairs from the window, holds (central, random listing) pairs, is the booked listing, and holds (central, random listing from the same market) pairs. Its first two terms are ordinary skip-gram with negative sampling, the third is the booking pulled in as global context, and the fourth is the market negatives. Airbnb learned vectors for 4.5 million active listings from more than 800 million click sessions, and to give a new listing a vector on the day it appears, it averages the vectors of the three geographically closest listings with the same listing type and price range.

Listing embeddings from sessions
clicked l1 clicked l2 clicked l3 centre clicked l4 clicked l5 booked lb end one guest's session in click order; a gap of 30 minutes starts a new session booked listing stays in the context for every centre RANDOM LISTINGS, ANY MARKET pushed away from l3 RANDOM LISTINGS, SAME MARKET AS l3 pushed away from l3 green: pulled together (window of 5 each side) Each listing ends up as 32 numbers. Listings that share a session, a booking and a market drift together. Without the second pink box, almost every negative is from another city, which is too easy to teach within-city taste.
Start with the amber centre listing l3. Green arrows pull in its window neighbours and the booked listing, and pink arrows push away random listings, half of them from l3's own market.

That post's offline test was about ordering: rank the listings a guest was choosing among by cosine similarity (the angle between two vectors) to a listing she clicked, and see where the eventually booked one lands, averaged over clicks as far back as 17 before the booking. Three trainings were compared, ordinary skip-gram, with booking as global context, and with both modifications, and the last gave a consistently lower average rank of the booked listing. Our experiment below isolates the same two modifications on a toy marketplace where we know the truth.

Try it Skip-gram listing embeddings: plain, booked as global context, and with market negatives
import numpy as np
rng = np.random.default_rng(0)
M, P, S, D = 8, 40, 4, 16     # markets, listings per market, styles, dims
L = M * P
market = np.repeat(np.arange(M), P)
style = np.tile(np.arange(S), L // S)

def session():                # 5 clicks in one market, then a booking
    m, fav = rng.integers(M), rng.integers(S)
    pool = np.where(market == m)[0]
    w = np.where(style[pool] == fav, 2.0, 1.0)
    clicks = rng.choice(pool, 5, p=w / w.sum())
    return list(clicks), rng.choice(pool[style[pool] == fav])

train = [session() for _ in range(30000)]

def fit(book_ctx, mkt_neg, epochs=4, lr=0.1, win=1, neg=5):
    V = (rng.random((L, D)) - .5) / D       # listing vectors
    C = np.zeros((L, D))                    # context vectors
    sig = lambda x: 1 / (1 + np.exp(-x))
    for _ in range(epochs):
        for clicks, book in train:
            seq = clicks + [book]
            for i, c in enumerate(clicks):
                ctx = [seq[j] for j in range(max(0, i - win),
                       min(len(seq), i + win + 1)) if j != i]
                if book_ctx and book not in ctx:
                    ctx.append(book)            # booked = global context
                for t in ctx:
                    ts = [t] + list(rng.integers(0, L, neg))
                    lab = [1.0] + [0.0] * neg
                    if mkt_neg:                 # same-market negatives
                        pool = np.where(market == market[c])[0]
                        ts += list(rng.choice(pool, neg))
                        lab += [0.0] * neg
                    ts, lab = np.array(ts), np.array(lab)
                    g = (sig(C[ts] @ V[c]) - lab)[:, None]
                    dv = (g * C[ts]).sum(0)
                    np.subtract.at(C, ts, lr * g * V[c])
                    V[c] -= lr * dv
    return V

def style_p5(V):              # do nearest neighbours share a style?
    Vn = V / np.linalg.norm(V, axis=1, keepdims=True)
    hits = []
    for a in range(L):
        pool = np.where((market == market[a]) & (np.arange(L) != a))[0]
        top = pool[np.argsort(-(Vn[pool] @ Vn[a]))[:5]]
        hits.append(np.mean(style[top] == style[a]))
    return np.mean(hits)

runs = [("plain skip-gram", 0, 0), ("+ booked as global", 1, 0),
        ("+ same-market negatives", 1, 1)]
for name, b, m in runs:
    share = style_p5(fit(b, m))
    print(f"{name:25} same-style share of top 5: {share:.2f}")
Chance is 0.25. Plain skip-gram scores 0.29, adding the booked listing as global context lifts it to 0.38, and adding same-market negatives lifts it to 0.49. Only the training pairs changed between the three runs.

Eight markets of 40 listings each have four hidden styles, and a guest in a session clicks five listings in her market, favouring one style, then books a listing of that style. The test then asks, for each listing, whether its five nearest neighbours in the same market share its style (25% by chance). Plain skip-gram barely beats chance. Booking as global context lifts it, because every click gets pulled toward a listing of the guest's real taste. Adding market negatives lifts it further, because without them almost all negatives are from other markets and teach nothing about taste inside one. (This is one run with a fixed seed. It is built to make the mechanism visible, and the sizes of the gaps are not Airbnb's.)

6.2 From vectors to real-time personalisation

Vectors by themselves don't re-rank anything. Airbnb's 2018 post describes how they enter the ranking model. For each guest the system keeps, in real time through Kafka, a message queue, two sets of recent events: the listings she clicked in the last two weeks, and the listings she skipped, defined as ones ranked high that she passed over in favour of a click on a lower-ranked listing. At each search, two features are computed for every candidate. EmbClickSim is its similarity to the listings she clicked (specifically, the maximum similarity to market-level centroids of her clicked listings), and EmbSkipSim is its similarity to the ones she skipped. Both go into the ranking model as extra features.

That post checks that the model uses them as intended with partial dependence plots, which fix all features but one and watch the score: higher EmbClickSim raises the score, and higher EmbSkipSim lowers it. Offline metrics improved, the online experiment succeeded, and real-time personalisation launched in the summer of 2017. Those vectors also powered the Similar Listings carousel, where the post reports a 21% increase in click-through rate and 4.9% more guests discovering the listing they ended up booking there. A 2019 paper later lists "similarity of the listing to the past views of the user, computed based on co-view embeddings" among the few features that come from another model.

Airbnb kept developing the approach. A 2026 post on guest journeys, with a companion paper called JourneyFormer at KDD 2026, replaces hand-crafted aggregates of a guest's history with a Transformer over the sequence of events itself: bookings, reviews and cancellations from the past seven years (capped at 80 events) and listing views from the last 21 days (capped at 200). Online, the long-term sequence alone raised uncancelled bookers (guests whose booking stayed booked) by 0.31%, and adding the short-term sequence made it 0.55%. The embeddings are computed in a daily batch job and combined with the live search at query time.

How to use the guest's recent behaviourPlusMinus
Hand-built aggregates (past bookings, average price)Interpretable, cheapHundreds of features to maintain; limited expressiveness (the 2026 post's words)
Listing embeddings with click and skip similarity (2017)Captures taste no feature describes; works within a session; cheap at serving timeEmbeddings are trained separately and refreshed on a schedule; a new listing starts with an average of neighbours
Transformer over the guest's event sequence (2025–2026)Learns directly from raw event history; long-term and short-term viewsHeavier training; embeddings computed in a daily batch job, so not instant

Airbnb adopted the middle row in 2017 and the last row more recently, a steady move from features people design to representations the model learns. Airbnb's 2018 post cites earlier work that trained item vectors on clicked or purchased items and on queries and ads that were clicked, so the step is available wherever a product has sessions.

07Price, two towers and new listings: letting users lead

After a launch, a ranking team faces an uncomfortable question: what next? Per the 2020 paper, its first answer was to borrow from the literature, and the results were neutral. More layers, residual connections and batch normalisation left NDCG unmoved, and for fully connected networks like theirs two hidden layers were enough: "model capacity was not our problem". Deep-and-wide networks with query-listing crosses and attention-based networks also failed to move the needle. Its reflection is that an architecture's success is tied to the shortcoming it fixes in its own baseline, and with a network it is hard to tell whether that shortcoming is present at home. So the team replaced the loop of download paper, implement, A/B test with a principle it summarises as users lead, model follows: quantify a user problem first, then change the model in response.

7.1 The price puzzle

Each successful ranking launch had brought more bookings and, with them, a lower average price in the results, which suggested guests preferred lower prices than earlier models assumed. To measure the gap, the team took for each booking the log of the booked listing's price minus the log of the median price in the results the guest saw. It expected a bell curve centred on zero and found a distribution leaning negative: guests booked cheaper than the middle of what they saw. One obvious reading is that cheaper listings should rank higher, and three attempts to push price down followed, each with a cost that appeared only online.

Attempt (2019–2020)What changedOnline result
Price outside the networkRemoved price from the inputs and subtracted from the output, with Average price −5.7%, bookings −1.5%
Monotonic networkSquared weights and tanh activations so every path from price to the output decreases with priceBookings −1.6%
Soft hintA second pairwise loss that labels the cheaper listing of each pair as the winner, mixed with weight alphaAverage price −3.3%, bookings −0.67% (offline NDCG had been matched)

The paper's explanation of the first two is that price interacts with everything else, so isolating it caused under-fitting, visible in training and test NDCG falling, and a strict monotonic constraint was still too much. Of the third, it says offline evaluation could only re-rank the top results in the logs, and "during the online test, applying the newly trained model to the entire inventory revealed" the cost. DNNs, it says, "behaved just like another star engineer on the team": left alone they find a reasonable solution, and forced in a direction, disaster follows.

To see what the existing network did with price, the team used individual conditional expectation (ICE) plots: take the listings of one search, sweep the price over its range with every other feature fixed, and plot the score. They showed that the original two-layer network already understood cheaper is better. Those failed architectures had been forcing something that was already there, at the cost of quality.

7.2 The right price for this trip

Looking again at the price-gap plot by city, the team found that the gap was much larger in tail cities, often in developing markets, than in head cities. That network seemed to suffer "the tyranny of the majority": price-quality tradeoffs tuned for the popular locations that dominated bookings, generalised to everywhere. A second observation fitted. With a pairwise loss, a feature that is identical across the two listings of a pair can't separate them, and query features such as location are identical across the pair, so they had little influence on the scores and dropping them barely changed NDCG. The model understood cheaper-is-better and lacked a notion of the right price for a trip, which depends on where, for how many people and for how long.

That inspired the two-tower architecture of the 2020 paper. A query tower takes the query and user features and produces a 100-number vector that represents the ideal listing for this query and guest. A listing tower produces a 100-number vector from the listing's features. A listing's score is the negative Euclidean distance between the two vectors, so closeness to the ideal is the score. Training uses the same pairs as before: the booked listing should end up closer to the ideal than the unbooked one. The paper notes the similarity to triplet loss, except that only pairs are available, and the missing anchor in the triple is learned by the query tower.

The 2020 ranker: two towers and position as a control
RANKING NETWORK (two towers, distance as the score) QUERY + USER FEATURES city, dates, guests, trip length, history of the guest LISTING FEATURES price, amenities, location, bookings, reviews QUERY TOWER two tanh layers, 100 numbers LISTING TOWER two tanh layers, 100 numbers SCORE minus the distance between ideal vector and listing vector POSITION k training: set to 0 with probability 0.15; scoring: 0 Query tower: once per search. Listing tower: once per listing, and it never sees the query. The 2020 paper adds position as an input of the network and does not say which layer receives it.
Read the two towers on the left and right, and the score between them. In the pink box, position is switched off, set to 0, whenever the model ranks a real search.

Against the two-layer network, online results were bookings +0.6%, with the NDCG computed online up 0.7%, driven by guests finding what they wanted more easily. Average price fell 2.3% as a side effect of better relevance, not of any price rule, and the booking gain more than covered it, with revenue up 0.75%. There's also a latency gain from the shape. In a fully connected network the first hidden layer dominates scoring cost, at for listings, first-layer units, query and user features and listing features. With two towers, the query tower runs once per search and only the listing tower runs per listing, which reduces the cost to . Online, this cut 99th-percentile scoring latency by 33%.

Next the team checked whether the network did what the story claimed. ICE plots of price now peaked around certain prices, though only for high-quality listings already near the top, and stayed monotonic for average ones. A t-SNE projection (a way to squash vectors to two dimensions for plotting) of the query tower's output showed clusters by guest count and trip length, and they were not price clusters: a booking in Moscow can cost more than one in Paris depending on party size and stay length. The paper says none of this is hard evidence, only enough to be confident the mechanism worked as intended.

7.3 New listings

The same method, finding a user problem first, led to the host's side of the marketplace. Broken out by segment, NDCG for booked listings new to the platform was 6% lower than for established ones, and the paper notes that online booking differences have been statistically significant for models that differed by as little as 0.7% in NDCG. Removing every feature built from guest interactions, such as past bookings, cut NDCG by 4.5%: the network leaned on engagement features, and a new listing has none, so it was fitted to an average.

One framing is explore versus exploit: boost new listings so they collect feedback at a small cost to bookings. Tuned to be bookings neutral, the boost got 8.5% more first-page impressions for new listings. But the short-term loss of relevance could be measured and the long-term gain from inventory could not, which led to "vigorous internal debates, with no resolution that satisfied every team". And the right boost depended on supply and demand in each location, so a global exploration budget would need thousands of local parameters.

So the team reframed the problem. What makes a new listing different is the absence of engagement features, so instead of boosting, estimate those features. One estimator in the paper averages the engagement features of nearby listings with the same guest capacity over a sliding time window, and it is scored offline by swapping its estimates into listings whose real engagement has converged, re-scoring them, and measuring how far their discounted rank moves.

That estimator cut the error by 42% against default values. Online, bookings of newly created listings rose 14%, along with a 14% increase in their share of first-page impressions, and overall bookings rose 0.38%, so guests benefited too.

Treating new listingsPlusMinus
Default values for missing engagementTrivialNew listings fit an average; NDCG 6% lower for them
Ranking boost (explore–exploit)Gives new listings impressions and feedbackHard to set, since the long-term benefit can't be measured; needs thousands of local parameters
Estimate the missing engagement (2020)A clear offline objective; improves new listings and overall bookingsThe estimator itself needs maintaining; averages hide an individual listing's quality

Airbnb picked the last row in 2020. Predicting missing statistics from neighbours is a standard cold-start move in recommenders.

Another segment showed a similar shortfall: boutique hotels and traditional bed and breakfasts, a rapidly growing part of the inventory, had lower NDCG than expected. The paper's hypothesis was that inventory under-represented in the training data wasn't ranked well because of positional bias, though it admits position may not be the only cause. That's where the next section starts.

08Position bias: was it good, or was it first?

Nadia clicked the first listing on her page. Was that because it was the best match, or because it was first? Every log line carries the same ambiguity, and our model trains on those lines. A guest looks at the top of the list more than the bottom, so a listing in position 0 collects clicks and bookings that the same listing in position 20 would not. If we train on raw bookings, the model learns that listings the previous model ranked high are good, which is the previous model's opinion handed back to it.

Haldar and colleagues formalise this in Improving Deep Learning for Airbnb Search (2020) with the position-based model of click behaviour. Booking probability is split into two factors: how relevant the listing is to her, and how likely she is to look at position at all.

The second factor doesn't depend on the listing , only on the position, the user (phone users look at the top more) and the query (a guest booking next week may pay less attention to the bottom). The paper cites the standard remedy from Joachims and colleagues in 2017: train a propensity model for the second factor and weight each example by the inverse of its propensity, which usually needs randomised experiments on the results. Airbnb chose another way.

8.1 Position as a control variable

The team's solution has two parts. It's non-intrusive, so no randomisation of results is needed, because of two features of the marketplace. Listings are physical things that can be booked once for a date range, and as they get booked and vanish from search, the positions of the others shift. And each listing has its own calendar, so different listings appear at different positions for similar queries on different dates. Together these make listings appear at different positions even when their scores hardly change, which is what lets a model tell the effect of position apart from the effect of the listing. And the model has no explicit propensity network. Instead position goes in as an ordinary input feature of the network, and at scoring time it is set to 0.

Why this works follows from the product form. Write the network's output as relevance times positional bias, . Since the true positional factor doesn't depend on the listing, any dependence of on is an error that training with enough data removes, leaving . At scoring time we set . Within one search the query and the user are the same for every listing, so

The paper writes this as equation (6): comparing two listings' scores in one search now depends only on their relevance, because the positional factor multiplies both scores. In the language of causal inference the team added position as a control variable: it is in the model so that its effect is accounted for in training, and it is held fixed when we use the model.

8.2 Position dropout

There is a cost. The relevance part now has position as an input, so in training it can lean on position to predict relevance, which it can't do at scoring time when position is 0. The paper measured this: a network with position as a feature and no other care scored roughly −1.3% NDCG against a baseline without it. A remedy is dropout on the position feature: during training, set position to 0 with some probability, so the model learns what its predictions look like without it. A high rate protects relevance, and a low rate gives the bias estimate clean access to position. Next the team swept the rate and computed two NDCG numbers on a test set, one with position set to 0 (relevance only) and one with the real position kept (relevance plus bias). Their difference measures how much the model has learned about position, and plotting it against relevance-only NDCG gave a curve from which the team chose a balance point, a dropout rate of 0.15.

Online, the test used the two-tower network of the previous section as the control and the same network trained with position as a feature, dropout 0.15, as the treatment. Bookings rose 0.7%. Revenue rose 1.8%, a surprise, and the paper's explanation is that price is an easy signal to learn while quality and location tradeoffs are subtler, so early models leaned on low prices, and because they decided what was shown at the top, that bias was baked into the training data of every later model. Removing positional bias let the model strike a better balance. Boutique hotels and bed and breakfasts, the segment that had started the investigation, saw bookings rise 1.1%.

Our toy below uses the same logic. An old ranker orders listings by their true appeal plus quirks of its own, so slot and appeal are partly independent, exactly the condition the paper says Airbnb's calendars provide. Clicks follow appeal times attention. We train a listing-score table with and without a position term, and rank listings by their score alone. In the table's first column, the old ranker's quirks grow.

Try it Recover true appeal from bookings with and without a position term
import numpy as np
rng = np.random.default_rng(3)
N, K, n = 300, 8, 400_000
r = rng.normal(0, 1, N)                 # true appeal of each listing
exam = np.array([1, .8, .62, .5, .4, .32, .26, .2])   # P(seen | slot)
quirk = rng.normal(0, 1, N)             # the old ranker's own quirks

def run(spread):
    vid = rng.integers(0, N, n)         # which listing was shown
    est = r[vid] + spread * quirk[vid] + rng.normal(0, .5, n)
    rank = np.argsort(np.argsort(-est)) / n
    pos = np.minimum((rank * K).astype(int), K - 1)
    p = exam[pos] / (1 + np.exp(-(r[vid] - 2.0)))   # appeal x attention
    y = rng.random(n) < p
    out = []
    for use_pos in (False, True):
        s, b = np.zeros(N), np.zeros(K)
        for _ in range(1500):
            z = s[vid] + (b[pos] if use_pos else 0)
            g = 1 / (1 + np.exp(-z)) - y
            s -= np.bincount(vid, g, N) / (n / N)
            if use_pos:
                b -= np.bincount(pos, g, K) / (n / K)
        top = set(np.argsort(-s)[:30]) & set(np.argsort(-r)[:30])
        out.append(len(top))
    return out

print("quirk size | top-30 found: no position / with position")
for sp in (0.0, 0.5, 1.0, 2.0):
    a, b = run(sp)
    print(f"{sp:10.1f} | {a:>20d}/30 {b:>14d}/30")
With no quirks in the old ranker (0.0) both models find all 30 of the 30 best listings. As the quirks grow, the model without a position term finds fewer, 18 of 30 at size 2.0, while the model with a position term finds 29 at every size from 0.5 up.

With no quirks, slot is a perfect function of appeal and the position term has nothing to separate. As the old ranker's own taste grows, the model without a position term learns to reward whatever the old ranker liked, and the model with one holds at 29. That also shows why the marketplace properties matter: separating position from relevance needs variation in position that isn't just a function of relevance.

Handling position biasPlusMinus
Ignore itNothing to buildThe model learns the old ranker's preferences; biases compound over model generations
Inverse propensity weighting (Joachims et al., 2017)Principled; unbiased under its assumptionsNeeds a propensity model, usually from randomised result perturbation, which costs bookings
Position as a feature, with dropout (Airbnb, 2020)No randomisation; one extra input; learns the bias jointlyNeeds position to vary independently of relevance; the dropout rate is a tuned compromise

Airbnb chose the third in 2020, with a measured +0.7% bookings. YouTube, in chapter 41, solved the same problem with a separate shallow tower that sees only position and device, whose output is added to the main model's logit. Both designs differ in where the bias lives, in a side network or in the main network with a dropped feature, and they rest on the same position-based model of attention.

Search engines, ad auctions and app stores all train click models with a position term or a propensity weight, since they share the problem: what we observe is what the previous system chose to show.

09The other side of the marketplace: hosts say no

Nadia sends her request. Another person now decides. If the listing is Instant Book the booking is confirmed at once, and otherwise the host accepts or rejects it, and until check-in either side can still cancel. Everything in the ranking so far optimised the chance of a booking, so a listing whose host often refuses looks as good as any other, and a refusal sends Nadia back to the start of a search that may already have taken weeks. In the 2023 paper Optimizing Airbnb Search Journey with Multi-task Learning, Chun How Tan and colleagues show a guest whose first two requests are both rejected or cancelled before a later one works out.

The paper lists three weaknesses of a baseline that trained on the booked listing alone: searches where the booked listing never appeared were thrown away, every non-booked listing counted as an equal negative even if the guest clicked it, and searches from everyone who didn't book were ignored, though non-bookers and non-booking actions are one and two orders of magnitude more plentiful than bookers and bookings. Two earlier fixes had failed. A model that predicted bookings and long clicks together raised long clicks and left bookings flat. Several single-task models blended with grid-searched weights raised bookings at first, but the weights went stale and the gain had declined a few months after launch.

9.1 Journey Ranker

The answer was one network with several heads, trained together, in four modules. Shared layers turn the listing features and the query and guest features into a listing embedding and a context embedding. A base module learns six positive milestones along the journey: click, long click, payment page, reservation request, host acceptance and uncancelled booking. They are chained by the rule of probability, each milestone conditional on the one before:

Each factor is the output of a small head on the shared layers, and the loss for each task is a standard ranking loss weighted by the share of that milestone's positives that go on to an uncancelled booking, so frequent events like clicks don't drown the rare final one. A twiddler module has three separate heads for the bad outcomes: a rejection, a cancellation by the host and a cancellation by the guest. They are rarer (from under 1% to 10% of cases depending on the action), arrive late, and are modelled separately because the base chain is linear and can't fork. A combination module turns the nine outputs into one score:

The coefficients aren't global constants. A small network computes them from the context embedding, so they change with the query and with how far the guest has got. The mix is linear because a non-linear one performed the same offline and the linear one can be explained, and no gradient flows from it back to the base or twiddler heads, so those keep their meaning. It is trained with a pairwise loss on a graded order: uncancelled booking is better than click, click better than impression, and all three bad outcomes are worse than an unclicked impression.

Journey Ranker: good milestones, bad milestones, and a mixer
SHARED LAYERS listing features -> listing embedding query + guest -> context embedding BASE: GOOD MILESTONES 1 click 2 long click 3 payment page 4 reservation request 5 host accepts 6 uncancelled booking TWIDDLERS: BAD MILESTONES host rejects host cancels guest cancels COMBINE linear mix; weights come from the context embedding FINAL SCORE one number per listing Combination loss orders the outcomes: uncancelled booking > click > impression > rejection or cancellation. Ten tasks, 9.2% more parameters: each head is one small layer on top of the shared layers.
Read left to right. Shared layers feed a chain of six positive tasks and three negative ones, and a small mixer turns all nine outputs into the score that orders Nadia's results.

Training data changed too. Every impression gets every label that applies, so the model can learn from clicks. Using all clickers would add two orders of magnitude more searches and plenty of noise, so the team kept only searches that led to a payment page view, roughly 50% more than before, and trained on about 500 million searches.

Offline, the full model's NDCG is 0.48% above the baseline with 9.2% more parameters. For context, the paper says that making the baseline 50% larger gains only 0.05 to 0.1% NDCG, and that an offline gain of 0.3% is considered promising for a significant online booking gain. An ablation shows where the gain comes from:

Base-module tasks (no twiddlers, no mixer)Offline NDCGSearches used
Uncancelled booking only (baseline)+0.00%+0%
Request + accepted booking + uncancelled booking+0.06%+25%
Click + uncancelled booking+0.22%+50%
All six milestones+0.31%+50%

More searches from clickers helped much more than more searches from rejected requesters, and the intermediate milestones gained 0.09% with the same searches. Online, Journey Ranker raised uncancelled bookers by 0.61% for Stays and clickers by 0.14%, and gained 2.0% in uncancelled bookers for in-person Experiences and 9.0% for Online Experiences. The mixer's weights can be read: host-initiated rejection and cancellation both follow a U shape against the days between search and check-in, since close to the trip a guest has no time to rebook and far from it a host has time to change their mind.

Hosts in the rankingPlusMinus
Rank by booking probability onlySimple, one labelListings that get rejected or cancelled rank as well as the others
Separate models blended by grid-searched weightsGave a first booking gainWeights went stale; the gain declined within months
One model with graded labelsSingle task, single lossMore than 1% lower offline NDCG when tried naively, as frequent labels crowd out rare ones
Multi-task heads plus a learned mixer (2023)Uses far more data; explainable weights; modest parametersTen tasks to maintain; mixer weights can't be checked against ground truth

Airbnb chose the last row in 2023, building on earlier chained conversion models from e-commerce and customer acquisition.

10Diversity: the tyranny of the majority

Suppose the model is excellent. Nadia's first page might still show eight versions of one flat in Baixa at nearly the same price, because the model's best guess for her is the same for the second, third and eighth listing. Haldar and colleagues' 2022 paper Learning To Rank Diversely At Airbnb starts from a stronger claim: the assumption that a listing's booking probability can be worked out independently of the other listings in the results "is false", and it limits every pairwise or pointwise ranker.

10.1 Why ranking by probability isn't diverse

Take two listings with logits and . A model puts first exactly when the pairwise booking probability exceeds one half, which means is the one that more than half of past bookers with this query would pick. In effect every position is a majority vote among people who booked. The paper adds a second observation, a Pareto pattern in booking value: in most cities roughly 20% of bookings account for 50% of the aggregate booking value, and those quality-leaning bookers have an average booking value four times that of the other 80%. Put together, the first page is decided entirely by the 80% who lean toward affordability, and the minority that wants quality gets no positions at all. The paper calls this "the tyranny of the majority" in search ranking. It is a fact about ranking by a majority-preference probability, so a better estimate of that probability can't fix it.

History shows how hard this was to fix. Starting in 2017, category-based diversification spread results over price buckets, locations and amenities, and the paper says "all these efforts resulted in disappointment", because forcing diversity along one dimension degraded the others. Abdool and colleagues' 2020 KDD paper Managing Diversity in Airbnb Search defines a diversity metric, mean listing relevance, and reports that a greedy ranker maximising it was neutral or slightly negative online, because it over-diversified: guests used price filters and viewed more listings, signs they were working harder. Later designs matched a target distribution of locations by simulated annealing, added a loss on the Hellinger distance (a measure of the gap between two distributions), and finally embedded the listings above with an LSTM, a network that reads a sequence one item at a time. That last design improved the diversity metric by 1.97% and offline NDCG by 1.26%, and the lesson, as the 2022 paper puts it, was to give the model more information and the freedom to diversify.

10.2 Conditioning on what is above

The 2022 paper takes the lesson as far as it goes. A guest scans down the page, and she considers the listing at position 1 only if the one at position 0 didn't suit her. So build the model for position 1 on the extra condition that the guest rejected position 0. Training data for that model comes from logs: drop the searches where the listing at position 0 was booked, call that listing the antecedent, and form {booked, not booked} pairs from the rest. A model trained there learns a pairwise preference among people who have already passed on the antecedent, a different crowd from the one that chose it, and its preferences are likely to differ, which is exactly diversity learned from data.

One model per position is impractical (hundreds of models, and a cubic-time loop), so the paper factors it. First comes the base model , the ordinary booking logit. A second model learns the similarity penalty between a candidate and an antecedent, trained on the rejected-antecedent pairs with the base logit held fixed. For position , the logit subtracts a discounted sum over the listings already placed:

The coefficients shrink as the listing's penalties overlap: two near-duplicate antecedents shouldn't be penalised twice. The paper settles on as the hyperparameter that maximises offline NDCG. Ranking then runs in rounds, as in Algorithm 2 of the paper: place the best listing, subtract each remaining listing's similarity penalty to what was just placed, place the best again, and repeat.

Ranking diversely: each position is chosen given what is above it
ROUND 1: nothing placed yet, so pick the highest logit for position 0 A Baixa flat logit 2.0 B Baixa flat, near A logit 1.9 C Baixa studio logit 1.7 D Alfama, balcony logit 1.5 E Graca, rooftop logit 1.4 ROUND 2: subtract a learned similarity to the listing already placed, then pick for position 1 A Baixa flat placed at 0 B Baixa flat, near A logit 1.9 - 0.9 = 1.0 C Baixa studio logit 1.7 - 0.8 = 0.9 D Alfama, balcony logit 1.5 - 0.1 = 1.4 E Graca, rooftop logit 1.4 - 0.2 = 1.2 D wins position 1 although B and C have higher logits, because they look too much like A. In production the penalty is lambda x s(l, antecedent), with s a small network learned from past searches. Numbers in the boxes are illustrative. The 2022 paper settled on lambda = 1/3 and repeats this step for each position. Cost: every remaining listing is scored again at every position, so the loop grows with the square of the list.
Compare the two rows. In round two the three Baixa listings lose points for resembling A, and the Alfama listing with a balcony climbs to the top.

Two engineering choices keep this affordable: the similarity model is a pair of listing towers whose outputs can be cached, so each listing is encoded once, and the loop is quadratic in the number of listings, which is workable because roughly 100 are evaluated.

A toy below puts the idea in numbers. Six taste groups of guests have unequal sizes, and listings belong to the group they appeal to. Guests scan down the page with decaying attention, and a guest who has rejected a look-alike books a later listing of her taste less often. We rank by booking chance, then re-rank with a growing penalty for repeating a taste.

Try it Re-rank with a similarity penalty and count the bookings
import numpy as np
rng = np.random.default_rng(5)
pop = np.array([.45, .25, .14, .09, .05, .02])   # guests per taste group
C, PER, K = len(pop), 12, 8
taste = np.repeat(np.arange(C), PER)             # taste of each listing
q = rng.uniform(.25, .6, C * PER)    # P(book | matching guest looks)
look = 1 / np.log2(np.arange(K) + 2)             # attention by slot
RHO = 0.2        # a guest who rejected a look-alike books it less often

def bookings(slate, n=400_000):
    g = rng.choice(C, n, p=pop)                  # each guest's taste
    done = np.zeros(n, bool)
    rejected = np.zeros(n, bool)                 # rejected a look-alike
    for k, l in enumerate(slate):
        seen = (rng.random(n) < look[k]) & ~done
        match = seen & (g == taste[l])
        p = np.where(rejected, RHO * q[l], q[l])
        hit = match & (rng.random(n) < p)
        rejected |= match & ~hit
        done |= hit
    return done.mean()

score = np.log(pop[taste] * q)         # ranking by booking chance alone
def rerank(lam):
    left, slate = list(range(C * PER)), []
    while len(slate) < K:
        pen = [lam * sum(taste[l] == taste[s] for s in slate)
               for l in left]
        best = left[int(np.argmax(score[left] - np.array(pen)))]
        slate.append(best)
        left.remove(best)
    return slate

print("penalty | tastes in top 8 | bookings per 100 searches")
for lam in (0, .25, .5, 1, 2):
    s = rerank(lam)
    n_tastes, b = len(set(taste[s])), 100 * bookings(s)
    print(f"{lam:7} | {n_tastes:15d} | {b:10.1f}")
Ranking by booking chance alone puts one taste group on the whole page and yields 31.3 bookings per 100 searches. A penalty of 0.5 spreads the page over three tastes for 44.9, a penalty of 1 reaches five tastes for 46.3, and a penalty of 2 covers all six for 46.4.

The curve flattens above a penalty of 1 because nothing is left to diversify. The toy also knows the true taste groups, which a real model has to learn from data.

Launch results from an online experiment matched the theory's predictions. Online NDCG rose 1.5%, offline NDCG 0.45% on the position-1 test set and 0.2% on the base model's. Bookings rose 0.29% and gross booking value 0.8%, with almost all of the bookings gain from guests booking on Airbnb for the first time, which is the group the 80% majority serves worst. Listings viewed rose 0.46% and listings saved 1.1%. Price variance among the top eight results rose 3.4%, and the number of listings in the top eight within 0.5 km of each other fell 0.62%. Ninety days after the test, when the trips had happened, 5-star ratings were up 0.4%. Latency was the cost: the 95th percentile rose 8.4% and the median 5.3%.

Approach to diversityPlusMinus
Category quotas (price, location buckets; 2017)Simple, controllablePushes down good listings for belonging to the wrong bucket; ignores other dimensions
Greedy re-ranker on a relevance-plus-distance metric (2019)Interpretable metricOver-diversified; neutral to negative online
Distribution matching on location or priceTargets a specific visible propertyOnly the chosen dimension; the first version needed simulated annealing, since bucket membership gives no gradient
LSTM context over the top results (2019/2020)The model sees the whole retrieval setAggregates the listings into one vector; cannot compare a candidate with what is directly above
Conditional pairwise model with similarity penalty (2022)Learned from data; same NDCG metric; large online gainQuadratic loop; higher latency; training data still biased toward the majority

Airbnb chose the last row in 2022. The paper's own caution is that the training data comes from a system that wasn't diverse, and it expects later logs to give the model more to learn from. Maximal marginal relevance and determinantal point processes work along similar lines, picking each item given what has been picked.

11Serving: one search through the funnel

We now have a heavy model, and the arithmetic of section 01 says it can't see every listing. Airbnb's search runs as a sharded scatter-gather system, as the January 2026 retrieval paper describes it: a root service fans a request out in parallel to leaf services, each owning a slice of the inventory, and merges the best of what they return. Three models take part, in order. A retrieval model on each leaf scores tens of thousands of homes cheaply and passes on the top . A heavyweight first-stage network passes on the top . A setwise re-ranker at the root optimises the top jointly, which is where the diversity logic of section 10 lives. In the paper's notation , each stage scoring about an order of magnitude fewer homes than the one before, and only a few sizes are published: a of roughly 1,000 in the 2020 diversity work and roughly 100 listings for the 2022 re-ranker.

A search fans out to shards and comes back together
SEARCH Lisbon, 4-6 Dec ROOT fans out, merges LEAF SHARD 1 retrieval: K candidates first-stage DNN: top N LEAF SHARD 2 retrieval: K candidates first-stage DNN: top N LEAF SHARD 3 retrieval: K candidates first-stage DNN: top N SECOND STAGE top T from all shards, re-ranked together for diversity PAGE cards or map pins K > N > T. Only a T of roughly 1,000 (2020 paper) and about 100 listings for the 2022 re-ranker are published.
Read left to right. Each shard retrieves and scores its own slice of the inventory, and the root service sends only the best of each slice on to the stage that looks at the whole page.

11.1 Retrieval for a hundred thousand homes

Retrieval was the last stage to get the neural treatment, driven by growth: flexible date search and split stays multiplied the eligible homes per query. Its legacy model was a linear model giving each listing one query-independent score a day. A 2026 paper replaces it with embedding-based retrieval, a two-tower model whose vectors are compared by similarity, with three notable choices.

First, the listing tower runs in a daily offline batch job, so only the query tower runs at request time and retrieval cost stops growing with the number of eligible listings. The price is that retrieval sees the previous day's price and availability. Second, training data. Sampling by search, with the booked listing as the positive and other impressions as negatives, only works when the booked listing was shown, and the paper found it drew most listings from the last 30% of a journey. Trip-based sampling groups all of a user's searches that share location, number of guests and a bucketised length of stay, so early searches still contribute, and picks negatives by first choosing a category of action (impressed, viewed, wishlisted) and then a listing in it, which gives harder negatives. Third, the index. Airbnb benchmarked two kinds of approximate nearest-neighbour index with FAISS, inverted-file (IVF), which groups vectors into clusters and searches only the closest few, and HNSW, which links them in a navigable graph, and chose IVF, since nearly every search carries a filter and listings change roughly 10,000 times a second. HNSW's memory grew too large under those updates and filters were hard to apply, while IVF treats the cluster as one more filter in Apache Lucene. One more finding: with 128 clusters from a daily k-means job, dot-product similarity produced clusters holding roughly 20% of the data, and switching to Euclidean distance balanced them.

Retrieval models were judged on recall, the share of the booked listing found among the top results. On held-out logs, recall at 10 was 53.3% for the legacy model, 60.2% for the first embedding model and 93.4% for the final one. On replayed production traffic, recall at 100 was 40.5%, 74.6% and 87.0%. Three successive launches gave a combined 0.31% relative increase in booking conversion and cut compute by roughly 16% relative to the baseline, and promotional emails, which reuse the same retrieval, gained 2.3% in bookings.

Retrieval for large result setsPlusMinus
Linear, query-independent daily score (legacy)Trivial to serveSame top listings for every query; recall 40.5% on replay
Two-tower embeddings with HNSWBetter recall than IVF on averageLarge memory under frequent updates; hard to combine with filters
Two-tower embeddings with IVF (chosen)Low memory; cluster ID works as a filter; cheap updatesLower recall than HNSW; clustering quality depends on the similarity function

11.2 Nadia's request, step by step

  1. SearchNadia taps Search. Her query carries a place, her dates and a guest count, and the guest state (her clicks and skips of the last two weeks, past stays) is available as features. Airbnb has not published the end-to-end latency target.
  2. Fan outThe root service sends the query to every leaf shard in parallel, and each shard owns part of the inventory.
  3. RetrieveEach leaf uses the query tower once, finds the nearest listings in its IVF clusters under the search's filters, and keeps the top K. Listings are scored with the previous day's price and availability, and the up-to-date values are brought in later in the search.
  4. ScoreThe first-stage network scores each candidate with position set to 0 and returns the top N. Its query tower runs once per search and its listing tower once per listing.
  5. Merge and re-rankThe root combines the shards' lists and the setwise re-ranker, which sees roughly a hundred listings, applies the diversity penalty position by position. Per the 2022 paper, the diversity stage raised median search latency by 5.3% and 95th-percentile latency by 8.4%.
  6. DisplayThe page shows the results as cards or, on a map, as pins. Her search, the positions, her clicks and the request are logged.

11.3 The same ranking on a map

Nadia, like most guests, is moving a map. A June 2024 paper, Learning to Rank for Maps at Airbnb, asks whether a ranking built for lists makes sense there. NDCG on map-driven searches was stubbornly 2% lower than on search-box queries, and engineers had added map-specific features for years without closing the gap.

Predict before you read on

Randomly shuffling the top results of a list-based search is known to cost roughly 8% of bookings. Airbnb ran the same shuffle on map searches on phones, where a guest sees only the map. Does the shuffle cost more, about the same, or nothing?

Show the answer

Nothing. Metrics in the treatment group were almost identical to control, and bookings did not differ. On a map the pins appear all at once, so the order of the top listings carries no attention. Ranking still decides which listings get pins, but not their order among those chosen. NDCG, whose discount encodes how attention falls down a list, stops being the right metric.

If attention on a map is spread evenly over the pins, the chance of a booking from a map result is the average of the pins' booking probabilities, so fewer, better pins raise it. The paper calls this Less Is More and builds a Bookability Filter that keeps a listing only when its logit is within a margin of the best one, which means its booking probability exceeds the top listing's divided by . Pin counts then vary with the search. Online, raised uncancelled bookings 1.7% and 5-star trips 1.6%, and at 34 million searchers per arm uncancelled bookings rose 1.9% of Airbnb's global bookings, described as one of the largest gains in years. A further test ruled out urgency from seeing fewer pins: randomly choosing 14 of the 18 pins cost 1.5% of bookings, so the gain came from better pins, which the paper calls focus.

This lesson is not about maps. NDCG's theory, that attention decays down a list, was an assumption that the interface made true, and a different interface breaks it.

12Training data, labels and the feedback loop

When Nadia books the Alfama flat, something has to turn that into a training example, and the choices about how matter as much as the architecture. Airbnb's default recipe is to look back from a booking over the guest's searches, take the impressions of the booked listing as positives and the other listings she saw as negatives, and build pairs, at a scale of 1.7 billion pairs in 2019 and about 500 million searches in 2023.

Each default hides a bias. Only searches where the booked listing was shown contribute, which pulls sampling toward the end of the journey. All non-booked listings are equal negatives, though she clicked some. Only bookers contribute, so the model learns the preferences of past bookers and serves everyone. And outcomes arrive at different times: negative milestones are delayed, and a rating comes only after the stay. Journey Ranker answers the one-label problem by labelling each impression with every outcome that applies, and the retrieval work answers the sampling problem with trip-based sampling and hard negatives.

A deeper issue is that the training data is the product of the last model. One example from the position paper shows it: early models preferred cheap listings, those listings were shown first and booked more, and the next model learned that guests prefer cheaper listings still, so a bias in what was shown became a bias in what was learned. Likewise, the diversity paper says that the training data is "biased against diversity" and expects a virtuous cycle once a diverse ranker produces more varied logs. A recommender can't escape the loop by modelling alone, and Airbnb's remedies are partial: position as a control variable, estimators that fill in what new listings lack, and richer labels.

Why not log everything a guest saw, including pages she never scrolled to?

Because it costs and because it misleads. Airbnb's retrieval paper notes that logging the entire eligible set for every request isn't practical from a scalability standpoint, and the inventory changes too quickly to reconstruct it offline: hosts update prices and availability all the time. Logs contain what was shown, so offline metrics on them describe the old system's choices, and the team's answer is a traffic replay cluster that re-scores real queries on the full eligible set.

13How Airbnb knows a change helped

Every section above ended in a claim of improvement, so how are the claims checked? Airbnb's papers describe two layers: NDCG offline for speed, and A/B tests online for the truth.

Offline, the metric earns its place by a neat argument in the 2022 paper, which compares ranking to roulette. In each of searches with listings, a listing at position is booked with probability , a product of its own booking chance and the chance that the guest looks at position . Expected bookings are the sum of those products, and if attention falls monotonically down the page, sorting by booking probability maximises it. Take any unsorted pair, with and attention . Swapping them changes the expected bookings by

so a sorted list can't be beaten. NDCG has the same shape: a booked listing at position wins , and that discount curve is built to follow how attention decays, so it is proportional to . A gain in NDCG is therefore a strong indicator of a gain in bookings. This is also why the metric breaks on maps, where attention doesn't decay with rank.

Airbnb's papers give rules of thumb for what an offline gain means. In 2020 the team notes that models whose NDCG differed by as little as 0.7% have shown statistically significant differences in online bookings, and in 2023 that an offline gain of 0.3% is considered promising. Journey Ranker's offline numbers are means of five training runs with a 95% confidence interval, because retraining noise would otherwise swamp differences this size.

13.1 When offline and online disagree

The more interesting evidence is where they disagree. Section 07's price loss matched the baseline's NDCG offline and cost 0.67% of bookings online, because offline evaluation could only re-rank the top results that appear in logs, and online the model scored the whole inventory. Hand-crafted noise for dropout gained roughly 1% NDCG offline and had no significant online effect. For retrieval, metrics from logs "tend not to generalize well to a true online setting", since logs contain only shown results, so the team built the replay framework: fork a small share of production queries to an offline cluster, score every eligible listing with both the heavy first-stage model and the candidate retrieval model, and measure recall of the heavy model's top results. The paper reports that this metric predicted the A/B result for all of the roughly ten retrieval models it tried.

13.2 The A/B discipline

The final word is an online experiment: new model for some searchers, old for others, compared on bookings that were not cancelled, the top-line metric. A 2026 guest-journey post says tests typically ran for three weeks with guardrail metrics watched throughout. Some effects take longer to arrive. The diversity paper waited 90 days after the test, until most booked trips had happened, to compare 5-star ratings, and the maps paper evaluates 5-star trips 120 days after the end of the experiment. Scale is used to detect small effects: the maps launch put 34 million searchers in each arm, which pushed p-values for key metrics below .

Experiments also settle questions of mechanism: the map shuffle, the urgency test and the diversity paper's predictions (an NDCG gain, a larger gross-booking-value gain, gains among first-time bookers) were each checked online. None of the sources say how experiments handle interference between arms in a marketplace where a listing can be booked only once, so we won't describe it.

Why does an NDCG gain of a few tenths of a percent justify a launch?

Because at this scale a few tenths of a percent is a very large number of stays, and because the metric is constructed to track bookings. A model that ranks the booked listing 0.3% better on average moves many of those listings up a few places across hundreds of millions of searches. An experiment then confirms it, since an offline number alone can't.

14What went wrong, and what it cost

The papers are unusually frank about failures, and they cluster into patterns. This table lists the ones that came with a measured result.

What was triedWhat happenedWhy, according to the papers
Neural network as a drop-in for GBDTBooking neutral; offline regressions at firstDeep learning is about scaling the whole system, not swapping a model
Listing ID embeddingsTraining NDCG up, test unchangedA listing is booked at most 365 times a year, so data per ID is too sparse
Multi-task with long viewsLong views up by a large margin; bookings neutralLong views carry a large component unrelated to bookings
More layers, residual connections, batch norm, attention, deep-and-wideNDCG unchangedTwo layers were enough; imported architectures fix other models' shortcomings
Price outside the networkPrice −5.7%, bookings −1.5%Price interacts with everything; under-fitting
Monotonic network in priceBookings −1.6%Too strict a constraint
Price loss mixed inPrice −3.3%, bookings −0.67%Offline evaluation only re-ranked logged results
Greedy diversity rankerNeutral to slightly negativeOver-diversified; more filters and views
Blended single-task modelsGain faded within monthsGrid-searched weights went stale

Three themes recur. A literature-driven loop returned nothing, and the team replaced it with users lead, model follows. Constraints that fight the model, such as monotonic price or a price loss, destroyed more than they bought. And assumptions from one setting broke in another: IDs from video, NDCG from lists, independent booking probabilities from pairwise ranking. Each fix that worked started from a segment where the model was weak: tail cities, new listings, boutique hotels, map searches, first-time bookers.

15The whole system

We can now draw the full design. On the left, the online path is Nadia's search, a request that fans out to shards, retrieves, scores, re-ranks and returns. On the right, the offline path is the loop that keeps the models current: what she saw and did is logged, turned into labels with sampling that corrects for how the data was collected, used to train the next model, checked offline, and shipped only if an online experiment says so.

The whole design, online and offline
ONLINE: Nadia's search OFFLINE: the loop that keeps the models current APP search: Lisbon, 4-6 Dec, 2 guests ROOT SERVICE fans out to leaf shards, merges RETRIEVAL two-tower, IVF index K candidates FIRST STAGE DNN, position = 0 top N SECOND STAGE setwise re-rank for diversity, top T RESULTS list of cards or map pins LIVE GUEST STATE clicks and skips of the last two weeks, past stays; feeds the scoring stages A/B TEST weeks of traffic, guardrail metrics, ratings read months later OFFLINE CHECKS NDCG, recall on replayed traffic TRAINING pairwise + multi-task losses, months of searches LABELS trip-based sampling, hard negatives, labels that arrive weeks later LOGS impressions with positions, clicks, requests, bookings, rejections, cancels log ship What Nadia sees and does is logged, and the log becomes the next model's labels. A model learns from a page it helped to create, which is the feedback loop.
Start at the app and follow the search down to the results. Then follow the log across to the bottom right, up through labels, training and the experiment, and back as a new model.

Nadia's search takes the path in the diagram. First the root service asks every shard for candidates, and each shard retrieves with the two-tower embedding index and scores with the first-stage network, using position 0. A setwise stage re-ranks the best of all shards together so the page isn't eight near-copies, and the result is shown as cards or pins. Her session feeds the live guest state, so her next search already reflects what she clicked and skipped, and her booking and the host's reply become labels weeks later.

Several parts remain unpublished: the end-to-end latency budget, the sizes of and , how often models are retrained, and how experiments deal with interference. Sources describe the system as of 2018 to 2026, and the current one has certainly moved on.

16Summary

  1. A big city's inventory can't be scored per search. With around a hundred thousand eligible homes and a heavy network, search runs as stages that each score an order of magnitude fewer listings: retrieval, a first-stage network, then a setwise re-ranker.
  2. Version 1 was a hand-made score. It was readable and needed no data, but its weights were guesses and it could not improve itself. A GBDT trained on booking utilities replaced it in 2015 and then plateaued.
  3. Ranking needs a ranking loss. Pair the booked listing with the others it was shown with, train with cross-entropy on the score difference, and weight each pair by the NDCG change of swapping the two. Sorting by the pairwise logits equals sorting by booking probability.
  4. Deep learning was not a drop-in replacement. Wins came from ten times the data, normalised and smooth features, a rebuilt training pipeline and two small hidden layers. Listing IDs, long-view labels, extra depth, wide-and-deep and attention all failed.
  5. Listing embeddings come from sessions. Skip-gram on click sequences, with the booked listing as global context and negatives drawn from the same market, gives 32-number vectors whose similarity to clicked and skipped listings feeds the ranker.
  6. Position is a control variable. It takes position as an input with dropout 0.15 and sets it to 0 when ranking, so the positional factor multiplies every listing's score equally. It gave +0.7% bookings and relied on listings appearing at different positions.
  7. Users lead, model follows. Forcing cheaper-is-better lost bookings. Tail cities, new listings and boutique hotels pointed to the two-tower design (+0.6% bookings, 33% lower p99 scoring latency) and to estimating missing engagement features for new listings (+14% on new-listing bookings).
  8. Hosts are part of the objective. Journey Ranker predicts six positive milestones and three negative ones with small heads on shared layers and mixes them with context-dependent weights, gaining +0.61% uncancelled bookers for Stays.
  9. Ranking by probability is not diverse. Every position is a majority vote of past bookers, so the quality-leaning minority is shut out. Conditioning each position on the listings above, through a learned similarity penalty, raised bookings 0.29% and gross booking value 0.8%.
  10. Assumptions belong to an interface. On maps, attention doesn't decay with rank, shuffling the top results cost nothing, and fewer, better pins (the Bookability Filter) raised uncancelled bookings 1.9%.
  11. Offline metrics filter and experiments decide. NDCG tracks bookings by construction, but price losses, noisy dropout and logged recall all looked fine offline and failed online, so Airbnb replays traffic, runs multi-week A/B tests and reads 5-star ratings months later.

17Build this

The ideas in this chapter are easy to nod along to. You can rebuild the core of the ranking stack in a day on synthetic data, with a ground truth no real marketplace gives you, and watch each fix change the result.

Project A small marketplace with an honest A/B test ~6 hours · numpy and torch

Simulate 2,000 listings, each with a latent quality, a price and one of six taste groups, and 50,000 searches by guests of different taste groups, each seeing 500 eligible listings. A guest books a listing she looks at with probability that depends on its quality and on whether it matches her taste, and she looks at slot with an attention that decays down the page. Let an old ranker order the results by quality plus a quirk of its own, and log what happens.

  1. Train three rankers on the logs: a pointwise regression on booking (1) and non-booking (0), a pairwise cross-entropy model, and a pairwise model weighted by the NDCG change of each swap. Report NDCG for each on held-out searches.
  2. Add position as an input, with dropout on it, and score with position set to 0. Sweep the dropout rate and plot NDCG without position against the gap between NDCG with and without it, as in section 08. Compare each model's ordering with the true quality.
  3. Add a second stage that subtracts a similarity penalty to what is already placed. Sweep the penalty and measure expected bookings by simulating guests of all six taste groups.
  4. Build a "price loss" model: add a second pairwise loss that prefers the cheaper listing, tuned until its offline NDCG matches the baseline's. Then evaluate it by simulating the whole inventory instead of the logged top results.
  5. Run a simulated A/B test of every pair of models with 20,000 searches per arm. Report the booking difference with a confidence interval, and find how many searches per arm you need to detect a 0.3% change.
You'll know it worked when the weighted pairwise model beats the unweighted one on NDCG, the model with a position term recovers the true quality where the one without it inflates what the old ranker liked, the similarity penalty raises expected bookings and then flattens, the price-loss model shows an offline tie and an online loss, and your A/B arithmetic shows why a 0.3% effect needs far more traffic than a 3% one.
A harder variant. Give 10% of the listings no engagement history, as if they were new. Train the ranker with engagement features, measure NDCG for the new segment, then add the nearest-neighbour engagement estimator of section 07 and compare.

18Interview questions

BeginnerWhy not rank listings with a hand-written scoring formula?

A formula can't hold the interactions between price, location, quality and the guest's party, and its weights are guesses that nothing checks against bookings. Airbnb started with one and replaced it with a GBDT in 2015, which the 2019 paper calls one of the largest step improvements in bookings in the company's history. A learned model sets weights from what guests did and keeps improving as data and inventory change. A formula is still useful as a baseline and as a fallback.

BeginnerWhat is NDCG and why is it the main offline metric?

NDCG scores a ranked list by giving credit to relevant items discounted by position. Airbnb uses binary relevance (the booked listing is 1, everything else 0), so one search scores ln 2 / ln(2 + position), from 1.00 at the top to 0.29 at position 9. That discount follows how attention decays down a page, which makes expected NDCG proportional to expected bookings, and the 2022 paper shows that sorting by booking probability maximises both. That is why an NDCG gain predicts a bookings gain, and why it fails on maps, where attention doesn't decay.

IntermediateCompare pointwise, pairwise and listwise losses for this problem.

Pointwise regression predicts a number per listing, and a made-up utility only relates indirectly to bookings. Pairwise training compares the booked listing with each other listing of the same search using cross-entropy on the score gap, so the logits order listings by booking probability under the Bradley–Terry model. LambdaRank weights each pair by the NDCG change of swapping the two, which focuses effort at the top, and it was Airbnb's first neural network breakthrough. Listwise losses such as a softmax over the result use the whole list, but common ones assume each listing's booking chance is independent of the others.

IntermediateWhy did listing-ID embeddings overfit at Airbnb?

An ID embedding needs many examples per item. A listing is a physical home that can be booked at most 365 nights a year, and typical ones far fewer, so a vector per listing fits noise in a handful of bookings. A learning curve in the 2019 paper showed training NDCG rising and test NDCG flat. Adding a multi-task view label didn't help, because long views have a large component unrelated to bookings. What worked was learning embeddings from sessions, where many listings share many clicks, and using listing features instead of IDs.

IntermediateHow do the listing embeddings of the 2018 paper work, and what are the two modifications?

A guest's click session is treated as a sentence, and skip-gram with negative sampling learns a 32-number vector per listing so that listings clicked together are close. One modification keeps the eventually booked listing in the positive context of every window, so early clicks are pulled toward the choice. Another adds negatives sampled from the central listing's own market, because guests search inside one market and random negatives from other cities teach nothing about taste within a city. Similarity to recently clicked and skipped listings then becomes a feature in the ranker.

IntermediateHow does Airbnb deal with position bias without randomising results?

It models booking probability as relevance times the chance of examining the position, feeds position into the network as an input during training, and sets it to 0 when ranking, so the positional factor multiplies every listing in a search equally. Position dropout (0.15) stops the relevance part leaning on position, which would otherwise cost roughly 1.3% NDCG. It depends on listings appearing at different positions for similar queries, which calendars and bookings cause. Online it gave +0.7% bookings and +1.8% revenue, because it also removed an accumulated bias toward cheap listings.

IntermediateHow are hosts' decisions included in ranking?

Journey Ranker (2023) trains one network with a base module for six positive milestones (click through uncancelled booking, chained by conditional probabilities), a twiddler module with heads for host rejection, host cancellation and guest cancellation, and a combination module that mixes the outputs linearly with weights computed from the context. A pairwise loss orders uncancelled booking above click above impression above the bad outcomes. It gained +0.61% uncancelled bookers for Stays, and blending separate models by grid-searched weights had decayed within months.

DeepWhy does ranking by booking probability produce similar results, and what did Airbnb do?

Each position goes to the listing that more than half of past bookers with that query would pick, a majority vote, and roughly 80% of bookers lean toward affordability, so the quality-leaning 20%, who carry half the booking value, get no representation. Airbnb's 2022 fix conditions each position on the listings above: a second model learns a similarity penalty from searches where the antecedent listing was rejected, and the ranker subtracts the discounted sum of penalties as it places each position (lambda = 1/3). Bookings rose 0.29% and gross booking value 0.8%, concentrated among first-time bookers, at the price of 5.3% higher median latency.

DeepOffline NDCG improved but the A/B test is flat or negative. What do you check?

First, whether the offline set only contains results the old system showed. Airbnb's price loss matched baseline NDCG offline and lost 0.67% of bookings online because it only re-ranked logged top results. Second, position bias in the logs. Third, a mismatch between the label and the metric, such as clicks or long views against bookings. Fourth, retraining noise: Airbnb averages five initialisations and treats roughly 0.3% as the scale of a promising gain. Fifth, the interface: NDCG assumes attention decays by rank, which maps break. Finally, replay traffic through the full candidate set instead of logged results.

DeepDesign candidate retrieval for 100,000 eligible homes with 10,000 listing updates a second and filters on every search.

Use a two-tower model with the listing tower in a daily batch job and only the query tower at request time, so cost doesn't grow with eligible listings, and refresh price and availability after retrieval. Train on trips, not searches, so early searches count, with hard negatives from clicks and wishlists. For the index Airbnb chose IVF over HNSW, because HNSW's memory grew under frequent updates and was hard to combine with filters, while IVF cluster IDs act as one more filter. Evaluate with traffic replay, recall of the heavy model's top results, which predicted A/B outcomes for all roughly ten models tried.

19Go deeper

📄
Paper
Applying Deep Learning to Airbnb Search
Haldar et al., KDD 2019. How Airbnb went from GBDT to a deep network, the failed listing-ID and multi-task models, and feature engineering for networks. arXiv:1810.09591
📄
Paper
Improving Deep Learning for Airbnb Search
Haldar et al., 2020. Two-tower ranker, price experiments, cold start, and position as a control variable with dropout. arXiv:2002.05515
📄
Paper
Real-time Personalization using Embeddings for Search Ranking at Airbnb
Grbovic and Cheng, KDD 2018. Listing embeddings from sessions, booking as global context and real-time click and skip similarity.
📝
Company blog
Listing Embeddings in Search Ranking
Grbovic et al., Airbnb Engineering, 13 March 2018. Same method in plain language, with the offline and online results.
📄
Paper
Managing Diversity in Airbnb Search
Abdool et al., KDD 2020. Diversity metric, second-stage rankers that failed and the LSTM context model. arXiv:2004.02621
📄
Paper
Learning To Rank Diversely At Airbnb
Haldar et al., 2022. Why pairwise ranking follows the majority, the conditional model with a similarity penalty and the NDCG and bookings argument. arXiv:2210.07774
📄
Paper
Optimizing Airbnb Search Journey with Multi-task Learning
Tan et al., KDD 2023. Journey Ranker: base, twiddler and combination modules for guests and hosts. arXiv:2305.18431
📄
Paper
Learning to Rank for Maps at Airbnb
Haldar et al., 2024. Why ranking does not matter among map pins, the Bookability Filter and the focus-versus-urgency experiment. arXiv:2407.00091
📄
Paper
Applying Embedding-Based Retrieval to Airbnb Search
Abdool et al., January 2026. Trip-based sampling, IVF versus HNSW and replay-based evaluation. arXiv:2601.06873
📝
Company blog
Personalizing Airbnb search by learning from the guest journey
Zha et al., Airbnb Tech Blog, 2026. A Transformer over long-term and short-term guest events, and the online results.
📄
Paper
From RankNet to LambdaRank to LambdaMART: An Overview
Burges, Microsoft Research technical report, 2010. Source of the NDCG-weighted pairwise loss in section 04.
📄
Paper
Unbiased Learning-to-Rank with Biased Feedback
Joachims, Swaminathan and Schnabel, WSDM 2017. Propensity-weighting approach to position bias that Airbnb's 2020 paper contrasts itself with.