Embedding-based retrieval for Airbnb search

Huiji Gao19 Mar 2025

Problem

Airbnb search must pick the most relevant homes out of millions of eligible listings. The task is hardest for large geographic areas (a state or a country) and for high-demand cities, where the candidate count is huge. Expensive ranking models cannot score every home, so an earlier stage has to cut the pool without dropping good listings. Flexible-date search adds more candidates to that stage.

Example from the article: a query for "France" or "Paris" matches far more homes than the later ranking models can score within latency limits.

Solution in brief

Train a two-tower model that maps queries and listings into one vector space. Build training pairs from user trips, with the booked home as the positive and homes the user saw but did not book as negatives. Compute listing embeddings daily offline and serve them through an IVF index, with Euclidean distance for balanced clusters.

Questions this case answers
  • How to retrieve relevant candidates from a very large, frequently updated catalog under a tight latency budget before heavy ranking
  • How to construct positive and hard-negative training pairs for a retrieval model from multi-step user journeys that end in a purchase
  • How to narrow millions of eligible listings to a small candidate set before expensive ranking models run?
  • How to build training pairs for a retrieval model from booking journeys?

Tools and methods

  • Two-tower model — a listing tower and a query tower that produce embeddings.
  • Contrastive learning — trains the model so a query is closer to a booked home than to a non-booked one.
  • Trip-based negative sampling — negatives come from homes the user saw or wishlisted but did not book.
  • IVF index — clusters listings in advance and retrieves from the closest clusters.
  • HNSW — the alternative graph index that was rejected.
Continue reading — it's free

Google or a one-time email code. No password.