Repository navigation
Keep the minimum loss in the first bin of membership probabilities. - #654
Open
copybara-service[bot] wants to merge 1 commit into
Open
copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
copybara-service
Bot
force-pushed
the
cl/1013704368
branch
from
November 4, 2026 13:57
12ed9a8 to
a85d724
Compare
`_compute_membership_probability` builds log-spaced histogram bins with `np.logspace(np.log10(min_value), np.log10(max_value), num_bins + 1)`. Because `10**log10(x)` can come out one rounding step above `x` (for example `x = 0.003`), the first bin edge can land just above the smallest loss. That loss then falls outside the histogram, `np.digitize(...) - 1` gives index -1, and the point is scored with the membership probability of the last, highest-loss bin. The lowest-loss example, usually the most confidently memorized training point, can therefore be reported with a near-zero membership probability instead of a high one. The privacy risk scores this auditing tool reports then understate the risk for exactly the points that matter most. No production model is affected directly; the error is in the audit output. The outer bin edges are now pinned to the minimum and maximum values, and bin indices are clipped to the valid range. The per-split normalization of the train and test histograms is unchanged, so unequal split sizes still yield split-size-independent scores. Tests pin the minimum loss at `0.003` to the first bin and check that a train split four times larger than an identically distributed test split still gives every point a probability of 0.5. PiperOrigin-RevId: 1013704368
copybara-service
Bot
force-pushed
the
cl/1013704368
branch
from
November 5, 2026 14:20
a85d724 to
b0a93ce
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Keep the minimum loss in the first bin of membership probabilities.
_compute_membership_probabilitybuilds log-spaced histogram bins withnp.logspace(np.log10(min_value), np.log10(max_value), num_bins + 1). Because10**log10(x)can come out one rounding step abovex(for examplex = 0.003), the first bin edge can land just above the smallest loss. That loss then falls outside the histogram,np.digitize(...) - 1gives index -1, and the point is scored with the membership probability of the last, highest-loss bin.The lowest-loss example, usually the most confidently memorized training point, can therefore be reported with a near-zero membership probability instead of a high one. The privacy risk scores this auditing tool reports then understate the risk for exactly the points that matter most. No production model is affected directly; the error is in the audit output.
The outer bin edges are now pinned to the minimum and maximum values, and bin indices are clipped to the valid range. The per-split normalization of the train and test histograms is unchanged, so unequal split sizes still yield split-size-independent scores. Tests pin the minimum loss at
0.003to the first bin and check that a train split four times larger than an identically distributed test split still gives every point a probability of 0.5.