Unit 6 of 7 · about 5 hours · derive, implement

Differential privacy: adjacency, sensitivity, noise and composition

The only privacy claim in this stage with a proof. Everything outside the stated mechanism, adjacency and budget keeps no promise.

You'll be able to

  • Define adjacency, unit of privacy, sensitivity and the guarantee for one aggregate.
  • Build a clamped Laplace release, derive its from sensitivity over scale, and compose two releases.
  • Measure utility loss against the true aggregate and list every component outside the guarantee.

Covers

Differential privacy adjacency and unit of privacySensitivity, clipping, , and calibrated noiseComposition, subsampling intuition and accounting inputsPrivacy utility trade-offs and unprotected system boundaries
1

Read

In this order, only the parts listed

0 of 4 done

  1. Adjacency, sensitivity and privacy mapsOpenDP theory - one bounded privacy mechanism

    A Framework to Understand DP: Distance Between Datasets - Adjacency (symmetric distance); Definition of Privacy; Distance Between Aggregates - Sensitivity (clamped sum); Stability Maps and Privacy Maps (chained Laplace sum with 0.48)

  2. Clamp, sum and Laplace chaining in codeOpenDP theory - one bounded privacy mechanism

    Differential Privacy with OpenDP: The Laplace Mechanism; Transformation Example: Sum; Transformation Example: Clamp; Chaining (clamp, bounded sum and Laplace composed with the privacy map); Retrospective

    Run the examples with OpenDP 0.16.0, the version these pages document. make_sequential_composition groups releases under one budget.

  3. Accuracy limits of noisy releasesOpenDP theory - one bounded privacy mechanism

    Accuracy: Pitfalls and Edge Cases: Accuracy vs Confidence Intervals; What is (preprocessing and resize effects on the guarantee target)

  4. The definition and DP-SGDData Privacy and Security (MIT Data-Centric AI)

    Towards a solution: differential privacy (the inequality over adjacent datasets; DP-SGD as the training analogue; parameter-setting and utility challenges)

2

Focus on

  • Adjacency is the whole promise: symmetric distance 1 means adding or removing one record, and multi-row contributors scale the bound by .
  • Clamping sets sensitivity before noise means anything: with bounds (0, 10) one record moves the sum by at most 10, so Laplace scale 10 buys about 1.
  • Chaining multiplies the reasoning: the clamp map fed into the noise map gives the release map, and sequential composition adds epsilons across releases.
  • Accuracy utilities bound noise error only: the guarantee covers the release minus the true aggregate, never the sample minus the population.
Common mistakes · 3
  • Quoting without adjacency, bounds and . The number is meaningless until the unit of privacy and the clamp are stated.
  • Reading accuracy output as a confidence interval for the population. It covers noise around this dataset aggregate only.
  • Assuming the guarantee covers the pipeline. Ingestion, bounds choice, budget accounting and the served model sit outside unless each is modeled.
3

Try it yourself

Closed-book, before checking anything

With OpenDP 0.16.0 (contrib enabled) on CPython 3.14.4, chain clamp to (0, 10), sum and Laplace scale 10 over float vectors under symmetric distance. map(1) returns 1.000000009313226: the sum reports sensitivity 10.00000009313226 to cover float rounding, and the Laplace map alone turns 10 into exactly 1.0. Draw 200 values uniform on [0, 10] with NumPy default_rng(7) (true clamped sum 1005.9) and make 2000 releases. OpenDP draws noise from its own unseeded generator, so the mean absolute error changes per run: three runs gave 9.79, 9.96 and 10.03 against the Laplace mean absolute deviation of 10 (standard error about 0.22). Then derive that two such releases compose to about 2.0.
4

Quiz yourself

Answer first, then mark it. Missed ones go to Review.

0 got · 0 missed

  1. 1.Bounds are (0, 10) and one person contributes one row. What is the clamped-sum sensitivity?Answer

    10. Removing or adding one clamped record changes the sum by at most the clamp range.

  2. 2.Scale is 10 and sensitivity is 10. What , and what changes with scale 5?Answer

    About 1.0. Scale 5 doubles it to about 2.0 and halves the noise: equals sensitivity divided by scale.

  3. 3.Two -1.0 releases run on the same data. What is the pair budget?Answer

    About 2.0 by basic sequential composition. Each release spends separately against the same adjacency.

  4. 4. is 0 for this Laplace release. What does allow in general?Answer

    An additive slack in the guarantee, informally a small probability that the bound does not hold, as with the Gaussian mechanism. Pure Laplace keeps at 0.

You're done when

You can derive from bounds and scale, quote measured error with its setup, and name everything the guarantee excludes.

Only when you can do this without notes.

Leads to

Notes

Resources · 2 for this unit, 8 more in the section
  • OpenDP theory - one bounded privacy mechanismOpenDP · required

    Read A Framework to Understand DP and Differential Privacy with OpenDP (in the 0.16.0 user guide, Framework API), then Accuracy: Pitfalls and Edge Cases and the Differencing, Membership and Reconstruction attack notebooks. Define one privacy unit, clamp an aggregate, add calibrated noise, record and inputs, measure utility and list everything outside the guarantee.

  • Data Privacy and Security (MIT Data-Centric AI)MIT CSAIL · support

    Read the threat-model examples, shadow-training and metrics-based membership attacks, extraction by sampling plus perplexity ranking, empirical-defense evaluation, and the definition with DP-SGD.

Also in this section

  • Building Secure and Reliable Systems - selected design routeGoogle · primary

    Read Chapters 1, 2, 4-9 and 12-14: adversaries, trade-offs, least privilege, understandability, changing landscapes, resilience, recovery, code, tests and deployment. Apply the chapter questions to the same RPC, store, tenant and migration boundary.

  • OWASP Threat Modeling Cheat SheetOWASP Foundation · required

    Model trust boundaries, data flows, data stores, processes and external entities, and list the assets they carry. Write misuse cases for unauthorized mutation, cross-tenant reads, stale credentials, sensitive logs and restore or migration paths, then turn each into a test or explicit residual risk.

  • OSTEP - introductory security chaptersOSTEP authors and Peter Reiher · support

    Use Chapters 53-56 for introductory security, authentication, access control and cryptography vocabulary. Connect process and container isolation to the threat model and state where those boundaries do not protect the system.

  • Systems Foundations Checkpoint - security and privacy sliceRoadmap-Final · support

    Use only the tenant-access, privacy aggregate, abuse, migration, backup and residual-risk requirements as the final assessment. A toy privacy mechanism is evidence for its stated aggregate, not a claim that the service or model is private.

  • A Survey of Privacy Attacks in Machine LearningACM Computing Surveys · support

    Use the attack taxonomy and threat model (adversarial knowledge, assets under attack) plus the causes of leaks and the defenses overview; skip the per-paper catalog.

  • Targeted Backdoor Attacks on Deep Learning Systems Using Data PoisoningarXiv · support

    Read the weak threat model (no model or training-set knowledge, about 50 poisoning samples) and the reported result of above 90 percent attack success; skip the optimization details.

  • OWASP Input Validation Cheat SheetOWASP Foundation · support

    Apply allowlist validation, parse-safely-then-validate, structured-data rules, and the common pitfalls (client-only checks, trusted internal sources, denylisting, logging rejected input).

  • OWASP Deserialization Cheat SheetOWASP Foundation · support

    Apply the Python clear-box rules (pickle, unsafe YAML loaders, jsonpickle) and the language-agnostic methods (pure-data formats, signed data).