AdsRank

ranking
pytorch
c++
machine-learning
A three-stage CTR ranking system on Criteo: two-tower + FAISS retrieval, DeepFM ranking, and ONNX Runtime serving in C++.
Author

Anto Francis

Published

Jun 2026

AdsRank retrieval and ranking funnel

Overview

AdsRank is a small version of the retrieve-then-rank funnel used in production ad systems, trained on a 5-million-impression sample of the Criteo click logs.

  1. Retrieval. Two-tower embeddings with FAISS narrow the full catalog to a candidate set.
  2. Ranking. A PyTorch DeepFM model scores those candidates for click-through rate.
  3. Serving. The ranker is exported to ONNX and served by a C++ inference benchmark.

Results

Stage Result
Ranking Held-out CTR AUC 0.782 → 0.801, log loss −4.2%
Retrieval + ranking 96% of an exhaustive ranker’s top-10 kept, scoring 90% fewer items
Serving p95 CPU latency 42 ms → 24 ms at a fixed batch size

Ranking model

DeepFM learns embeddings for the categorical features and models interactions between them. Ablations over those interactions showed which feature crosses mattered.

Serving in C++

After exporting to ONNX, latency improvements came from tuning ONNX Runtime thread counts and reusing input buffers so each request doesn’t allocate new ones.

Stack

Python · C++ · PyTorch · FAISS · ONNX Runtime · Linux