Skip to content

Add accounting_noise_multiplier property for correct privacy accounting#12

Merged
david-stan merged 1 commit intojbr-mainfrom
fix-adaclip-accountant-noise-multiplier
Jan 29, 2026
Merged

Add accounting_noise_multiplier property for correct privacy accounting#12
david-stan merged 1 commit intojbr-mainfrom
fix-adaclip-accountant-noise-multiplier

Conversation

@david-stan
Copy link
Collaborator

AdaClipDPOptimizer internally adjusts noise_multiplier based on Theorem 1 from https://arxiv.org/pdf/1905.03871.pdf. However, the accountant hook was reading this adjusted value instead of the original user-provided value, leading to incorrect privacy budget calculations.

This fix introduces an accounting_noise_multiplier property:

  • DPOptimizer: returns self.noise_multiplier (default behavior)
  • AdaClipDPOptimizer: overrides to return the original value

The accountant hook now uses this property, ensuring correct privacy accounting regardless of optimizer implementation details.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Docs change / refactoring / dependency upgrade

Motivation and Context / Related issue

How Has This Been Tested (if it applies)

Checklist

  • The documentation is up-to-date with the changes I made.
  • I have read the CONTRIBUTING document and completed the CLA (see CONTRIBUTING).
  • All tests passed, and additional code has been covered with new tests.

…ting

AdaClipDPOptimizer internally adjusts `noise_multiplier` based on Theorem 1
from https://arxiv.org/pdf/1905.03871.pdf. However, the accountant hook was
reading this adjusted value instead of the original user-provided value,
leading to incorrect privacy budget calculations.

This fix introduces an `accounting_noise_multiplier` property:
- DPOptimizer: returns `self.noise_multiplier` (default behavior)
- AdaClipDPOptimizer: overrides to return the original value

The accountant hook now uses this property, ensuring correct privacy
accounting regardless of optimizer implementation details.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coveralls
Copy link

Pull Request Test Coverage Report for Build 21488317796

Details

  • 7 of 7 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 80.531%

Totals Coverage Status
Change from base Build 21465886418: 0.02%
Covered Lines: 6970
Relevant Lines: 8655

💛 - Coveralls

@david-stan david-stan merged commit f68c10b into jbr-main Jan 29, 2026
7 of 8 checks passed
@david-stan david-stan deleted the fix-adaclip-accountant-noise-multiplier branch January 29, 2026 17:47
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.

2 participants