Nick Greenquist
← All posts
Projects

Recency Is All You Need: A 12-Model Experiment on User-History Representation for Two-Tower Retrieval in Recommenders

The standard way to build the user side of a two-tower retrieval model (going back to YouTube’s DNN recommender, Covington et al., 2016) is to pool the user’s whole interaction history into a single vector. The downside is that it can bury the strongest signal you have: the last item the user interacted with.

TL;DR

I trained twelve versions of the user tower in my two-tower movie recommender, all identical except for which parts of the watch history feed the user vector (the whole history, the liked or disliked movies, a rating-weighted history, or just the most recent movie). All of them were trained on MovieLens 32M and compared on retrieval MRR:

  • Recency: adding the last watched movie to the usual full-history pool improves MRR by +22%, the biggest gain in the study. That one movie on its own nearly matches the entire summed history.
  • Ratings: the liked / disliked / rating-weighted pools (the reason for the production four-pool tower) add nothing over a plain sum pool. The rating-weighted pool alone is the worst of the twelve.
  • Going one movie further back barely helps, which is basically why the field moved from pooling to sequential models and Transformers (FMC → FPMC → SASRec).

Whole-corpus MRR for all 12 user-pooling arms, sorted and color-coded by pool family

All twelve user towers. Adding the last-watched movie (orange) is worth +22% MRR, while the rating-based pools (blue) sit right on the full-history baseline.


Turning a history into a vector

A two-tower model scores a (user, item) pair with the dot product of two embeddings. At its most basic, the user tower is just the user’s history: a variable-length list of watched movies that has to become one fixed-size vector. The default is a ‘sum pool’: look up an embedding for each movie, add them up, and project:

Pooling an arbitrary-length watch history into one fixed user vector

The pooling op itself didn’t matter much (sum and mean came out about even here). What actually mattered was which parts of the history you pool. Instead of throwing everything into one bag of movies, you can split it into sub-histories:

  • By rating sign: separate pools for liked and disliked movies
  • By rating magnitude: weight each movie by how far its rating was above or below the user’s average
  • By recency: pull the most recent movie out as its own input

Adding a channel

The last-watched movie is the simplest case. The model looks up that one movie’s embedding (no sum) and runs it through its own LayerNorm. That 32-d block gets concatenated next to the sum-pool block, and the combined vector goes through one shared projection (concat first, then project once):

Adding the last-watched item as its own 32-d block, concatenated before the shared projection

Since each block feeds its own columns of the projection’s input, the model can weight “what you just watched” differently from “everything you’ve watched.” Every model in this post is just a different set of these blocks turned on.

The twelve models

Each model (or ‘arm’) turns on a different set of pools. Every active pool adds a 32-dim block, and the blocks are concatenated and projected → 256 → 128 → L2-normalize. The sum pools (full, liked, disliked, weighted) add up all matching movies into one vector. The single-item slots (last_liked, last_watched, second_to_last_watched) look up exactly one movie (no sum), and each one gets its own projection weights.

#ModelActive poolsDimWhat it isolates
1Only historyfull32the baseline single sum pool
2+ likesfull, liked64does a clean affinity channel beat lumping likes into full?
3+ dislikesfull, liked, disliked96does an explicit avoidance channel add subtractable signal?
4Weighted onlyweighted32can one rating-weighted pool carry it alone?
54-poolfull, liked, disliked, weighted128the full rating partition (= the production pooling block)
64-pool + last-liked… , last_liked160add immediate liked-session context on the 4-pool
7history + last-likedfull, last_liked64minimal recency + rating test
8history + weightedfull, weighted64rating-weighting added on top of the full pool
9last-liked onlylast_liked32the most-recent liked item, alone
10last-watched onlylast_watched32the most-recent item (any rating), alone (first-order Markov)
11history + last-watchedfull, last_watched64recency channel on plain history (FPMC)
12history + last-watched + 2nd-lastfull, last_watched, second_to_last_watched96does recency reach past the single last item?

They fall into three groups: the baseline (arm 1), the rating arms (2/3/4/5/8), and the recency arms (6/7/9/10/11/12).

Results

I used a held-out ‘rollback’ eval: for each of the 19,134 validation users, the context is their history so far and the target is the next movie they watched, for n ≈ 382,138 examples in total. All numbers are over the full corpus.

Whole-corpus retrieval, with the MRR change vs arm 1:

#ModelActive poolsMRRRecall@10Recall@50NDCG@10MRRΔ
1Only historyfull0.11330.21890.45900.1270
2+ likesfull,liked0.11410.22080.46020.1280+0.0008
3+ dislikesfull,liked,disliked0.11330.22040.45930.12740.0000
4Weighted onlyweighted0.07080.14760.34840.0790−0.0425
54-poolfull,liked,disliked,weighted0.11320.22170.46130.1276−0.0001
64-pool + last-liked…,last_liked0.12270.24170.49380.1391+0.0094
7history + last-likedfull,last_liked0.12360.24310.49360.1402+0.0103
8history + weightedfull,weighted0.11300.21990.45960.1270−0.0003
9last-liked onlylast_liked0.08050.16880.36550.0917−0.0328
10last-watched onlylast_watched0.10990.21000.40660.1241−0.0034
11history + last-watchedfull,last_watched0.13860.26370.51290.1566+0.0253
12history + last-watched + 2nd-lastfull,last_watched,second_to_last_watched0.14310.27240.52740.1619+0.0298

Results by popularity tier

Does any of this help more on popular movies or on the long tail? Here’s MRR split by how popular the target movie is:

ArmWhole (382,138)HEAD >1k (369,486)Q4 popular (343,906)Q3 mid (26,923)TAIL ≤1k (12,652)
1 full0.11330.11710.12470.01420.0032
2 +liked0.11410.11790.12550.01400.0033
3 +disliked0.11330.11710.12470.01470.0031
4 weighted0.07080.07320.07820.00510.0015
5 4-pool0.11320.11690.12450.01520.0036
6 +lastL0.12270.12680.13480.01880.0044
7 full+lastL0.12360.12770.13580.01820.0046
8 full+wt0.11300.11680.12440.01330.0029
9 lastL-only0.08050.08310.08810.01520.0070
10 lastW-only0.10990.11320.11980.02510.0128
11 full+lastW0.13860.14310.15200.02320.0061
12 full+lastW+2nd0.14310.14780.15680.02510.0070

What the numbers say

  • Recency matters, mostly just one movie deep. Adding the last watched movie (arm 11) beats the plain pool by +22%. Adding the 2nd-to-last on top (arm 12) barely moves things past noise, so most of the signal is first-order.
  • One recent movie is almost as good as the entire summed history. last_watched alone (arm 10) is within 3% of the full pool (arm 1), which shows how much information gets lost when you collapse ~50 movies into one vector.
  • Recency beats ratings. last_watched beats last_liked on every tier. Filtering on “did they like it?” throws away the movie they just watched, which turns out to be the most predictive one.
  • The rating pools didn’t add anything. The liked/disliked/weighted splits (arms 2/3/5/8) all sit right on the plain pool, and weighted-only (arm 4, 0.0708) is the worst arm since the debiasing starves the gradient.
  • Popular and long-tail movies have different winners. The recency arms win on popular movies (arm 12 is best on every head tier), while on the tail last_watched alone (arm 10) wins because it doesn’t carry the full pool’s popularity bias.

Caveats

  • The eval probably overstates recency. The task is predicting a user’s next movie, and the winning models get to see the exact movie they just watched. On MovieLens, back-to-back ratings often come from the same sitting, so the last watch is an unusually strong hint. Some of that +22% is just that.
  • This is also specific to the dataset. Recency dominates on MovieLens, where watching is sequential and tied to sessions. On a different problem (different catalog, weaker sessions, longer gaps between events), the last item might matter a lot less and ratings might matter more. I’d re-test this on your own data rather than treating it as a universal rule.

Takeaway

If you’re pooling a user’s history into one vector for two-tower retrieval, recency might matter a lot more than ratings. It definitely did here.

None of this is new, and the arms here basically retrace the FMC → FPMC → SASRec progression in sequential recommendation:

  • last_watched alone (arm 10) is a first-order Markov chain (FMC).
  • Adding it to the full pool (arm 11) gives you FPMC (Factorizing Personalized Markov Chains): a personalized history pool plus a last-item transition term.
  • Arm 12 adds a hand-built second-order term, and it barely moves the needle.

Hand-coding recency mostly runs out by the second item, which is the main reason people moved toward models that learn which past items matter with self-attention over the sequence (like SASRec).


Appendix

  • Architecture: two-tower model with an ID-only item tower (BASE_TOWERS=idonly FEATURE_TOWERS=none). Only USER_POOLS changes between arms.
  • Training (same for every arm): seed 42, 200k steps, LR 0.001 (cosine → 1e-4), batch 512, softmax temperature 0.1, α = 0. The pool inputs come from the cached softmax training tensor, so no data was rebuilt between arms.
  • Evaluation: held-out rollback over all 19,134 validation users (n ≈ 382,138); Recall / Hit / NDCG / MRR @ K ∈ {1, 5, 10, 20, 50, 100, 150, 200, 250}, plus the popularity-tier split.

Background sources:

This is a personal project, not affiliated with my employer. All views are my own.

← All posts