Skip to content

Rdp for subsampled gaussian mechanism under the sampling without replacement scheme #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

yuxiangw
Copy link

  1. Function compute_rdp_sample_without_replacement implements Theorem 9 of Wang, Balle, Kasiviswanathan. "Subsampled Renyi Differential Privacy and Analytical Moments Accountant." AISTATS'2019.

  2. Added a test script.

  3. Added a reference to why compute_rdp is correctly calculating the RDP for subsampled Gaussian mechanism under the Poisson sampling scheme (independently include a data point with probability q). At least for integer order...

…eplacement. Also, adding references for the existing Poisson sampling scheme calculations.
@googlebot
Copy link
Collaborator

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added the cla: no cla: no label Aug 14, 2019
@yuxiangw
Copy link
Author

yuxiangw commented Aug 15, 2019 via email

@googlebot
Copy link
Collaborator

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

1 similar comment
@googlebot
Copy link
Collaborator

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes cla: yes and removed cla: no cla: no labels Aug 15, 2019
Accountant." AISTATS'2019.

A strengthened version -- Theorem 27 -- applies subsampled-Gaussian mechanism. An implementation
is available at https://github.com/yuxiangw/autodp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be able to also include an implementation of the strengthened version? Initially, I thought we would only need the result in Theorem 27 because TensorFlow Privacy only uses the Gaussian Mechanism. But now that you have an implementation of Theorem 9, it'd be useful to keep ti for the future (when we start including other mechanisms).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implemented version is for the Gaussian mechanism. Although it is easy to modify it and make it more modular to cover other mechanisms. The strengthened version (Theorem 27) is somewhat tricky to implement... and the improvement over Theorem 9 is only in the third term of the expansion onwards. I think it makes sense to first merge this PR and then start another branch to investigate how to add Theorem 27 in the most light-weight manner.


for i in range(2, alpha+1):
if i == 2:
log_coef_i = math.log(special.binom(alpha, i)) + i * math.log(q)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think the use of numpy's log1p would lead to more stable calculations? Any other tricks to stabilize the calculations?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was following the implementation from compute_rdp. For small alpha, this should OK. For large alpha, maybe doing everything in the log-space might be better. It really depends on how special.binom is implemented in scipy.


# A simple test script to demonstrate the calculated RDP

q= 0.01
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: q = 0.01

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

results2 = compute_rdp_sample_without_replacement(q, noise_multiplier, steps, orders)


import matplotlib.pyplot as plt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe pylint will complain about this. Perhaps best to do it at the beginning.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@npapernot
Copy link
Collaborator

@kairouzp what is the status on this?

@ChrisWaites
Copy link

+1 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants