Code and data for "What Gets Measured Gets Managed: Sign-aware Recommendation Needs Sign-aware Evaluation" (NeurIPS 2026).
Multi-seed benchmark and evaluation toolkit for signed graph recommendation. Ships with reference numbers for 10 models × 5 datasets × 3 seeds; new models and datasets plug in via simple contracts (see §7).
Datasets. The processed splits of all 5 datasets are in
baselines/SIGformer/data/<dataset>/(train.txt/valid.txt/test.txt, formatuserId itemId rating; also reachable via the top-leveldata/symlink). See §2.
Note on pre-trained embeddings. Per-seed embeddings (
eval/embeddings/<model>_<dataset>_s<seed>.pt, ~3.5 GB total) are not included in this repository due to their size; they will be released separately. All reported numbers can be reproduced from scratch viabash scripts/run_all_seeds.sh <N_GPU>followed by the evaluation pipeline in §4.
- 10 models (4 unsigned + 6 signed)
- Unsigned: LightGCN, LightGCL, XSimGCL, GFormer
- Signed: SIGformer, SiReN, SiGRec, Pone-GNN, SDCGCL, NFARec
- 5 datasets: Amazon-CDs, Amazon-Music, Epinions, KuaiRand, KuaiRec
- 3 seeds: 2024, 42, 2025 (mean±std reported)
- Signed-aware metrics: NDCG, Recall, SNDCG, SRecall, Hit, SHit, Probe AUC, Valence metrics
git clone https://github.com/goldtan/sign-aware-evaluation.git rec
cd recAll 10 baseline models are vendored under baselines/. No additional cloning needed.
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txtPython ≥ 3.10 (tested with 3.12), CUDA ≥ 12.x. The PyG stack (torch_geometric, torch_scatter, torch_sparse, torch_cluster) is sensitive to the installed PyTorch/CUDA combo — see the comments at the top of requirements.txt for manual install commands.
The training / evaluation pipeline resolves all paths from each file's own
location (__file__ in Python, ${BASH_SOURCE[0]} in shell), so no path
rewrite is needed — run scripts/run_all_seeds.sh from a fresh clone and
it finds baselines/, eval/embeddings/, outputs/logs/, etc. relative to
the repo root.
A handful of peripheral dev/analysis scripts (e.g. baselines/SIGformer/code/plot_*.py,
eval/analysis/reeval_hit.py, baselines/GFormer/convert_sigformer_data*.py)
still hard-code /workspace/rec/. They are not part of the documented
reproduction pipeline. If you want to run them on a different cluster, either
clone the repo into /workspace/rec, or apply:
grep -rln "/workspace/rec" --include='*.py' --include='*.sh' | \
xargs sed -i "s|/workspace/rec|$(pwd)|g"The canonical copy of the 5 benchmark datasets is baselines/SIGformer/data/<dataset>/ (symlinked at the repo root as data/), with train.txt, valid.txt, test.txt in SIGformer format (space-separated userId itemId rating) and an info.txt per dataset.
Each baseline also vendors its own copy of the same splits under baselines/<model>/data/ (or Datasets/, dataset/ depending on the model's convention), converted to that model's input format where needed.
Datasets other than the 5 above are not shipped with this repo. Extra NFARec correlation/adjacency matrices (up to 18 GB for amazon-cds) are regenerated on first run.
bash scripts/run_seed.sh <SEED> <N_GPU>
# e.g. bash scripts/run_seed.sh 42 4bash scripts/run_all_seeds.sh <N_GPU>The script walks through models in order (SIGformer → SiReN → SiGRec → Pone-GNN → SDCGCL → NFARec → LightGCN → LightGCL → XSimGCL → GFormer), distributes datasets across GPUs, and skips any (model, dataset, seed) tuple whose embedding already exists at eval/embeddings/<model>_<dataset>_s<seed>.pt.
Per-dataset offset / threshold is set correctly per paper convention:
| Dataset | Offset for signed models |
|---|---|
| amazon-cds, amazon-music, epinions (rating 1-5) | 4 |
| KuaiRand, KuaiRec (binary 0/1) | 1 |
bash scripts/chain_signaware.sh <GPU> <SEED> # skips embeddings that exist
bash scripts/chain_ponegnn.sh <GPU> <SEED> # Pone-GNN only
bash scripts/chain_siren.sh <GPU> <SEED> # SiReN only (amazon/epinions)- Embeddings (inline save):
eval/embeddings/<model>_<dataset>_s<seed>.pt - Checkpoints:
baselines/<model>/checkpoints/or similar per-model locations - Training logs:
outputs/logs/seed_<seed>/<tag>.log
For GFormer / LightGCL the training step only saves a checkpoint; embedding extraction is automatic in run_all_seeds.sh via eval/extract/extract_<model>.py. To extract manually:
python -u eval/extract/extract_lightgcl.py --seed=42EVAL_SEED=2024 python -u eval/compute_all_tables.py
# → writes results/json/phase1_s2024.jsonRepeat for EVAL_SEED=42 and EVAL_SEED=2025.
Each JSON contains, per <model>_<dataset> key, all metrics: NDCG, Recall, SNDCG, SRecall, Hit, SHit, neg-infiltration, Probe AUC, Rel.AUC, Val.AUC, Med.V-AUC, Overlap.
python3 eval/aggregate_multiseed.py
# → results/json/multiseed_summary.jsonrec/
├── baselines/ # 10 model source trees (all vendored)
│ ├── Unsigned: LightGCN/, LightGCL/, SELFRec/ (XSimGCL), GFormer/
│ └── Signed: SIGformer/, SiReN/, SiGRec/,
│ Pone-GNN/, SDCGCL/, NFARec/
├── bench/wrappers/ # optional uniform wrapper interfaces
├── config/ # dataset/model yaml configs
├── data/ # symlink → baselines/SIGformer/data (canonical datasets)
├── eval/
│ ├── compute_all_tables.py # per-seed evaluation
│ ├── aggregate_multiseed.py # mean ± std aggregation
│ ├── extract/*.py # checkpoint → embedding
│ ├── analysis/*.py # one-off analyses (gamma sweep etc.)
│ ├── metrics.py, data.py
│ └── embeddings/ # .gitignored
├── scripts/
│ ├── run_all_seeds.sh, run_seed.sh
│ ├── chain_{signaware, ponegnn, siren}.sh
│ └── extract_*.py / run_parallel_*.sh
├── outputs/logs/ # .gitignored
└── models/ # symlinks → baselines/*
# 1. train (everything, ~several days on 4 GPUs)
bash scripts/run_all_seeds.sh 4
# 2. evaluate each seed
for s in 2024 42 2025; do
EVAL_SEED=$s python -u eval/compute_all_tables.py
done
# 3. aggregate + markdown
python3 eval/aggregate_multiseed.py
python3 eval/generate_md_tables.py
# → results/md_sections/*.md ready for inclusion in manuscriptThe evaluation pipeline in eval/ is model-agnostic: it consumes saved
embeddings and produces every metric table. Any new model or dataset that
follows the contracts below is picked up automatically.
Save final user/item embeddings to the toolkit's path convention:
import torch
torch.save(
{'user_emb': user_emb, 'item_emb': item_emb},
f'eval/embeddings/<your_model>_<dataset>_s<seed>.pt',
)
# user_emb: (num_users, d), item_emb: (num_items, d)
# IDs must match the dataset's train.txt ordering.Then re-run §4 — your model shows up alongside the 10 baselines in every
metric table. Add the model key to MODELS in eval/compute_all_tables.py
and to UNSIGNED or SIGNED in eval/generate_md_tables.py to include it
in the paper-style markdown tables.
- Data files. Place
train.txt,valid.txt,test.txt(SIGformer format: space-separateduserId itemId rating) into each baseline's dataset directory (baselines/<model>/data/<dataset>/or the model's equivalentdataset//Datasets/convention). - Offset / threshold. Pick the signed threshold that matches the rating scale (4 for 1–5 ratings, 1 for binary 0/1) and set it in every signed model's per-dataset config.
- Whitelist. Add the dataset folder name to the allow-list at the bottom
of
.gitignoreso it is tracked by git. - Registry. Add the dataset name to
DS5ineval/generate_md_tables.py(and pass it via--datasets=<name>when invokingeval/compute_all_tables.py, or add it to that script's default dataset list).
Once those four steps are done, the standard commands in §3 and §4 work unchanged on the new dataset.
- NFARec amazon-cds: requires ≥ 80 GB GPU (H100) due to
N×Ncorrelation matrix. On 24 GB GPUs only 1 seed (s2024) is available; the paper reports that cell withn_seeds=1.
| Model | License | Source |
|---|---|---|
| SIGformer | No license | StupidThree/SIGformer |
| LightGCN | No license | gusye1234/LightGCN-PyTorch |
| LightGCL | No license | HKUDS/LightGCL |
| XSimGCL (SELFRec) | No license | Coder-Yu/SELFRec |
| GFormer | Apache 2.0 | HKUDS/GFormer |
| SiReN | No license | cw-seo/SiReN-reco |
| Pone-GNN | No license | Young0222/Pone-GNN |
| SiGRec | No public repo | Huang et al., IPM 2023 |
| SDCGCL | No license | LQgdwind/nips25-sdcgcl |
| NFARec | No license | WangXFng/NFARec |
| Dataset | License | Source |
|---|---|---|
| Amazon Reviews (CDs, Music) | No formal license (citation required) | Amazon Reviews 2018 |
| Epinions | No formal license (citation required) | SNAP |
| KuaiRand | CC BY-SA 4.0 | chongminggao/KuaiRand |
| KuaiRec | CC BY-SA 4.0 | chongminggao/KuaiRec |
This work has been accepted to NeurIPS 2026:
What Gets Measured Gets Managed: Sign-aware Recommendation Needs Sign-aware Evaluation. NeurIPS 2026.
A BibTeX entry will be added once the proceedings are published.