This article details Airbnb's architecture for personalizing search results using a Transformer-based sequence model. It focuses on how they capture guest behavior over long periods, optimize data processing for efficiency, and integrate sequence embeddings into their real-time ranking system.
Read original on Airbnb EngineeringAirbnb moved from traditional hand-crafted features to a sequence modeling approach to personalize search. The core challenge was to leverage years of guest interactions (views, bookings, cancellations) to predict preferences. This required a system capable of handling vast, sparse, and noisy event data, predominantly listing views, while optimizing for booking conversion rather than just engagement.
To manage the computational complexity of modeling long event sequences, Airbnb ingeniously split the guest journey into two distinct sequences, each capped to optimize for relevance and tractability:
System Design Takeaway
This dual-sequence approach demonstrates a common strategy in large-scale system design: segmenting data based on its temporal relevance and impact to optimize processing and storage, especially in ML systems where raw data can be overwhelmingly large. Event encoding uses a shared feature pool with unified embedding tables for high-cardinality IDs.
Training a Transformer on hundreds of millions of search-label pairs and serving predictions in real-time presented significant performance challenges. Airbnb implemented several key optimizations:
The sequence model was integrated incrementally, first with the long-term sequence, then adding the short-term view sequence, and finally co-training with a setwise ranker. A setwise ranker considers a set of candidate listings together, reasoning about their relative differences, which allows for more nuanced personalization than pointwise rankers. This system significantly improved offline NDCG and online uncanceled bookings and views across search and promotional emails, demonstrating the generality of the learned guest representations. Future work includes near-real-time embedding updates and richer event types.