LLM-Powered Relevance Assessment for Search Results

pinterest · Tech · 2025 · source Agentic: no · promotional bias: low · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Search relevance measurement for online experiments

Pinterest Search needed cheaper and faster relevance labels so A/B experiments could detect small ranking-quality changes and heterogeneous treatment effects rather than only large topline movements.

Constraints:

Architecture

Pinterest fine-tuned multilingual open-source language models as cross-encoder relevance classifiers over query-Pin pairs. The selected XLM-RoBERTa-large model generates five-level relevance labels for the top 25 search results in paired A/B experiment samples. LLM labeling enables larger stratified query samples, sDCG@25 computation, heterogeneous-effect analysis, and lower minimum detectable effects while validation compares LLM labels and derived metrics against human annotations.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  Labels["Human relevance labels"] --> Model["Cross-encoder relevance model"]
  PinText["Pin text representation"] --> Model
  Model --> Labeling["LLM labeling pipeline"]
  Labeling --> Metrics["Experiment metrics pipeline"]
  Sampling["Stratified sampling design"] --> Metrics
  Metrics --> Validation["Validation suite"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Human relevance labels Training and validation labels for five-level query-Pin relevance. Cross-encoder relevance model
Pin text representation Combines titles, descriptions, BLIP captions, linked page metadata, board titles, and engaged query tokens. Cross-encoder relevance model
Cross-encoder relevance model Fine-tuned multilingual model that jointly scores query-Pin pairs across five relevance levels. Human relevance labels, Pin text representation, LLM labeling pipeline
LLM labeling pipeline Labels paired experiment samples and top-25 search results with model-generated relevance labels. Cross-encoder relevance model, Experiment metrics pipeline
Experiment metrics pipeline Computes sDCG@25, topline metrics, paired differences, and heterogeneous effects. LLM labeling pipeline, Validation suite
Stratified sampling design Allocates sample units by query interest and popularity to improve representativeness and reduce variance. Experiment metrics pipeline
Validation suite Compares LLM labels and query-level metrics against human labels across exact match, within-one agreement, rank correlations, and error distributions. Experiment metrics pipeline

Data flow

Human-annotated query-Pin pairs train a cross-encoder relevance model. The model consumes query text and a rich Pin representation, emits five-dimensional relevance scores, labels top-K experiment results, computes query-level sDCG@25, aggregates topline metrics, and analyzes heterogeneous effects by popularity and interest segments with false-discovery-rate control.

4 supporting quotes
“We fine-tune open-source LLMs on relevance prediction tasks using human-annotated labels, then utilize the fine-tuned LLMs to evaluate the ranking results across experimental groups in online A/B experiments.”article, stated
“We then use this fine-tuned search relevance model to generate 5-dimensional relevance scores and use the label corresponding to the highest score (argmax) for relevance assessment.”article, stated
“For each query in our paired sample, we retain the top K search results and generate LLM-based relevance labels.”article, stated
“Lastly, we calculate heterogeneous effects by query popularity and query interest (e.g. beauty, women’s fashion, art, etc), utilizing a [Benjamini-Hochberg procedure]”article, stated

Why this architecture

Pinterest chose a fine-tuned multilingual cross-encoder because relevance labels needed high-quality query-Pin judgment for offline experiment measurement, while reduced labeling cost made larger stratified samples feasible. XLM-RoBERTa-large was selected over Llama-3-8B because it delivered sufficient quality at far lower inference time and cost.

3 supporting quotes
“We use a cross-encoder model architecture to predict a Pin’s relevance to a given query, as illustrated in Figure 1.”article, stated
“LLM labeling significantly reduces relevance labeling costs as well as labeling time, which enables much larger sampling designs.”article, stated
“While the Llama-3–8B model offers slight improvement in accuracy, its inference time and cost increase 6 times.”article, stated

Models used: XLM-RoBERTa-large · Llama-3-8B · multilingual BERT-base · T5-base · mDeBERTa-V3-base · DistilBERT · BLIP

Scale

Alternatives considered (roads not taken)

Human annotations for all relevance measurement

Rejected because: Human labels had low availability, high marginal cost, and forced sample designs that could only detect large effects.

“Relevance measurement typically relies on human annotations, but is limited by the low availability of human labels and the high marginal cost of generating them.”article, stated

Simple random sampling with human-label economics

Rejected because: The LLM cost structure made stratified query sampling and larger samples practical, reducing MDE.

“The introduction of LLM labeling enabled us to redesign our sampling approach. We increased our sample sizes, moved from simple random sampling (SRS) to stratified sampling”article, stated

Llama-3-8B as the production relevance model

Rejected because: It offered only slight accuracy improvement while increasing inference time and cost by 6x.

“While the Llama-3–8B model offers slight improvement in accuracy, its inference time and cost increase 6 times.”article, stated

Text-only Pin metadata without visual captions

Rejected because: Pinterest used BLIP-generated captions as part of a richer Pin representation, while leaving raw-image VLMs as future work.

“we leverage a comprehensive set of textual features, including Pin titles and descriptions, BLIP image captions”article, stated

Patterns

fine-tuning-adaptation (model-adaptation)

Pinterest fine-tunes multilingual open-source LLMs on human relevance labels for five-level query-Pin relevance classification.

“We fine-tune open-source LLMs on relevance prediction tasks using human-annotated labels”article, stated

eval-driven-development (evaluation)

The entire system is a production evaluation layer for A/B tests, with LLM labels validated against human labels and experiment metrics.

“At Pinterest Search, we track whole-page relevance in online A/B experiments to evaluate new ranking models and ensure a high-quality user experience.”article, stated
“We conducted a rigorous validation of the metrics derived from LLM labeling.”article, stated

model-routing (model-selection)

Pinterest evaluated multiple candidate models and selected XLM-RoBERTa-large for the best quality/efficiency balance rather than maximum raw accuracy.

“Therefore, we select XLM-RoBERTa-large as it offers a good balance between prediction quality and inference efficiency.”article, stated

latency-optimization (inference)

The production model choice keeps labeling throughput practical: 150,000 rows in 30 minutes on one A10G GPU.

“Inference runs on a single A10G GPU, allowing us to label 150,000 rows within 30 minutes.”article, stated

Tradeoffs

Use fine-tuned LLM relevance labels

Chose model-generated labels trained on human annotations over ongoing human annotation as the primary measurement source.

Rationale: LLM labels cut cost and time enough to enable larger samples and better experiment sensitivity.

“This approach not only significantly reduces labeling costs and improves evaluation efficiency, but also unlocks opportunities to further improve metric quality”article, stated

Use a cross-encoder relevance model

Chose joint query-Pin scoring over cheaper independent representations.

Rationale: The source presents the cross-encoder as the relevance-prediction architecture used for query-Pin judgment.

“We use a cross-encoder model architecture to predict a Pin’s relevance to a given query”article, stated

Prioritize XLM-RoBERTa-large for production

Chose lightweight high-quality multilingual model over Llama-3-8B's slightly higher accuracy.

Rationale: XLM-RoBERTa-large balanced prediction quality with inference efficiency.

“The model is lightweight yet delivers high-quality predictions.”article, stated

Scale and stratify experiment samples

Chose larger stratified query sampling over simple random sampling under human-label constraints.

Rationale: Stratification reduced variance and made heterogeneous treatment effects measurable.

“Prior to LLM labeling, stratified query sampling with human annotations was impractical, as it required a large number of queries to adequately represent each fine-grained stratum.”article, stated

Gotchas (what bit them)

Human labels can make experiment metrics too insensitive.

Root cause: Low label availability and high marginal cost force small samples and large MDEs.

Resolution: Use fine-tuned LLM labeling to scale sample sizes and enable stratified sampling.

“These large MDEs were primarily the result of the constraints on our sampling designs imposed by the high cost and time consumption of human labeling.”article, stated

The highest-accuracy model may be operationally wrong.

Root cause: Llama-3-8B had slightly better accuracy but materially higher inference time and cost.

Resolution: Select XLM-RoBERTa-large as the production model.

“While the Llama-3–8B model offers slight improvement in accuracy, its inference time and cost increase 6 times.”article, stated

Individual-label accuracy is not enough to validate experiment measurement.

Root cause: A/B tests depend on query-level metrics and paired differences, not just Pin-level exact match.

Resolution: Validate query-level sDCG@K correlations, error distributions, and paired-difference errors.

“For experimental evaluation, we need to calculate the metric difference between the control and treatment groups.”article, stated

Multilingual relevance assessment needs separate validation.

Root cause: Most training query-Pin pairs were English, creating a possible performance gap for non-English queries.

Resolution: Validate France and Germany query-level metric alignment before relying on non-English LLM labels.

“with the majority of query-Pin pairs in English. As a result, careful validation is required for non-English queries to extend LLM-based relevance assessment to those queries.”article, stated

Evaluation

Pinterest validated LLM labeling through Pin-level exact match and within-one agreement, query-level Kendall and Spearman correlations, sDCG@25 error distributions, paired-difference errors for A/B tests, popularity segments, and non-English market validation for France and Germany.

Metrics: 73.7% exact match with human labels · 91.7% within one relevance point · Kendall's tau > 0.5 for US popularity segments · Spearman's rho > 0.65 for US popularity segments · overall query-level error below 0.01 · MDE reduced to <=0.25% · 150,000 rows in 30 minutes on one A10G GPU

3 supporting quotes
“LLM-generated labels and human labels yield an exact match rate of 73.7%, with 91.7% of ratings deviating at most by 1 point.”article, stated
“We achieve Kendall’s τ>0.5 and Spearman’s ρ>0.65 for all query popularity segments, indicating a strong alignment across all segments.”article, stated
“the errors in paired differences are even more centered around 0 with lighter tails, indicating that LLM-based labeling provides highly reliable estimates of paired differences for A/B experiment assessment.”article, stated

Outcomes

The case reports 150,000 labels in 30 minutes on one A10G GPU, K=25 results per query, exact and within-one agreement metrics, and MDE reduction from 1.3%-1.5% to <=0.25%.

3 supporting quotes
“We have successfully deployed the LLM-based relevance assessment at Pinterest Search, significantly reducing the manual annotation costs and turnaround time”article, stated
“achieving an order of magnitude reduction in MDEs for improved detection of relevance shifts.”article, stated
“Transition to LLM-based relevance assessment enables us to scale up the evaluation query set and redesign the sampling strategy”article, stated