Recommender systems over-recommend a few popular items and bury the long tail. The standard fixes treat popularity as one fixed number per item, counted over the whole training log. They then subtract it, normalize it away, or model it with a separate prediction head. That number is wrong in the setting that matters most. In news, retail, and music, what is popular changes by the hour. A method that removes a static popularity score will under-correct items that are trending right now and over-correct items that were hits last year.
This note borrows an idea from self-supervised audio learning. There, clips cut from nearby moments of one recording are trained to share a representation, which captures slowly varying properties such as the speaker or the room. The recommendation analogue we propose is not the obvious one. Popularity is not the fast, per-user noise inside a session. It behaves more like the room: a background shared by everyone who interacts at the same moment. So we pair interactions from different users that happen close together in wall-clock time. The part of the representation that such pairs share is a learned, time-varying "what's trending" context. We then pair interactions from the same user that are far apart in time. The part those pairs share is the user's lasting taste. At recommendation time we swap the current trend context for a long-run average. This removes the effect of today's hype without treating popular items as bad.
Core Claim
The claim has two parts. First, time proximity across users is a usable self-supervised signal for estimating popularity as a vector-valued, time-dependent context rather than a scalar count. Second, this context can be subtracted by setting it to a time-averaged reference rather than zero, and doing so improves accuracy on items whose popularity has shifted between training and test. It should do this while giving up less head-item accuracy than static debiasing. The part that would be new is the pairing axis. Every prior temporal-proximity method pairs segments within one stream. Every prior popularity debiaser either ignores time or uses counts. The specific test that would falsify the idea is simple. If a sliding-window click count fed to an existing debiaser matches our method on the popularity-shifted test slice, the learned context adds nothing and the idea should be dropped.
Where This Sits in Prior Work
The method comes from audio. Speaker2Vec and its Siamese extension predict a nearby window from the current one, so only slowly varying speaker traits survive. COLA recasts this as telling same-recording segment pairs apart from different-recording pairs. Speaker verification work adapts it across domains by treating intra-utterance segments as positives. The closest methodological template is Content-Context Factorized Representations. It splits an encoder output into content and context, uses gradient reversal (a layer that flips gradients so one branch is trained to fail at a task) to keep the two independent, and relies on the fact that background noise stays constant while speech changes. It reports a drop in LibriSpeech test-other word error rate from 4.31% to 4.10%. That paper also constrains the design: temporal contrast alone did not factorize the representation, and an explicit independence penalty was needed. We keep that penalty. What we change is the definition of "context". It becomes the moment in global time, shared across users, instead of the recording.
Three results motivate the proposal by showing where popularity lives. Adap-τ shows that item embedding length grows with interaction count, and it fixes this by normalizing embeddings and tuning an adaptive temperature. Graph-convolution analysis shows that message passing amplifies popular hub items. CSBR shows that session models learn to avoid tail items. All three measure popularity statically. Contrastive Learning for Debiased Candidate Generation shows that a contrastive loss with sampled negatives already acts as an implicit inverse-propensity correction. This matters for us: if negatives are drawn from the same time window, that correction becomes time-local for free. We treat that as a serious competitor below.
The closest debiasers are DIRAC and DCRec. DIRAC gives each item separate interest and conformity embeddings and supervises conformity with an explicit popularity prediction head. Its authors list dynamic popularity modeling as future work. DCRec down-weights contrastive regularization on high-conformity interactions, using transition and co-interaction graphs. Neither uses wall-clock time or cross-user concurrency. MACR subtracts a counterfactual "direct popularity effect" at inference and reports average HR@20 gains of 153% on matrix factorization and 241% on LightGCN under uniform test sampling. Its counterfactual sets popularity to zero, which is what makes over-suppression of head items possible. POPK is the nearest temporal work: a temporal counterfactual for news popularity. As described in our file, it neither learns the popularity context through self-supervision nor extends beyond news. We use it as a baseline where code allows. PAAC aligns tail items with head items from the same user's history and ignores time entirely. Wang's session study gives stratified evidence that neighbor-based session models memorize popular transitions.
Research Program
The model is a standard sequential encoder, SASRec-style or SR-GNN, whose output for each interaction is split into an interest part $z^I$ and a context part $z^C$. A lightweight context encoder maps each wall-clock window $w$ to a vector $c_w$. It does this by pooling $z^C$ over all interactions, from all users, that fall in that window. The next-item score for user $u$ at time $t$ on item $i$ is
$$s(u,i,t) = \langle z^I_u, v_i \rangle + \langle c_{w(t)}, g_i \rangle,$$
where $v_i$ is the item's interest embedding, $g_i$ is its sensitivity to trends, and $w(t)$ is the window containing $t$. This is the score used for training on observed next clicks.
Two contrastive objectives shape the split. The cross-user temporal objective treats context parts of interactions from different users in the same window as positives, and interactions from distant windows as negatives:
$$\mathcal{L}_{C} = -\log \frac{\exp(\mathrm{sim}(z^C_a, z^C_b)/\tau)}{\sum_{b'} \exp(\mathrm{sim}(z^C_a, z^C_{b'})/\tau)},$$
where $a$ and $b$ come from different users in one window, the $b'$ range over the positive plus interactions from other windows, $\mathrm{sim}$ is cosine similarity, and $\tau$ is a temperature. The user-stationarity objective uses the same form on $z^I$. Its positives are the same user's sessions separated by more than a long gap $\Delta$, so any shared signal cannot be trend. A gradient-reversal head tries to predict the window index from $z^I$ and is defeated, following Chan and Ghosh. A symmetric head keeps user identity out of $z^C$.
Windows are multi-scale, at hour, day, and week, following the multi-scale stationarity argument from audio. We report which scale carries the signal on each dataset. Cross-user false positives are the analogue of turn-taking in diarization. Two users can click in the same hour for unrelated reasons, so positives are drawn from within an item-category neighborhood as a secondary ablation.
At inference, the debiased score replaces $c_{w(t)}$ with $\bar c$, the average context over the training period. We then add back a fraction $\lambda$ of the deviation $c_{w(t)} - \bar c$. With $\lambda = 0$ the ranking ignores current hype. With $\lambda = 1$ it follows it. Sweeping $\lambda$ traces the accuracy-versus-tail trade-off directly, instead of hiding it in a training hyperparameter. Averaging rather than zeroing is the deliberate contrast with MACR. Items that are popular for lasting reasons keep their advantage.
Baselines
The naive reference is the same backbone trained with plain next-item cross-entropy, with nothing else added, evaluated under the same temporal split. On Diginetica and RetailRocket we also run Wang's propensity-gated SKNN/GRU4REC ensemble, which reports Hit Rate@20 of 0.556 on Diginetica and 0.586 on RetailRocket in Exploring Popularity Bias in Session-based Recommendation. Those numbers come from its own split, so we re-run it on ours rather than quote it as a target.
The strongest existing session-level method is DIRAC. It explicitly separates interest from conformity on the same session datasets, so it is the most direct competitor to our factorization. No reported result was found on Lacuna for DIRAC's absolute Recall@20 or MRR@20; the summary says only that it was best on both datasets. For collaborative-filtering-style datasets the strongest reported debiaser is MACR, which reports the relative HR@20 gains of 153% (matrix factorization) and 241% (LightGCN) quoted earlier, with no absolute values found. We also run DCRec, Adap-τ, CSBR, PAAC, and POPK where implementations exist. Every method gets the same backbone where it is backbone-agnostic, the same temporal split, and an equal hyperparameter search budget of the same number of trials on a validation window that precedes the test window. All methods also get the same embedding dimension.
The two baselines that decide the paper are ablations we build ourselves. The first is windowed-count MACR and windowed-count DIRAC. We replace their global popularity inputs with sliding-window click counts at the best-performing scale. This isolates learned vector context from dynamic scalar popularity. The second is our model trained on a log where timestamps are shuffled within each user. This keeps each user's order and gaps roughly intact but destroys cross-user concurrency, so it isolates the key ingredient. Beating these baselines means a statistically significant improvement, across at least three seeds, in Recall@20 and NDCG@20 on the popularity-shifted test slice defined below. It also requires no worse than a one-point loss in overall Recall@20 on the natural, skewed test distribution.
Why not just…?
Why not just feed recent click counts into an existing debiaser? This is the real threat. It is the first ablation above rather than an afterthought. A count is one number per item and cannot express that a news event lifts a whole cluster of related items, including rarely clicked ones with too few recent counts to estimate. If the windowed-count baselines match us on the shifted slice and on tail items with fewer than a handful of clicks per window, we will report that the learned context is unnecessary.
Why not just draw in-batch negatives from the same time window? Given the implicit inverse-propensity view in Contrastive Learning for Debiased Candidate Generation, time-grouped batches alone should produce a time-local popularity correction at zero extra cost. We run this as its own baseline. If it recovers most of the gain, the contribution shrinks to that sampling trick, and we will say so. We expect it to fall short in one specific place. It corrects the training loss but gives no explicit context to swap at inference, so it cannot offer the $\lambda$ trade-off or handle test windows whose trend differs from any training window.
Why not just normalize embeddings with an adaptive temperature? Adap-τ removes the link between embedding length and popularity and reports an average 9% gain. But length reflects cumulative, static popularity, and normalization does not tell a trending item from an evergreen one. We include Adap-τ as a baseline and also as a component: our model is run with and without normalization, to show whether the two fixes stack or overlap.
Why not just add time-gap features to the sequence model? Time-aware encoders see the gaps within one user's history but never see what other users did at the same moment, which is exactly where our signal lives. The shuffled-timestamp ablation answers this directly. It keeps within-user gap information available to the encoder and removes only cross-user concurrency.
Proposed Experiments and Decisive Checks
We use datasets with real timestamps and visible popularity drift. Adressa and Globo are news; MACR used both. Diginetica, RetailRocket, and YOOCHOOSE are retail sessions. Last.fm and 30MU are music, with long sessions averaging 17.11 items in 30MU. Reddit comes from DCRec. All splits are strictly temporal: train on earlier weeks, validate on the next window, test on the one after.
We report Recall@20, MRR@20, and NDCG@20 on the natural test distribution. We also report the uniform-item protocol of MACR and PAAC, since the file flags that optimizing only for uniform evaluation can hurt real-world metrics. Alongside these we report CSBR's TailCoverage@20 and tail proportion, and accuracy across the ten popularity groups used by Adap-τ.
The new evaluation slice is popularity-shifted items. These are test items whose share of clicks in the test window differs from their training-period share by more than a factor of two, split into rising and falling items. Static debiasers should fail in opposite directions on the two halves, and our method should not.
Three checks decide the outcome. First, the learned context $c_w$ should predict next-window click share better than the previous window's counts do. If it cannot, it is not capturing trends. Second, on the shifted slice, the full model must beat windowed-count MACR and DIRAC and the time-grouped-negatives baseline. Third, the shuffled-timestamp ablation must lose most of that gain. The $\lambda$ sweep then shows whether swapping in the average context moves the accuracy-versus-tail curve outward relative to MACR's zeroing. That is the direct test of whether head-item over-suppression is reduced. On the smaller retail sets, the cost is one extra pooled encoder and two contrastive losses, comparable to DCRec's graph branches, and we report wall-clock training time for every method.
References
- Speaker2Vec: Unsupervised Learning and Adaptation of a Speaker Manifold Using Deep Neural Networks with an Evaluation on Speaker Segmentation
- An Unsupervised Neural Prediction Framework for Learning Speaker Embeddings Using Recurrent Neural Networks
- Contrastive Learning of General-Purpose Audio Representations
- Self-Supervised Learning Based Domain Adaptation for Robust Speaker Verification
- Content-Context Factorized Representations for Automated Speech Recognition
- Adap-τ : Adaptively Modulating Embedding Magnitude for Recommendation
- How graph convolutions amplify popularity bias for recommendation?
- Long-tail session-based recommendation from calibration
- Contrastive Learning for Debiased Candidate Generation in Large-Scale Recommender Systems
- Disentangling Interest and Conformity for Eliminating Popularity Bias in Session-Based Recommendation
- Debiased Contrastive Learning for Sequential Recommendation
- Model-Agnostic Counterfactual Reasoning for Eliminating Popularity Bias in Recommender System
- Popular News Always Compete for the User's Attention! POPK: Mitigating Popularity Bias via a Temporal-Counterfactual
- Popularity-Aware Alignment and Contrast for Mitigating Popularity Bias
- Exploring Popularity Bias in Session-based Recommendation