Logic Foundry

Build with understanding.

Airbnb’s CASTLE turns booking choices into labeled examples for natural-language search

Airbnb researchers introduced CASTLE to train natural-language search models before enough real search traffic is available. The framework starts with two listings a guest considered and asks a large language model (LLM) to write a query that fits the booked listing but not the other one. The result is a synthetic query with two relevance labels, without a separate model having to assign them.

How CASTLE builds a training example

CASTLE draws listing pairs from de-identified booking sessions. The listing the guest booked becomes the positive example; another listing the same guest viewed but did not book becomes the negative example. The booking anchors the pair in observed behavior, but the query is generated: it describes a distinction between the listings, not necessarily the guest’s reason for choosing one.

Methods such as InPars and Promptagator generate queries first and assign relevance labels in a separate step. The Airbnb researchers argue that separating those tasks can introduce errors and widen the gap between synthetic queries and the searches guests actually make.

CASTLE combines template prompts, few-shot prompts drawing on about 500 seed queries collected through targeted user research, and prompts that focus on attributes distinguishing the two listings. It also varies query length and phrasing. For pairs with too little booking history, including those involving new listings, an LLM-based evaluator called Virtual Judge assigns relevance labels to additional query–listing combinations. A variant called CASTLE-R is designed for production systems that have begun to accumulate real search traffic.

What the evaluation shows

The researchers measured how closely the generated query distribution matched the distribution of real user queries using Kullback–Leibler (KL) divergence, where lower values indicate a closer match. CASTLE scored 1.01, compared with 9.33 for Promptagator, the strongest baseline—a 9.2-fold reduction in divergence. In a separate comparison of the types of attributes expressed in queries, CASTLE scored 0.08, compared with 0.09 for the curated research seed queries.

The team also checked the labels directly. Three independent domain experts reviewed 200 sampled examples, each consisting of a query and two listings. The individual reviewers agreed with CASTLE’s relevance labels 91% to 93% of the time.

On LinkedIn, AI engineer Mark Tsai raised a different question: had the model learned to match search intent to listing attributes, or could it recognize familiar templates or listings? He suggested comparing a random split of the synthetic examples with a stricter split in which neither seed templates nor listing IDs appear in both training and evaluation, then testing on held-out real queries.

Author Wendy Ran Wei replied that the team had evaluated the model on real queries excluded from training and had used safeguards against leakage when constructing 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.