recbole.SASRecCPR
SASRec with its output softmax layer replaced by softmax-CPR, for next-item recommendation.
Tabular and recommender · 172 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Parameters
- 410.6K
- Operations
- 172
- Framework
- PyTorch
- Recurrent
- No
- Published
- WSDM 2024
- Cited by
- 11 (as of 22 October 2026)
- Authors
- Haw-Shiuan Chang, Nikhil Agarwal, Andrew McCallum
- Source
- GitHub: RUCAIBox/RecBole
- License
- MIT
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m8665
- Graph hash
- fba0025819be6e133e6ead4a86c1931e90ee211dcb328750fd3375324e9820b4
- Skeleton hash
- 74342469250e35d88f7a773cabb617f13d35ad56a46b1df76d32e4f1e202ada4
- Architecture hash
- 06b009930415c721fc3037281842bea5a9c32bb8a41769ebd0953ffe2c658452
- Diagram SHA-256
- 63c36ee3add59bc9acf0ca6b17e486b55f721d86cfb6ea0cb3610aeef2f44504
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
SASRecCPR is a sequential recommender: it takes the item history of a user and outputs a probability distribution over the next item. It is SASRec, a self-attentive sequential recommendation model, with simple modifications to the output softmax layer that replace it with softmax-CPR. The paper behind it found that the usual softmax output layer, with its single hidden state and static item embeddings, prevents neural sequential recommenders from learning when users copy items from their history and when they exclude them.
Softmax-CPR combines three methods: context partition, pointer network and reranker partition. It uses different hidden states to compute the probabilities of different partitions of items, for example one hidden state for the items already in the input sequence and another for the rest. The method was originally proposed to reduce hallucinations in language generation models, and the paper adapts it to recommendation.
Across 12 datasets, the paper reports that softmax-CPR improves geometrically averaged NDCG at 10 by 19% over softmax, with similar improvement gaps for SASRec and GRU4Rec, and that the extra parameters it introduces are negligible. In those experiments SASRec used 2 layers, 2 heads and an inner size of 256.
Key idea. The paper identified the softmax layer's single hidden state and static item embeddings as a major source of difficulty with repeated items, and adapted softmax-CPR to SASRec and GRU4Rec.
- SASRecCPR
- SASRec CPR
- softmax-CPR
- sequential recommendation
- next item prediction
- repeated items
- softmax bottleneck
- pointer network
- RecBole
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{chang2023copycopycriticalissue,
title={To Copy, or not to Copy; That is a Critical Issue of the Output Softmax Layer in Neural Sequential Recommenders},
author={Haw-Shiuan Chang and Nikhil Agarwal and Andrew McCallum},
year={2023},
eprint={2310.14079},
archivePrefix={arXiv},
primaryClass={cs.IR},
url={https://arxiv.org/abs/2310.14079},
}