
Inside CASTLE: A novel framework leveraging user booking signals and contrastive learning to train natural language search models
The Airbnb engineering team introduced CASTLE at CIKM 2026, a framework designed to train natural language search models before logging a single real query. By combining contrastive listing pairs from de-identified booking sessions with seed-guided LLM prompting, CASTLE bridges the gap between synthetic data generation and authentic user behavior. This article explores how to automatically generate highly accurate relevance labels and handle long-tail search intents without relying on manual annotations.
Essential reading for Search & AI engineers implementing zero-shot/cold-start search models, as well as backend engineers designing scalable LLM synthetic dataset pipelines.
When introducing natural language search to Airbnb to replace traditional filter controls, the team faced a severe cold-start problem due to the lack of historical user queries and relevance labels. Existing synthetic query generation approaches like InPars and Promptagator showed a high distributional mismatch compared to actual user search behavior or suffered from error propagation when using separate LLMs to judge relevance post-hoc.
The engineering team developed CASTLE, a framework that jointly generates synthetic queries and relevance labels using contrastive listing pairs (positive vs. negative) derived from de-identified booking sessions. By combining template-based, few-shot (using 500 user-research seed queries), and attribute-grounded prompts with a query-variety mechanism, CASTLE creates realistic queries while guaranteeing accurate relevance labels by design through contrastive pair construction.
CASTLE achieved a Kullback–Leibler (KL) divergence score of 1.01 against real user search distributions, representing a 9.2x improvement over the best baseline (Promptagator at 9.33), with human domain expert evaluation confirming 91–93% label agreement. Additionally, its query length standard deviation (σ = 2.48) closely matched real user patterns (σ = 2.49), while continuing to effectively oversample long-tail search intents even after production launch.
Trade-off
Newly listed properties without booking history cannot form contrastive listing pairs and require fallback to an LLM-based Virtual Judge (VJ) evaluator, while offline generation incurs compute overhead for prompting LLMs and managing contextual prompt pipelines.
A scenario where a new search service lacks historical query logs and query-to-item relevance labels, making supervised model training difficult.
A structured data pair formed by comparing an item selected by a user (Positive) against viewed-but-not-selected alternatives (Negative) during a booking session.
A statistical measure indicating how much one probability distribution differs from a baseline reference distribution, where values closer to zero indicate higher similarity.




