--- license: other license_name: amazon-reviews-2023 license_link: https://amazon-reviews-2023.github.io/ language: - en pretty_name: Amazon Reviews 2023 — 5-core Leave-One-Out (sequential, with item features) size_categories: - 10M` + `item_meta_` | | **Generative / Semantic-ID** (TIGER, …) | `seq_maxlen20_` + `item_meta_` | | **Non-sequential** (MF, BPR, LightGCN) | `last_out_` + `item_meta_` | | Custom (re-split yourself) | `interactions_` | ```python from datasets import load_dataset # sequential split (history capped at 50), Video Games ds = load_dataset("/", "seq_maxlen50_Video_Games") train, valid, test = ds["train"], ds["validation"], ds["test"] # item content features for the same category meta = load_dataset("/", "item_meta_Video_Games")["train"] ``` --- ## Dataset structure (configs × splits) The dataset is organised exactly the way Hugging Face groups data: **one config per `processing-variant × category`**, and inside each config the usual **`train` / `validation` / `test`** splits. - **5 categories:** `Video_Games`, `Industrial_and_Scientific`, `Beauty_and_Personal_Care`, `Musical_Instruments`, `Books`. - **5 processing variants** (→ folders / config prefixes): - `interactions_*` — the 5-core interaction table (single `train` split; no split applied). - `last_out_*` — leave-one-out **direct** split (`train`/`validation`/`test`), no history column. - `seq_maxlen20_*` — leave-one-out **sequential** split, history truncated to ≤ 20 items. - `seq_maxlen50_*` — leave-one-out **sequential** split, history truncated to ≤ 50 items. - `item_meta_*` — item content features (single `train` split). ⇒ `5 categories × 5 variants = 25 configs`. The default config is `seq_maxlen50_Video_Games`. ### Repository layout ``` interactions/.jsonl last_out/.{train,valid,test}.jsonl seq_maxlen20/.{train,valid,test}.jsonl seq_maxlen50/.{train,valid,test}.jsonl item_meta/.jsonl stats.json stats.md ``` ### Record schemas **`interactions_*` and `last_out_*`** — one interaction per line: ```json {"user_id": "AEVPP…N7WFQ", "parent_asin": "B09JY72CNG", "rating": 4.0, "timestamp": 1630594913298} ``` **`seq_maxlen20_*` / `seq_maxlen50_*`** — same, plus the chronological history (list of `parent_asin`, most-recent-last, capped at the max length): ```json {"user_id": "AEVPP…N7WFQ", "parent_asin": "B09JY72CNG", "rating": 4.0, "timestamp": 1630594913298, "history": ["B08R5B7YS4", "B0863MT183", "…"]} ``` **`item_meta_*`** — one item per line (content features; image URLs inside `images`): ```json {"parent_asin": "B00Z9TLVK0", "title": "NBA 2K17 - Early Tip Off Edition - PlayStation 4", "main_category": "Video Games", "store": "2K", "categories": ["Video Games", "PlayStation 4", …], "price": 58.0, "average_rating": 4.3, "rating_number": 123, "features": ["…"], "description": ["…"], "images": [{"thumb": "https://…_SX38_SY50_.jpg", "large": "https://….jpg", "hi_res": "https://….jpg", "variant": "MAIN"}], "details": {"…": "…"}} ``` - **Join key:** `parent_asin` links interactions/history ↔ `item_meta`. - `parent_asin` is the Amazon product (parent) id — variants (size/colour) of the same product share one `parent_asin`; it is the standard item id for the Amazon Reviews 2023 benchmark. --- ## Data-processing protocol Source: the official **Amazon Reviews 2023** release ([McAuley-Lab/Amazon-Reviews-2023](https://huggingface.co/datasets/McAuley-Lab/Amazon-Reviews-2023), [website](https://amazon-reviews-2023.github.io/)). 1. **Input.** Official de-duplicated raw interactions (`benchmark/.../rating_only`) and raw item metadata (`raw/meta_categories/meta_.jsonl`). 2. **5-core filtering.** Iteratively drop users and items with fewer than **5** interactions until every remaining user **and** item has ≥ 5. (Removes extreme-sparsity noise — the standard RecSys setting.) 3. **Chronological ordering.** Group interactions per user and sort ascending by `timestamp`; keep the earliest occurrence of each `(user, item)` pair. 4. **Leave-one-out split.** Per user: **last** interaction → `test`, **second-to-last** → `validation`, the rest → `train`. 5. **Sequential history.** For sequential configs, attach each target's prior history, truncated to the most recent **20** or **50** items. 6. **Item features.** Join the 5-core item set with the raw metadata (100 % coverage for all five categories). The 5-core and leave-one-out logic is borrowed **verbatim** from the official benchmark scripts ([`kcore_filtering.py`, `last_out_split.py`](https://github.com/hyp1231/AmazonReviews2023/tree/main/benchmark_scripts)), so the splits reproduce the official `5core/last_out` exactly. This recipe is the one popularised by **TIGER** (Rajput et al., NeurIPS 2023, [arXiv:2305.05065](https://arxiv.org/abs/2305.05065)) and used by most recent sequential / generative-recommendation papers. --- ## Validation / double-check This dataset was verified at **two independent levels**. ### Level 1 — exact match to the official benchmark For every category, our re-derived 5-core interaction count and our number of test users are **identical** to the official `McAuley-Lab/Amazon-Reviews-2023` `5core/rating_only` and `5core/last_out` files (asserted in the build script): | Category | #interactions (ours = official) | #test users (ours = official) | |---|---:|---:| | Video_Games | 814,586 ✓ | 94,762 ✓ | | Industrial_and_Scientific | 412,947 ✓ | 50,985 ✓ | | Beauty_and_Personal_Care | 6,624,441 ✓ | 729,576 ✓ | | Musical_Instruments | 511,836 ✓ | 57,439 ✓ | | Books | 9,488,297 ✓ | 776,370 ✓ | ### Level 2 — exact match to numbers reported in peer-reviewed papers Our `(users / items / interactions)` match, **to the digit**, the statistics reported by multiple independent papers that use the same standard 5-core leave-one-out processing: | Category | Ours (users / items / interactions) | Reported identically by | |---|---|---| | Video_Games | 94,762 / 25,612 / 814,586 | GrIT ([arXiv:2602.19728](https://arxiv.org/abs/2602.19728)) | | Industrial_and_Scientific | 50,985 / 25,848 / 412,947 | GrIT ([2602.19728](https://arxiv.org/abs/2602.19728)); Token-Weighted ([2601.17787](https://arxiv.org/abs/2601.17787)) | | Musical_Instruments | 57,439 / 24,587 / 511,836 | Token-Weighted ([2601.17787](https://arxiv.org/abs/2601.17787)) | | Beauty_and_Personal_Care | 729,576 / 207,649 / 6,624,441 | AlphaFree ([2603.02653](https://arxiv.org/abs/2603.02653)); Closing-the-Gap ([2508.14910](https://arxiv.org/abs/2508.14910)) | | Books | 776,370 / 495,063 / 9,488,297 | Not-Just-What-But-When ([2507.23209](https://arxiv.org/abs/2507.23209)) | Average sequence lengths also match (e.g. Musical 8.91, Industrial 8.10, Books 12.22). > **Why some papers report different numbers.** Papers that use the *old 2014* > Beauty (≈ 22k users), that *sub-sample* (e.g. 10k users), that add *extra > filters* (drop items lacking metadata/images, keep only `rating ≥ 4`), or that > *omit 5-core* (temporal-truncation) naturally report different statistics — > these are their own design choices, not discrepancies in this dataset. --- ## Statistics (after 5-core) | Category | #Users | #Items | #Interactions | Avg len | Median | Sparsity | Items w/ meta | |----------|-------:|-------:|--------------:|--------:|-------:|---------:|--------------:| | `Video_Games` | 94,762 | 25,612 | 814,586 | 8.5961 | 6 | 0.99966437 | 25,612 (100%) | | `Industrial_and_Scientific` | 50,985 | 25,848 | 412,947 | 8.0994 | 6 | 0.99968665 | 25,848 (100%) | | `Beauty_and_Personal_Care` | 729,576 | 207,649 | 6,624,441 | 9.0799 | 7 | 0.99995627 | 207,649 (100%) | | `Musical_Instruments` | 57,439 | 24,587 | 511,836 | 8.9109 | 7 | 0.99963757 | 24,587 (100%) | | `Books` | 776,370 | 495,063 | 9,488,297 | 12.2214 | 7 | 0.99997531 | 495,063 (100%) | ### Leave-one-out split row counts | Category | direct train | valid | test | seq20 train | seq50 train | |----------|-------------:|------:|-----:|------------:|------------:| | `Video_Games` | 625,062 | 94,762 | 94,762 | 530,300 | 530,300 | | `Industrial_and_Scientific` | 310,977 | 50,985 | 50,985 | 259,992 | 259,992 | | `Beauty_and_Personal_Care` | 5,165,289 | 729,576 | 729,576 | 4,435,713 | 4,435,713 | | `Musical_Instruments` | 396,958 | 57,439 | 57,439 | 339,519 | 339,519 | | `Books` | 7,935,557 | 776,370 | 776,370 | 7,159,187 | 7,159,187 | (`valid` = `test` = #users, by construction. Sequential `train` uses the rolling next-item scheme — one row per target position with non-empty history; the 20/50 variants share the same row count and differ only in history length.) --- ## Choosing `maxlen` 20 vs 50 Both are mainstream. Use **50** for ID-based sequential models (SASRec-style) and **20** for semantic-ID / generative models (TIGER-style). Most users have short histories (median 6–7), so the two variants are identical for the majority of rows and differ only for long-history users. --- ## Intended uses & limitations - **Intended:** next-item sequential recommendation, generative / semantic-ID recommendation, content/multimodal recommendation, cold-start studies. - **Item ids** are `parent_asin` (product level). Histories and targets are item ids; bring in text/images from `item_meta_*`. - **No leakage by construction** (test = each user's last item, never in train). - **Limitations:** implicit feedback (all retained reviews are positives by default; use `rating` if you need explicit labels); leave-one-out is the per-subset majority protocol but a global *temporal* split is a reasonable alternative for leakage-free, time-realistic evaluation; the two largest categories (Books, Beauty) are processed from the official pre-filtered 5-core data (identical output, verified equivalent). --- ## Provenance Built with a single script (`process_amazon2023.py`) that downloads the official data, applies the protocol above, and emits these JSONL files. Item metadata is fetched with a resumable, stall-resistant downloader (Books metadata alone is ~14 GB raw before filtering). ## License & attribution Derived from **Amazon Reviews 2023** (McAuley Lab). Intended for **research use**; please comply with the terms of the original dataset and Amazon. If you use this resource, please cite the source dataset: > Yupeng Hou, Jiacheng Li, Zhankui He, An Yan, Xiusi Chen, Julian McAuley. > *Bridging Language and Items for Retrieval and Recommendation.* 2024. > [arXiv:2403.03952](https://arxiv.org/abs/2403.03952) · > https://amazon-reviews-2023.github.io/ and the leave-one-out / semantic-ID protocol origin: > Shashank Rajput et al. *Recommender Systems with Generative Retrieval (TIGER).* > NeurIPS 2023. [arXiv:2305.05065](https://arxiv.org/abs/2305.05065)