How The New York Times Cooking Team Makes Personalized Recipe Recommendations

Kyelee Fitts, Celia Eddy13 Oct 2023

Problem

Readers of The New York Times Cooking choose among tens of thousands of recipes and differ in diet, cook time and cuisine. Editors curate the homepage and newsletters by hand each week, which cannot fit every reader. The team added algorithmic carousels next to the editorial ones.

The first personalized bandit sent the same popular recipes to most users, which defeats the point of the carousel.

Example from the article: a user who saved three salad and soup recipes is shown the Cucumber Salad rather than the Salt-and-Pepper Roast Chicken.

Solution in brief

Each carousel ranks a pool of eligible recipes. Most carousels use a contextual bandit over recipe-embedding features. A user history vector (the mean embedding of saved recipes) gives a similarity feature, and a reward that pays more for clicks on recipes similar to that history keeps recommendations from collapsing into popular items.

Questions this case answers
  • How to rank a large content catalog per user with a bandit when a click-only reward pushes the same popular items to everyone
  • How to infer implicit user preferences from saved items and feed them to a ranking model as contextual features
  • How to build item-to-item and region-aware recommendations from item text and metadata without labeled relevance data
  • How to personalize carousels for a catalog of tens of thousands of items when editors curate by hand?

Tools and methods

  • Sentence transformer embeddings — recipe vectors from title, description, ingredients and steps.
  • Cosine similarity — compares recipe to recipe and recipe to user history.
  • Contextual multi-armed bandit — ranks a pool by predicted click reward plus an uncertainty term.
  • Personalized reward — extra reward for clicks on recipes similar to the user's history.
  • Seasonality score — per-region, per-season score that builds local pools.
  • Diet-count vector — normalized counts of saved recipes by diet tag, used as a bandit feature.
Continue reading — it's free

Google or a one-time email code. No password.