CTR prediction

Also known as: Click-through rate prediction

On this page 7

CTR prediction, short for click-through rate prediction, is the task of estimating the probability that a specific user will click a specific item when it is shown in a specific context. In recommender systems it is the core scoring step of the ranking stage: candidate items are scored by a model, and the ones with the highest predicted click probability, often combined with other objectives, are placed at the top of the feed, search results or ad slot.

Because the output is a calibrated probability, not just an ordering, CTR models serve two purposes at once. They rank items for relevance, and in advertising they feed directly into auctions where the expected value of an impression is bid multiplied by predicted CTR.

How CTR prediction models a click

CTR prediction is framed as binary classification over impression logs. Each logged impression becomes a training example with a label of 1 if it was clicked and 0 otherwise, and the model is trained with log loss (binary cross-entropy) to output p(click | user, item, context). Typical click rates are low, often between 0.1% and 5% depending on the surface, so the data is heavily imbalanced.

Inputs are dominated by high-cardinality categorical features such as user ID, item ID, category, device, hour of day and query terms. Each is mapped to a dense embedding vector, and the model learns feature interactions, for example that a given user clicks sports videos mainly on mobile in the evening. The table below groups the usual feature families.

Feature familyExamplesRole in the model
User featuresID, age band, long-term interestsPersonal preference
Item featuresID, category, price, creatorItem appeal and type
Context featuresDevice, time, page positionSituational intent
Behavior sequencesRecent clicks and viewsShort-term interest
Cross featuresUser category times item categoryExplicit interactions
Feature families used in CTR prediction

Model families from logistic regression to deep ranking

CTR models evolved from linear models toward architectures that learn interactions automatically. Early production systems used logistic regression with hand-crafted cross features and online learning. Factorization machines and field-aware factorization machines then modeled pairwise interactions through latent vectors, which generalize to feature pairs rarely seen together.

Deep models combine embeddings with neural layers. Wide & Deep pairs a memorizing linear part with a generalizing deep part; DeepFM replaces the hand-crafted wide part with a factorization machine; Deep & Cross Network adds explicit bounded-degree crossing layers; attention-based models summarize a user’s behavior sequence relative to the candidate item. The following table compares these families.

Model familyInteraction learningStrengthLimitation
Logistic regressionManual cross featuresFast, interpretableFeature engineering burden
Factorization machinePairwise latent vectorsHandles sparse pairsOnly second order
Wide & DeepLinear plus MLPMemorization and generalizationWide part still manual
DeepFMFM plus MLP, shared embeddingsNo manual crossesImplicit higher orders
Deep & Cross NetworkExplicit cross layersEfficient high-order crossesTuning of cross depth
Sequence attention modelsAttention over historyCaptures current intentHigher serving cost
Main CTR model families

In large systems, most parameters sit in the embedding tables, which can reach billions of rows. Engineering effort therefore concentrates on feature hashing, embedding sharding and memory-efficient lookups as much as on the network layers.

Where CTR prediction fits in a recommender pipeline

CTR prediction normally runs in the ranking stage of a multi-stage ranking pipeline. Candidate generation, often a two-tower model with approximate nearest neighbor search, narrows millions of items to a few hundred or thousand. A heavier CTR model then scores this shortlist, and a re-ranking step applies diversity, freshness or business rules.

CTR prediction is related to, but distinct from, several neighboring tasks. The comparison below clarifies the differences.

TaskPredictsTypical labelMain use
CTR predictionClick probability per impressionClicked or notRanking, ad auctions
Rating predictionExplicit score1 to 5 starsPreference estimation
Conversion rate predictionPurchase after clickConverted or notBidding on outcomes
Learning to rankRelative order of itemsGraded relevanceSearch result ordering
CTR prediction compared with related tasks

Modern feeds rarely optimize clicks alone. Multi-objective recommendation combines predicted CTR with predicted watch time, conversion, likes or dissatisfaction signals into a single score, because optimizing pure CTR rewards clickbait.

Evaluating CTR models offline and online

Offline, CTR models are judged on ranking quality and calibration. AUC measures how well the model orders clicked above non-clicked impressions, and in mature systems an AUC gain of 0.001 to 0.003 is often considered meaningful. Log loss and the ratio of predicted to observed CTR measure calibration, which matters whenever the probability itself is used, as in ad pricing.

Offline metrics are only a proxy. Final decisions rely on online A/B tests that measure click-through rate, engagement, revenue and longer-term retention. A model can raise offline AUC and still lose online if it shifts exposure toward a narrow set of items.

Biases and pitfalls in click data

Click logs reflect what the previous system chose to show, so CTR prediction inherits systematic biases. The table below lists the most common problems and how practitioners address them.

ProblemCauseTypical mitigation
Position biasTop slots get clicks regardless of relevancePosition feature at training, fixed at serving
Exposure biasUnshown items have no labelsExploration traffic, inverse propensity weighting
Cold startNew items lack ID historyContent features, embedding warm-up
Feature leakageFeatures computed after the impressionStrict point-in-time feature joins
Data driftInterests and catalog change dailyFrequent or online retraining
Frequent CTR prediction problems
  • A feedback loop forms when the model trains on clicks it caused, which can amplify popularity bias and narrow recommendations.
  • Negative downsampling speeds up training but shifts predicted probabilities, so outputs must be recalibrated before use in auctions.
  • A high click rate does not prove satisfaction; quick returns and hides are important negative signals.

Understanding it simply

CTR prediction is a system’s best guess about whether you will tap on something. Before an app shows you a video, a product or an ad, it scores hundreds of options. Each gets a number such as 3% or 12%. The options most likely to interest you move to the top.

It works a bit like a shop assistant with a good memory. The assistant recalls what you looked at last time and when you usually visit. The guess is never certain. A good system also checks that you were actually happy with what you clicked, not only that you clicked.

Applied in practice

An online retailer shows eight product recommendations on each product page. Its first system ranked items by overall popularity, and the widget reached a click-through rate of about 1.8%. The data science team replaces it with a two-stage pipeline: item-to-item retrieval returns 500 candidates, and a DeepFM-style CTR model scores them using user history, product category, price band, device and page position.

The team trains on 30 days of impression logs, includes slot position as a feature during training and sets it to a fixed value at serving to reduce position bias, and recalibrates outputs after negative downsampling. Offline AUC improves from 0.71 to 0.75. In a two-week A/B test on 10% of traffic, the widget’s click-through rate rises to about 2.4% and attributed revenue grows by roughly 6%.

Because clicks on heavily discounted items rose faster than purchases, the team adds a conversion rate prediction term to the final score, which keeps revenue gains while reducing low-value clicks.