WhoBuilt

What We Learned from Using LLMs in Pinterest

Jul 16, 2025· 18 min· 2.6K views·Watch on YouTube

Speakers

Pinterest Search Relevance machine learning engineers Mukuntha Narayanan and Han Wang share lessons from using LLMs to improve Pinterest Search.

LLMs improve relevance prediction

Pinterest concatenates a search query and Pin text, then uses a fine-tuned open-source LLM as a cross-encoder to predict relevance on a five-point scale. An 8-billion-parameter Llama model improved performance by 12% over multilingual BERT and 20% over Pinterest’s SearchSage embedding model.

Captions and user actions enrich Pin text

Han Wang describes building Pin representations from titles, descriptions, LLM-generated image captions, board titles, and queries that led to strong engagement. Ablation studies showed that captions provided a solid baseline and adding more text features, including user-action features, improved relevance prediction.

Distillation makes the model practical to serve

Pinterest trains a smaller student model on five-scale relevance scores produced by an LLM teacher, expanding training data about 100 times with samples from daily search logs across domains, languages, and countries. The student uses a bi-encoder and additional features such as SearchSage embeddings, graph embeddings, and BM25 text-match statistics.

Offline embeddings support global search

Pin embeddings are inferred offline across billions of Pins and refreshed when their inputs meaningfully change. Query embeddings run online in a few milliseconds, with an approximately 85% cache hit rate. The team reports relevance and search-fulfillment gains in international segments, and says the student’s embeddings also help represent content for related Pins and the home feed.

One multilingual model serves all languages

Mukuntha Narayanan recaps four lessons: LLMs predict relevance well, captions and user actions add useful content information, distillation supports efficient serving, and relevance tuning produces useful semantic representations. In the Q&A, he says Pinterest uses the same multilingual model across languages and that synthetic data helped extend improvements beyond markets with substantial human-labeled data.

Takeaways

  • Use a cross-encoder teacher when query-to-item interactions matter for relevance labels.
  • Test image captions and engagement-derived annotations as inputs, then measure each with ablations.
  • Distill expensive teacher scores into a smaller model trained on fresh, representative traffic samples.
  • Move item embedding inference offline and cache repeated query embeddings to control serving latency.
  • A multilingual model and synthetic labels can help extend relevance improvements into markets with limited human-labeled data.

Mentioned in this talk

Search inside this talk

What was claimed 13

Related talks