Powering Millions of Real-Time Rankings with Production AI

Mihail Douhaniaris, Martin Jewell, Greg Chase, Mihir Mathur22 May 2024

Problem

A travel marketplace makes over 30 million ranking predictions a day, each returned in under 80 ms. Historically the ranker used only batch-computed features. Features computed in real time from a visitor's browsing proved more valuable, but they need streaming infrastructure and monitoring of feature freshness and drift. Traffic is seasonal, so serving cost must follow load. The team also runs constant A/B tests and must notice feature drift in a model that is retrained daily.

Example from the article: a running count of each visitor's impressions of each activity, taking into account the position on the results page where the impression happened.

Solution in brief

Features are defined once in a feature platform (Tecton) that reads both the data warehouse and Kafka streams. The same definitions give point-in-time correct training data and low-latency online values. A daily Airflow job retrains the model and logs predictions to an observability tool (Arize), which watches feature drift and NDCG.

Questions this case answers
  • How to compute and serve streaming per-user features to a low-latency model while keeping training and serving values consistent
  • How to monitor a frequently retrained model for feature drift and metric regressions without labeled data arriving immediately
  • How to add real-time behavioral features, such as a visitor's recent impressions, to a search ranking model?
  • How to serve streaming features to a ranker with single-digit-millisecond latency under seasonal traffic?

Tools and methods

  • Tecton — feature definitions, streaming aggregation, online and offline stores, feature monitoring
  • Kafka — event streams of impressions, clicks and bookings
  • Redis — online store behind Tecton
  • Airflow, MLflow — daily dataset build, training and model registry
  • FastAPI, Docker, Kubernetes — serving control and treatment models
  • Arize — feature drift, data quality and NDCG monitoring
  • PSI and KL divergence — drift metrics
Continue reading — it's free

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