Shengxiang Lin1, Jiajie Su1, Pengyang Zhou1, Xiang Chen1, Xiaolin Zheng1,*, Feng Tian2,*, Chaochao Chen1
1Zhejiang University, 2Xi'an Jiaotong University
* Corresponding Authors
PGPO is a privacy-preserving framework for LLM-enhanced recommendation. It constructs a vocabulary-level semantic graph, identifies high-influence prototype words, learns privacy-preserving prototype variants with Group Relative Policy Optimization, and progressively propagates the learned obfuscation structure to the remaining vocabulary.
The repository provides the complete pipeline for data preparation, semantic graph construction, prototype extraction, GRPO training, privacy-preserving variant generation, and downstream evaluation on MovieLens-1M and Amazon-Book.
- [2026.10] PGPO is now officially available in the ACL Anthology as an EMNLP 2026 Main Conference paper.
- [2026.08] PGPO is accepted to EMNLP 2026 Main Conference.
- [2026.06] The PGPO implementation and evaluation pipeline are publicly available.
Figure 1. Overview of PGPO. High-influence prototype words are first identified, and a vocabulary-level static semantic graph is constructed. The LLM then explores prototype obfuscation anchors under GRPO-based reward optimization and propagates them through the graph to the remaining vocabulary.
The official EMNLP 2026 version is available in the ACL Anthology:
- ACL Anthology: 2026.emnlp-main.480
- PDF: 2026.emnlp-main.480.pdf
- EMNLP 2026 Proceedings: ACL Anthology event page
- Prototype-aware semantic graph: identifies structurally influential words and precomputes vocabulary-level semantic neighborhoods.
- GRPO-based variant exploration: jointly optimizes semantic displacement, relational fidelity, and category validity.
- Progressive graph expansion: propagates reliable prototype mappings from the semantic core to the full vocabulary.
- Context-aware generation cache: uses finalized neighboring mappings as structural anchors during training and generation.
- End-to-end evaluation: supports generation-quality analysis, recommendation evaluation, embedding inversion, and white-box source re-identification.
PGPO/
βββ data/ # Raw and processed datasets
βββ base_models/ # Locally downloaded pretrained models
βββ generate_edges/ # LLM-based semantic edge construction
βββ models/ # PGPO datasets, rewards, cache, generator, and trainer
βββ evaluate/ # Evaluation pipelines and documentation
β βββ embedding/ # Item-text embedding construction
β βββ quality/ # Word- and sentence-level quality evaluation
β βββ recsys/ # Recommendation backends
β βββ attack/ # Embedding inversion attacks
β βββ w2w_attack/ # Replay-MLE white-box re-identification
β βββ README.md # Complete evaluation guide
βββ figs/ # Figures used in the documentation
βββ prepare_amazon_raw0.py # Amazon-Book subset construction
βββ extract_id_name.py # Item ID-name extraction
βββ cut_item_edges.py # Category-aware semantic edge pruning
βββ compute_embeddings.py # Prototype embeddings and similarity statistics
βββ train_grpo.py # PGPO training and variant generation
βββ download_base_models.py # Base-model downloader
βββ requirements.txt # Python dependencies
βββ README.md
git clone https://github.com/Shengxiang-Lin/PGPO.git
cd PGPO
conda create -n pgpo python=3.10 -y
conda activate pgpo
pip install -r requirements.txtmkdir -p base_models
python download_base_models.pyThe downloader currently fetches Qwen3-4B-Base. Other models used by particular stages, such as BERT-base-uncased, Qwen2.5-14B-Instruct, or T5-base, should be placed under base_models/ or supplied through the corresponding command-line path argument.
Download MovieLens-1M, extract ratings.dat, movies.dat, and users.dat, and place them under:
data/ml-1m/raw/
Download Books.csv and meta_Books.json.gz, and place them under:
data/amazon-book/raw/
cp -r data/ml-1m/raw data/ml-1m/raw-0
python extract_id_name.py --dataset ml-1m
python generate_edges/generate_edges_local.py --dataset ml-1m
python cut_item_edges.py --dataset ml-1m
python compute_embeddings.py --dataset ml-1mpython prepare_amazon_raw0.py --dataset amazon-book
python extract_id_name.py --dataset amazon-book
python generate_edges/generate_edges_local.py --dataset amazon-book
python cut_item_edges.py --dataset amazon-book
python compute_embeddings.py --dataset amazon-bookThe preprocessing pipeline produces cleaned semantic edges, fine-grained vocabulary entries, prototype influence scores, embeddings, and neighborhood similarity files under data/<dataset>/handled/.
Train and generate variants for MovieLens-1M:
python train_grpo.py --dataset movielensTrain and generate variants for Amazon-Book:
python train_grpo.py --dataset amazon-bookA configurable example is shown below:
python train_grpo.py \
--dataset movielens \
--model_name_or_path ./base_models/Qwen3-4B-Base \
--learning_rate 5e-7 \
--batch_size 2 \
--num_generations 8 \
--max_steps 5000 \
--use_cache 2000Default outputs are written to:
output/grpo_model/movielens/
output/grpo_model/amazon-book/
output/generated_variants_movielens.json
output/generated_variants_amazon-book.json
The trained model weights on MovieLens-1M and Amazon-Book are available at π€
Evaluation instructions are detailed in evaluate/README.md. The guide covers:
- semantic and obfuscated item-embedding construction;
- word- and sentence-level variant quality;
- SASRec, LightGCN, FREEDOM, LightGT, TALLRec, and LLaRA evaluation;
- Vec2Text-style embedding inversion;
- Replay-MLE-NoHistory white-box source re-identification.
This project is licensed under the MIT License.
For questions and collaborations, please contact:
- Shengxiang Lin: reallinshengxiang@gmail.com
This repository builds on open-source resources and models including Qwen, Unsloth, TALLRec, LLaRA, RecBole, LightGT, MMRec and Vec2Text.
Official citation metadata and BibTeX are available from the ACL Anthology entry and the ACL BibTeX export.
@inproceedings{lin-etal-2026-pgpo,
title = "{PGPO}: Prototype-Guided Progressive Obfuscation for Privacy-Preserving {LLM}-Enhanced Recommendation",
author = "Lin, Shengxiang and
Su, Jiajie and
Zhou, Pengyang and
Chen, Xiang and
Zheng, Xiaolin and
Tian, Feng and
Chen, Chaochao",
editor = "Lee, Hung-Yi and
Dev, Sunipa and
Li, Jessy and
Elliott, Desmond",
booktitle = "Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing",
month = oct,
year = "2026",
address = "Budapest, Hungary",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2026.emnlp-main.480/",
pages = "11027--11046",
ISBN = "979-8-89176-459-0"
}