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Yelp-Multimodal-Recommendation
|
| 7 |
+
language:
|
| 8 |
+
- en
|
| 9 |
+
tags:
|
| 10 |
+
- POI
|
| 11 |
+
- recommendation
|
| 12 |
+
- recommender-system
|
| 13 |
+
- GNN
|
| 14 |
+
- graph-neural-network
|
| 15 |
+
- LightGCN
|
| 16 |
+
- contrastive-learning
|
| 17 |
+
- yelp
|
| 18 |
+
- arxiv:2608.16407
|
| 19 |
---
|
| 20 |
+
|
| 21 |
+
# LLM-MGCL: Checkpoints
|
| 22 |
+
|
| 23 |
+
Trained checkpoints for **LLM-MGCL**, from the paper
|
| 24 |
+
[*POI Recommendation with LLM-Augmented Multi-Graph Learning and Contrastive Alignment*](https://arxiv.org/abs/2608.16407)
|
| 25 |
+
(Tamer, Höpken, Wang, 2026).
|
| 26 |
+
|
| 27 |
+
Code: **[GitHub](<GITHUB-URL>)**
|
| 28 |
+
|
| 29 |
+
## Model
|
| 30 |
+
|
| 31 |
+
LLM-MGCL extends LightGCN with two item-item views and aligns them with contrastive learning:
|
| 32 |
+
|
| 33 |
+
| Graph | Edges | Edge weight |
|
| 34 |
+
|---|---|---|
|
| 35 |
+
| **G_UI** | user-item training interactions | star rating `(stars − 1) / 4`, clamped at 0.1 |
|
| 36 |
+
| **G_SEM** | top-10 most similar items within 50 km | cosine similarity of LLM-generated photo summaries (`all-MiniLM-L6-v2`) |
|
| 37 |
+
| **G_GEO** | top-10 nearest items within 50 km | `1 / (1 + distance_km)` (Haversine) |
|
| 38 |
+
|
| 39 |
+
The three graphs are propagated in parallel with LightGCN (3 / 2 / 2 layers) from shared
|
| 40 |
+
64-dimensional ego embeddings, and the item views are fused additively. Training uses BPR,
|
| 41 |
+
L2 regularisation (1e-3) and a bidirectional InfoNCE loss between the collaborative view and the
|
| 42 |
+
semantic and geographic views (λ = 0.05, τ = 0.2).
|
| 43 |
+
|
| 44 |
+
## Contents
|
| 45 |
+
|
| 46 |
+
All models were trained with seeds **42, 123 and 2024**, so there are 3 checkpoints per run.
|
| 47 |
+
|
| 48 |
+
| Run | Description |
|
| 49 |
+
|---|---|
|
| 50 |
+
| LLM-MGCL | full model |
|
| 51 |
+
| LLM-MGCL w/o CL | ablation: λ = 0 |
|
| 52 |
+
| LLM-MGCL w/o G_SEM | ablation: semantic view removed |
|
| 53 |
+
| LLM-MGCL w/o G_GEO | ablation: geographic view removed |
|
| 54 |
+
| LightGCN, SGL, NGCF, GC-MC, NeuMF, MF-BPR | baselines |
|
| 55 |
+
|
| 56 |
+
ItemKNN and UserKNN have no weights. The code computes them deterministically.
|
| 57 |
+
|
| 58 |
+
Each `.pt` file is a dict containing `model_state` (a PyTorch `state_dict`), `model_config` and
|
| 59 |
+
`seed`. These are raw PyTorch weights, not a `transformers` model. Load them with the model
|
| 60 |
+
classes from the GitHub repository.
|
| 61 |
+
|
| 62 |
+
## Results
|
| 63 |
+
|
| 64 |
+
Yelp Multimodal Recommendation dataset, full-ranking evaluation on the test split, mean ± std over 3 seeds:
|
| 65 |
+
|
| 66 |
+
| Model | Recall@20 | NDCG@20 |
|
| 67 |
+
|---|---|---|
|
| 68 |
+
| **LLM-MGCL** | **0.1163 ± 0.0049** | **0.0705 ± 0.0012** |
|
| 69 |
+
| LightGCN | 0.0763 ± 0.0022 | <…> |
|
| 70 |
+
|
| 71 |
+
For all models and metrics see Table 1 of the paper.
|
| 72 |
+
|
| 73 |
+
## Usage
|
| 74 |
+
|
| 75 |
+
The checkpoints only work with the graphs and id mappings produced by the repository's
|
| 76 |
+
preprocessing, because user and item indices must match. Build them first, then download the
|
| 77 |
+
checkpoints and evaluate:
|
| 78 |
+
|
| 79 |
+
```bash
|
| 80 |
+
git clone <GITHUB-URL> && cd llm-mgcl
|
| 81 |
+
pip install -e .
|
| 82 |
+
python scripts/build_graphs.py # split, id mapping, G_UI / G_SEM / G_GEO
|
| 83 |
+
|
| 84 |
+
huggingface-cli download bbbur/LLM-MGCL --local-dir hf_checkpoints
|
| 85 |
+
python scripts/import_colab_checkpoints.py --src hf_checkpoints
|
| 86 |
+
|
| 87 |
+
python scripts/compare_models.py # Table 1, ablation, significance tests
|
| 88 |
+
python scripts/cold_start.py # cold-start analysis
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
Loading a single model in Python:
|
| 92 |
+
|
| 93 |
+
```python
|
| 94 |
+
from huggingface_hub import hf_hub_download
|
| 95 |
+
import torch
|
| 96 |
+
from llm_mgcl.models import build_model
|
| 97 |
+
from llm_mgcl.pipeline import load_dataset
|
| 98 |
+
from llm_mgcl.utils import load_config, get_device
|
| 99 |
+
|
| 100 |
+
cfg, device = load_config("configs/default.yaml"), get_device()
|
| 101 |
+
ds = load_dataset(cfg, device)
|
| 102 |
+
|
| 103 |
+
path = hf_hub_download("bbbur/LLM-MGCL", "<path/to/llm_mgcl_geo_seed42.pt>")
|
| 104 |
+
model = build_model("llm_mgcl", ds.data.n_users, ds.data.n_items, cfg).to(device)
|
| 105 |
+
model.load_state_dict(torch.load(path, map_location=device, weights_only=False)["model_state"])
|
| 106 |
+
model.eval()
|
| 107 |
+
|
| 108 |
+
scores = model.scorer(ds.graphs)(torch.tensor([0], device=device)) # [1, n_items]
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
## Training data
|
| 112 |
+
|
| 113 |
+
[wzehui/Yelp-Multimodal-Recommendation](https://huggingface.co/datasets/wzehui/Yelp-Multimodal-Recommendation).
|
| 114 |
+
Users with fewer than 3 reviews are removed. Each user's interactions are split 80 / 10 / 10 into
|
| 115 |
+
train / validation / test (`random_state=42`). The models were trained with Adam (lr 1e-3),
|
| 116 |
+
StepLR (step 20, γ 0.5) and batch size 2048 for up to 100 epochs. Early stopping is based on
|
| 117 |
+
validation Recall@20 (evaluated every 2 epochs, patience 8 evaluations).
|
| 118 |
+
|
| 119 |
+
## Limitations
|
| 120 |
+
|
| 121 |
+
* The models are transductive. They only score users and items seen during training, with the
|
| 122 |
+
exact id mapping of the preprocessing.
|
| 123 |
+
* They were trained and evaluated on Yelp only, and results may not transfer to other cities,
|
| 124 |
+
platforms or domains.
|
| 125 |
+
* The semantic graph depends on LLM-generated photo summaries. Items without photos have no
|
| 126 |
+
semantic neighbours.
|
| 127 |
+
|
| 128 |
+
## Citation
|
| 129 |
+
|
| 130 |
+
```bibtex
|
| 131 |
+
@article{tamer2026llmmgcl,
|
| 132 |
+
title = {POI Recommendation with LLM-Augmented Multi-Graph Learning and Contrastive Alignment},
|
| 133 |
+
author = {Tamer, Burak and H{\"o}pken, Wolfram and Wang, Zehui},
|
| 134 |
+
journal = {arXiv preprint arXiv:2608.16407},
|
| 135 |
+
year = {2026},
|
| 136 |
+
eprint = {2608.16407},
|
| 137 |
+
archivePrefix = {arXiv},
|
| 138 |
+
primaryClass = {cs.IR},
|
| 139 |
+
url = {https://arxiv.org/abs/2608.16407}
|
| 140 |
+
}
|
| 141 |
+
```
|
| 142 |
+
|
| 143 |
+
## License
|
| 144 |
+
|
| 145 |
+
MIT. Use of the Yelp data is subject to Yelp's dataset terms.
|