Skip to content

Pangyh2001/LLM_NFL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

No Free Lunch Theorem for Privacy-Preserving LLM Inference

这个仓库用于复现实验:证明在 privacy-preserving LLM inference 场景中,隐私保护能力与任务效用之间存在 trade-off,对应论文主题 "No Free Lunch Theorem for Privacy-Preserving LLM Inference"

项目结构

.
├── nfl_privacy/
│   ├── __init__.py
│   ├── args.py
│   ├── clients.py
│   ├── config.py
│   ├── data.py
│   ├── metrics.py
│   ├── perturbation.py
│   └── text.py
├── args.py
├── compute_privacy_loss.py
├── func.py
├── README.md
└── XUXIE_unity_eval.py

环境变量

在运行依赖 OpenAI 兼容接口的实验前,请先设置:

export BLACKBOX_OPENAI_API_KEY="your-blackbox-api-key"
export LOCAL_OPENAI_API_KEY="your-local-api-key"   # 如果本地服务需要

运行方式

1) 隐私泄露实验

python compute_privacy_loss.py --model gpt-4 --dataset-split "train[:100]"

2) 效用评估实验

python XUXIE_unity_eval.py --model gpt-4 --dataset-split "train[:20]"

增加最小化单元测试与 smoke test。

About

这个仓库存储了验证LLM隐私和效用权衡,测量效用损失和隐私泄露分别随着ε的增加的变化情况

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages