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 View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

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

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 20 code samples harvested from 5 repositories linked to this paper: 12 ran (of which 0 constructed an object rather than computing a result; 10 with no instrument failure: 1 honoured, 0 violated, 9 with no contract checked; 2 where Syntology's instrument failed) · 8 unverified. Where Syntology's instrument failed: 1 where our contract draft was wrong; 1 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: community (archive-listed): 20 samples from 5 repositories, 12 ran (10 with no instrument failure; 2 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

No sample is linked to this paper from 2 of its repositories that Syntology harvested for other papers:

Levels written between 2026-09-22 and 2026-09-26 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

UlionTse/mlgb mentioned on GitHubpytorchSyntology: not harvested report
facebookresearch/generative-recommenders mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Actions Speak Louder than Words: Trillion-Parameter Sequential Transducers for... (arXiv:2402.17152; that paper's own run record: 15 ran (of which 13 constructed an object rather than computing a result; 14 with no instrument failure: 0 honoured, 0 violated, 14 with no contract checked; 1 where Syntology's instrument failed) · 27 unverified); nothing checks that they implement this paper's method. report
mangushev/mfgan mentioned on GitHubtfMITSyntology: 5 samples, 3 ran (2 instrument-failed) · 2 unverified report
otto-de/recsys-dataset mentioned on GitHubMITSyntology: 6 samples, 6 ran (0 instrument-failed) · 0 unverified report
paddorch/SASRec.paddle mentioned on GitHubpaddleApache-2.0Syntology: 2 samples, 1 ran (0 instrument-failed) · 1 unverified report
kang205/SASRec tfApache-2.0Syntology: 5 samples, 2 ran (0 instrument-failed) · 3 unverified report
microsoft/recommenders tfSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Auto-Encoding Variational Bayes (arXiv:1312.6114; that paper's own run record: 140 ran (of which 52 constructed an object rather than computing a result; 120 with no instrument failure: 4 honoured, 2 violated, 114 with no contract checked; 20 where Syntology's instrument failed) · 59 unverified); nothing checks that they implement this paper's method. report
pmixer/SASRec.pytorch pytorchApache-2.0Syntology: 2 samples, 0 ran · 2 unverified 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.

A paper named beside a repository with no sample linked to this paper is shown with that paper's own run record, not this paper's: “ran” means executed on a synthesized input, not that the code is correct, and “where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Papers are listed in arXiv-id order, at most three per repository.

Code Syntology ran Syntology

20 samples harvested: 12 ran (of which 0 constructed an object rather than computing a result; 10 with no instrument failure: 1 honoured, 0 violated, 9 with no contract checked; 2 where Syntology's instrument failed) · 8 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

1ran · honoured contract
1ran · our draft was wrong
1ran; the contract check could not run
9ran
8unverified

Licence: 5 of the 20 samples are pointer only, meaning Syntology does not serve that copy's text. For 5 of them, this paper's copy is under a permissive licence and cleared, but the stored copy of the same code that Syntology serves is not; the licence label's tooltip gives Syntology's recorded reason. 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; the list below is grouped by repository, each group headed by its name and what it is to the paper. “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. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (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 are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. 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 six 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; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. 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.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

mangushev/mfgan community (archive-listed) 5 samples, 3 ran (2 instrument-failed) · 2 unverified
dropout in 34 papers model.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant fingerprinted MIT (permissive) here; the stored copy is pointer only · 873e08c3f15eb1e4 · report fixture: signature input_tensor:EagerTensor/2/float, dropout_prob:float/0/float · returned EagerTensor · level recorded 2026-09-22
example prepare_data.py ran MIT (permissive) · 51a55750bad649a9 · report fixture: signature input:list/1/int, factors:ndarray/2/int, products:ndarray/2/int, is_real_example:bool/0/bool · returned Example · level recorded 2026-09-26
reshape_to_matrix model.py ran · our draft was wrong fingerprinted MIT (permissive) here; the stored copy is pointer only · 7b84f3e6a96584b4 · report fixture: signature input_tensor:EagerTensor/3/float · returned EagerTensor · level recorded 2026-09-22
get_assignment_map_from_checkpoint in 32 papers training.py unverified MIT (permissive) here; the stored copy is pointer only · 50958618b65e514e · report
reshape_from_matrix in 7 papers model.py unverified MIT (permissive) · 3370499aacadb239 · report
otto-de/recsys-dataset community (archive-listed) 6 samples, 6 ran (0 instrument-failed) · 0 unverified
evaluate_session src/evaluate.py ran MIT (permissive) · fcc7874cdb3add47 · report fixture: returned dict · level recorded 2026-09-26
get_max_ts src/testset.py ran MIT (permissive) · eab2ac5ffc1c2836 · report fixture: returned int · level recorded 2026-09-26
ground_truth src/labels.py ran MIT (permissive) · c573805ca4f55418 · report fixture: returned list · level recorded 2026-09-26
prepare_labels src/evaluate.py ran MIT (permissive) · 89eb96b11b86a9c2 · report fixture: returned dict · level recorded 2026-09-26
prepare_predictions src/evaluate.py ran MIT (permissive) · 62f28fd0561698f8 · report fixture: signature predictions:list/1/str · returned dict · level recorded 2026-09-26
trim_session src/testset.py ran MIT (permissive) · 77689c32893561dc · report fixture: signature session:dict/0/?, max_ts:int/0/int · returned dict · level recorded 2026-09-26
paddorch/SASRec.paddle community (archive-listed) 2 samples, 1 ran (0 instrument-failed) · 1 unverified
sample_function in 7 papers sasrec/data.py ran Apache-2.0 (permissive) · f54d868213b75be7 · report fixture: signature user_train:dict/0/?, usernum:int/0/int, itemnum:int/0/int, batch_size:int/0/int, maxlen:int/0/int, result_queue:NoneType/0/?, SEED:int/0/int · returned zip · level recorded 2026-09-26
data_partition in 8 papers sasrec/utils.py unverified Apache-2.0 (permissive) · b69fecb2a2840c7b · report
kang205/SASRec community (archive-listed) 5 samples, 2 ran (0 instrument-failed) · 3 unverified
positional_encoding in 63 papers
census: 5 implementations from 6 papers, 4 distinct outputs on one shared input
modules.py ran Apache-2.0 (permissive) · 9567ab1b29ad4797 · report fixture: returned EagerTensor · level recorded 2026-09-26
random_neq in 8 papers sampler.py ran · honoured contract Apache-2.0 (permissive) here; the stored copy is pointer only · 13e1db5681123f3a · report fixture: signature l:int/0/int, r:int/0/int, s:set/0/? · returned int · level recorded 2026-09-22
embedding modules.py unverified Apache-2.0 (permissive) · fdc971ebe26e3773 · report
sample_function in 7 papers sampler.py unverified Apache-2.0 (permissive) here; the stored copy is pointer only · ed413c5d2cc8afc9 · report
pmixer/SASRec.pytorch community (archive-listed) 2 samples, 0 ran · 2 unverified
build_index in 7 papers python/utils.py unverified Apache-2.0 (permissive) · 8f34807990e04010 · report
sample_function in 7 papers python/utils.py unverified Apache-2.0 (permissive) · d64812b980f1617e · 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