Debiasing the Cloze Task in Sequential Recommendation with Bidirectional Transformers

Khalil Damak, Sami Khenissi, Olfa NasraouiKDD 2022 · DOI

Introduction

Sequential recommendation systems, particularly those utilizing bidirectional transformers like BERT4Rec, have revolutionized how we predict user preferences by treating interaction histories as sequences. These models typically learn via the Cloze task, where specific items in a sequence are masked and the model is trained to predict them. However, a fundamental flaw persists: exposure bias.

In real-world scenarios, we only observe what a user clicked on, not what they might have liked but never saw. Standard models assume that an interacted item is the only relevant one, ignoring the fact that many relevant items may never have been exposed to the user. While Inverse Propensity Scoring (IPS) is often used to debias static recommendation settings, it fails to account for the dynamic nature of sequential data.

The Challenge of Temporal Drift

The core insight of this research is that item exposure in a sequence is not static; it evolves over time. Traditional IPS assigns a single weight to an item regardless of when it appears. However, in sequential contexts, the probability of exposure depends heavily on the user's previous actions—a phenomenon the authors call "temporal drift."

Interaction timesteps for "The Godfather" and "Back to the Future" trilogies illustrating temporal drift.

As shown in the figure above, sequels like The Godfather Part II or Back to the Future Part III naturally appear later in a user's history. A static debiasing method would treat an interaction at timestep 10 the same as one at timestep 90, failing to capture the time-dependent nature of exposure and relevance.

Proposed Method: Inverse Temporal Propensity Scoring (ITPS)

To address this, the authors introduce Inverse Temporal Propensity Scoring (ITPS). This framework moves beyond the binary "exposed + relevant = interaction" model by introducing a "Choice" variable. This acknowledges that even if multiple relevant items are exposed at a given time, a user can only interact with one due to finite attention.

Key components of ITPS include:

  1. Temporal Propensity: Propensity scores are calculated as time-varying weights ($t$), reflecting how exposure probabilities change throughout a sequence.
  2. Unbiased Estimator: The authors mathematically demonstrate that while standard IPS is biased in temporal settings, the ITPS-based loss function serves as an unbiased estimator of the "ideal" Cloze task loss—the loss achievable if all relevant items were known.

Experimental Evaluation

The framework was tested using a mix of semi-synthetic and real-world datasets:

  • ss-ml-100k: A semi-synthetic dataset where "true" relevance and exposure are known, providing a ground-truth "Oracle" for comparison.
  • Real-world benchmarks: MovieLens 1M, 20M, and Amazon Beauty.

Key Results and Robustness

ITPS-BERT4Rec consistently outperformed both the standard BERT4Rec and the IPS-weighted version. Notably, the model demonstrated significant robustness as the severity of exposure bias in the training data increased.

Performance comparison (NDCG and Recall) across varying levels of exposure bias severity (p).

As illustrated in the results above, ITPS-BERT4Rec (green line) remains significantly closer to the "Oracle" performance (red line) than other methods. While standard IPS (orange line) degrades rapidly as bias severity ($p$) increases, ITPS maintains high accuracy across NDCG and Recall metrics. On the real-world MovieLens 1M dataset, ITPS-BERT4Rec achieved an NDCG@10 of 0.3844, a substantial leap over the baseline 0.3262.

Long-term Impact and Filter Bubbles

Beyond immediate accuracy, the authors explored the long-term health of the recommendation ecosystem. By simulating feedback loops where model outputs become future training data, they found that ITPS-BERT4Rec is more effective at preventing "filter bubbles." It maintains higher item novelty (Expected Free Discovery) over time, ensuring a more diverse and healthy recommendation stream compared to biased models.

Conclusion

ITPS provides a mathematically grounded and practically effective solution for debiasing sequential recommenders. By acknowledging that exposure is a dynamic, time-dependent process, ITPS-BERT4Rec achieves superior accuracy and robustness. Future work may involve refining propensity estimation in real-world settings where true exposure probabilities are unknown, and extending the ITPS framework to other sequential architectures like GRU4Rec.

Summary updated

BibTeX
@inproceedings{damak2022debiasing,
  author = {Khalil Damak and Sami Khenissi and Olfa Nasraoui},
  title = {{Debiasing the Cloze Task in Sequential Recommendation with Bidirectional Transformers}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2022},
  doi = {10.1145/3534678.3539430},
}
Figure