深度學習推薦系統Deep Learning Recommendation System

碩士論文:以自適應、情境感知的堆疊注意力推薦模型追蹤使用者隨時間改變的偏好,發表於 IEEE TKDE。Master's thesis on an adaptive, context-aware, stacked-attention recommender that follows users' changing preferences over time. Published in IEEE TKDE.

Recommendation SystemsDeep LearningPyTorchAttention NetworksTKDE

相關發表Publication : IEEE Transactions on Knowledge and Data Engineering(TKDE),長篇研究論文IEEE Transactions on Knowledge and Data Engineering (TKDE), full research paper

這是我在國立成功大學(NCKU)資訊工程所的碩士論文,後續整理為期刊論文,發表於 IEEE Transactions on Knowledge and Data Engineering(TKDE)。

使用者偏好隨時間改變:早期穩定、轉變中、目前穩定三個階段,模型依各階段的情境預測下一個物品

問題

多數推薦系統假設使用者的偏好固定不變,但實際上偏好會隨年齡、社群與生活階段而演變。若只看整段歷史紀錄,模型容易推薦「過去的你」才感興趣的內容。本研究聚焦於如何讓推薦模型即時跟上這類偏好變化。

方法

本模型稱為 Contextual User Preference Attention Model,核心包含兩個注意力模組:

  • 情境物品注意力模組(Contextual Item Attention Module):將使用者在固定時間區間內互動過的物品視為「情境」,透過注意力機制判斷哪些物品最能代表當下偏好;當使用者開始接觸與過去不同的物品時,模組也會隨之調整。
  • 多頭使用者注意力模組(Multi-Head User Attention Module):以多個注意力頭捕捉偏好的不同面向(例如不同類型的電影或商品),再透過多層堆疊,於高維特徵空間中重組出使用者偏好表徵。

最後由偏好評分函數為候選物品評分並排序。

模型架構:使用者與物品先進入情境物品注意力模組,再經堆疊的多頭使用者注意力模組,最後由偏好評分函數輸出分數

實驗與成果

  • 資料集:三個跨領域且稀疏程度差異顯著的公開資料集——MovieLens-100k(電影評分)、Pinterest(圖片社群)與 Amazon Beauty(商品評論)。
  • 比較基準:BPR、NCF、NAIS、GRU4Rec、SASRec 等基線方法。
  • 評估方式:採用留一法(leave-one-out),並以 HR@10、NDCG@10 與 MRR@10 衡量排序品質。
  • 實驗結果:在三個資料集上均取得最佳表現,論文報告相對最強基線的提升為 HR@10 3.25%、NDCG@10 4.91%、MRR@10 5.63%。
  • 以循環神經網路為架構的 GRU4Rec 在較密集的 MovieLens 資料上表現不俗,但在極稀疏的 Pinterest 與 Beauty 上明顯下滑;本模型則在稀疏與密集資料上皆能維持穩定表現。

我的角色

本專案為碩士論文研究(指導教授:蔣榮先教授),我亦為該篇 TKDE 論文的第一學生作者。完整實作收錄於連結的 GitHub 程式碼庫。

This work began as my master’s thesis at National Cheng Kung University (NCKU) and was later published as a journal paper in IEEE Transactions on Knowledge and Data Engineering (TKDE).

A user's preference changes over time: an earlier stable phase, a changing phase and the current stable phase; the model predicts the next item from the context of each phase

Problem

Most recommender systems assume a user’s taste remains static, yet preferences evolve with age, social circles, and stage of life. A model that reads the entire interaction history all at once tends to recommend what a past version of the user would have liked. This research addresses how a recommender can adapt to those shifting preferences.

Approach

The proposed Contextual User Preference Attention Model consists of two core attention modules:

  • Contextual Item Attention Module: treats the items a user interacted with within a fixed time window as the current context, using attention to identify which items best reflect present preferences. When a user begins engaging with items different from earlier ones, the module adapts accordingly.
  • Multi-Head User Attention Module: uses multiple attention heads to capture distinct facets of user preference (such as different movie genres or product categories), then stacks multiple layers to recombine them into a higher-level user representation.

A preference scoring function then scores and ranks the candidate items.

Model architecture: user and item embeddings pass through the contextual item attention module, then the stacked multi-head user attention modules, and a preference scoring function outputs the score

Results

  • Datasets: three public datasets across distinct domains with widely varying sparsity—MovieLens-100k (movie ratings), Pinterest (image boards), and Amazon Beauty (product reviews).
  • Baselines: BPR, NCF, NAIS, GRU4Rec, and SASRec, among others.
  • Protocol: leave-one-out evaluation, with ranking quality measured by HR@10, NDCG@10, and MRR@10.
  • Outcome: achieves the best performance across all three datasets; the paper reports relative improvements over the strongest baseline of 3.25% (HR@10), 4.91% (NDCG@10), and 5.63% (MRR@10).
  • The recurrent GRU4Rec performs well on the denser MovieLens dataset but degrades sharply on the highly sparse Pinterest and Beauty datasets, whereas the proposed model remains consistent across both sparse and dense regimes.

My Role

Conducted as my master’s thesis research (advisor: Prof. Jung-Hsien Chiang), and I served as the first student author of the resulting TKDE paper. The full implementation is available in the linked GitHub repository.