Skip to content
Shengxiang-LinPublic

About

Official Repository for "PGPO: Prototype-Guided Progressive Obfuscation for Privacy-Preserving LLM-Enhanced Recommendation" (EMNLP 2026 MainConference)

Topics

Resources

Code of conduct

Stars

145 stars

Watchers

1 watching

Forks

Repository files navigation

PGPO: Prototype-Guided Progressive Obfuscation for Privacy-Preserving LLM-Enhanced Recommendation

Shengxiang Lin1, Jiajie Su1, Pengyang Zhou1, Xiang Chen1, Xiaolin Zheng1,*, Feng Tian2,*, Chaochao Chen1

1Zhejiang University, 2Xi'an Jiaotong University

* Corresponding Authors

License: MIT Python 3.10+ Training: TRL+Unsloth Paper: ACL Anthology

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.

πŸ“° News

  • [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.

πŸ—οΈ Architecture

PGPO Framework

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.

πŸ“„ Paper

The official EMNLP 2026 version is available in the ACL Anthology:

✨ Key Features

  • 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.

πŸ“ Project Structure

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

πŸš€ Quick Start

1. Installation

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.txt

2. Download Base Models

mkdir -p base_models
python download_base_models.py

The 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.

3. Prepare Raw Data

MovieLens-1M

Download MovieLens-1M, extract ratings.dat, movies.dat, and users.dat, and place them under:

data/ml-1m/raw/

Amazon-Book

Download Books.csv and meta_Books.json.gz, and place them under:

data/amazon-book/raw/

4. Run Data Preprocessing

MovieLens-1M

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-1m

Amazon-Book

python 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-book

The preprocessing pipeline produces cleaned semantic edges, fine-grained vocabulary entries, prototype influence scores, embeddings, and neighborhood similarity files under data/<dataset>/handled/.

πŸ‹οΈ PGPO Training

Train and generate variants for MovieLens-1M:

python train_grpo.py --dataset movielens

Train and generate variants for Amazon-Book:

python train_grpo.py --dataset amazon-book

A 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 2000

Default outputs are written to:

output/grpo_model/movielens/
output/grpo_model/amazon-book/
output/generated_variants_movielens.json
output/generated_variants_amazon-book.json

πŸ“¦ Model Weights

The trained model weights on MovieLens-1M and Amazon-Book are available at πŸ€—

πŸ“Š Evaluation

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.

πŸ“„ License

This project is licensed under the MIT License.

πŸ“§ Contact

For questions and collaborations, please contact:

πŸ™ Acknowledgments

This repository builds on open-source resources and models including Qwen, Unsloth, TALLRec, LLaRA, RecBole, LightGT, MMRec and Vec2Text.

πŸ“š Citation

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"
}

About

Official Repository for "PGPO: Prototype-Guided Progressive Obfuscation for Privacy-Preserving LLM-Enhanced Recommendation" (EMNLP 2026 MainConference)

Topics

Resources

Code of conduct

Stars

145 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages