All models

recbole.LightSANs

A linear-cost self-attention recommender that attends to a handful of latent interests instead of every past item.

Tabular and recommender · 120 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (22 KB)

Open in a new tab

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
229.2K
Operations
120
Framework
PyTorch
Recurrent
No
Published
SIGIR 2021
Cited by
146 (as of 19 October 2026)
Authors
Xinyan Fan, Zheng Liu, Jianxun Lian and others
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m8640
Graph hash
85d9efd43e4f23af5076dc0f4ae25cc2a3dfbc2c174be3317b103516622a8dc8
Skeleton hash
d5c5fdc85af4903308f4a29dcdb4f9dc7c65b408a7a8d32deedefe1c4daebacd
Architecture hash
97f371d048919ba706ad07f68f94ca6a5217f00fa6b4470fb114860645c0672b
Diagram SHA-256
def9d13805ee660f3b647b4ac7637a0652fe4f8a1362e3b7ccc8ad0494f9443c
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

LightSANs, the low-rank decomposed self-attention networks, is a Transformer variant for next-item recommendation. Self-attention networks have been intensively applied for sequential recommenders, but the paper points to their quadratic complexity and vulnerability to over-parameterization. LightSANs introduces a low-rank decomposed self-attention that projects a user's historical items into a small constant number of latent interests. It scales linearly with the user's historical sequence length in time and space and is more resilient to over-parameterization.

Conventional self-attention recommenders mix up item embeddings and position embeddings to introduce sequential relations. LightSANs instead designs a decoupled position encoding, which models the sequential relations between items more precisely. The model is trained with a cross-entropy loss.

The paper evaluates on three real-world benchmark datasets: Yelp, Amazon Books and ML-1M. It reports that LightSANs yield more competitive results than other approaches across all evaluation metrics. LightSANs also outperform their absolute-position variant, which the paper credits to the decoupled position encoding. On ML-1M, whose sequences are longer than the other datasets, the absolute-position variant achieves more than a 2× speedup. In the released code, all self-attention models use 2 layers of self-attention with 2 attention heads, and the embedding hidden dimension is set to 64.

Key idea. LightSANs projects a user's history onto a few latent interests so each item attends to k interests instead of all items, giving linear-cost self-attention.

  • lightsans
  • next-item recommendation
  • low-rank self-attention
  • latent interests
  • decoupled position encoding
  • sequential recommendation
  • efficient transformer
  • recbole

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@inproceedings{Fan_2021, series={SIGIR ’21}, title={Lighter and Better: Low-Rank Decomposed Self-Attention Networks for Next-Item Recommendation}, url={http://dx.doi.org/10.1145/3404835.3462978}, DOI={10.1145/3404835.3462978}, booktitle={Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval}, publisher={ACM}, author={Fan, Xinyan and Liu, Zheng and Lian, Jianxun and Zhao, Wayne Xin and Xie, Xing and Wen, Ji-Rong}, year={2021}, month=July, pages={1733–1737}, collection={SIGIR ’21} }