pytorch / opacus

Training PyTorch models with differential privacy
https://opacus.ai
Apache License 2.0
1.65k stars 328 forks source link

Negative Epsilons at high deltas #585

Open tudorcebere opened 1 year ago

tudorcebere commented 1 year ago

🐛 Bug

Hello!

Probably an edge case, but some warning/error could be raised. The issue is that at high values of delta, the accountant gives negative epsilon values. Script to reproduce the error: https://colab.research.google.com/drive/1t7jhg_Np6UUZcJLNfBV1wNZHIZ71nVw7?usp=sharing

nhianK commented 4 months ago

Looking for a solution to this. Having the same issue

HuanyuZhang commented 2 months ago

I agree with you that we might need some warning messages. But could you please tell in which scenario you need this (sampling rate \approx delta), just for my own understanding of use cases.

Here is an extreme example when sampling_rate = delta. Consider the following algorithm: Randomly subsample one data point from the dataset (with probability delta), then output its true value.

This algorithm satisfies (0,delta)-DP, but it definitely leaks a lot of information and should be of trivial interest.