All models

TGSRec

Temporal graph transformer that scores user-item pairs at any point in time.

Tabular and recommender · 442 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 (7 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
131.8K
Operations
442
Framework
PyTorch
Recurrent
No
Published
CIKM 2021
Cited by
7 (as of 27 October 2026)
Authors
Ziwei Fan, Zhiwei Liu, Jiawei Zhang and others
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
m20791
Graph hash
8a7b03134af6fff15a3bde41791dde1e057cdd0114df0ab5deb7ab609d6f2150
Skeleton hash
2eaf3fd5b23ed8fd1d21576a0c8b304b6e56fc12151fe6f936e439ad561cd704
Architecture hash
621a98f7430d88d285d1bacba27c82bef4a98a5a71c711e4f751b1d34a765dfc
Diagram SHA-256
bb9b5d8fa7e2b48a286c096cfc6b792f88a857bf34c36677c0c77f63018aa81d
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

TGSRec (Temporal Graph Sequential Recommender) predicts what a user is likely to want at any chosen moment, from a time-stamped history of which users interacted with which items. Many sequential recommenders learn the order in which items follow one another but, the paper argues, ignore the links between users with similar histories and how those links change over time.

The history is stored as a continuous-time bipartite graph, with users and items as nodes and each interaction as an edge carrying a timestamp. Timestamps are turned into vectors by a learnable function of sines and cosines that also covers times never seen in training. The main building block, the Temporal Collaborative Transformer layer, replaces self-attention with attention between a node and its neighbors: the query comes from the user or item being updated, and the keys and values come from the nodes it interacted with. After the last layer, the score for a user and an item at a given time is calculated from their two output embeddings.

The official code builds on an earlier temporal graph network, TGAT. The paper reports average absolute gains of up to 22.5% in Recall at 10 and 22.1% in MRR over the other methods on five datasets. The README, however, says the authors found bugs in the code and were rerunning the experiments.

Key idea. The paper built a recommender that combines item order and timed user-item signals through collaborative attention over a continuous-time bipartite graph.

  • tgsrec
  • temporal graph sequential recommender
  • sequential recommendation
  • temporal graph
  • recommender system
  • continuous-time recommendation
  • collaborative filtering
  • bipartite graph

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

Cite the paper

@misc{fan2021continuoustimesequentialrecommendationtemporal,
      title={Continuous-Time Sequential Recommendation with Temporal Graph Collaborative Transformer}, 
      author={Ziwei Fan and Zhiwei Liu and Jiawei Zhang and Yun Xiong and Lei Zheng and Philip S. Yu},
      year={2021},
      eprint={2108.06625},
      archivePrefix={arXiv},
      primaryClass={cs.IR},
      url={https://arxiv.org/abs/2108.06625}, 
}