Skip to content

Keep the minimum loss in the first bin of membership probabilities. - #654

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
cl/1013704368
Open

copybara-service[bot] wants to merge 1 commit into
masterfrom
cl/1013704368

Conversation

@copybara-service

Copy link
Copy Markdown

Keep the minimum loss in the first bin of membership probabilities.

_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.

`_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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant