Learning Heterogeneous Temporal Patterns of User Preference for Timely Recommendation

Junsu Cho, Dongmin Hyun, SeongKu Kang, Hwanjo Yu

Abstract

Standard recommender systems often fail to capture the "timeliness" of user needs, treating time as a monolithic numerical feature. This paper introduces TimelyRec, a framework designed to model heterogeneous temporal patterns, including periodic habits and evolving trends. By employing a Multi-Aspect Time Encoder (MATE) with gradual attention and a Time-Aware History Encoder (TAHE), TimelyRec effectively predicts both the preferred item and the optimal timing for recommendation. Evaluations on MovieLens, Amazon Books, and LastFM datasets demonstrate significant performance gains over state-of-the-art baselines, particularly in the novel task of item-timing recommendation.

Introduction

While existing recommender systems excel at identifying general user tastes, they frequently struggle with the nuance of timeliness. Most "time-aware" models treat time as a simple feature, overlooking two critical aspects of human behavior: the heterogeneity of patterns and the "when" problem. User behavior is rarely monolithic; it consists of periodic routines (e.g., seasonal purchases) and evolving interests (e.g., shifting trends based on recent events). Furthermore, standard evaluations focus on recommending the right item at a fixed time, rather than predicting the optimal moment to engage a user—a task defined by the authors as "item-timing recommendation."

Heterogeneous temporal patterns in user behavior, showing periodic and evolving trends across different users.

Methodology: The TimelyRec Framework

TimelyRec addresses these challenges through a cascaded architecture consisting of two specialized encoders designed to process (user, item, timestamp) triplets.

The TimelyRec architecture featuring the Multi-Aspect Time Encoder (MATE) and the Time-Aware History Encoder (TAHE).

Multi-Aspect Time Encoder (MATE)

MATE is designed to capture periodic patterns across multiple granularities, such as hour, day, and month. It introduces Gradual Attention, which "blurs" the focus around specific time slots to account for the inherent "fuzziness" of human habits (e.g., a morning coffee routine that varies slightly each day). Additionally, MATE personalizes time embeddings, recognizing that temporal contexts like "Friday night" carry different meanings for different user demographics.

Time-Aware History Encoder (TAHE)

TAHE focuses on evolving patterns by analyzing a user's recent interaction history. It utilizes Time-based Attention to weight past actions according to their temporal similarity to the target recommendation time. To capture broader trends, TAHE incorporates sinusoidal positional encoding, allowing the model to track the "vogue" or popularity of items over time.

Experimental Evaluation

The framework was evaluated using three diverse real-world datasets: MovieLens (1M), Amazon Books, and LastFM. To ensure the models could learn long-term temporal patterns, the data was filtered to include users with histories spanning six months to three years.

Key Results

TimelyRec demonstrated substantial improvements over state-of-the-art baselines like SASRec and TimeLSTM:

  • Item Recommendation: On the LastFM dataset, TimelyRec achieved a 43.08% improvement in Hit Ratio (HR@1).
  • Item-Timing Recommendation: In this more challenging task, the model saw gains of up to 57.26% in NDCG@5.
  • Qualitative Insights: The model successfully learned complex temporal dependencies, such as the distinct differences between weekday and weekend patterns, without explicit feature engineering.

Conclusion and Future Work

TimelyRec represents a significant step forward in making recommendations more timely and context-aware. By acknowledging that time is irregular and human habits are fuzzy, the framework provides a more realistic approach to user modeling. While the current architecture introduces some computational overhead and faces typical cold-start challenges, future research will explore integrating additional side information, such as geographical and social data, to further refine temporal predictions.

Summary updated

BibTeX
@inproceedings{cho2021learning,
  author = {Junsu Cho and Dongmin Hyun and SeongKu Kang and Hwanjo Yu},
  title = {{Learning Heterogeneous Temporal Patterns of User Preference for Timely Recommendation}},
  booktitle = {The Web Conference},
  year = {2021},
  url = {https://openreview.net/forum?id=koUS0xBqJj},
}
Figure