EXP-002: Week 2, matrix factorization with BPR¶
- Date: 2026-12-01
- Code:
python -m recsys.evaluate --all(grid), thenpython -m recsys.evaluate --all --only bpr --bpr-grid 64:0.001 --checkpoints 200,300,400,500(longer training) · model inrecsys/models/bpr.py· intervals frompython -m recsys.compare - Data: Video_Games 5-core (ADR-001), split by time (ADR-002), same users and protocol as EXP-001
- Seed: 42 (the model's initial values and every negative sample come from it)
- Run time: BPR takes about 16 minutes to train for 500 epochs on a laptop CPU; item-to-item takes 3 seconds
- Commit note: the run files record commit
ef5c6b3because the BPR code was committed after the runs; the same code is in the Week 2 commit.
Question¶
Do learned embeddings (matrix factorization trained with BPR) beat item-to-item CF, as they did in the Netflix Prize era?
Protocol¶
Same as EXP-001: tune on validation (fit before 2022-10-01, score Oct–Nov 2022, 3,331 users), then refit on everything before 2022-12-01 and score December 2022 once (2,650 users).
BPR settings tried: 32, 64 or 128 factors × regularisation 0.0001 or 0.001, learning rate 0.05, batches of 4,096 triples. Each setting was trained once and scored on validation at several epoch counts (early stopping).
Validation: BPR tuning (NDCG@10, Oct–Nov 2022)¶
| Factors | Reg | 25 | 50 | 100 | 150 | 200 | 300 | 400 | 500 epochs |
|---|---|---|---|---|---|---|---|---|---|
| 32 | 0.0001 | 0.0036 | 0.0037 | 0.0046 | 0.0047 | 0.0047 | |||
| 32 | 0.001 | 0.0037 | 0.0039 | 0.0044 | 0.0053 | 0.0052 | |||
| 64 | 0.0001 | 0.0032 | 0.0063 | 0.0067 | 0.0072 | 0.0080 | |||
| 64 | 0.001 | 0.0032 | 0.0060 | 0.0073 | 0.0084 | 0.0090 | 0.0098 | 0.0099 | 0.0103 |
| 128 | 0.0001 | 0.0035 | 0.0052 | 0.0072 | 0.0080 | 0.0077 | |||
| 128 | 0.001 | 0.0035 | 0.0051 | 0.0076 | 0.0081 | 0.0083 |
The first grid stopped at 200 epochs, and the best setting was still improving there. So it was trained on to 500 epochs. The gains flatten out after 300 (0.0098, 0.0099, 0.0103). For reference on validation, item-to-item scored 0.0104 and 30-day popularity 0.0164.
Test (December 2022)¶
| Model | Recall@10 | Recall@50 | NDCG@10 |
|---|---|---|---|
| Popularity, all time | 0.0032 | 0.0113 | 0.0017 |
| Popularity, last 30 days | 0.0280 | 0.0691 | 0.0186 |
| Item-to-item (P1), all neighbours | 0.0187 | 0.0541 | 0.0101 |
| BPR (P2), 64 factors, 200 epochs | 0.0136 | 0.0452 | 0.0072 |
| BPR (P2), 64 factors, 500 epochs | 0.0168 | 0.0520 | 0.0095 |
Paired bootstrap over users (2,000 resamples), BPR at 500 epochs minus the other model:
| Comparison | NDCG@10 difference | 95% CI | Recall@50 difference | 95% CI |
|---|---|---|---|---|
| vs item-to-item | −0.0005 | [−0.0037, +0.0026] | −0.0021 | [−0.0112, +0.0070] |
| vs 30-day popularity | −0.0090 | [−0.0139, −0.0042] | −0.0172 | [−0.0276, −0.0065] |
| vs all-time popularity | +0.0078 | [+0.0054, +0.0105] | +0.0406 | [+0.0334, +0.0485] |
Result¶
- Gate, as written (beat item-to-item, or explain why not): not beaten. BPR ties item-to-item: every interval crosses zero.
- Against popularity: BPR beats all-time popularity about 5.6× on NDCG@10, and loses clearly to 30-day popularity, exactly like item-to-item.
Why¶
- BPR learns popularity before taste. At 30 epochs the loss stalled while the item bias absorbed popularity, and BPR only matched all-time popularity (validation NDCG@10 0.0034). Taste in the user and item vectors arrived later and slowly.
- The launch wave hurts embeddings too. A third of December's interactions are with games first seen in the previous 60 days (EXP-001). A new game has few training interactions, so its vector is barely trained, and the item bias learns all-time popularity, not recent popularity.
- Sparse users. The median user has 6 interactions, so a user vector is estimated from very little. Item-to-item needs no per-user training at all.
So on this data, the Netflix-era trend (embeddings beat neighbours) does not reproduce under an honest time split. The recent-popularity bar from EXP-001 still stands.
Next¶
- Keep 30-day popularity as the bar to beat. P3 (YouTube's deep candidate generation) adds the "example age" feature, which was designed for exactly this freshness problem; check whether it closes the gap.
- Add a cold/warm split to the harness: scores on new versus established games, so the launch-wave explanation is measured, not inferred.
- BPR is about 300× slower to train than item-to-item here, for no gain. Training cost goes in every later comparison.
The intervals for EXP-001 were recomputed with recsys.compare and match the published ones within ±0.0007 (resampling noise).