Papers › Self-Attentive Sequential Recommendation

Self-Attentive Sequential Recommendation

20 Aug 2018arXiv:1808.09781archive 2025-07-28

Wang-Cheng Kang, Julian McAuley

Sequential dynamics are a key feature of many modern recommender systems, which seek to capture the `context' of users' activities on the basis of actions they have performed recently. To capture such patterns, two approaches have proliferated: Markov Chains (MCs) and Recurrent Neural Networks (RNNs). Markov Chains assume that a user's next action can be predicted on the basis of just their last (or last few) actions, while RNNs in principle allow for longer-term semantics to be uncovered. Generally speaking, MC-based methods perform best in extremely sparse datasets, where model parsimony is critical, while RNNs perform better in denser datasets where higher model complexity is affordable. The goal of our work is to balance these two goals, by proposing a self-attention based sequential model (SASRec) that allows us to capture long-term semantics (like an RNN), but, using an attention mechanism, makes its predictions based on relatively few actions (like an MC). At each time step, SASRec seeks to identify which items are `relevant' from a user's action history, and use them to predict the next item. Extensive empirical studies show that our method outperforms various state-of-the-art sequential models (including MC/CNN/RNN-based approaches) on both sparse and dense datasets. Moreover, the model is an order of magnitude more efficient than comparable CNN/RNN-based models. Visualizations on attention weights also show how our model adaptively handles datasets with various density, and uncovers meaningful patterns in activity sequences.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="1808.09781")

Code

Syntology Ran 3 of 20 code samples harvested from 5 repositories linked to this paper; 17 have no recorded run. Of those that ran: 1 ran · honoured contract; 1 ran · our draft was wrong; 1 ran · fixture could not drive it.

By repository: community (archive-listed): 20 samples from 5 repositories, 3 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

UlionTse/mlgb mentioned on GitHubpytorch report
mangushev/mfgan mentioned on GitHubtfMIT report
otto-de/recsys-dataset mentioned on GitHubMIT report
paddorch/SASRec.paddle mentioned on GitHubpaddleApache-2.0 report
kang205/SASRec tfApache-2.0 report
pmixer/SASRec.pytorch pytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

20 samples harvested; 3 ran; 1 honoured the contract we drafted; 17 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
1ran · our draft was wrong
1ran · fixture could not drive it
17unverified

Licence: 0 of the 20 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 5 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

dropout mangushev/mfgan/model.py community (archive-listed) ran · fixture could not drive it fingerprinted MIT (permissive) · 873e08c3f15eb1e4 · report
random_neq kang205/SASRec/sampler.py community (archive-listed) ran · honoured contract Apache-2.0 (permissive) · 13e1db5681123f3a · report
reshape_to_matrix mangushev/mfgan/model.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · 7b84f3e6a96584b4 · report
build_index pmixer/SASRec.pytorch/python/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · 8f34807990e04010 · report
data_partition paddorch/SASRec.paddle/sasrec/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · b69fecb2a2840c7b · report
embedding kang205/SASRec/modules.py community (archive-listed) unverified Apache-2.0 (permissive) · fdc971ebe26e3773 · report
evaluate_session otto-de/recsys-dataset/src/evaluate.py community (archive-listed) unverified MIT (permissive) · fcc7874cdb3add47 · report
example mangushev/mfgan/prepare_data.py community (archive-listed) unverified MIT (permissive) · 51a55750bad649a9 · report
get_assignment_map_from_checkpoint mangushev/mfgan/training.py community (archive-listed) unverified MIT (permissive) · 50958618b65e514e · report
get_max_ts otto-de/recsys-dataset/src/testset.py community (archive-listed) unverified MIT (permissive) · eab2ac5ffc1c2836 · report
ground_truth otto-de/recsys-dataset/src/labels.py community (archive-listed) unverified MIT (permissive) · c573805ca4f55418 · report
normalize kang205/SASRec/modules.py community (archive-listed) unverified Apache-2.0 (permissive) · 2a23cef922cb4b79 · report
positional_encoding kang205/SASRec/modules.py community (archive-listed) unverified Apache-2.0 (permissive) · 9567ab1b29ad4797 · report
prepare_labels otto-de/recsys-dataset/src/evaluate.py community (archive-listed) unverified MIT (permissive) · 89eb96b11b86a9c2 · report
prepare_predictions otto-de/recsys-dataset/src/evaluate.py community (archive-listed) unverified MIT (permissive) · 62f28fd0561698f8 · report
reshape_from_matrix mangushev/mfgan/model.py community (archive-listed) unverified MIT (permissive) · 3370499aacadb239 · report
sample_function kang205/SASRec/sampler.py community (archive-listed) unverified Apache-2.0 (permissive) · ed413c5d2cc8afc9 · report
sample_function paddorch/SASRec.paddle/sasrec/data.py community (archive-listed) unverified Apache-2.0 (permissive) · f54d868213b75be7 · report
sample_function pmixer/SASRec.pytorch/python/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · d64812b980f1617e · report
trim_session otto-de/recsys-dataset/src/testset.py community (archive-listed) unverified MIT (permissive) · 77689c32893561dc · report

Tasks

Recommendation SystemsSequential Recommendation

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Recommendation Systems Amazon Beauty SASRec Hit@10 0.4854 #6 of 6 Archive leaderboard report
Recommendation Systems Amazon Beauty SASRec nDCG@10 0.3219 #6 of 6 Archive leaderboard report
Recommendation Systems Amazon Games SASRec Hit@10 0.7410 #5 of 6 Archive leaderboard report
Recommendation Systems Amazon Games SASRec nDCG@10 0.5360 #5 of 6 Archive leaderboard report
Recommendation Systems Amazon-Book SASRec HR@10 0.0306 #16 of 16 Archive leaderboard report
Recommendation Systems Amazon-Book SASRec HR@50 0.0754 #16 of 16 Archive leaderboard report
Recommendation Systems Amazon-Book SASRec NDCG@10 0.0164 #16 of 16 Archive leaderboard report
Recommendation Systems Amazon-Book SASRec NDCG@50 0.0260 #16 of 16 Archive leaderboard report
Recommendation Systems MovieLens 1M SASRec HR@10 0.8245 #18 of 31 Archive leaderboard report
Recommendation Systems MovieLens 1M SASRec HR@10 (full corpus) 0.2821 #18 of 31 Archive leaderboard report
Recommendation Systems MovieLens 1M SASRec NDCG@10 (full corpus) 0.1603 #18 of 31 Archive leaderboard report
Recommendation Systems MovieLens 1M SASRec nDCG@10 0.5905 #18 of 31 Archive leaderboard report
Recommendation Systems MovieLens 20M SASRec HR@10 (full corpus) 0.2889 #16 of 18 Archive leaderboard report
Recommendation Systems MovieLens 20M SASRec nDCG@10 (full corpus) 0.1621 #16 of 18 Archive leaderboard report
Recommendation Systems Steam SASRec Hit@10 0.8729 #1 of 1 Archive leaderboard report
Recommendation Systems Steam SASRec nDCG@10 0.6306 #1 of 1 Archive leaderboard report
Sequential Recommendation MovieLens 1M SASRec HR@10 0.2137 #3 of 4 Archive leaderboard report
Sequential Recommendation MovieLens 1M SASRec HR@10 (99 Neg. Samples) 0.7904 #3 of 4 Archive leaderboard report
Sequential Recommendation MovieLens 1M SASRec HR@20 0.3245 #3 of 4 Archive leaderboard report
Sequential Recommendation MovieLens 1M SASRec HR@5 0.1374 #3 of 4 Archive leaderboard report
Sequential Recommendation MovieLens 1M SASRec HR@5 (99 Neg. Samples) 0.6874 #3 of 4 Archive leaderboard report
Sequential Recommendation MovieLens 1M SASRec MRR (99 Neg. Samples) 0.5020 #3 of 4 Archive leaderboard report
Sequential Recommendation MovieLens 1M SASRec NDCG@10 0.1116 #3 of 4 Archive leaderboard report
Sequential Recommendation MovieLens 1M SASRec NDCG@10 (99 Neg. Samples) 0.5642 #3 of 4 Archive leaderboard report
Sequential Recommendation MovieLens 1M SASRec NDCG@20 0.1395 #3 of 4 Archive leaderboard report
Sequential Recommendation MovieLens 1M SASRec NDCG@5 0.0873 #3 of 4 Archive leaderboard report
Sequential Recommendation MovieLens 1M SASRec NDCG@5 (99 Neg. Samples) 0.5308 #3 of 4 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections