cape

source code of paper "A Contextual-Aware Position Encoding for Sequential Recommendation", WWW'25

https://github.com/yjdy/cape

Science Score: 41.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.5%) to scientific vocabulary
Last synced: 9 months ago · JSON representation ·

Repository

source code of paper "A Contextual-Aware Position Encoding for Sequential Recommendation", WWW'25

Basic Info
  • Host: GitHub
  • Owner: yjdy
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Size: 1.12 MB
Statistics
  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • Open Issues: 2
  • Releases: 0
Created over 1 year ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog License Citation

README.md

CAPE

source code of paper "A Contextual-Aware Position Encoding for Sequential Recommendation", WWW'25

[![arXiv](https://img.shields.io/badge/arXiv%20paper-2409.12740-da282a.svg)](https://arxiv.org/pdf/2502.09027) License Python version Pytorch version

The code in this repository is currently under development

Quick Start

  1. Run a model on benchmark datasets (e.g., KuaiVideo)

Users can follow the benchmark section to get benchmark datasets and running steps for reproducing the existing results. Please see an example here: https://github.com/reczoo/BARS/tree/main/ranking/ctr/DCNv2/DCNv2criteox1

  1. Tune hyper-parameters of a model

cd experiment python run_param_tuner.py --config config/DIN_amazonelectronics_x1_tuner_config.yaml --gpu 0 You can set hyper-parameter use_cope to True to use CAPE in the model.

Experimental Result

| SR Model | PE | AmazonElectronics (gAUC↑) | AmazonElectronics (AUC↑) | AmazonElectronics (logloss↓) | KuaiVideo (gAUC↑) | KuaiVideo (AUC↑) | KuaiVideo (logloss↓) | |----------|--------|--------------------------|--------------------------|-----------------------------|--------------------|------------------|----------------------| | DIN | None | 0.883526 | 0.886028 | 0.43019 | 0.661646 | 0.741604 | 0.447621 | | | Naïve | 0.883947 | 0.886702 | 0.428511 | 0.661123 | 0.743029 | 0.441684 | | | RoPE | 0.884544 | 0.887220 | 0.429256 | 0.664594 | 0.745957 | 0.439012 | | | CoPE | 0.884549 | 0.886706 | 0.430099 | 0.661646 | 0.742936 | 0.442531 | | | CAPE | 0.885698 | 0.888156 | 0.428468 | 0.665215 | 0.745973 | 0.438510 | | DIEN | None | 0.884014 | 0.886774 | 0.428798 | 0.661032 | 0.743491 | 0.437697 | | | Naïve | 0.885397 | 0.887903 | 0.426713 | 0.659564 | 0.744395 | 0.435241 | | | RoPE | 0.887128 | 0.889513 | 0.426858 | 0.661536 | 0.744089 | 0.438067 | | | CoPE | 0.885736 | 0.888723 | 0.426941 | 0.661589 | 0.744392 | 0.435911 | | | CAPE | 0.887736 | 0.889723 | 0.425941 | 0.662178 | 0.744486 | 0.434926 | | BST | None | 0.878645 | 0.879191 | 0.464533 | 0.661409 | 0.741465 | 0.446131 | | | Naïve | 0.881701 | 0.884188 | 0.430641 | 0.660665 | 0.744091 | 0.435769 | | | RoPE | 0.882918 | 0.885657 | 0.429100 | 0.662909 | 0.745502 | 0.432553 | | | CoPE | 0.882166 | 0.884399 | 0.430178 | 0.660777 | 0.744202 | 0.435414 | | | CAPE | 0.883349 | 0.886499 | 0.430582 | 0.664139 | 0.746326 | 0.433429 | | SASRec| None | 0.879654 | 0.879692 | 0.460631 | 0.659623 | 0.744130 | 0.437802 | | | Naïve | 0.879493 | 0.882471 | 0.434959 | 0.661535 | 0.743983 | 0.436454 | | | RoPE | 0.882185 | 0.884663 | 0.433952 | 0.661662 | 0.745082 | 0.434806 | | | CoPE | 0.880922 | 0.883757 | 0.433889 | 0.654668 | 0.741277 | 0.433345 | | | CAPE | 0.882793 | 0.885344 | 0.431368 | 0.663006 | 0.745512 | 0.435691 | | DMIN | None | 0.885558 | 0.887029 | 0.427322 | 0.659194 | 0.743807 | 0.435644 | | | Naïve | 0.883131 | 0.885329 | 0.431241 | 0.661405 | 0.745304 | 0.434112 | | | RoPE | 0.884383 | 0.886762 | 0.425995 | 0.660126 | 0.745036 | 0.433466 | | | CoPE | 0.885583 | 0.887662 | 0.426295 | 0.659226 | 0.744025 | 0.434486 | | | CAPE | 0.885703 | 0.888053 | 0.424144 | 0.662567 | 0.746088 | 0.434272 |

Citation

If our work has been of assistance to your work, feel free to give us a star ⭐ or cite us using :

@article{yuan2025CAPE, title={A Contextual-Aware Position Encoding for Sequential Recommendation}, author={Jun Yuan and Guohao Cai and Zhenhua Dong}, journal={arXiv preprint arXiv:2502.09027}, year={2025}, eprint={2502.09027}, archivePrefix={arXiv} }

Aknowledgement

Thanks to the excellent code repository FuxiCTR CAPE is released under the Apache-2.0 license, some codes are modified from FuxiCTR, which are released under the Apache-2.0 license.

Owner

  • Login: yjdy
  • Kind: user

Citation (CITATION)

@inproceedings{yuan25CAPE,
author = {Jun Yuan and Guohao Cai and Zhenhua Dong},
title = {A Contextual-Aware Position Encoding for Sequential Recommendation},
year = {2025},
isbn = {9798400713316},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3701716.3715206},
doi = {10.1145/3701716.3715206},
pages = {577–585},
numpages = {9},
booktitle = {Proceedings of the ACM Web Conference 2025},
keywords = {Recommender Systems, Position Encoding, Sequential Recommendation},
location = {Sydney, NSW, Australia},
series = {WWW '25}
}

GitHub Events

Total
  • Issues event: 6
  • Watch event: 10
  • Member event: 1
  • Issue comment event: 5
  • Push event: 6
  • Create event: 2
Last Year
  • Issues event: 6
  • Watch event: 10
  • Member event: 1
  • Issue comment event: 5
  • Push event: 6
  • Create event: 2

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 4
  • Total pull requests: 0
  • Average time to close issues: 20 days
  • Average time to close pull requests: N/A
  • Total issue authors: 3
  • Total pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 4
  • Pull requests: 0
  • Average time to close issues: 20 days
  • Average time to close pull requests: N/A
  • Issue authors: 3
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • wcnm231 (2)
  • NielsRogge (1)
  • qirongbo (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels