6.4.10 · D1AI Safety & Alignment

Foundations — Privacy (differential privacy, membership inference)

1,715 words8 min readBack to topic

Before we can read a single line of the parent privacy note, we need to earn every symbol it fires at us. Below, each idea is built from nothing, drawn as a picture, and then justified — why does the topic need this? Nothing is assumed.


1. A dataset — the pile of records

Plain words. Think of a filing cabinet. Each drawer is a person. is the whole cabinet.

The picture.

Figure — Privacy (differential privacy, membership inference)

Why the topic needs it. Every privacy question is "what does removing one drawer do?" You cannot ask that until you have named the cabinet and its drawers .

The subscript is just a counter: is the first record, the seventh. The symbol (read "the size of ") counts the drawers.


2. Neighboring datasets and — the cabinet with one drawer changed

Privacy is about one person's influence. So we compare two cabinets that differ by exactly one drawer.

The picture.

Figure — Privacy (differential privacy, membership inference)

Why two flavours? Look at the figure. Under replace-one, a sum can move by two records' worth (one leaves, one enters), so any change caused by a person is potentially doubled versus add/remove. The parent note pins down which one it uses in every derivation for exactly this reason.


3. Probability — how often something happens

The symbol reads "the probability of event ": a number from (never) to (always).

reads: "the probability that the mechanism's output lands inside the set of outputs ." Here means "is a member of," and is just "some collection of outputs we care about" (e.g. "all answers above 50").


4. A mechanism — the noisy answer machine

The picture.

Figure — Privacy (differential privacy, membership inference)

Why "randomized"? A deterministic machine (same input → same output every time) would leak: change one drawer, watch the single answer flip, and you'd know that drawer mattered. Randomness hides the flip inside noise. That is the whole trick.

Examples of in ML: computing a gradient, releasing a mean, publishing model weights.


5. The exponential — the "how much closer" dial

Two new symbols: and .

  • (Greek "epsilon") is a small positive number we choose. It is the privacy budget: small = strong privacy, large = weak privacy.
  • is a fixed constant, the base of natural growth. means " raised to the power ."

The key small-number fact. For tiny , So means output probabilities differ by at most . That is how you read an epsilon.

The picture.

Figure — Privacy (differential privacy, membership inference)

Now the parent's central inequality is readable: It says: for neighbors, no output becomes more than an factor more likely. Whether your drawer is in or out, every answer keeps almost the same chance.


6. A query and its sensitivity — how loud is one person?

is a query: a plain function that reads the dataset and returns a number (e.g. "the mean age"). No randomness yet — that's the mechanism's job.

Reading the symbols. means "the largest over all choices." The vertical bars mean absolute value — distance from zero, always non-negative, so . So is "the worst-case wobble one person can cause."

Why the topic needs it. To hide one person, we must add enough noise to drown out that person's worst-case wobble. If a person can move the answer by , whispering of noise is useless. Sensitivity tells the mechanism how loud to be.


7. Laplace noise — the noise shaped for the exponential

Why this exact shape? Its formula already has an exponential of an absolute value, . Because the DP promise is about a ratio of exponentials, dividing one Laplace density by a shifted one gives another clean exponential — which lands you exactly at . Gaussian noise (the bell curve) has instead, and the squared term breaks the clean bound — that's why Gaussian gives only approximate DP, needing an extra symbol .

Set : louder person (big ) ⇒ wider noise; stricter budget (small ) ⇒ wider noise. Both directions match intuition.


8. Gradients , clipping norm , and the model

The parent applies all this to training. Three final symbols:

  • (theta): the model's parameters — the pile of numbers being learned.
  • : the loss on record — a number scoring "how wrong" the model is on that one example.
  • (nabla): the gradient — the arrow pointing in the direction that increases the loss fastest. Training steps against it. Crucially, this arrow is computed from one person's data, so it can carry that person's fingerprint.

Why clip? An uncapped gradient can be arbitrarily long, so one person's wobble is unbounded → infinite noise required → useless. Clipping forces each person's contribution to length , so under add/remove the sum of gradients has sensitivity exactly . Now we know how loud to whisper.


The prerequisite map

Dataset D and records x_i

Neighbors D1 and D2

Sensitivity delta f

Probability Pr

Mechanism M randomized

Exponential e to the epsilon

Differential Privacy guarantee

Laplace noise Lap b

Gradient and clipping C

DP-SGD training

Read it top-down: records build neighbors, neighbors build sensitivity, sensitivity plus the exponential and Laplace noise build the DP guarantee, and gradients-with-clipping feed that whole machine into training.


Equipment checklist

Cover the right side and answer aloud before opening the parent note.

What is a dataset and what is one ?
A list of records, one per person; is the -th person's data.
What makes two datasets "neighbors"?
They differ in exactly one record (add/remove) or one swap (replace-one).
Why does replace-one double the sensitivity vs add/remove?
One record leaves and another enters, so a sum can move by two records' worth.
What does mean in words?
The chance the randomized mechanism's output lands inside the set of outputs .
Why must a mechanism be random?
A deterministic answer would flip visibly when one record changes, revealing that record.
What does tell you for small ?
Output probabilities differ by at most about an fraction — small = strong privacy.
Why the exponential and not plain ?
Multiplicative factors multiply; budgets add; bridges them.
Define sensitivity in one line.
The largest change in the query's answer caused by changing one record.
Why is Laplace noise the natural fit for pure DP?
Its shape makes the probability ratio a clean exponential equal to .
Why clip gradients to norm ?
To bound one person's contribution, giving the summed gradient a finite sensitivity ( under add/remove).