meta-pytorch/opacus

Training PyTorch models with differential privacy

What it solves

Opacus는 개발자가 차분 프라이버시를 사용하여 PyTorch 모델을 학습시킬 수 있게 하여, 학습 과정에서 학습 세트의 개별 데이터 포인트에 대한 민감한 정보가 유합되지 않도록 보장합니다.

How it works

기존 PyTorch 모델, optimizer, data loader를 래핑하는 PrivacyEngine을 제공합니다. make_private() 메서드를 사용하여, 이 라이브러리는 차분 프라이버시 확률적 경사 하강법 (DP-SGD)을 구현하며 사용자가 학습 중 소모되는 프라이버시 예산을 실시간으로 추적할 수 있게 합니다.

Who it’s for

  • ML practitioners 모델에 차분 프라이버시를 통합하는 데 최소한의 코드 변경만으로 간단한 방법이 원하는 경우.
  • Differential Privacy researchers 프라이버시 보호 ML 알고리즘을 실험하고 조정하는 데 유연한 도구가 필요한 경우.

Highlights

  • Minimal integration effort: Requires very few changes to existing PyTorch training loops.
  • Privacy budget tracking: Enables online tracking of the privacy loss during training.
  • Memory efficiency: Supports Fast Gradient Clipping and Ghost Clipping 을 통해 DP-SGD의 메모리 오버헤드를 줄입니다.
  • Broad compatibility: Works with various architectures, including LSTMs and BERT (via LoRA and peft).