Offline recommender evaluation

Also known as: offline evaluation of recommenders

On this page 7

Offline recommender evaluation is the practice of measuring the quality of a recommendation model on historical interaction data instead of on live users, by hiding part of the known interactions and checking how well the model predicts or ranks the hidden items. In recommender systems, it is the main filter that decides which candidate models deserve an expensive online experiment.

Offline evaluation is fast, cheap and repeatable, but it answers a narrower question than an A/B test. It estimates how well a model reproduces past behavior, which is only a proxy for the business outcome that matters after deployment. Knowing where that proxy breaks is the core expertise behind the method.

How offline recommender evaluation works

Offline recommender evaluation follows a hold-out protocol: the interaction log is split into a training set used to fit the model and a test set whose interactions are hidden. The model then produces a ranked list for each test user, and ranking metrics compare that list with the items the user actually interacted with.

The splitting strategy has a large effect on the result. A random split leaks future information into training, while a temporal split trains on interactions before a cutoff date and tests on later ones, which better mirrors deployment. Leave-one-out splits hold back each user’s last interaction and are common in sequential recommendation research.

StrategyHow it worksMain risk
Random splitInteractions assigned to test at randomFuture data leaks into training
Temporal global splitOne cutoff date for all usersTest period may be atypical
Leave-one-outLast interaction per user held outSmall, noisy test set per user
User-based splitWhole users held outMeasures cold start, not warm users
Common data splitting strategies

Metrics used in offline evaluation

Modern offline evaluation relies mostly on top-N ranking metrics computed at a cutoff K, such as 10 or 20, because users see only a short list. Rating prediction errors such as RMSE, made famous by the Netflix Prize, are now used far less because they correlate weakly with ranking quality.

MetricWhat it measuresSensitivity to position
Hit rate at KWhether any relevant item appears in top KNone within the cutoff
Precision at KShare of top K items that are relevantNone within the cutoff
Recall at KShare of relevant items found in top KNone within the cutoff
NDCG at KGraded relevance discounted by rankStrong, logarithmic discount
MRRInverse rank of the first relevant itemStrong, first hit only
RMSEError of predicted ratingsNot a ranking metric
Accuracy metrics and what they reward

Accuracy alone favors safe, popular items, so mature evaluations add beyond-accuracy metrics: catalog coverage, recommendation diversity, novelty and serendipity. These capture whether the system helps users discover the long tail or simply repeats bestsellers.

Sampled metrics and evaluation pitfalls

Sampled evaluation ranks each held-out item against a small set of random negatives, often 100, instead of the full catalog. It saves compute, but research has shown that sampled metrics can reverse model rankings, because a weak model can look strong when competing against only a few easy negatives. Full-catalog ranking is the safer default when feasible.

MistakeEffect on resultsFix
Random split on time-ordered dataInflated accuracy from leakageUse a temporal split
Sampled negatives onlyUnreliable model orderingRank against the full catalog
Weak or untuned baselinesExaggerated gains for new modelsTune popularity and matrix factorization baselines
Ignoring exposure biasRewards copying the old systemApply inverse propensity scoring
Single random seedNoise mistaken for improvementReport variance across runs
Frequent mistakes and how to fix them

A further concern is reproducibility. Several studies have found that newly published neural models often fail to beat carefully tuned simple baselines, such as item-based collaborative filtering, once the evaluation protocol is controlled.

Bias in logged data and counterfactual evaluation

Logged interactions are not a neutral sample of user preferences: users can only click items the production system chose to show, and items near the top receive more attention. This exposure bias and position bias mean a new model that recommends unseen items is penalized even when its choices are good.

Counterfactual evaluation, also called off-policy evaluation, corrects for this by reweighting logged outcomes. Inverse propensity scoring divides each observed reward by the probability that the logging policy showed that item, producing an unbiased but often high-variance estimate. Self-normalized and doubly robust estimators reduce that variance at the cost of some bias.

  • Propensities must be logged at serving time; reconstructing them afterward is error-prone.
  • Randomized exploration traffic, even a few percent, makes later off-policy estimates far more reliable.
  • Large action spaces make exact propensity weighting impractical without approximations.

Offline versus online evaluation

Offline evaluation and online A/B testing are complementary stages, not alternatives. Offline results screen candidates cheaply, while online tests measure the true causal effect on engagement, retention or revenue.

AspectOffline evaluationOnline A/B test
Cost and speedMinutes to hours, no user riskDays to weeks, real user exposure
What it measuresAgreement with past behaviorCausal impact on live metrics
Feedback loopsNot capturedCaptured over the test period
Number of candidatesDozens or hundredsUsually two to a few
Strengths of each evaluation mode

Teams typically track the offline-online correlation over time. When offline gains repeatedly fail to appear online, the offline protocol, not the model, is usually the first thing to revise.

A non-technical view

Imagine testing a new store assistant before letting them serve customers. You show them old shopping records with the last purchase covered. Then you ask them to guess what each shopper bought next. Good guesses suggest the assistant understands customers.

That is offline recommender evaluation. It is quick and safe. But the old records only show items the previous assistant suggested. So a fresh, clever idea can look wrong on paper. Real customers give the final verdict, which is why companies still run live tests afterward.

A concrete example

A music streaming team has three candidate models for its daily playlist: an item-based collaborative filtering baseline, a matrix factorization model and a sequential transformer model. They train each on six months of listening logs and test on the following two weeks, using a temporal split and full-catalog ranking.

The transformer improves NDCG at 20 by 9 percent over the tuned baseline, while the matrix factorization model gains only 2 percent. However, the transformer’s catalog coverage falls sharply, because it concentrates on already popular tracks. The team adds a diversity re-ranking step and accepts a smaller accuracy gain of 6 percent in exchange for coverage close to the baseline.

Only this adjusted version enters a two-week A/B test. It raises listening time per session by a modest but statistically significant margin, confirming that the offline screening selected a model worth deploying.