Look into the Future: Deep Contextualized Sequential Recommendation

Lei Zheng, Ning Li, Yanhuan Huang, Ruiwen Xu, Weinan Zhang, Yong YuarXiv 2024 · DOI

Abstract

Sequential recommendation systems typically analyze a user's historical clicks to predict their next move. However, human interests often follow predictable patterns that are better understood with hindsight. This paper presents LIFT (Look into the Future), a framework that retrieves similar interactions from a global user pool and leverages their future behaviors as context. By utilizing the "hindsight" of other users who have already completed similar behavioral sequences, LIFT achieves state-of-the-art performance on click-through rate (CTR) and ranking tasks while strictly avoiding temporal data leakage for the target user.

Introduction: The Challenge of Backward-Looking Models

Most existing sequential recommendation models are inherently backward-looking. They process a sequence of past items to estimate the probability of a future interaction. While effective, this approach ignores a wealth of information: the common trajectories shared across a massive user base. For instance, if many users who bought a smartphone subsequently bought a specific type of protective case, that "future" knowledge is highly relevant for a new user who just purchased the same phone.

The primary obstacle to using this information is temporal data leakage. One cannot use a target user's own future data to predict their current behavior. LIFT overcomes this by treating the global interaction log as a searchable knowledge base, retrieving the "future" paths of other users to provide context for the current user.

Comparison of recommendation paradigms: Traditional, Sequential, Retrieval-based, and the proposed LIFT model which incorporates future behavior from other users.

Methodology: The LIFT Framework

LIFT introduces a retrieval-enhanced architecture designed to capture deep contextualized representations.

1. Retrieval-Based Context and the "Future Hack"

When making a prediction for a target user, LIFT employs the BM25 algorithm to identify the top-$K$ most similar historical interactions from a global datastore. Crucially, for each retrieved interaction, LIFT extracts not only the preceding behavior but also the succeeding ("future") behavior. Since these sequences belong to other users in a historical log, this information is available at inference time without violating temporal constraints for the target user.

2. Architecture and Pretraining

The model utilizes a decoder-only Transformer encoder, which the authors find superior for capturing temporal dependencies compared to bidirectional or RNN-based alternatives.

The LIFT architecture, featuring (a) a pretrained sequence encoder with masked behavior labels and (b) an attention-based predictor that aggregates retrieved context.

A core innovation is Masked Behavior Pretraining. Unlike standard masked language modeling (like BERT) which masks items, LIFT masks the behavior labels (e.g., click vs. no-click). This forces the encoder to learn how the surrounding context—both past and future—determines the outcome of an interaction, capturing the "intrinsic information" of the sequence.

3. Attention-Based Prediction

The final stage involves an attention mechanism that serves as a predictor. It aggregates the target user’s history with the retrieved "past+future" contexts. By weighting these retrieved sequences based on their relevance to the target query, the model produces a context-aware prediction.

Experimental Evaluation

LIFT was evaluated across five real-world datasets, including large-scale industrial sets (Taobao, Tmall, Alipay) and public benchmarks (MovieLens-1M, LastFM).

Key Results

LIFT consistently outperformed nine strong baselines, including DIN, SIM, and BERT4Rec.

  • CTR Prediction: On the Taobao dataset, LIFT achieved a 3.43% improvement in AUC over the best baseline (RIM). On the Alipay dataset, the improvement reached 9.97%.
  • Ranking Tasks: Significant gains were observed in Hit Ratio (HR@10) and NDCG, indicating that "future" context effectively narrows down user preferences.
  • Efficiency: Despite the retrieval step, LIFT maintains competitive inference times. By using offline pre-encoding for the global datastore, it remains significantly faster than heavy sequential models like BERT4Rec.

Discussion and Key Insights

The success of LIFT stems from treating hindsight as privileged information. In a large-scale system, thousands of users have already "finished the story" that a target user is just beginning. Their completed sequences act as a proxy for potential futures. Furthermore, the shift from item-masking to label-masking ensures the model focuses on the most informative signal in recommendation: the actual user response.

Limitations

While powerful, LIFT relies on the quality of the initial retrieval. If the BM25 search fetches irrelevant interactions, it introduces noise, though the attention mechanism helps mitigate this. Additionally, maintaining a massive, searchable global interaction datastore requires significant infrastructure.

Conclusion

LIFT demonstrates that "looking into the future" via the experiences of others is a potent strategy for sequential recommendation. By bridging the gap between historical patterns and future outcomes through retrieval and contextualized encoding, LIFT sets a new standard for accuracy and relevance in the field.

Summary updated

BibTeX
@misc{zheng2024look,
  author = {Lei Zheng and Ning Li and Yanhuan Huang and Ruiwen Xu and Weinan Zhang and Yong Yu},
  title = {{Look into the Future: Deep Contextualized Sequential Recommendation}},
  year = {2024},
  eprint = {2405.14359},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.14359},
}
Figure