Warden: Real Time Anomaly Detection at Pinterest

Isabel Tallam, Charles Wu, Kapil Bajaj17 May 2023

Problem

ML teams at Pinterest each built their own way to notice that a model decays when the world changes, for example when winter-clothing recommendations keep showing in spring. Trust and Safety analysts found spam creators by running queries by hand. Spam is a small share of activity, and total pin creation is a daily and weekly wave, so a spam burst is invisible in the aggregate. Spammers also change tactics.

Example from the article: a pin shows a chocolate cake, but the click lands on an unrelated page. Removing the pin treats the symptom, so the team wanted to find the account that creates such pins in bulk.

Solution in brief

Warden is a modular platform with three plug-in stages: query data, apply an anomaly algorithm, notify. For model drift it computes the Population Stability Index (PSI) between a current and a historical window of scores every few minutes. For spam it runs the Yahoo EGADS time-series library on pin-creation counts, then drills down by ISP, country and other filters.

Questions this case answers
  • How to detect distribution drift in a model's output scores continuously and alert before it causes a production issue
  • How to find a small burst of abusive activity hidden inside a strongly seasonal event stream
  • How to detect drift in ML model scores in near real time without every team building its own monitoring?
  • How to choose the time window and bucket size for a PSI-based drift alert so it is neither noisy nor blind?

Tools and methods

  • Warden platform — query, detect, notify modules
  • Population Stability Index (PSI) — compares binned score distributions in two windows
  • Yahoo EGADS — time-series modeling plus anomaly detection models for spikes in pin creation
  • Apache Druid — first data source, real-time data already grouped by timestamp
  • Slack and email — alerts to the owner teams
Continue reading — it's free

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