Boosting Search Relevance using Business Logic Scripting

Mert Pınarbaşı4 Sep 2024

Problem

Trendyol's search relevance team re-ranks the top 1,000 products from the search API with ML models. Feature preparation, score adjustment and any other model-related logic lived in the re-rank API. Each change to a model or a business rule therefore needed an API deployment, which meant downtime risk and a dependency on engineers. The data science team could not own its logic, and experimentation was slow.

Example from the article: before BLS, pre- and post-processing and any other logic tied to the ML model ran in the re-rank API, so every change needed a new API deployment.

Solution in brief

Move pre-processing, post-processing and model ensembling out of the API into Business Logic Scripting (BLS) scripts that run inside NVIDIA Triton Inference Server, next to the models. The re-rank API only fetches features and calls Triton; data scientists own the scripts. The same mechanism routes requests to several model variants for A/B tests.

Questions this case answers
  • How to let model owners change feature preparation and score post-processing without redeploying the application that calls the model
  • How to serve and compare several ranking-model variants in production behind one low-latency endpoint when payloads contain thousands of items
  • How to let data scientists change search re-ranking pre- and post-processing without redeploying the serving API?
  • How to run an A/B test of two re-ranking models on one inference server?

Tools and methods

  • NVIDIA Triton Inference Server — hosts the re-ranking models, handles dynamic batching and instance scaling.
  • Business Logic Scripting (BLS) — Python scripts in Triton that prepare features, call models, adjust and combine scores.
  • XGBoost, LightGBM — example model types behind BLS.
  • gRPC with Protobuf — binary transport for large product payloads.
  • Kubernetes — scaling by adding pods.
Continue reading — it's free

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