tensorflow / tensorflow/privacy

Potential bug in rdp analysis

Open
#166 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2k
Forks
477
Avg merge
22h 12m
Merged PRs (30d)
1

Description

Hello !
I'm getting suspicious results when computing epsilon with small alphas.
For example with the code:

from tensorflow_privacy.privacy.analysis.rdp_accountant import compute_rdp
from tensorflow_privacy.privacy.analysis.rdp_accountant import get_privacy_spent

noise_multiplier = 1
batch_size = 105
steps = 1
delta = 1e-3

orders = [1 + 1e-8] + [1 + x / 10. for x in range(1, 100)] + list(range(12, 64))
sampling_probability = batch_size / 100000
rdp = compute_rdp(
    q=sampling_probability,
    noise_multiplier=noise_multiplier,
    steps=steps,
    orders=orders
)
print(get_privacy_spent(orders, rdp, target_delta=delta))  # returns (0, 0.001, 1.00000001)

The privacy spent should be small but not zero. When I remove (1 + 1e-8) of orders, I get the correct answer.
I tracked down this behavior to this line, which puts epsilon to zero for sufficiently small rdp, but I'm not sure why...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tensorflow_privacy/privacy/analysis/rdp_accountant.py at the linked line around the small-RDP handling, then run the issue's compute_rdp and get_privacy_spent example with orders including 1 + 1e-8. Done means the small-alpha case reports a nonzero epsilon consistent with the same calculation without that order, without changing the other reported values unexpectedly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
machine-learning, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.