Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Mobile Order Click-Through Rate (CTR) Recommendation with Ray on Apache Spark at Burger King (Kai Huang, Intel & Luyang Wang, Restaurant Brands International)

Mobile Order Click-Through Rate (CTR) Recommendation with Ray on Apache Spark at Burger King (Kai Huang, Intel & Luyang Wang, Restaurant Brands International)

For fast food recommendation, user behavior sequences and context features (such as time, weather, and location) are both important factors to be taken into consideration. At Burger King, we have developed a new state-of-the-art recommendation model called Transformer Cross Transformer (TxT). It applies Transformer encoders to capture both user behavior sequences and complicated context features and combines both transformers through the latent cross for joint context-aware fast food recommendations. Online A/B testings on mobile apps show that TxT can significantly lift the Click-Through Rate (CTR) compared with existing methods results. TxT has also been successfully applied to other fast food recommendation use cases outside of Burger King.

In addition, we have built an end-to-end recommendation pipeline leveraging Ray, Apache Spark and Apache MXNet, which integrates data processing (with Spark) and distributed training (with MXNet and Ray) into a unified data analytics and AI pipeline, running on the same big data cluster where the data is stored and processed. Such a unified system has been proven to be efficient, scalable, and easy to maintain in the production environment.

In this session, we will elaborate on our model topology and discuss the implementation details of our end-to-end recommendation pipeline. We will also share our practical experience in successfully building such a mobile order recommendation system with Ray and Spark on big data platforms.


July 19, 2021

More Decks by Anyscale

Other Decks in Technology


  1. #RaySummit Ray Summit Mobile order Click-Through Rate (CTR) Recommendation with

    Ray on Apache Spark at Burger King LUYANG WANG Restaurant Brands International KAI HUANG Intel Corporation
  2. #RaySummit Ray Summit Agenda LUYANG WANG ▪ Food recommendation use

    case ▪ Transformer Cross Transformer Recommender KAI HUANG ▪ AI on big data ▪ Distributed training pipeline with Ray on Apache Spark
  3. #RaySummit Ray Summit Fast Food Recommendation Use Case

  4. #RaySummit Ray Summit ▪ Different level of product to consider

    here, e.g., Combo versus A La Carte ▪ Compatibility with other items in the basket ▪ Location, time, weather awareness ▪ Guest Checkout versus login user Fast Food CTR Recommendation Use Case
  5. #RaySummit Ray Summit ▪ Collaborative Filtering ▪ Wide and Deep

    / Neural Collaborative Filtering ▪ RNN Based ▪ Behavior Sequence Transformer / BERT4REC ▪ Requirements of user identifier ▪ User embedding size is huge ▪ Challenge to differentiate current session purchase versus previous purchase history ▪ Challenge to learn complex context feature interactions Challenges Use Case Challenges Approaches We Tried:
  6. #RaySummit Ray Summit Transformer Cross Transformer Recommender

  7. #RaySummit Ray Summit Our Recommendation Solution: Transformer Cross Transformer (TxT)

    Model Components ▪ Sequence Transformer ▪ Taking item order sequence + optional purchase history as input ▪ Context Transformer ▪ Taking multiple context features as input ▪ Latent Cross Joint Training ▪ Element-wise product for both transformer outputs
  8. #RaySummit Ray Summit Accelerate Model Learning Leveraging NLP and Computer

  9. #RaySummit Ray Summit Model Comparison RNN Latent Cross Behavior Sequence

  10. #RaySummit Ray Summit Performance Comparison Model Conversation Rate Gain Add-on

    Sales Gain RNN Latent Cross (control) - - TxT +7.5% +4.7% Inference Performance A/B Testing Performance
  11. #RaySummit Ray Summit Model Training Architecture ▪ Previous Current Previous

  12. #RaySummit Ray Summit AI on Big Data

  13. #RaySummit Ray Summit Distributed, High-Performance Deep Learning Framework for Apache

    Spark* AI on Big Data Accelerating Data Analytics + AI Solutions At Scale https://github.com/intel-analytics/bigdl Unified Analytics + AI Platform for distributed TensorFlow*, Keras*, PyTorch* and BigDL on Apache Spark* and Ray https://github.com/intel-analytics/analytics-zoo
  14. #RaySummit Ray Summit Orca Seamlessly scale out TF & PyTorch

    on Spark & Ray Cluster Serving Distributed real-time model serving on Flink Zouwu Scalable time series analysis pipeline w/ AutoML RayOnSpark Run Ray programs directly on Big Data platform PPML Privacy Preserving Data Analytics & ML on SGX K8s Cluster Cloud Python Libraries (Numpy/Pandas/sklearn/…) DL Frameworks (TF/PyTorch/BigDL/OpenVINO/…) Distributed Analytics (Spark/Flink/Ray/…) Laptop Hadoop Cluster Powered by oneAPI Scaling End-to-End AI Pipelines to Distributed Big Data https://github.com/intel-analytics/analytics-zoo Analytics Zoo: Software Platform for Big Data AI
  15. #RaySummit Ray Summit Seamless Scaling from Laptop to Distributed Big

    Data Clusters Unified Data Analytics and AI Platform ▪ Easily prototype end-to-end pipelines that apply AI models to big data. ▪ “Zero” code change from laptop to distributed cluster. ▪ Seamlessly deployed on production Hadoop/K8s clusters. ▪ Automate the process of applying machine learning to big data. Production Data pipeline Prototype on laptop using sample data Experiment on clusters with history data Production deployment w/ distributed data pipeline
  16. #RaySummit Ray Summit Motivations for RayOnSpark ▪ Efforts required to

    directly deploy Ray applications on existing Hadoop/Spark clusters. ▪ Challenge to prepare the Python environment on each node without modifying the cluster. ▪ Need a unified system for big data analytics and Ray applications.
  17. #RaySummit Ray Summit Distributed Training Pipeline with RayOnSpark

  18. #RaySummit Ray Summit RayOnSpark ▪ Runtime cluster environment preparation. ▪

    Create a SparkContext on the drive node and use Spark to perform data cleaning, ETL, and preprocessing tasks. ▪ RayContext on Spark driver launches Ray across the cluster. ▪ Similar to RaySGD, we implement a lightweight shim layer around native MXNet modules for easy deployment on YARN cluster. ▪ Each MXNet worker takes the local data partition of Spark RDD or DataFrame from the plasma object store used by Ray. Launch Ray* on Apache Spark* Seamlessly integrate Ray applications into Spark data processing pipelines
  19. #RaySummit Ray Summit ▪ Minimum code changes and learning efforts

    are needed to scale the training from single node to big data clusters. ▪ The entire pipeline runs on a single cluster. No extra data transfer needed. Import mxnet as mx from zoo.orca import init_orca_context from zoo.orca.learn.mxnet import Estimator # init_orca_context unifies SparkContext and RayContext sc = init_orca_context(cluster_mode="yarn", num_nodes, cores, memory) # Use sc to load data and do data preprocessing. mxnet_estimator = Estimator(train_config, model=txt, loss=SoftmaxCrossEntropyLoss(), metrics=[mx.metric.Accuracy(), mx.metric.TopKAccuracy(3)]) mxnet_estimator.fit(data=train_rdd, validation_data=val_rdd, epochs=…, batch_size=…) End-to-end Distributed Training Pipeline Project Orca provides a user-friendly interface for the pipeline.
  20. #RaySummit Ray Summit Conclusion ▪ Context-Aware Fast Food Recommendation at

    Burger King with RayOnSpark https://arxiv.org/abs/2010.06197 https://medium.com/riselab/context-aware-fast-food-recommendation-at-burger-king-with-rayonspark- 2e7a6009dd2d ▪ For more details of RayOnSpark: https://analytics-zoo.readthedocs.io/en/latest/doc/Ray/QuickStart/ray-quickstart.html https://medium.com/riselab/rayonspark-running-emerging-ai-applications-on-big-data-clusters-with-ray -and-analytics-zoo-923e0136ed6a ▪ More information for Analytics Zoo at: https://github.com/intel-analytics/analytics-zoo https://analytics-zoo.readthedocs.io/
  21. #RaySummit Ray Summit Thank you