next-transaction-prediction-eval
PANTHER: Generative Pretraining Beyond Language for Sequential User Behavior Modeling — Li et al. (2025) (arXiv:2510.10102, 2025)
What this evaluates
Evaluates a model's ability to predict the next user transaction or item interaction based on historical sequential behavior. It probes the model's capacity to capture periodic patterns, user-specific preferences, and generalize across financial and recommendation domains.
Datasets
- WeChat Pay — total 5300000000; splits: train (-1), val (-1), test (-1); repo https://github.com/yzhangjy/PANTHER
- CCT — total 20000000; splits: train (-1), val (-1), test (-1)
- MBD-mini — total ?; splits: train (-1), val (-1), test (-1)
- MovieLens-1M — total 1000000; splits: train (-1), val (-1), test (-1); HF
ml-1m
- Yelp — total ?; splits: train (-1), val (-1), test (-1); HF
yelp
Metrics
HR@1 (primary) — range: [0, 1]
- Hit Ratio at 1: 1 if the ground-truth item is ranked #1 in the predicted list, else 0. Averaged over test instances.
HR@5 — range: [0, 1]
- Hit Ratio at 5: 1 if the ground-truth item appears in the top-5 predicted items, else 0. Averaged over test instances.
HR@10 — range: [0, 1]
- Hit Ratio at 10: 1 if the ground-truth item appears in the top-10 predicted items, else 0. Averaged over test instances.
NDCG@5 — range: [0, 1]
- Normalized Discounted Cumulative Gain at 5: Ranks predicted items by score, discounts gains logarithmically by position, and normalizes by the ideal DCG. Averaged over test instances.
Input / output format
Input: Tokenized sequence of historical user transactions (attributes: amount, merchant category, etc.)
Output: Ranked list of candidate next transactions/items, or top-K predictions.
Scoring recipe
def compute_hr_at_k(preds, gold, k):
return 1.0 if gold in preds[:k] else 0.0
def compute_ndcg_at_k(preds, gold, k):
dcg = 0.0
for i, item in enumerate(preds[:k]):
if item == gold:
dcg = 1.0 / math.log2(i + 2)
break
idcg = 1.0 / math.log2(2)
return dcg / idcg if idcg > 0 else 0.0
# Aggregate over test set
hr_scores = [compute_hr_at_k(preds, gold, k) for preds, gold in test_data]
ndcg_scores = [compute_ndcg_at_k(preds, gold, k) for preds, gold in test_data]
return sum(hr_scores) / len(hr_scores), sum(ndcg_scores) / len(ndcg_scores)
Common pitfalls
- Must use full-ranking evaluation (~3,700 items) rather than sampled negatives to match the paper's protocol.
- Splits are chronological, not random, to prevent data leakage from future transactions.
Evidence (verbatim from paper)
Specifically, HR@K measures the fraction of test instances in which the ground-truth item appears among the top-K predicted items. NDCG@K assesses the ranking quality by assigning higher weights to relevant items placed at top positions, normalized by the ideal discounted gain.
Citation
@misc{li2025panther,
title={PANTHER: Generative Pretraining Beyond Language for Sequential User Behavior Modeling},
author={Li et al. (2025)},
year={2025},
note={arXiv:2510.10102}
}
1---2name: next-transaction-prediction-eval3description: Evaluates a model's ability to predict the next user transaction or item interaction based on historical sequential behavior. It probes the model's capacity to capture periodic patterns, user-specific preferences, and generalize across financial and recommendation domains. Use when the user wants to benchmark on WeChat Pay, CCT, MBD-mini, MovieLens-1M, Yelp, or asks about evaluating this task. Reports HR@1.4---56# next-transaction-prediction-eval78> PANTHER: Generative Pretraining Beyond Language for Sequential User Behavior Modeling — Li et al. (2025) (arXiv:2510.10102, 2025)910## What this evaluates1112Evaluates a model's ability to predict the next user transaction or item interaction based on historical sequential behavior. It probes the model's capacity to capture periodic patterns, user-specific preferences, and generalize across financial and recommendation domains.1314## Datasets1516- **WeChat Pay** — total 5300000000; splits: train (-1), val (-1), test (-1); repo https://github.com/yzhangjy/PANTHER17- **CCT** — total 20000000; splits: train (-1), val (-1), test (-1)18- **MBD-mini** — total ?; splits: train (-1), val (-1), test (-1)19- **MovieLens-1M** — total 1000000; splits: train (-1), val (-1), test (-1); HF `ml-1m`20- **Yelp** — total ?; splits: train (-1), val (-1), test (-1); HF `yelp`2122## Metrics2324- `HR@1` **(primary)** — range: [0, 1]25 - Hit Ratio at 1: 1 if the ground-truth item is ranked #1 in the predicted list, else 0. Averaged over test instances.26- `HR@5` — range: [0, 1]27 - Hit Ratio at 5: 1 if the ground-truth item appears in the top-5 predicted items, else 0. Averaged over test instances.28- `HR@10` — range: [0, 1]29 - Hit Ratio at 10: 1 if the ground-truth item appears in the top-10 predicted items, else 0. Averaged over test instances.30- `NDCG@5` — range: [0, 1]31 - Normalized Discounted Cumulative Gain at 5: Ranks predicted items by score, discounts gains logarithmically by position, and normalizes by the ideal DCG. Averaged over test instances.3233## Input / output format3435**Input**: Tokenized sequence of historical user transactions (attributes: amount, merchant category, etc.)3637**Output**: Ranked list of candidate next transactions/items, or top-K predictions.3839## Scoring recipe4041```python42def compute_hr_at_k(preds, gold, k):43 return 1.0 if gold in preds[:k] else 0.04445def compute_ndcg_at_k(preds, gold, k):46 dcg = 0.047 for i, item in enumerate(preds[:k]):48 if item == gold:49 dcg = 1.0 / math.log2(i + 2)50 break51 idcg = 1.0 / math.log2(2)52 return dcg / idcg if idcg > 0 else 0.05354# Aggregate over test set55hr_scores = [compute_hr_at_k(preds, gold, k) for preds, gold in test_data]56ndcg_scores = [compute_ndcg_at_k(preds, gold, k) for preds, gold in test_data]57return sum(hr_scores) / len(hr_scores), sum(ndcg_scores) / len(ndcg_scores)58```5960## Common pitfalls6162- Must use full-ranking evaluation (~3,700 items) rather than sampled negatives to match the paper's protocol.63- Splits are chronological, not random, to prevent data leakage from future transactions.6465## Evidence (verbatim from paper)6667> Specifically, HR@K measures the fraction of test instances in which the ground-truth item appears among the top-K predicted items. NDCG@K assesses the ranking quality by assigning higher weights to relevant items placed at top positions, normalized by the ideal discounted gain.6869## Citation7071```bibtex72@misc{li2025panther,73 title={PANTHER: Generative Pretraining Beyond Language for Sequential User Behavior Modeling},74 author={Li et al. (2025)},75 year={2025},76 note={arXiv:2510.10102}77}78```7980- arXiv: 2510.10102