Airbnb’s CASTLE uses booking choices to train natural-language search

Airbnb researchers have introduced CASTLE, a framework for training natural-language search models before enough real search traffic exists. It starts with a choice recorded in a de-identified booking session: a guest viewed two listings and booked one. A large language model then writes a search query that fits the booked listing but not the alternative. The query is synthetic; the booking choice is real.

This approach addresses two problems at once. To handle requests such as “a pet-friendly beachfront home for eight,” a search model needs examples of how guests express preferences and labels indicating which listings match. Methods such as InPars and Promptagator generate queries first and rely on a separate model judgment to label relevance. With CASTLE’s paired listings, the labels are set by construction: the booked listing is the positive example and the viewed but unbooked listing is the negative one.

CASTLE generates queries using templates, prompts with examples drawn from about 500 seed queries collected through targeted user research, and prompts that focus on attributes that distinguish the two listings. It also varies query length and phrasing. For pairs without enough booking history, including those involving new listings, an LLM-based evaluator called Virtual Judge can label additional query–listing combinations. A variant, CASTLE-R, is designed for production systems that have begun to collect real search traffic.

How closely did the synthetic data resemble real searches?

The researchers compared the distribution of generated queries with that of real user queries using Kullback–Leibler (KL) divergence, for which a lower value indicates a closer match. CASTLE scored 1.01, compared with 9.33 for Promptagator, the strongest baseline—a 9.2-fold reduction in divergence. When the comparison focused on the types of attributes in queries, CASTLE scored 0.08, compared with 0.09 for the human-curated seed queries. In a separate check, three domain experts independently reviewed 200 sampled query-and-listing triplets. Each expert agreed with CASTLE’s relevance labels in 91% to 93% of cases.

Those measurements address query similarity and label quality. In a LinkedIn discussion about the CASTLE research, AI engineer Mark Tsai raised a different question: had the model learned to match guest preferences to listing attributes, or was it recognizing familiar templates or listings? He proposed comparing a random split of synthetic triplets with a stricter split in which neither seed templates nor listing IDs appear in both sets, then testing on previously unused real queries.

Author Wendy Ran Wei replied that the team had evaluated its models on real queries excluded from training and had taken precautions against data leakage when building the evaluation set. She said the paper, available on arXiv, did not report the controlled comparison Tsai proposed and identified it as a direction for further research.