Sequential Modeling with Self-Attention
Users consume items in sequences with temporal dynamics
Traditional methods ignore:
Predict next item
SASRec (Kang & McAuley, 2018)
Input: [i₁] [i₂] [i₃] [i₄]
↓ ↓ ↓ ↓
causal attention (masked)
↓ ↓ ↓ ↓
Predict: [i₂] [i₃] [i₄] [i₅]
Estimate user embedding
BERT4Rec (Sun et al., 2019)
Input: [cls] [i₁] [MASK] [i₃]
↓ ↓ ↓ ↓
bi-directional attention
↓ ↓ ↓ ↓
Predict: [emb] [?] [i₂] [?]
Open notebooks/04_sasrec.qmd