A question about microbatching and its impact on the compute_dp_sgd_privacy_statement function.
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- machine-learning, security
Hướng nghiên cứu
Bắt đầu bằng cách đọc tensorflow_privacy/privacy/analysis/compute_dp_sgd_privacy_lib.py và phần triển khai compute_dp_sgd_privacy_statement, tập trung vào nhánh used_microbatching và việc điều chỉnh noise_multiplier của nhánh này. So sánh logic đó với phần giải thích được dẫn trong Section 5.6 và các giả định lấy mẫu của hàm. Được xem là hoàn thành khi hành vi microbatching và vai trò của kích thước microbatch được đối chiếu rõ ràng trong tài liệu hoặc xác định được một sai khác cụ thể.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hello contributors of TensorFlow Privacy,
I am having a hard time understanding the changes to the privacy guarantee when using microbatches. I will provide an in-depth explanation of my current understanding, but there is a TLDR at the end of this post.
The function tf_privacy.compute_dp_sgd_privacy is deprecated since it assumes Poisson sampling and "does not account for doubling of sensitivity with microbatching."
The documentation of the new function, compute_dp_sgd_privacy_statement, points to ("How to DP-fy ML: A Practical Guide to Machine Learning with Differential Privacy", https://arxiv.org/abs/2303.00654, Sec 5.6.) for further explanation.
The basic modifications of microbatching are:
- Clip the average per microbatch gradient to clipping norm C.
- Sum the averaged per-microbatch gradients.
- Add noise proportional to the clipping norm and noise multiplier.
- Divide by the number of microbatches.
However, the chapter also mentions how exactly the privacy guarantee changes when using microbatching. Most notably, the chapter says, "...epsilon remains the same as in the no microbatching setting, but this approach adds more noise. The standard deviation used is 2k times larger, where k is the size of each microbatch."
In the code (https://github.com/tensorflow/privacy/blob/master/tensorflow_privacy/privacy/analysis/compute_dp_sgd_privacy_lib.py) microbatching mainly does the following:
if used_microbatching:
noise_multiplier /= 2
Initially this is quite confusing given the previous explanation by Ponomareva et al. I thought that there was some kind of mistake and that the line should read:
if used_microbatching:
noise_multiplier *= 2size_microbatches
The comments of the aforementioned Python file mention that the noise multiplier is halved to account for the doubling of sensitivity, which is described by Ponomareva et al. This would mean that we use a /2 to counteract the *2 that was introduced with microbatching. I don't understand why this is necessary. Is this done to uphold some equality?
Whatever the case might be, the paper also states that microbatching adds k times more noise. I don't think this is included anywhere in the epsilon calculation. Why is this not addressed?
There is probably something that I am overlooking or don't understand, but I can't find that thing. Is it correct that the noise multiplier just gets cut in half, or is this an oversight?
TLDR: The code for the epsilon calculation, compute_dp_sgd_privacy_statement, of TensorFlow Privacy halves the noise multiplier when microbatching is enabled. This correction is applied both in the case of Poisson sampling and not. According to the relvant paper ("How to DP-fy ML: A Practical Guide to Machine Learning with Differential Privacy", (https://arxiv.org/abs/2303.00654) Sec 5.6.), microbatching adds more noise to the Gaussian Mechanism of DP-SGD. Why is the noise multiplier halved? Does the number of microbatches and their size really not matter?
- Ngôn ngữ chính
- Python
- Star
- 2k
- Fork
- 477
- Merge trung bình
- 17 giờ 24 phút
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của tensorflow/privacy
-
[Draft] New IssueĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 1/100
tensorflow/privacy#633 · 1 bình luận ·
-
HUSSIENALI0780Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 1/100
tensorflow/privacy#626 · 1 bình luận ·
-
٦٦٧٧Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 1/100
tensorflow/privacy#625 ·
-
Bug ReportĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
tensorflow/privacy#624 ·
-
SecureĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
tensorflow/privacy#623 ·
Tất cả issue của tensorflow/privacy
Issue tương tự
-
Edit: TVS Encarnacion [PY]Đang mởchannels:edit check:passed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] The blue-green mitigation strategy lists catalog names and views before the source tablesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
aws-samples/sample-aws-genai-db-modernizer#2097 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
ietf-tools/datatracker#12027 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: Python SDK overwrites OVPack backups with HTTP 200 JSON errorsCó thể đã có người làm @stefanielizeth73-art đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
volcengine/OpenViking#7347 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
deepset-ai/haystack-core-integrations#4228 ·
Maintainer thường phản hồi trong vòng 1 ngày