CS 1261: Fairness, Privacy, and Cryptography
Lecture Notes

Course Taught by Professor Cynthia Dwork
Notes Compiled by Cristiana Murgoci

Spring 2026

Three Flavors of Indistinguishability

Statistical Indistinguishability

The course opens by comparing two coins:

Distinguishing Biased Coins

Let XBinomial(n,p)X \sim \mathrm{Binomial}(n,p). Then: 𝔼[X]=pn,Var(X)=p(1p)n.\mathbb{E}[X] = pn, \qquad \mathrm{Var}(X) = p(1-p)n. By Chernoff bounds, Pr[|X𝔼[X]|tσ]eΘ(t2).\Pr[|X - \mathbb{E}[X]| \ge t\sigma] \le e^{-\Theta(t^2)}.

Sample Complexity of Bias Detection To distinguish a coin of bias bb from a fair coin with constant confidence, n=Θ(1b2)n = \Theta\!\left(\frac{1}{b^2}\right) samples are necessary and sufficient.

Insight: Statistical indistinguishability is governed by variance scaling as n\sqrt{n}.

Differential Privacy and Adjacent Datasets

Two datasets x,yx, y are adjacent if they differ in exactly one individual’s record. Concretely: xx might be everyone in the room, and yy might be everyone in the room plus one additional person. Only that one record differs; everything else is identical.

Why adjacency?

The goal of differential privacy is to protect individuals: to ensure that no single person’s decision to contribute their data can meaningfully change what an observer learns. Defining privacy with respect to adjacent datasets captures this precisely.

Why randomized mechanisms?

Differential privacy necessarily involves randomized algorithms. For a given input, a randomized mechanism does not produce the same output every time — it produces a probability distribution over outputs. Privacy is then a statement about these distributions: the distributions on adjacent inputs must be nearly identical.

ε\varepsilon-Differential Privacy A randomized mechanism MM satisfies ε\varepsilon-differential privacy if for all adjacent datasets x,yx, y and all measurable output sets SS: Pr[M(x)S]eεPr[M(y)S].\Pr[M(x) \in S] \;\le\; e^{\varepsilon} \cdot \Pr[M(y) \in S].

Interpretation.

Every possible transcript of an interaction with MM is essentially equally likely whether or not any given individual is present in the dataset. An observer who sees the output of MM cannot reliably infer whether a specific person’s data was included.

Statistical vs. computational protection.

DP is a statistical guarantee: it is indistinguishability in the face of unlimited computational power. Unlike cryptographic notions, DP does not rely on hardness assumptions. The protection comes from how many observations the adversary gets — running the mechanism more times leaks more — not from the adversary’s computational limitations. Even an adversary with infinite computing power who knows every other person’s data cannot determine whether a target individual participated.

Real-world motivation.

Computational Indistinguishability

In cryptography, indistinguishability is restricted to polynomial-time adversaries. The key definitions below are from Barak’s lecture notes (§2.4).

Concrete Indistinguishability (Barak Def. 2.9) Random variables X,YX, Y over {0,1}n\{0,1\}^n are (T,ε)(T,\varepsilon)-indistinguishable, written XT,εYX \approx_{T,\varepsilon} Y, if for every algorithm (circuit) DD of size at most TT: |Pr[D(X)=1]Pr[D(Y)=1]|ε.\bigl|\Pr[D(X)=1] - \Pr[D(Y)=1]\bigr| \;\le\; \varepsilon. DD is called a distinguisher. TT bounds its running time; ε\varepsilon bounds its advantage.

The indistinguishability game.

An adversary Eve tries to tell XX from YY. A challenger flips a hidden bit b{0,1}b\in\{0,1\}, samples from XX if b=0b{=}0 or YY if b=1b{=}1, and gives the sample to Eve. Eve outputs a guess bb'. The scheme is secure if Pr[Eve wins]=Pr[b=b]12+ε2,\Pr[\text{Eve wins}] = \Pr[b' = b] \;\le\; \tfrac{1}{2} + \tfrac{\varepsilon}{2}, equivalently, Eve’s advantage |Pr[b=1b=0]Pr[b=1b=1]|ε|\Pr[b'{=}1\mid b{=}0] - \Pr[b'{=}1\mid b{=}1]| \le \varepsilon.

Asymptotic (Ensemble) Indistinguishability (Barak Def. 2.10) Ensembles {Xn}\{X_n\} and {Yn}\{Y_n\} are computationally indistinguishable, written {Xn}{Yn}\{X_n\} \approx \{Y_n\}, if for every polynomial p()p(\cdot) and all sufficiently large nn: Xnp(n),1/p(n)Yn.X_n \;\approx_{p(n),\, 1/p(n)}\; Y_n. Equivalently, no PPT adversary can distinguish XnX_n from YnY_n with non-negligible advantage.

Properties. Computational indistinguishability (\approx) satisfies:

Unlike DP, computational indistinguishability:

Pseudorandom Generators: A Concrete Example

The canonical application of computational indistinguishability is the pseudorandom generator (PRG).

Setup.

A PRG G:{0,1}n{0,1}2nG : \{0,1\}^n \to \{0,1\}^{2n} takes an nn-bit seed and deterministically produces a 2n2n-bit output string. (The stretch factor of 2 is for concreteness; any polynomial stretch works.) The machinery of GG is completely deterministic — the only randomness is in the choice of the seed.

How many pseudorandom strings are there?

There are 2n2^n possible seeds, so there are at most 2n2^n possible outputs — a tiny fraction of all 22n2^{2n} strings of length 2n2n. A truly random string of length 2n2n almost certainly falls outside the image of GG, because |Im(G)|/22n2n/22n=2n|\mathrm{Im}(G)| / 2^{2n} \le 2^n / 2^{2n} = 2^{-n}.

The indistinguishability requirement.

An exponential-time distinguisher could enumerate all 2n2^n outputs of GG, check membership, and distinguish pseudorandom from truly random strings easily. The requirement is therefore restricted to polynomial-time distinguishers:

Pseudorandom Generator (PRG) A deterministic function G:{0,1}n{0,1}2nG : \{0,1\}^n \to \{0,1\}^{2n} is a PRG if the ensemble {G(Un)}\{G(U_n)\} is computationally indistinguishable from {U2n}\{U_{2n}\}: {G(Un)}n1{U2n}n1,\{G(U_n)\}_{n \ge 1} \;\approx\; \{U_{2n}\}_{n \ge 1}, where UkU_k denotes the uniform distribution on {0,1}k\{0,1\}^k. No polynomial-time algorithm can distinguish a pseudorandom string from a truly random string with non-negligible advantage.

PRGs are the building block for stream ciphers and are studied in depth in Chapter 14.

The Third Flavor: Outcome Indistinguishability (Preview)

The chapter title promises three flavors. The third arises in the context of prediction algorithms and algorithmic fairness.

The problem of evaluating prediction algorithms.

Prediction algorithms assign probabilities to events: the probability that it will rain tomorrow, that a patient’s tumor will metastasize, that a person will repay a loan. Evaluating such algorithms is fundamentally difficult because these are non-repeatable events — we cannot rewind the future, re-run it many times, and measure the frequency of outcomes. There is no universally agreed mathematical definition of the probability of a non-repeatable event.

Calibration: necessary but not sufficient.

One natural criterion is calibration (Dawid, 1982): a forecaster is calibrated if, among all instances on which it predicted probability pp, the fraction of true outcomes is approximately pp. For example, among all days on which the forecaster said “70% chance of rain,” it should have actually rained on approximately 70% of those days.

Calibration is clearly desirable. Alarmingly, however, it is achievable by a complete charlatan who knows nothing about the phenomenon being predicted — one can construct a perfectly calibrated forecaster that is entirely uninformative. This shows that calibration alone is not a meaningful guarantee of accuracy or fairness.

The outcome indistinguishability framework.

Inspired by Feynman’s account of how physics validates a new law — build an experiment to test whether the law’s computed consequences match reality, and if they don’t, the law is wrong regardless of its elegance — we want a richer notion of what it means for a model’s predictions to be valid.

Outcome Indistinguishability (informal)

A model p̃\tilde{p} is outcome indistinguishable with respect to a class of distinguishers 𝒟\mathcal{D} if no test D𝒟D \in \mathcal{D} can tell the difference between:

  • outcomes drawn from the real world (true distribution), and

  • outcomes drawn from the model’s distribution p̃\tilde{p}.

The class of distinguishers 𝒟\mathcal{D} encodes what kinds of tests we care about. By varying 𝒟\mathcal{D}, one recovers:

This gives a hierarchy of fairness notions ordered by distinguisher power, and connects algorithmic fairness directly to the indistinguishability framework used throughout the course. The full theory is developed in Chapter 4.

Summary: three flavors.
Flavor Limitation on distinguisher Application
Statistical Number of samples Differential Privacy
Computational Polynomial time Cryptography, PRGs
Outcome Specified test class Algorithmic Fairness

Algorithmic Fairness

Representation and Bias

Algorithms never operate on individuals directly. Instead, each individual is mapped through a representation function ρ:𝒳𝒵\rho : \mathcal{X} \to \mathcal{Z} that extracts a finite set of features. The algorithm sees only ρ(x)\rho(x), not the full person xx. This compression is a fundamental source of bias.

Choice of features matters.

Consider a cancer study. Two research groups each study whether a particular treatment causes metastasis. Group A examines positions {r1,,rk}\{r_1,\ldots,r_k\} in a tumor’s DNA and finds a 30% metastasis rate among patients who look like you in those positions. Group B examines positions {b1,,bm}\{b_1,\ldots,b_m\} and finds a 5% rate. What can we conclude about your prognosis? Nothing — because the two groups studied different projections of your tumor. Only a study examining both sets of features simultaneously would be informative. Whenever the representation matters this much, it is a vector for the introduction of bias.

Sources of Bias

Non-representative training data.

A classifier trained to minimize error on a distribution 𝒟\mathcal{D} only generalizes to that distribution. If a minority group constitutes a small fraction of 𝒟\mathcal{D}, near-zero error overall can be achieved by performing arbitrarily badly on the minority while doing well on the majority. The algorithm has no incentive to be accurate on groups that barely affect aggregate loss.

Biased labels.

Labels themselves may encode historical discrimination. If the same behavior by a child of color is systematically coded as “defiant” while an identical behavior by a white child is coded as “spirited,” the training data absorbs this bias. The algorithm then learns to replicate it. Similarly, rearrest is used as a proxy for recidivism in criminal justice tools, but rearrest rates reflect policing intensity and systemic inequality, not solely individual behavior. People who commit crimes may not be rearrested; people who are arrested may not have committed a crime.

Differentially expressive features.

The same feature value can mean different things for different populations. The Allegheny County Child Protective Services screening tool (Virginia Eubanks, Automating Inequality, 2014) accessed Medicaid records to flag prior drug treatment. A poor family on Medicaid has a visible treatment history; a wealthy family that paid privately at a clinic has none. The feature “no drug treatment history” means different things depending on socioeconomic status. Other examples: income of $100,000/year has different implications for men and women given structural wage inequality; number of children is positively correlated with career success for men and negatively for women.

Principled criteria for feature selection.

The question of which features to include in a predictor is under-studied but critical. Several principled objections arise:

Measurement and hardware bias.

Bias can be embedded in the hardware itself. Camera lenses are historically optimized for white skin tones; microphones and broadcast frequencies were calibrated for male vocal ranges, leading to the perception that women’s voices are “shrill” — a perception produced by the technology, not by the voices. These are not labeling errors; they are biases in the measurement apparatus.

Label inflation and denominator problems.

When labels reflect reporting rates rather than ground truth, populations that are surveilled more will appear to have higher rates of the labeled behavior. CPS receives more calls about families in dense urban neighborhoods (where neighbors can hear a crying baby) than about identical situations in rural areas. “Number of prior calls” is not “prior abuse” — it is a function of surveillance density, which correlates with poverty and race.

Group Fairness

Group fairness properties are statistical requirements imposed on a classifier’s behavior across demographic groups.

The Confusion Matrix

For a binary classifier with true label Y{0,1}Y \in \{0,1\} and predicted label Ŷ{0,1}\hat{Y} \in \{0,1\}, all outcomes fall into four cells:

Predicted positive Predicted negative
Truly positive True Positive (TP) False Negative (FN)
Truly negative False Positive (FP) True Negative (TN)

Error Rates and Positive Predictive Value For a group GG: False Positive Rate (FPR)G=FPGFPG+TNG=Pr[Ŷ=1Y=0,G]False Negative Rate (FNR)G=FNGTPG+FNG=Pr[Ŷ=0Y=1,G]Positive Predictive Value (PPV)G=TPGTPG+FPG=Pr[Y=1Ŷ=1,G]\begin{align*} \text{False Positive Rate (FPR)}_G &= \frac{FP_G}{FP_G + TN_G} = \Pr[\hat{Y}=1 \mid Y=0, G]\\ \text{False Negative Rate (FNR)}_G &= \frac{FN_G}{TP_G + FN_G} = \Pr[\hat{Y}=0 \mid Y=1, G]\\ \text{Positive Predictive Value (PPV)}_G &= \frac{TP_G}{TP_G + FP_G} = \Pr[Y=1 \mid \hat{Y}=1, G] \end{align*} The base rate of group GG is pG=Pr[Y=1G]p_G = \Pr[Y=1 \mid G], the fraction of truly positive individuals in GG. It is a property of the population, not the classifier.

Chouldechova’s Impossibility Theorem

Impossibility of Simultaneous Fairness (Chouldechova, 2017) For any imperfect classifier and two groups S,TS, T with unequal base rates pSpTp_S \ne p_T, it is impossible to simultaneously achieve:

  1. Equal false positive rates: FPRS=FPRT\mathrm{FPR}_S = \mathrm{FPR}_T,

  2. Equal false negative rates: FNRS=FNRT\mathrm{FNR}_S = \mathrm{FNR}_T,

  3. Equal positive predictive value: PPVS=PPVT\mathrm{PPV}_S = \mathrm{PPV}_T.

Proof sketch.

There is a mathematical identity linking these four quantities for any group GG: PPVG=pG(1FNRG)pG(1FNRG)+(1pG)FPRG.\mathrm{PPV}_G = \frac{p_G(1 - \mathrm{FNR}_G)}{p_G(1-\mathrm{FNR}_G) + (1-p_G)\mathrm{FPR}_G}. This identity holds independently within each group. Requiring equal FPR and equal FNR across SS and TT pins two of the three varying quantities; the identity then forces PPVS=PPVT\mathrm{PPV}_S = \mathrm{PPV}_T if and only if pS=pTp_S = p_T. If base rates differ, at least one of the three conditions must be violated.

Real-world instantiation: COMPAS.

In 2016, ProPublica (Julia Angwin) reported that Northpointe’s COMPAS recidivism risk tool exhibited higher false positive rates for Black defendants and higher false negative rates for white defendants. Northpointe responded that their tool was calibrated — equal positive predictive value across racial groups. Both claims were correct. Chouldechova’s theorem explains why: differential base rates in rearrest (themselves a product of differential policing) make it mathematically impossible to equalize all three criteria simultaneously.

Statistical Parity and Its Limits

Statistical Parity A classifier satisfies statistical parity with respect to groups GG and G\bar G if the acceptance (positive prediction) rates are equal: Pr[Ŷ=1G]=Pr[Ŷ=1G].\Pr[\hat{Y}=1 \mid G] = \Pr[\hat{Y}=1 \mid \bar G].

Statistical parity is meaningful in the breach: a large violation is a warning sign worth investigating. But it is not a solution concept. A discriminatory actor can satisfy statistical parity while circumventing its intent: if a steakhouse owner wishes to exclude group GG and is required to show equal advertising rates across GG and G\bar G, they can target the ads at the vegetarians within GG — people who will not come regardless. The statistical parity requirement is met; the discriminatory intent is achieved.

Scoring Functions: Analogous Impossibility

For scoring functions s:𝒳[0,1]s : \mathcal{X} \to [0,1] (rather than binary classifiers):

Fairness Criteria for Scores

  • Calibration: within each bin of predicted score vv, the fraction of positive outcomes is v\approx v, independently within each group.

  • Balance for the positive class: 𝔼[sY=1,G1]=𝔼[sY=1,G2]\mathbb{E}[s \mid Y=1, G_1] = \mathbb{E}[s \mid Y=1, G_2] (positive individuals receive the same average score across groups).

  • Balance for the negative class: 𝔼[sY=0,G1]=𝔼[sY=0,G2]\mathbb{E}[s \mid Y=0, G_1] = \mathbb{E}[s \mid Y=0, G_2].

Impossibility for Scores (Kleinberg–Mullainathan–Raghavan, 2016) For two groups with unequal base rates, no imperfect predictor can simultaneously satisfy calibration, balance for the positive class, and balance for the negative class.

Proof sketch.

Calibration implies that the total score assigned to group GtG_t equals the number of positive individuals in GtG_t: iGtsi=μt(t=1,2),\sum_{i \in G_t} s_i = \mu_t \qquad (t = 1, 2), where μt\mu_t is the number of positives in group tt. The balance conditions fix XX (average score for negatives) and YY (average score for positives) to be group-independent. Expanding the sum: μt=Yμt+X(ntμt),\mu_t = Y \cdot \mu_t + X \cdot (n_t - \mu_t), which simplifies to μt=ntX+μt(YX)\mu_t = n_t X + \mu_t(Y - X) for groups of equal size nt=nn_t = n. This gives a pair of lines (one per group) in the (X,Y)(X, Y) plane; they coincide only when base rates μ1/n=μ2/n\mu_1/n = \mu_2/n are equal. Otherwise, the lines intersect only at X=0,Y=1X=0, Y=1 (perfect prediction).

Takeaway.

Group fairness desiderata are not merely in political tension — they are algebraically incompatible for imperfect classifiers when base rates differ.

Individual Fairness

Individual Fairness For task metric dd: μuμvd(u,v).\|\mu_u - \mu_v\| \le d(u,v).

This is a Lipschitz constraint over distributions.

Fairness Linear Program

The individually fair classification problem can be cast as a linear program: min{μu}u𝒰𝔼u,o[L(u,o)]subject toμuμvd(u,v)u,v𝒰.\min_{\{\mu_u\}_{u \in \mathcal{U}}} \;\mathbb{E}_{u,o}[L(u,o)] \quad \text{subject to} \quad \|\mu_u - \mu_v\| \le d(u,v) \quad \forall\, u,v \in \mathcal{U}. Fairness is a hard constraint; utility is the soft objective. Linear programs are solvable in polynomial time.

Limitations.

Three practical obstacles limit this approach:

  1. Scale. The universe 𝒰\mathcal{U} may contain billions of individuals. A polynomial running time in |𝒰||\mathcal{U}| is infeasible in practice (e.g., |𝒰|2|\mathcal{U}|^2 constraints is already a trillion for a billion-person universe). One needs something closer to linear time.

  2. Generalization. The LP is built on the individuals observed during training. It provides no fairness guarantee for individuals outside the training set.

  3. Metric access. The LP requires the task metric dd as input. Where does dd come from? This is the metric-learning problem, addressed in Chapter [chap:metric].

PAC learning (probably approximately correct learning) offers a partial remedy to the first two problems by working on a small sample rather than the full universe — producing a classifier that is likely to be approximately fair on the population.

Task-Competitive Composition

Motivation.

Consider an online advertising setting where multiple advertisers compete for each user’s attention in a real-time auction. When you visit a news website, an instantaneous auction determines which ad you see. Higher bidders displace lower bidders. Can fairness be guaranteed across this system?

A concrete example.

A grocery delivery service bids $1 for the attention of expectant parents (high lifetime value; subscription retention is strong). A tech company bids $0.50 for qualified undergraduate candidates. Both advertisers design their classifiers to be individually fair for their own task — the grocery service advertises equally to similarly-situated expectant households; the tech company advertises equally to similarly-qualified candidates.

The grocery service outbids the tech company whenever both want the same user. The effective result: the tech company can only reach users the grocery service passed on. Expectant parents — disproportionately on parental leave or career transitions, disproportionately female — are systematically excluded from tech job ads, not by any intentional discrimination, but by the financial dynamics of the auction. Neither advertiser violated its own fairness condition.

Historical instantiation. A 2010 Wall Street Journal investigation reported that a major ad network categorized users into demographic bins with names like “White Picket Fence” and “Double Income, No Kids.” Credit card companies using this network were accused of steering minority users toward credit products with less favorable terms — a serious concern given federal anti-discrimination law in credit. The steering emerged from the composition of individually-designed targeting strategies, not from any single actor’s misconduct.

Formal setup.

A randomized classifier is a map C:𝒰Δ(𝒪)C : \mathcal{U} \to \Delta(\mathcal{O}) assigning each individual a distribution over outcomes. For binary outcomes 𝒪={0,1}\mathcal{O} = \{0,1\}, define pu:=Pr[C(u)=1]p_u := \Pr[C(u)=1]. Individual (metric) fairness requires μuμvd(u,v)\|\mu_u - \mu_v\| \le d(u,v); for binary outcomes this becomes |pupv|d(u,v)|p_u - p_v| \le d(u,v).

Naive task-competitive composition.

Consider tasks TT (grocery) and TT' (tech), with task-specific metrics dd and dd' and individually fair classifiers CC and CC' respectively. Ties go to TT.

The difference in TT'-exposure between two individuals u,vu, v: (1pu)pu(1pv)pv.(1-p_u)p_u' - (1-p_v)p_v'.

Key observation. Even if pp is Lipschitz with respect to dd and pp' is Lipschitz with respect to dd', the product (1p)p(1-p)p' need not be Lipschitz under either metric. The multiplicative interaction introduced by outbidding breaks both fairness conditions.

Proof of violation.

Choose u,vu, v with 0<pu<pv0 < p_u < p_v (task TT favors vv) and pupv>0p_u' \ge p_v' > 0 (task TT' favors uu), with d(u,v)d'(u,v) maximized. The gap in TT'-exposure is: (1pu)pu(1pv)pv=d(u,v)allowed gap+(pvpu)pvviolation term>0.(1-p_u)p_u' - (1-p_v)p_v' \;=\; \underbrace{d'(u,v)}_{\text{allowed gap}} + \underbrace{(p_v - p_u)p_v'}_{\text{violation term} > 0}. Setting α=pv/pu\alpha = p_v / p_u and choosing probabilities so that αpu/pv\alpha \ge p_u' / p_v' (achievable because α\alpha can be pushed to exceed this ratio without violating CC'’s fairness), the violation term is strictly positive. The system as a whole violates individual fairness for task TT', even though each classifier is individually fair in isolation.

Naive Composition Fails Let dd and dd' be non-trivial task metrics (i.e., some pair of individuals has d(u,v)(0,1)d(u,v) \in (0,1)). Then there exist individually fair classifiers CC for TT and CC' for TT' such that their naive task-competitive composition violates individual fairness for TT'.

Implication: coordination is necessary.

Fairness of the whole system does not follow automatically from fairness of its parts. An advertising network that wants to guarantee multi-task individual fairness must actively coordinate across advertisers — it is insufficient for each advertiser to independently satisfy its own fairness criterion. This is not merely a theoretical concern: when the structure of a market (auctions, outbidding, priority rules) causes tasks to interact, the platform bears responsibility for the emergent aggregate behavior.

The Denominator Problem in Auditing

Auditing a classifier for fairness requires a benchmark: a reference quantity against which to compare observed rates. The choice of benchmark determines the conclusion.

Population-based benchmark.

Compare the stop rate for group SS against the stop rate for group TT, using total population as the denominator: stops in S|S|vs.stops in T|T|.\frac{\text{stops in }S}{|S|} \quad\text{vs.}\quad \frac{\text{stops in }T}{|T|}. In hypothetical data (Neil and Winship, Annals of Criminology): SS has 15,000 criminals out of 100,000; TT has 10,000 out of 100,000. If 10% of SS are stopped vs. 5% of TT, the population benchmark concludes a 2:1 disparity — strong evidence of discrimination against SS.

Usage-based benchmark.

Now suppose every person in a public space is stopped independently with probability 1/41/4, uniformly, with no consideration of race. Approximately 25% of SS and 25% of TT in the space are stopped. This is by construction non-discriminatory. Yet if SS uses the space at twice the rate of TT (for socioeconomic or geographic reasons), the population-based ratio of stops will be 2:1, exactly matching the earlier “evidence of discrimination” — even though the stopping rule is blind to race.

The denominator problem

The denominator reflects an assumption about what the police are doing and who is exposed to police contact. Different assumptions — total population, at-risk population, population using a specific space, criminally active population — yield different ratios from identical data and can support opposite conclusions.

Implications.

When evaluating claims based on benchmark tests:

Different defensible answers produce different conclusions from the same data. This does not mean fairness auditing is impossible, but it means conclusions require explicit assumptions that should be stated and scrutinized.

Structural limits: a summary.

Taken together, the results of this chapter suggest that group fairness is not a well-posed solution concept:

The appropriate response to a group fairness failure is investigation, not automatic remediation. The mathematical impossibility results explain the failure; they do not prescribe a solution.

Paper Readings

Chouldechova (2017) — Fair Prediction with Disparate Impact.

When base rates differ across demographic groups, no classifier can simultaneously satisfy calibration within each group, equal false positive rates, and equal false negative rates. The argument is purely algebraic: once calibration fixes the conditional expectations, the error rates are fully determined by the base rates, leaving no freedom to equalize them. This result is the mathematical backbone of the COMPAS controversy and demonstrates that apparent fairness trade-offs can be structural impossibilities rather than design failures.

Dwork, Hardt, Pitassi, Reingold, Zemel (2012) — Fairness Through Awareness.

Introduces individual fairness as a Lipschitz condition: a randomized classifier is fair if similar individuals (under a task-specific metric dd) receive outcome distributions within D(M(u),M(v))d(u,v)D(M(u), M(v)) \leq d(u,v) of each other. The fairness-constrained classification problem can be expressed as a linear program, and the central open question — where the metric comes from — motivates Chapter 3. This paper established the individual-vs.-group distinction that now structures most of the algorithmic fairness literature.

Learning the Metric: Human Arbiter

Individual Fairness: Treat Similar People Similarly

The most intuitive articulation of fairness is also one of the hardest to formalize: similar individuals should be treated similarly. This is the principle of individual fairness, introduced by Dwork, Hardt, Pitassi, Reingold, and Zemel (2012) as a formal counterpart to informal notions of non-discrimination.

The central challenge: “similar” is not a property of individuals in isolation — it is task-specific and context-dependent. Two candidates might be similar for the purpose of hiring engineers but dissimilar for the purpose of assessing surgical risk. There is no universal similarity function; the metric must be chosen by someone who understands the task.

Individual Fairness (Lipschitz Condition) Let (𝒳,d)(\mathcal{X}, d) be a metric space on individuals and (Δ(𝒴),D)(\Delta(\mathcal{Y}), D) a metric space on distributions over outcomes. A randomized classifier M:𝒳Δ(𝒴)M : \mathcal{X} \to \Delta(\mathcal{Y}) satisfies individual fairness if it is (D,d)(D, d)-Lipschitz: D(M(u),M(v))d(u,v)u,v𝒳.D\bigl(M(u),\, M(v)\bigr) \;\leq\; d(u, v) \qquad \forall\, u, v \in \mathcal{X}. That is: the distance between the outcome distributions assigned to two individuals is bounded by their task-specific similarity distance.

Why a metric?

The Lipschitz condition requires dd to be a true metric (symmetric, satisfies triangle inequality, d(u,u)=0d(u,u)=0). The triangle inequality is not just a technical convenience: it prevents the situation where uu and ww are each deemed “similar” to vv but treated very differently.

The metric DD on outcomes.

A natural choice for DD is total variation distance between the outcome distributions. If outcomes are binary (e.g., loan approved/denied), total variation between two Bernoulli distributions simplifies to |pupv||p_u - p_v| — the absolute difference in approval probabilities.

The Metric Problem

Individual fairness does not say which metric dd to use. This is intentional: the choice of dd is a normative decision, not a mathematical one. The question “are these two people similar for this task?” is a policy question, not a data question.

Why the metric cannot be learned from the data.

A natural thought: learn dd from historical outcomes. If the historical data comes from a biased process (discriminatory hiring, unequal access to credit), then distances learned from those outcomes will encode the bias. Using biased historical data to define “similarity” and then requiring the algorithm to respect that similarity perpetuates the original discrimination under the guise of mathematical fairness.

The metric must be an external normative input that reflects what we believe people ought to be judged on — not what they have historically been judged on.

Who specifies the metric?

Several approaches have been proposed:

  1. Domain experts. A hiring committee, a medical board, or a panel of legal experts specifies which features are task-relevant and how differences in those features should be weighted.

  2. Regulatory requirements. Anti-discrimination law may mandate that certain features (race, sex, religion) be ignored, implicitly defining a metric that is insensitive to those coordinates.

  3. Human arbiter / oracle. A designated human (or panel) answers queries about specific pairs or triplets of individuals. This externalizes the normative question: the math defers to human judgment.

The Human Arbiter Model

The human arbiter approach treats the task-specific metric dd as accessible only through a human oracle that can answer comparison queries. We do not assume the oracle reveals exact distances; it only answers ordinal questions.

Triplet Oracle A triplet oracle for metric (X,d)(X, d) takes as input three individuals a,b,cXa, b, c \in X and returns the identity of the closer one: 𝒪(a,b,c)={bif d(a,b)d(a,c),cotherwise.\mathcal{O}(a, b, c) \;=\; \begin{cases} b & \text{if } d(a,b) \leq d(a,c), \\ c & \text{otherwise.} \end{cases} The oracle answers: “Is bb or cc closer to aa?”

Why triplets?

Exact distances are hard for humans to provide: asking “how similar are these two candidates on a scale of 0 to 1?” yields inconsistent, poorly calibrated answers. Comparative judgments — “which of these two candidates is more similar to a third?” — are more reliable and cognitively natural. Triplet queries have been validated empirically as a basis for metric learning from human feedback.

Learning an Ordering via Triplet Queries

From comparisons to orderings.

Fix a representative individual r𝒳r \in \mathcal{X}. The triplet oracle can answer queries of the form “which of u,vu, v is closer to rr?” This is exactly the comparison oracle needed to run any comparison-based sorting algorithm.

MergeSort Query Complexity Given nn individuals and access to a triplet oracle anchored at rr, MergeSort recovers a total ordering of all individuals by d(r,)d(r, \cdot) using O(nlogn)O(n \log n) oracle queries.

Proof.

MergeSort makes Θ(nlogn)\Theta(n \log n) comparisons. Each comparison is one triplet query. The sort returns individuals in non-decreasing order of d(r,)d(r, \cdot), which is a valid total ordering because d(r,)d(r, \cdot) is a real-valued function.

From an ordering to distances.

A total ordering gives us the ranks σ(u)\sigma(u) for each uu, but not the actual distances d(r,u)d(r, u). To estimate d(r,u)d(r, u), we use the gaps between adjacent elements in the sorted order. This requires stronger oracle access (e.g., asking for approximate ratios of distances, not just ordinal comparisons), and recovery is only approximate.

Approximate Metric Recovery: α\alpha-Submetrics

Exact metric recovery from ordinal queries is information-theoretically impossible in general: many metrics are consistent with the same set of triplet answers. We therefore aim for approximate recovery.

α\alpha-Submetric A function d:𝒳×𝒳0d' : \mathcal{X} \times \mathcal{X} \to \mathbb{R}_{\geq 0} is an α\alpha-approximation to metric dd if: d(u,v)d(u,v)αd(u,v)u,v𝒳.d(u, v) \;\leq\; d'(u, v) \;\leq\; \alpha \cdot d(u, v) \qquad \forall\, u, v \in \mathcal{X}. An α\alpha-submetric satisfies d(u,v)d(u,v)+αd'(u,v) \leq d(u,v) + \alpha (additive approximation).

Representative-based distance.

Fix a representative rr. Define: dr(u,v)=|d(r,u)d(r,v)|.d_r(u, v) \;=\; \bigl|d(r, u) - d(r, v)\bigr|. By the reverse triangle inequality, dr(u,v)d(u,v)d_r(u,v) \leq d(u,v) for all u,vu, v (it is a 1-Lipschitz projection of dd). It is a pseudometric: it satisfies all metric axioms except it may assign zero distance to distinct points (if d(r,u)=d(r,v)d(r,u) = d(r,v) but uvu \neq v).

Using multiple representatives.

Choose a set of representatives R={r1,,rk}R = \{r_1, \ldots, r_k\}. Define: d̂(u,v)=maxrRdr(u,v)=maxrR|d(r,u)d(r,v)|.\hat{d}(u, v) \;=\; \max_{r \in R} d_r(u, v) \;=\; \max_{r \in R} \bigl|d(r,u) - d(r,v)\bigr|. This is always a lower bound: d̂(u,v)d(u,v)\hat{d}(u,v) \leq d(u,v). If RR is chosen such that for every pair (u,v)(u,v) there exists rRr \in R with d(r,u)d(r,u) and d(r,v)d(r,v) differing by close to d(u,v)d(u,v), then d̂\hat{d} approximates dd well.

For doubling-dimension metric spaces (where every ball of radius 2ρ2\rho can be covered by a bounded number of balls of radius ρ\rho), a random sample of size O(logn)O(\log n) is sufficient for a good approximation with high probability.

The Mahalanobis Distance: A Canonical Parametric Form

When individuals are represented as vectors in p\mathbb{R}^p, the most expressive linear metric is the Mahalanobis distance:

Mahalanobis Distance For a positive semi-definite matrix Ap×pA \in \mathbb{R}^{p \times p}: dA(u,v)=(uv)A(uv).d_A(u, v) \;=\; \sqrt{(u-v)^\top A\, (u-v)}.

Special cases: A=IA = I gives Euclidean distance; A=Σ1A = \Sigma^{-1} (inverse covariance) gives the classical Mahalanobis distance that whitens the feature space. The matrix AA encodes which features matter and how much: a large diagonal entry for feature jj means differences in jj are penalized heavily.

Metric learning as semidefinite programming.

Given a set of “must-link” pairs 𝒮\mathcal{S} (similar individuals) and “cannot-link” pairs 𝒟\mathcal{D} (dissimilar individuals), one can find the best-fit AA by solving: minA0(u,v)𝒮dA(u,v)2subject to(u,v)𝒟dA(u,v)21.\begin{align*} \min_{A \succeq 0} \quad & \sum_{(u,v) \in \mathcal{S}} d_A(u,v)^2 \\ \text{subject to} \quad & \sum_{(u,v) \in \mathcal{D}} d_A(u,v)^2 \geq 1. \end{align*} This is a semidefinite program (SDP): the constraint A0A \succeq 0 (positive semi-definiteness) is convex, so the problem can be solved in polynomial time. The constraint set 𝒮\mathcal{S} and 𝒟\mathcal{D} can be populated from human arbiter responses to pairwise queries.

Historical context.

The Mahalanobis distance was introduced by P.C. Mahalanobis in 1936, originally to measure anthropometric distances between population groups in British India — arguing that intra-caste variation exceeds inter-caste variation, and that geographic proximity is a more principled basis for social classification than caste hierarchy. The original application was explicitly political; the tool it introduced is genuinely powerful and now ubiquitous in statistics and machine learning. This history is a reminder that mathematical tools are not neutral: they are invented to answer specific questions, those questions carry normative assumptions, and the tools can be repurposed in both better and worse directions.

Limitations and Critiques

Who is the arbiter?

The human arbiter model defers the normative question to a human — but does not resolve it. If the designated arbiter is not representative (e.g., drawn from a homogeneous population), the metric will reflect their perspective, not the affected community’s. Diversity of the arbiter pool matters as much as the mathematical formalism.

Whose similarity?

The metric is task-specific: similar for hiring engineers is not the same as similar for bail decisions. In practice, the same features (education, neighborhood) are used across many tasks, creating de facto cross-task conflation of similarity.

Tension with group fairness.

Individual fairness and group fairness (e.g., equalized odds, demographic parity) are not equivalent, and can conflict. A metric that treats individuals as similar when they have the same qualifications may still produce racially disparate outcomes if qualifications are unequally distributed across groups as a result of historical inequality. Individual fairness is silent on this; it only asks that the algorithm respect the metric, not that the metric itself be equitable.

The bootstrapping problem.

Validating a fairness metric requires knowing what the fair outcomes are — but knowing fair outcomes is equivalent to having the metric. There is no ground truth to check against: the arbiter’s responses are constitutive, not descriptive, of the fairness standard.

Paper Readings

Dwork, Hardt, Pitassi, Reingold, Zemel (2012) — Fairness Through Awareness.

The foundational paper for this chapter: proposes the human arbiter model in which a designated oracle answers comparison queries about individual similarity, externalizing the normative question of who counts as similar for a given task. The paper proves that the resulting metric can be used to formulate fair classification as a linear program, and explicitly frames the open problem — how to elicit or learn the metric in practice — that the rest of this chapter addresses.

Mukherjee, Yao, Gaboardi, Learned-Miller, Agarwal (2020) — Two Simple Ways to Learn Individual Fairness Metrics from Data.

Shows that a Mahalanobis distance encoding task-specific similarity can be learned from human-provided pairwise labels (similar/dissimilar) or triplet comparisons without requiring full expert specification. Both approaches reduce to convex optimization: the pairwise-constraint version is a semidefinite program; the triplet version uses gradient descent. The resulting metric is interpretable as a feature reweighting, but the quality of the metric depends entirely on the raters’ judgments — the method systematizes elicitation without validating whether the elicited standard is itself equitable.

Outcome Indistinguishability & the Multi-XX Framework

Motivation: the meaning of a single probability

Richard Feynman famously asked: what does it mean to say there is a 12% chance of rain tomorrow? For a repeatable experiment we can check the prediction by running many trials; but tomorrow is a unique event. The same question applies to recidivism prediction, loan approval, or medical diagnosis: the ground truth πi\pi^\star_i for individual ii is never directly observable.

The Outcome Indistinguishability framework sidesteps this epistemological problem by asking a behavioral question: can a downstream observer—using whatever statistical tests they care about—distinguish behavior under the model from behavior under the true distribution? If not, the model is, in every practical sense, as good as the truth.

Outcome indistinguishability: A model is good relative to a collection of distinguishers 𝒞\mathcal{C} if no distinguisher c𝒞c\in\mathcal{C} can tell whether outcomes were drawn from real life or from the model.

This mirrors the scientific method: propose a model, derive observable consequences, and test whether those consequences match reality. Passing the tests does not prove the model is universally correct; it only says the model is good for the uses captured by the tests in 𝒞\mathcal{C}.

Connection to computational indistinguishability.

The OI framework was inspired in part by the polynomial-time indistinguishability definitions from cryptography (Chapter 14). Both use the same template: fix a class of efficient tests; require that two distributions (real-world outcomes vs. model outcomes, or truly random bits vs. pseudorandom bits) cannot be told apart by any test in that class. OI is the fairness-flavored instantiation of the same core idea.

Formal setup

The goal is that cc should behave nearly the same whether the outcome is drawn from real life or from the model.

Distinguisher hierarchy

Different real-world observers have different amounts of information. We organize them into a four-level hierarchy of increasing power:

  1. No-access distinguisher: sees only the raw input ii and the binary outcome yy; receives no prediction p̃i\tilde p_i.

  2. Sample-access distinguisher: sees (i,p̃i,y)(i, \tilde p_i, y) but only for finitely many sampled individuals. Cannot query the model on arbitrary inputs.

  3. Oracle-access distinguisher: can query the model on any i𝒳i\in\mathcal{X}, receiving p̃i\tilde p_i, then observe the outcome yy.

  4. Full-access distinguisher: knows the model p̃\tilde p in full; can compute p̃i\tilde p_i for every ii without querying.

Demanding OI against a stronger class 𝒞\mathcal{C} is a strictly stronger requirement. In the algorithm we will work with real-valued distinguishers: c:𝒳×[0,1]×{0,1}[0,1]c : \mathcal{X} \times [0,1] \times \{0,1\} \to [0,1], mapping (individual, prediction, outcome) to a score in [0,1][0,1]. The distinguishing gap becomes Δc=𝔼i[𝔼[c(i,p̃i,Ỹi)]𝔼[c(i,p̃i,Yi)]]=𝔼i[(πip̃i)δc(i)],\Delta_c = \mathbb{E}_i\!\bigl[\mathbb{E}[c(i,\tilde p_i, \tilde Y_i)] - \mathbb{E}[c(i,\tilde p_i, Y_i^\star)]\bigr] = \mathbb{E}_i\!\bigl[(\pi^\star_i - \tilde p_i)\,\delta_c(i)\bigr], where δc(i):=c(i,p̃i,1)c(i,p̃i,0)\delta_c(i) := c(i,\tilde p_i, 1) - c(i,\tilde p_i, 0) is the per-individual contrast (how much cc changes when the outcome flips).

Real world versus model world

Fix a distinguisher c𝒞c\in\mathcal{C}.

Define the expected behavior of cc in the real world: Ac=𝔼I𝒟𝒳[𝔼[c(I,p̃I,YI)I]].A_c = \mathbb{E}_{I\sim\mathcal{D}_{\mathcal X}} \left[ \mathbb{E}\left[ c(I,\tilde p_I,Y_I^\star)\mid I \right] \right].

Define the expected behavior of cc in the model world: Bc=𝔼I𝒟𝒳[𝔼[c(I,p̃I,ỸI)I]].B_c = \mathbb{E}_{I\sim\mathcal{D}_{\mathcal X}} \left[ \mathbb{E}\left[ c(I,\tilde p_I,\tilde Y_I)\mid I \right] \right].

The distinguishing gap is: Δc=AcBc.\Delta_c = A_c-B_c.

The model is ε\varepsilon-outcome-indistinguishable with respect to 𝒞\mathcal{C} if |Δc|εc𝒞.|\Delta_c|\le \varepsilon \qquad \forall c\in\mathcal{C}.

Decomposition of the distinguishing gap

Gap decomposition For any distinguisher c:𝒳×[0,1]×{0,1}[0,1]c : \mathcal{X}\times[0,1]\times\{0,1\}\to[0,1] and any model p̃\tilde p, Δc=𝔼I[(πIp̃I)δc(I)],\Delta_c \;=\; \mathbb{E}_{I}\!\Bigl[({\pi^\star_I - \tilde p_I})\,\delta_c(I)\Bigr], where δc(i)=c(i,p̃i,1)c(i,p̃i,0)\delta_c(i) = c(i,\tilde p_i,1) - c(i,\tilde p_i,0).

Proof. Write 𝔼[c(i,p̃i,Ỹi)]=p̃ic(i,p̃i,1)+(1p̃i)c(i,p̃i,0)\mathbb{E}[c(i,\tilde p_i, \tilde Y_i)] = \tilde p_i\,c(i,\tilde p_i,1)+(1-\tilde p_i)\,c(i,\tilde p_i,0) and similarly for the ground-truth term (replacing p̃i\tilde p_i with πi\pi^\star_i for the Bernoulli draw while keeping p̃i\tilde p_i as the prediction fed to cc). Subtracting and simplifying: 𝔼[c(i,p̃i,Ỹi)]𝔼[c(i,p̃i,Yi)]=p̃iδc(i)πiδc(i)=(πip̃i)δc(i).\begin{align*} \mathbb{E}[c(i,\tilde p_i, \tilde Y_i)] - \mathbb{E}[c(i,\tilde p_i, Y_i^\star)] &= \tilde p_i\,\delta_c(i) - \pi^\star_i\,\delta_c(i) = -(\pi^\star_i - \tilde p_i)\,\delta_c(i). \end{align*} Taking expectations over II and absolute values gives the result. ◻

Interpretation. The gap is an inner product between the error vector (πip̃i)(\pi^\star_i - \tilde p_i) and the sensitivity vector δc(i)\delta_c(i). A distinguisher can detect the model’s flaws exactly when its sensitivity is aligned with those flaws.

Algorithm: iterative p̃\tilde p-nudging

Start with the trivial predictor: p̃(0)(i)=12i.\tilde p^{(0)}(i)=\frac{1}{2} \qquad \forall i.

Repeat:

  1. If |Δc|ε|\Delta_c|\le \varepsilon for every c𝒞c\in\mathcal{C}, stop.

  2. Otherwise, choose a distinguisher cc with |Δc|>ε|\Delta_c|>\varepsilon.

  3. Update: p̃(t+1)(i)=Π[0,1](p̃(t)(i)+Δc2δc(i)).\tilde p^{(t+1)}(i) = \Pi_{[0,1]} \left( \tilde p^{(t)}(i) + \frac{\Delta_c}{2}\delta_c(i) \right).

Here Π[0,1]\Pi_{[0,1]} is projection back into the interval [0,1][0,1].

Intuition for the update

If Δc>0\Delta_c>0, then on average the model is underpredicting in directions where δc(i)>0\delta_c(i)>0. So we nudge p̃i\tilde p_i upward for such individuals.

If δc(i)<0\delta_c(i)<0, the same update nudges p̃i\tilde p_i downward.

Thus the update is a gradient-like correction against the distinguisher that currently detects the largest systematic error.

Circuit interpretation

The algorithm can be viewed as gradually building a predictor circuit.

The computationally hard part is often finding a distinguisher c𝒞c\in\mathcal{C} with large |Δc||\Delta_c|. This is related to agnostic learning. But once such a distinguisher is found, the update itself is simple.

Convergence: potential function argument

Define the mean-squared error potential Φ(p̃)=𝔼I[(πIp̃(I))2][0,1].\Phi(\tilde p) \;=\; \mathbb{E}_I\!\bigl[(\pi^\star_I - \tilde p(I))^2\bigr] \;\in [0,1].

Lemma 4.1 (Descent per update). Suppose at step tt we pick a violating cc with Δcε\Delta_c \ge \varepsilon and apply the update p̃(t+1)(i)Π[0,1](p̃(t)(i)+Δc2δc(i)).\tilde p^{(t+1)}(i) \;\leftarrow\; \Pi_{[0,1]}\!\Bigl(\tilde p^{(t)}(i) + \tfrac{\Delta_c}{2}\,\delta_c(i)\Bigr). Then Φ(p̃(t))Φ(p̃(t+1))34Δc2.\Phi(\tilde p^{(t)}) - \Phi(\tilde p^{(t+1)}) \;\ge\; \tfrac{3}{4}\,\Delta_c^2.

Proof sketch. Let η=Δc/2\eta = \Delta_c/2 and ei=πip̃i(t)e_i = \pi^\star_i - \tilde p^{(t)}_i. Ignoring projection (which only helps), the new squared error at individual ii is (eiηδc(i))2=ei22ηeiδc(i)+η2δc(i)2.(e_i - \eta\,\delta_c(i))^2 = e_i^2 - 2\eta\,e_i\,\delta_c(i) + \eta^2\,\delta_c(i)^2. Taking expectations and using 𝔼[eiδc(i)]=Δc\mathbb{E}[e_i\,\delta_c(i)] = \Delta_c and 𝔼[δc(i)2]1\mathbb{E}[\delta_c(i)^2]\le 1 (since c[0,1]c\in[0,1]): Φ(p̃(t+1))Φ(p̃(t))2ηΔc+η2=Φ(p̃(t))Δc2+Δc24=Φ(p̃(t))34Δc2.\Phi(\tilde p^{(t+1)}) \;\le\; \Phi(\tilde p^{(t)}) - 2\eta\Delta_c + \eta^2 = \Phi(\tilde p^{(t)}) - \Delta_c^2 + \tfrac{\Delta_c^2}{4} = \Phi(\tilde p^{(t)}) - \tfrac{3}{4}\,\Delta_c^2.  ◻

Iteration bound Starting from Φ(p̃(0))1\Phi(\tilde p^{(0)}) \le 1, after at most 4/ε2\lceil 4/\varepsilon^2 \rceil updates every distinguisher in 𝒞\mathcal{C} has gap ε\le \varepsilon. The algorithm terminates in O(1/ε2)O(1/\varepsilon^2) rounds.

Proof. Each violating step drops Φ\Phi by at least 34ε2\tfrac{3}{4}\varepsilon^2. Since Φ0\Phi\ge 0 and Φ1\Phi\le 1, there can be at most 1(3/4)ε2=43ε2\frac{1}{(3/4)\varepsilon^2} = \frac{4}{3\varepsilon^2} such steps before no violating cc remains. ◻

Connection to gradient descent

The nudge update p̃Π[0,1](p̃+ηδc)\tilde p \leftarrow \Pi_{[0,1]}(\tilde p + \eta\,\delta_c) is exactly a projected gradient step on the potential Φ\Phi, where δc\delta_c serves as the gradient direction. The algorithm is therefore an instance of projected gradient descent, and the O(1/ε2)O(1/\varepsilon^2) bound matches the standard convergence rate for gradient descent with step-size proportional to the gradient norm.

Multi-XX: accuracy, calibration, and validity

Definition 4.1 (Multi-accuracy). A predictor p̃\tilde p is (𝒮,ε)(\mathcal{S},\varepsilon)-multi-accurate if for every set S𝒮S\in\mathcal{S}: |𝔼IS[πIp̃(I)]|ε.\Big|\,\mathbb{E}_{I\in S}\!\bigl[\pi^\star_I - \tilde p(I)\bigr]\,\Big| \;\le\; \varepsilon. Equivalently, choosing c(i,p̃i,y)=𝟏[iS]yc(i,\tilde p_i, y) = \mathbf{1}[i\in S]\cdot y, multi-accuracy says the model has no systematic over- or under-prediction on any group in 𝒮\mathcal{S}.

Multi-accuracy is a special case of OI: it corresponds to taking 𝒞\mathcal{C} to be the class of indicator-function distinguishers c(i,p̃i,y)=𝟏[iS]yc(i,\tilde p_i, y) = \mathbf{1}[i\in S]\cdot y. The iterative algorithm above therefore produces a multi-accurate predictor in O(1/ε2)O(1/\varepsilon^2) rounds whenever 𝒮\mathcal{S} is finite (or efficiently enumerable).

Connection to group fairness.

Multi-accuracy is stronger than requiring average calibration per group: it bounds the signed error, preventing the model from simultaneously over-predicting for one demographic subgroup while under-predicting for another. By choosing 𝒮\mathcal{S} to contain all protected groups and their pairwise (and higher-order) intersections, we approach intersectional fairness.

Multi-calibration.

Strengthening multi-accuracy to require calibration within each score bucket of each group yields multi-calibration (Hébert-Johnson, Kim, Reingold, Rothblum, 2018): S𝒮,v[0,1]:𝔼[πIIS,p̃I=v]v.\forall S\in\mathcal{S},\;\forall v\in[0,1]: \quad \mathbb{E}\!\bigl[\pi^\star_I \mid I\in S,\;\tilde p_I = v\bigr] \;\approx\; v. The same nudge-and-project algorithm achieves this; it is a strictly stronger guarantee than multi-accuracy.

Limitations

  1. Small groups. When a group S𝒮S\in\mathcal{S} is small, the empirical estimate of 𝔼IS[πIp̃I]\mathbb{E}_{I\in S}[\pi^\star_I - \tilde p_I] has high variance. Meaningful multi-accuracy guarantees require sample sizes that grow with |𝒮||\mathcal{S}| and shrink with group size.

  2. Intersectionality at scale. Requiring accuracy on all intersections S1S2S_1\cap S_2\cap\cdots causes |𝒮||\mathcal{S}| to grow exponentially in the number of protected attributes, making the O(1/ε2)O(1/\varepsilon^2) bound vacuous without additional structure (e.g., computationally efficient distinguisher classes).

  3. Gameable accuracy definitions. A model can achieve multi-accuracy while still making badly miscalibrated predictions within fine-grained subgroups, motivating the stronger multi-calibration guarantee.

Connection to fairness

Multi-accuracy protects against systematic group-level prediction errors. If a predictor systematically overpredicts loan repayment for one group, multi-accuracy pushes those predictions down. If it systematically underpredicts for another group, multi-accuracy pushes those predictions up.

By choosing 𝒮\mathcal{S} to include protected groups and intersections of protected groups, one obtains a form of intersectional fairness.

However, small groups are difficult:

Thus Multi-XX helps with intersectionality only for groups explicitly included in 𝒮\mathcal{S} and sufficiently represented in the data.

Paper Readings

Hébert-Johnson, Kim, Reingold, Rothblum (2018) — Multicalibration: Calibration for the Computationally Identifiable Masses.

Introduces multicalibration: the requirement that a predictor be calibrated not just globally but on every subgroup that a polynomial-time algorithm can identify. The main result is an efficient boosting-style algorithm that iterates through subgroups, applies a small nudge wherever calibration fails, and halts after O(1/α2)O(1/\alpha^2) rounds — the same structure as the OI algorithm in this chapter. Multicalibration implies multi-accuracy and is implied by outcome indistinguishability against oracle-access distinguishers, making it a key waypoint in the OI hierarchy.

Dwork, Kim, Reingold, Rothblum, Yona (2021) — Outcome Indistinguishability.

Formally defines the OI framework: a predictor is outcome indistinguishable with respect to a class 𝒞\mathcal{C} of distinguishers if no c𝒞c \in \mathcal{C} can tell real-world outcomes from model-generated ones. The paper proves the equivalences between OI, multi-accuracy, and multicalibration at each level of the distinguisher hierarchy, and shows that the nudge-and-project algorithm achieves ε\varepsilon-OI in O(1/ε2)O(1/\varepsilon^2) rounds. It is the primary reference for the material in this chapter.

Trevisan, Tulsiani, Vadhan (2009) — Regularity, Boosting, and Efficiently Simulating Every High-Entropy Distribution.

Proves that any distribution with high Shannon entropy can be efficiently simulated by a distribution that is computationally indistinguishable from it, by iteratively correcting the simulator against the best-fitting distinguisher from a fixed class. The boosting-style argument and the potential function that bounds the number of correction steps are structurally identical to those in the OI convergence proof, providing the complexity-theoretic underpinning for the algorithm analyzed in this chapter.

Differential Privacy and Reconstruction

Fundamental Law of Information Recovery

Dinur–Nissim If too many queries are answered too accurately, database reconstruction is possible.

Specifically: error o(n)o(n) implies blatant non-privacy; even o(n)o(\sqrt{n}) error fails under many random queries.

Database Reconstruction Model

Let the database be d{0,1}nd \in \{0,1\}^n. A query corresponds to a subset S[n]S \subseteq [n]: True answer: iSdi\text{True answer: } \sum_{i \in S} d_i, mechanism response: R(S)=iSdi+noise.R(S) = \sum_{i \in S} d_i + \text{noise.} We assume a uniform accuracy guarantee: S[n],|R(S)iSdi|E.\forall S \subseteq [n],\ \left| R(S) - \sum_{i \in S} d_i \right| \le E.

Blatant Non-Privacy

Definition (Blatant Non-Privacy)

An algorithm is blatantly non-private if an adversary can reconstruct all but o(n)o(n) entries.

Reconstruction from Accurate Answers

Reconstruction Theorem

If all subset queries are answered with error at most EE, then the Hamming distance between any consistent database cc and the real database dd satisfies H(c,d)4E.H(c,d)\le 4E.

Proof Sketch.

Both dd and any consistent cc satisfy |R(S)Sdi|E|R(S) - \sum_S d_i| \le E and |R(S)Sci|E|R(S) - \sum_S c_i| \le E. By triangle inequality, |SdiSci|2E|\sum_S d_i - \sum_S c_i| \le 2E for all SS. Setting S1={i:di=1}S_1 = \{i:d_i=1\} and S0={i:di=0}S_0=\{i:d_i=0\}: H(c,d)=|iS0diiS0ci|+|iS1diiS1ci|2E+2E=4E.H(c,d)=\left|\sum_{i\in S_0}d_i - \sum_{i\in S_0}c_i\right| +\left|\sum_{i\in S_1}d_i-\sum_{i\in S_1}c_i\right|\le 2E+2E=4E. If E=o(n)E=o(n) then H(c,d)=o(n)H(c,d)=o(n): almost the entire database is reconstructable.

Reconstruction from Linearly Many Random Queries

Take q{1,1}nq \in \{-1,1\}^n drawn uniformly at random; true answer qdq\cdot d; noise |noise|αn3.|\text{noise}| \le \frac{\sqrt{\alpha n}}{3}.

Signal from Distant Databases

If H(c,d)αnH(c,d) \ge \alpha n, then q(dc)q \cdot (d-c) is a sum of αn\alpha n independent ±1\pm 1 variables. By anti-concentration, Prq[|q(dc)|αn]κ\Pr_q[|q\cdot(d-c)|\ge\sqrt{\alpha n}]\ge \kappa for some constant κ>0\kappa>0.

After βn\beta n independent queries, by union bound: Pr[ distant c that survives]2αnpβn,p=1κ.\Pr[\exists \text{ distant } c \text{ that survives}] \le 2^{\alpha n} \cdot p^{\beta n}, \quad p = 1-\kappa. Choosing β>α+γlog2(1/p)\beta > \frac{\alpha + \gamma}{\log_2(1/p)} drives this to 2γn2^{-\gamma n}, eliminating all distant databases with high probability.

Theorem (Random Query Reconstruction)

If O(n)O(n) random queries are answered with noise o(n)o(\sqrt{n}), then database reconstruction is possible with high probability.

Concentration vs. Anti-Concentration

Let S=i=1kXiS = \sum_{i=1}^k X_i, Xi{1,1}X_i \in \{-1,1\} i.i.d.

Concentration (Chernoff): Pr[|S|t]2et2/(2k)\Pr[|S|\ge t]\le 2e^{-t^2/(2k)}. Most mass lies near 0.

Anti-Concentration: Pr[|S|k]κ>0\Pr[|S|\ge \sqrt{k}]\ge \kappa > 0 (from CLT: S/k𝒩(0,1)S/\sqrt{k}\approx \mathcal{N}(0,1)).

Key Insight for Reconstruction

If noise <αn3< \frac{\sqrt{\alpha n}}{3}, then with constant probability each random query produces a signal larger than the noise. After Θ(n)\Theta(n) queries, all distant databases are eliminated.

Connection to Differential Privacy

Noise must scale at least Ω(n)\Omega(\sqrt{n}) to prevent reconstruction. Differential privacy Pr[M(x)S]eεPr[M(y)S]\Pr[M(x)\in S]\le e^\varepsilon \Pr[M(y)\in S] prevents catastrophic reconstruction even under adaptive querying.

Paper Readings

Dinur and Nissim (2003) — Revealing Information While Preserving Privacy.

Proves that any mechanism answering all subset-sum queries on an nn-bit database with error o(n)o(\sqrt{n}) allows efficient reconstruction of almost the entire database. The attack issues O(n)O(n) random queries, forming an overdetermined linear system whose solution approximates the private bits; the n\sqrt{n} error threshold is tight. This result is the formal justification for differential privacy: it establishes that useful statistical answers and full individual-level privacy cannot coexist, so any practically private mechanism must inject noise of order at least n\sqrt{n}.

Laplace and Exponential Mechanisms

Global Sensitivity

Global Sensitivity For a function f:𝒳nf:\mathcal{X}^n \to \mathbb{R}: Δf=maxadj x,y|f(x)f(y)|.\Delta f = \max_{\text{adj }x,y} |f(x)-f(y)|.

Sensitivity measures how much one individual’s data can change the output.

Laplace Mechanism

Laplace Mechanism The mechanism M(x)=f(x)+Lap(Δfε)M(x) = f(x) + \mathrm{Lap}\!\left(\frac{\Delta f}{\varepsilon}\right) satisfies ε\varepsilon-differential privacy.

Proof idea. For adjacent x,yx,y, the ratio of output densities is bounded: pdfM(x)(t)pdfM(y)(t)eε.\frac{\mathrm{pdf}_{M(x)}(t)}{\mathrm{pdf}_{M(y)}(t)} \le e^\varepsilon.

Interpretation

Noise scale is: sensitivity/ε.\text{sensitivity} / \varepsilon. Stronger privacy (ε\varepsilon \downarrow) means more noise.

Accuracy for a Single Query

Let YLap(Δfε)Y \sim \mathrm{Lap}\!\left(\frac{\Delta f}{\varepsilon}\right). We want Pr[|Y|α]1β\Pr[|Y| \le \alpha] \ge 1-\beta. Using the Laplace tail bound: Pr[|Y|tb]=et,b=Δfε.\Pr[|Y| \ge t \cdot b] = e^{-t}, \quad b=\frac{\Delta f}{\varepsilon}. Set t=ln(1/β)t = \ln(1/\beta), giving: α=Δfεln(1/β).\alpha = \frac{\Delta f}{\varepsilon}\ln(1/\beta).

Laplace Accuracy (Single Query) α=O(Δfεlog1β).\alpha = O\!\left(\frac{\Delta f}{\varepsilon}\log\frac{1}{\beta}\right).

High-Dimensional Laplace Mechanism

For vector-valued queries f:𝒳nkf:\mathcal{X}^n \to \mathbb{R}^k, define the 1\ell_1 sensitivity: Δ1f=maxadj x,yf(x)f(y)1.\Delta_1 f = \max_{\text{adj }x,y} \|f(x)-f(y)\|_1. For instance, if we ask simultaneously how many people are over six feet tall and how many prefer vanilla to strawberry, one person can change both counts by 1, giving 1\ell_1 sensitivity 2. In general, for kk arbitrary counting queries, one person can affect all kk counts, so Δ1f=k\Delta_1 f = k in the worst case.

The mechanism draws kk independent noise terms and adds one to each coordinate: M(x)=f(x)+(Y1,,Yk),Yii.i.d.Lap(Δ1fε).M(x) = f(x) + (Y_1,\dots,Y_k), \qquad Y_i \overset{\mathrm{i.i.d.}}{\sim} \mathrm{Lap}\!\left(\frac{\Delta_1 f}{\varepsilon}\right). The privacy proof is identical to the one-dimensional case, applied coordinate by coordinate.

Privacy depends on 1\ell_1 sensitivity, not on the dimension kk.

Accuracy for kk Queries

We want Pr[maxi|Yi|α]1β\Pr\!\left[\max_i |Y_i| \le \alpha\right] \ge 1-\beta. By a union bound: Pr[i:|Yi|α]kPr[|Y|α].\Pr[\exists\, i: |Y_i|\ge \alpha] \le k \cdot \Pr[|Y|\ge \alpha]. Setting Pr[|Y|α]β/k\Pr[|Y|\ge\alpha] \le \beta/k and solving via the Laplace tail: exp(αεΔ1f)βkα=Δ1fεln(kβ).\exp\!\left(-\frac{\alpha\varepsilon}{\Delta_1 f}\right) \le \frac{\beta}{k} \quad\Longrightarrow\quad \alpha = \frac{\Delta_1 f}{\varepsilon}\ln\!\left(\frac{k}{\beta}\right).

Laplace Accuracy (kk Queries) α=O(Δ1fεlogkβ).\alpha = O\!\left(\frac{\Delta_1 f}{\varepsilon}\log\frac{k}{\beta}\right).

Key insight

Accuracy degrades only logarithmically in the number of queries.

Histogram Queries: Sensitivity Is Always 1

A histogram query partitions the population into disjoint cells and counts how many individuals fall into each cell. Examples include:

Histogram Sensitivity No matter how many cells a histogram has, its 1\ell_1 sensitivity is 1. Adding or removing one individual changes exactly one cell count by ±1\pm 1 and leaves all other cells unchanged, because the partition ensures each individual belongs to exactly one cell.

For a histogram with kk cells: Δ1fhist=1vs.Δ1farbitrary=k.\Delta_1 f_{\mathrm{hist}} = 1 \quad\text{vs.}\quad \Delta_1 f_{\mathrm{arbitrary}} = k. The Laplace mechanism adds noise Lap(1/ε)\mathrm{Lap}(1/\varepsilon) to each cell, independent of kk.

This is one of the foremost practical advantages of DP for administrative statistics. Most government statistics — population counts by region, age, income bracket, and so on — are histograms or contingency tables (multi-dimensional histograms). All have sensitivity 1.

Choosing the right algorithm.

For a given ε\varepsilon, there are often many ε\varepsilon-DP algorithms for the same task with different accuracy. Exploiting histogram structure yields dramatically better accuracy at no privacy cost. The comparison between algorithms is always on utility, never on privacy.

Privacy Budget Interpretation

Differential privacy can be viewed as having a total budget ε\varepsilon.

Naively splitting gives ε/k\varepsilon/k per query, forcing noise k/ε\propto k/\varepsilon.

Naive composition leads to noise growing linearly in the number of queries. Advanced composition (Chapter 8) and the Gaussian mechanism (Chapter 9) reduce this to O(k)O(\sqrt{k}).

Differential Privacy vs. Cryptographic Privacy

The cryptographic setting.

A sender transmits an encrypted message. The legitimate receiver learns the plaintext; the eavesdropper learns nothing useful. These two parties are different. Modern cryptography — under standard hardness assumptions — achieves this.

The DP setting.

The data analyst is both the legitimate user and the potential adversary. We cannot simultaneously let the analyst learn something useful and prevent them from learning anything.

The fundamental law of information release

If a data analysis algorithm teaches the analyst anything useful about the population, then some information about the individuals in the dataset is necessarily leaked. This is unavoidable. The goal of DP is not to prevent leakage entirely, but to ensure it is small, calibrated, and formally bounded.

An additional subtlety: even a well-intentioned analyst who publishes results enables a later party to combine them with other analyses from the same dataset. Privacy loss accumulates over time across all users, which is why composition theorems matter.

The Exponential Mechanism

The Laplace mechanism works for real-valued outputs. But many natural outputs are discrete or categorical — the most common search query string, the best expert among a panel, the optimal auction price. Adding noise to these does not make sense.

Exponential Mechanism Let Ψ\Psi be a finite set of possible outputs, and let u:𝒳n×Ψu: \mathcal{X}^n \times \Psi \to \mathbb{R} be a utility function with sensitivity Δu=maxψΨmaxadj x,y|u(x,ψ)u(y,ψ)|.\Delta u = \max_{\psi\in\Psi}\max_{\text{adj }x,y} |u(x,\psi) - u(y,\psi)|. The exponential mechanism E\mathcal{M}_E outputs ψΨ\psi \in \Psi with probability proportional to exp(εu(x,ψ)2Δu).\exp\!\left(\frac{\varepsilon\, u(x,\psi)}{2\,\Delta u}\right).

Exponential Mechanism Is ε\varepsilon-DP E\mathcal{M}_E satisfies ε\varepsilon-differential privacy.

Proof sketch. Fix adjacent x,yx, y and any ψΨ\psi \in \Psi. Let Zx=ψeεu(x,ψ)/2ΔuZ_x = \sum_{\psi'} e^{\varepsilon u(x,\psi')/2\Delta u}. Pr[E(x)=ψ]Pr[E(y)=ψ]=eεu(x,ψ)/2ΔuZxZyeεu(y,ψ)/2Δu=eε(u(x,ψ)u(y,ψ))/2ΔuZyZx.\frac{\Pr[\mathcal{M}_E(x)=\psi]}{\Pr[\mathcal{M}_E(y)=\psi]} = \frac{e^{\varepsilon u(x,\psi)/2\Delta u}}{Z_x} \cdot \frac{Z_y}{e^{\varepsilon u(y,\psi)/2\Delta u}} = e^{\varepsilon(u(x,\psi)-u(y,\psi))/2\Delta u} \cdot \frac{Z_y}{Z_x}. The first factor is at most eε/2e^{\varepsilon/2} by definition of Δu\Delta u. For the second, each term in ZyZ_y is at most eε/2e^{\varepsilon/2} times the corresponding term in ZxZ_x, so Zy/Zxeε/2Z_y/Z_x \le e^{\varepsilon/2}. Multiplying: ratio eε\le e^{\varepsilon}. ◻

Why the factor of 2?

Adding one individual can increase the utility of some outcomes and decrease the utility of others simultaneously. The 2Δu2\Delta u denominator accounts for this: the numerator contributes at most eε/2e^{\varepsilon/2}, and the ratio of normalizing constants contributes another eε/2e^{\varepsilon/2}.

Exponential Mechanism Accuracy Let u*=maxψu(x,ψ)u^* = \max_\psi u(x,\psi) and Ψ*(x)={ψ:u(x,ψ)=u*}\Psi^*(x) = \{\psi : u(x,\psi) = u^*\}. For any Vu*V \le u^*: Pr[E(x) outputs ψ with u(x,ψ)V]|Ψ||Ψ*|eε(Vu*)/(2Δu).\Pr\bigl[\mathcal{M}_E(x)\text{ outputs }\psi\text{ with }u(x,\psi) \le V\bigr] \;\le\; \frac{|\Psi|}{|\Psi^*|}\cdot e^{\varepsilon(V - u^*)/(2\Delta u)}.

Proof sketch. Bound the numerator by the total unnormalized weight of all bad outputs, and the denominator by the weight of the optimal outputs alone: |Ψ|eεV/2Δu|Ψ*|eεu*/2Δu=|Ψ||Ψ*|eε(Vu*)/2Δu.\frac{|\Psi|\cdot e^{\varepsilon V/2\Delta u}}{|\Psi^*|\cdot e^{\varepsilon u^*/2\Delta u}} = \frac{|\Psi|}{|\Psi^*|}\cdot e^{\varepsilon(V-u^*)/2\Delta u}. ◻

Outputs far below the optimum are exponentially unlikely. This bound is a template: plug in |Ψ||\Psi|, |Ψ*||\Psi^*|, and the gap u*Vu^* - V for each application.

Limitations of Independent Noise

Laplace answers queries independently, with noise uncorrelated across queries. It cannot exploit structure shared between queries.

Better mechanisms (e.g., SmallDB, Chapter 7) introduce correlated noise to answer many queries more efficiently.

SmallDB: Nets, Exponential Mechanism, Accuracy

Motivation: Answering Exponentially Many Queries

With nn data points and Laplace noise, we can accurately answer roughly nn adaptive queries. Can we do better? Remarkably, yes: with the exponential mechanism we can answer exponentially many counting queries by releasing a synthetic database.

Setup.

We have a real database XX of nn rows and a large collection 𝒬\mathcal{Q} of counting queries. Instead of answering each query directly, we release a synthetic database X̃\tilde{X} that approximates the fractional answers to all queries in 𝒬\mathcal{Q}. The fractional query is fq(X)=1ni=1nq(xi)f_q(X) = \frac{1}{n}\sum_{i=1}^n q(x_i). We want X̃\tilde{X} such that for all q𝒬q\in\mathcal{Q}: |fq(X̃)fq(X)|α.|f_q(\tilde{X}) - f_q(X)| \le \alpha.

The SmallDB Algorithm

Outcome space.

The exponential mechanism chooses X̃\tilde{X} from the set of all small databases of size m=log|𝒬|α2,m = \left\lceil \frac{\log|\mathcal{Q}|}{\alpha^2} \right\rceil, drawn from the same universe as XX. Crucially, mm depends only on |𝒬||\mathcal{Q}| and α\alpha, not on nn.

Utility function.

For a candidate small database ψ\psi: u(X,ψ)=maxq𝒬|fq(X)fq(ψ)|.u(X, \psi) = -\max_{q \in \mathcal{Q}} |f_q(X) - f_q(\psi)|. All utilities are 0\le 0; a utility close to 0 means ψ\psi agrees well with XX on all queries.

Sensitivity.

Under the swap adjacency (replace one row of XX), each fractional query changes by at most 1/n1/n, so Δu=1/n\Delta u = 1/n.

Privacy and accuracy.

The exponential mechanism with parameter ε\varepsilon is ε\varepsilon-DP, and with high probability outputs X̃\tilde{X} within α+O(log|𝒬|nε)\alpha + O\!\left(\frac{\log|\mathcal{Q}|}{n\varepsilon}\right) of XX on all queries.

The Histogram Representation

Fix the universe 𝒳\mathcal{X} of all possible data rows with types 𝒳1,𝒳2,\mathcal{X}_1, \mathcal{X}_2, \ldots

Histogram Representation The histogram of a database XX of size nn is the vector (h1,h2,)(h_1, h_2, \ldots) where hjh_j is the number of rows in XX of type 𝒳j\mathcal{X}_j. Every database corresponds to a unique histogram (up to row order), and vice versa.

A small database of size mm corresponds to a histogram with entries summing to mm. Even if the universe has 2d2^d types, a small database of size m2dm \ll 2^d has at most mm nonzero histogram entries.

The Net Theorem and the Probabilistic Method

α\alpha-Net (w.r.t. 𝒬\mathcal{Q}) A set RR of databases is an α\alpha-net for 𝒬\mathcal{Q} if for every database XX there exists ψR\psi \in R with maxq𝒬|fq(X)fq(ψ)|α.\max_{q\in\mathcal{Q}} |f_q(X) - f_q(\psi)| \;\le\; \alpha.

Small Databases Form a Net Let 𝒬\mathcal{Q} be any finite collection of counting queries. The set RR of all databases of size m=log|𝒬|/α2m = \lceil \log|\mathcal{Q}|/\alpha^2 \rceil is an α\alpha-net for 𝒬\mathcal{Q}: every large database is within α\alpha of some element of RR.

Proof via the probabilistic method. Fix any database XX of size nn. Construct a random small database ZZ of size mm by drawing Z1,,ZmZ_1, \ldots, Z_m independently, each equal to type 𝒳j\mathcal{X}_j with probability hj/nh_j/n.

Step 1. For any q𝒬q \in \mathcal{Q}: 𝔼[q(Zi)]=jhjnq(𝒳j)=fq(X)\mathbb{E}[q(Z_i)] = \sum_j \frac{h_j}{n} \cdot q(\mathcal{X}_j) = f_q(X). So fq(Z)=1mi=1mq(Zi)f_q(Z) = \frac{1}{m}\sum_{i=1}^m q(Z_i) is an average of mm i.i.d. {0,1}\{0,1\}-valued variables with mean fq(X)f_q(X).

Step 2 (Chernoff bound). Pr[|fq(Z)fq(X)|α]2e2mα2\Pr\!\left[|f_q(Z) - f_q(X)| \ge \alpha\right] \le 2e^{-2m\alpha^2}.

Step 3 (Union bound). Pr[maxq𝒬|fq(Z)fq(X)|α]|𝒬|2e2mα2<1\Pr\!\left[\max_{q\in\mathcal{Q}}|f_q(Z)-f_q(X)|\ge\alpha\right] \le |\mathcal{Q}|\cdot 2e^{-2m\alpha^2} < 1 for m=log|𝒬|/α2m = \lceil \log|\mathcal{Q}|/\alpha^2 \rceil.

Step 4 (Probabilistic method). Since the probability of ZZ being bad is strictly less than 1, a good ZZ must exist. That ZZ lies in RR, so RR is an α\alpha-net. ◻

The Probabilistic Method

To prove that a good object exists: construct a random object, show the probability of it being bad is strictly less than 1, and conclude a good one must exist. The argument does not find the object explicitly, only guarantees its existence. This technique, popularized by Erdős, appears throughout combinatorics and theoretical CS.

Why this is surprising.

The size mm depends only on |𝒬||\mathcal{Q}| and α\alpha, completely independent of nn. No matter how large the original database, a tiny synthetic database of size mm can approximate all queries.

Accuracy of SmallDB

From the exponential mechanism accuracy theorem: d(X,Ẑ)α+1εnlog||+1εnlog(1/β),d(X,\widehat{Z}) \;\lesssim\; \alpha + \frac{1}{\varepsilon n}\log|\mathcal{R}| + \frac{1}{\varepsilon n}\log(1/\beta), where α\alpha is the net approximation error, the second term is the privacy penalty, and the third is a confidence correction.

Size of the Net

Each database in \mathcal{R} has mm rows drawn from 𝒳\mathcal{X}, so |||𝒳|m|\mathcal{R}| \approx |\mathcal{X}|^m, giving: log||mlog|𝒳|=O(log|𝒬|α2log|𝒳|).\log|\mathcal{R}| \approx m\log|\mathcal{X}| = O\!\left(\frac{\log|\mathcal{Q}|}{\alpha^2}\log|\mathcal{X}|\right).

Optimizing the Error

Plugging into the accuracy bound and balancing α\alpha against the privacy term: αlog|𝒬|log|𝒳|εnα2α3log|𝒬|log|𝒳|εnα(log|𝒬|log|𝒳|εn)1/3.\alpha \approx \frac{\log|\mathcal{Q}|\log|\mathcal{X}|}{\varepsilon n \alpha^2} \quad\Longrightarrow\quad \alpha^3 \approx \frac{\log|\mathcal{Q}|\log|\mathcal{X}|}{\varepsilon n} \quad\Longrightarrow\quad \alpha \approx \left(\frac{\log|\mathcal{Q}|\log|\mathcal{X}|}{\varepsilon n}\right)^{1/3}. The absolute error satisfies nαn2/3n\alpha \approx n^{2/3}.

SmallDB Accuracy α=O((log|𝒬|log|𝒳|εn)1/3).\alpha = O\!\left(\left(\frac{\log|\mathcal{Q}|\log|\mathcal{X}|}{\varepsilon n}\right)^{1/3}\right).

Why This Does Not Break Privacy Lower Bounds

Reconstruction theorems say: too many queries answered too accurately \Rightarrow reconstruction of the database. SmallDB avoids this because the error n2/3\approx n^{2/3} is large enough to prevent reconstruction — the noise is not too small.

Feature Dimension Warning

The accuracy bound depends on log|𝒳|\log|\mathcal{X}|. If individuals have many features, |𝒳||\mathcal{X}| grows exponentially and the error grows accordingly.

Important takeaway

DP works best when:

  • nn is large (many individuals), and

  • log|𝒳|\log|\mathcal{X}| is small (relatively few features per individual).

Comparison with Laplace

SmallDB uses correlated noise implicit in the synthetic database to answer exponentially many queries at error O(n2/3)O(n^{-2/3}), far better than Laplace’s O(k/εn)O(k/\varepsilon n) for large kk.

Advanced Composition and Privacy Loss

Motivation: Going Beyond Simple Composition

Simple composition says that kk applications of an ε\varepsilon-DP mechanism cost kεk\varepsilon in privacy. For large kk this bound is too pessimistic. Advanced composition shows the true cost scales like kε\sqrt{k}\,\varepsilon — an exponential improvement for high-query regimes.

The key insight is that privacy loss is a random variable, not a fixed constant. It can be negative, and the positive and negative losses partially cancel. The cumulative loss behaves like a biased random walk.

The Adaptive Composition Game

Advanced composition is proved via a general game that captures cumulative privacy loss across different databases and mechanisms, not just repeated queries to one database.

The game.
  1. The challenger fixes a secret bit b{0,1}b \in \{0,1\} at the start.

  2. In each round i=1,,ki = 1, \ldots, k:

    • The adversary chooses a pair of adjacent databases xi0,xi1x_i^0, x_i^1 and an ε\varepsilon-DP mechanism MiM_i (adaptively, based on all prior outputs).

    • The challenger returns yiMi(xib)y_i \sim M_i(x_i^b).

  3. After kk rounds, the adversary guesses bb.

The adversary may use a different pair of databases and a different mechanism each round. This models your cumulative privacy loss across all databases you participate in throughout your life, not just one interaction.

Privacy Loss Random Variables

Privacy Loss Random Variable For mechanism MM run on database xx, compared against adjacent database yy, the privacy loss random variable for output cc is: M(x)M(y)(c)=lnPr[M(x)=c]Pr[M(y)=c].\mathcal{L}^{(c)}_{M(x)\|M(y)} = \ln\frac{\Pr[M(x) = c]}{\Pr[M(y) = c]}. We sample this random variable by running M(x)M(x) and observing the output cc.

For an ε\varepsilon-DP mechanism: ||ε|\mathcal{L}| \le \varepsilon almost surely (this is exactly the bounded log-ratio condition).

Negative Privacy Loss and the Random Walk Intuition

When is privacy loss negative?

The loss is negative when Pr[M(x)=c]<Pr[M(y)=c]\Pr[M(x)=c] < \Pr[M(y)=c]: the observed output is more likely under the adjacent database yy than under the true database xx. Instead of giving a hint toward xx, the output points away from it, giving the adversary a false read.

The random walk picture.

Imagine your database is xx. Each mechanism output shifts the adversary’s belief slightly toward xx (positive loss) or away from it (negative loss). Since xx is the true database, outputs are somewhat more likely under xx, so the walk has a slight positive drift. But many steps go in the negative direction, partially canceling the drift. The cumulative loss after kk steps behaves like O(kε)O(\sqrt{k}\cdot\varepsilon) rather than kεk\cdot\varepsilon, just as a random walk with drift μ\mu has standard deviation O(k)O(\sqrt{k}) after kk steps.

Expected loss is O(ε2)O(\varepsilon^2), not O(ε)O(\varepsilon).

A technical lemma (proved using KL divergence properties) shows: 𝔼[M(x)M(y)(Y)]ε(eε1)ε2.\mathbb{E}[\mathcal{L}^{(Y)}_{M(x)\|M(y)}] \;\le\; \varepsilon(e^\varepsilon - 1) \;\le\; \varepsilon^2. (The improved bound ε2\varepsilon^2 without the factor of 2 was established in later work.) Since ε<1\varepsilon < 1, the expected loss per step is ε2ε\varepsilon^2 \ll \varepsilon — the positive and negative losses cancel to a much smaller residual than the worst case.

Adversary Views and Bad Views

Two parallel worlds.

Define the adversary’s view as everything it observes: its own randomness RR and all outputs y1,,yky_1, \ldots, y_k. There are two parallel versions:

Privacy fails if these two views are distinguishable.

By the chain rule of probability and the DP bound at each step: lnPr[V0=v]Pr[V1=v]=i=1ki,\ln\frac{\Pr[V^0 = v]}{\Pr[V^1 = v]} = \sum_{i=1}^k \mathcal{L}_i, where i\mathcal{L}_i is the privacy loss at step ii, conditioned on the shared history.

Bad views.

A view vv is bad if Pr[V0=v]>eε*Pr[V1=v]\Pr[V^0=v] > e^{\varepsilon^*} \Pr[V^1=v] for some target ε*\varepsilon^*. Privacy fails only when the adversary lands in a bad view. We decompose: Pr[V0S]Pr[V0 is bad]+eε*Pr[V1S]\Pr[V^0 \in S] \;\le\; \Pr[V^0 \text{ is bad}] + e^{\varepsilon^*} \Pr[V^1 \in S] for any set SS. If the probability of a bad view is at most δ\delta, the mechanism is (ε*,δ)(\varepsilon^*, \delta)-DP.

Applying Azuma–Hoeffding

The privacy losses 1,,k\mathcal{L}_1, \ldots, \mathcal{L}_k form a martingale difference sequence: each is bounded |i|ε|\mathcal{L}_i| \le \varepsilon, and 𝔼[i1,,i1]ε2\mathbb{E}[\mathcal{L}_i \mid \mathcal{L}_1,\ldots,\mathcal{L}_{i-1}] \le \varepsilon^2. The Azuma–Hoeffding inequality applies to exactly this setting:

Pr[i=1ki>kε2+tεk]et2/2.\Pr\!\left[\sum_{i=1}^k \mathcal{L}_i > k\varepsilon^2 + t\varepsilon\sqrt{k}\right] \;\le\; e^{-t^2/2}.

Setting t=2ln(1/δ)t = \sqrt{2\ln(1/\delta)} gives the right-hand side equal to δ\delta, and:

Advanced Composition for Pure DP For every δ>0\delta > 0, the adaptive composition of kk mechanisms each satisfying ε\varepsilon-DP satisfies (ε*,δ)(\varepsilon^*, \delta)-DP, where: ε*=2kln(1/δ)ε+kε(eε1).\varepsilon^* = \sqrt{2k\ln(1/\delta)}\cdot\varepsilon + k\varepsilon(e^\varepsilon - 1). For small ε\varepsilon, the dominant term is O(kln(1/δ)ε)O\!\left(\sqrt{k\ln(1/\delta)}\cdot\varepsilon\right), compared to the naive kεk\varepsilon of simple composition.

Optimal privacy budget.

Equating the two terms and solving for ε\varepsilon as a function of kk: choosing ε1/k\varepsilon \approx 1/\sqrt{k} minimizes the total privacy loss for a fixed number of queries.

Approximate Differential Privacy and the Gaussian Mechanism

Motivation: The Limits of Pure DP

All the mechanisms we have seen so far satisfy pure ε\varepsilon-differential privacy: for all adjacent x,yx,y and all events SS, Pr[M(x)S]eεPr[M(y)S]\Pr[M(x)\in S] \le e^\varepsilon \Pr[M(y)\in S]. This is a worst-case, information-theoretic guarantee.

The ubiquitous Gaussian distribution — beloved in statistics for its tail concentration and its connection to least-squares estimation — cannot satisfy this guarantee. Accommodating Gaussian noise requires a relaxed definition.

Why Gaussian Noise Does Not Give Pure DP

The natural question is: why use Laplace noise rather than Gaussian noise? Gaussian noise is familiar, analytically convenient, and has lighter tails. The answer is that Gaussian noise cannot satisfy pure ε\varepsilon-DP.

The log-ratio argument.

Pure ε\varepsilon-DP requires the log-ratio lnpX(c)pY(c)\ln\frac{p_X(c)}{p_Y(c)} to be bounded by ε\varepsilon for all outputs cc and all adjacent X,YX, Y. For the Laplace distribution, this ratio is bounded everywhere because the PDF decays exponentially and the ratio of two shifted Laplace PDFs converges to a fixed constant. For the Gaussian 𝒩(f(X),σ2)\mathcal{N}(f(X), \sigma^2) vs. 𝒩(f(Y),σ2)\mathcal{N}(f(Y), \sigma^2): lnpf(X)(c)pf(Y)(c)=(cf(Y))2(cf(X))22σ2=(f(X)f(Y))(2cf(X)f(Y))2σ2.\ln\frac{p_{f(X)}(c)}{p_{f(Y)}(c)} = \frac{(c - f(Y))^2 - (c - f(X))^2}{2\sigma^2} = \frac{(f(X)-f(Y))(2c - f(X) - f(Y))}{2\sigma^2}. This is linear in cc and grows without bound as c±c \to \pm\infty. No finite ε\varepsilon can bound the log-ratio over all outputs.

Key fact

Gaussian noise gives (ε,δ)(\varepsilon, \delta)-DP (approximate DP) for appropriate parameters, but never pure ε\varepsilon-DP for any finite ε\varepsilon.

2\ell_2 Sensitivity

2\ell_2 Sensitivity The 2\ell_2 sensitivity of a function f:𝒳nkf : \mathcal{X}^n \to \mathbb{R}^k is: Δ2f=maxadjacent x,yf(x)f(y)2.\Delta_2 f = \max_{\text{adjacent } x, y} \|f(x) - f(y)\|_2.

Comparison to 1\ell_1 sensitivity.

For kk counting queries (each output coordinate is a fraction in [0,1][0,1]):

Since kk\sqrt{k} \ll k for large kk, the Gaussian mechanism can add far less noise than Laplace for high-dimensional queries — at the cost of the pure-DP guarantee.

Approximate (ε,δ)(\varepsilon,\delta)-Differential Privacy

We relax the pure DP guarantee by allowing a small additive failure probability δ\delta.

(ε,δ)(\varepsilon,\delta)-Differential Privacy (Approximate DP) A randomized mechanism MM satisfies (ε,δ)(\varepsilon,\delta)-differential privacy if for all pairs of adjacent databases x,yx,y and all measurable events SS: Pr[M(x)S]eεPr[M(y)S]+δ.\Pr[M(x)\in S] \;\le\; e^\varepsilon\,\Pr[M(y)\in S] \;+\; \delta. The special case δ=0\delta=0 recovers pure ε\varepsilon-DP.

Interpretation.

With probability at most δ\delta, the mechanism may “fail” — the ratio of output probabilities on adjacent databases may exceed eεe^\varepsilon. On the remaining 1δ1-\delta probability mass, the standard eεe^\varepsilon bound holds.

Quantifier order: pure vs. approximate.

There is a subtle but important difference:

Pure DP is strictly stronger. In practice, approximate DP is widely used because it enables the Gaussian mechanism and better composition bounds.

How Small Must δ\delta Be?

The insurance argument: why delta = 1/n is not safe

Consider the following “mechanism” on a database of size nn: select one uniformly random individual and publish their complete record. This satisfies (0,1/n)(0,\,1/n)-DP, yet it explicitly exposes one person’s data with probability 1/n1/n.

From any single person’s perspective, their chance of exposure is small. But consider an insurer covering the database operator against privacy-loss claims: this mechanism generates a privacy breach every single time it is run, and the insurer must pay damages on every run.

Rule of thumb. δ\delta should be cryptographically small: decaying faster than the inverse of any polynomial in nn. Values like δ=n2\delta = n^{-2} or smaller are considered acceptable in practice.

2\ell_2 Sensitivity

The Gaussian mechanism adds noise calibrated to the 2\ell_2 sensitivity, which can be substantially smaller than the 1\ell_1 sensitivity used by Laplace.

2\ell_2 Sensitivity For f:𝒳nkf:\mathcal{X}^n\to\mathbb{R}^k, the 2\ell_2 sensitivity is Δ2f=maxadj x,yf(x)f(y)2.\Delta_2 f \;=\; \max_{\text{adj }x,\,y} \|f(x)-f(y)\|_2.

Comparison for counting queries.

For kk arbitrary counting queries, adding or removing one individual can change each count by at most 1, so f(x)f(y)f(x)-f(y) has at most kk nonzero entries each in {1,0,1}\{-1,0,1\}.

For kk arbitrary counting queries: Δ1f=k,Δ2f=k.\Delta_1 f = k, \qquad \Delta_2 f = \sqrt{k}. The 2\ell_2 sensitivity is smaller by a factor of k\sqrt{k}.

The Gaussian Mechanism

Gaussian Mechanism Let f:𝒳nkf:\mathcal{X}^n\to\mathbb{R}^k. For privacy parameters ε,δ>0\varepsilon,\delta > 0, the Gaussian mechanism releases M(x)=f(x)+(Y1,,Yk),Yii.i.d.𝒩(0,σ2),M(x) \;=\; f(x) + (Y_1,\ldots,Y_k), \qquad Y_i \;\overset{\mathrm{i.i.d.}}{\sim}\; \mathcal{N}(0,\,\sigma^2), where σ=Δ2f2ln(1.25/δ)ε.\sigma \;=\; \frac{\Delta_2 f \cdot \sqrt{2\ln(1.25/\delta)}}{\varepsilon}.

Gaussian Mechanism Privacy With σ\sigma as defined above, the Gaussian mechanism satisfies (ε,δ)(\varepsilon,\delta)-differential privacy.

Why 2\ell_2 sensitivity?

The mechanism adds independent Gaussian noise of the same variance to each coordinate. The privacy loss depends on f(x)f(y)2\|f(x)-f(y)\|_2: the 2\ell_2 distance between the outputs on adjacent databases. Calibrating σ\sigma to Δ2f\Delta_2 f ensures coverage of the worst-case pair.

Accuracy of the Gaussian Mechanism

For a single coordinate Yi𝒩(0,σ2)Y_i\sim\mathcal{N}(0,\sigma^2), standard Gaussian tail bounds give Pr[|Yi|tσ]2et2/2.\Pr[|Y_i|\ge t\sigma] \;\le\; 2e^{-t^2/2}. Applying a union bound over all kk coordinates:

Gaussian Accuracy (kk Queries) With probability at least 1β1-\beta, the Gaussian mechanism satisfies max1ik|M(x)if(x)i|=O(Δ2fεlnkβln1δ).\max_{1\le i\le k}|M(x)_i - f(x)_i| \;=\; O\!\left(\frac{\Delta_2 f}{\varepsilon}\sqrt{\ln\!\frac{k}{\beta}\cdot\ln\!\frac{1}{\delta}}\right).

Laplace vs. Gaussian: A Comparison

For kk arbitrary counting queries (so Δ1f=k\Delta_1 f = k, Δ2f=k\Delta_2 f = \sqrt{k}):

Laplace Gaussian
Privacy guarantee Pure ε\varepsilon-DP (ε,δ)(\varepsilon,\delta)-DP
Noise scale Δ1f/ε\Delta_1 f / \varepsilon Δ2fln(1/δ)/ε\Delta_2 f \cdot \sqrt{\ln(1/\delta)}/\varepsilon
Savings for kk queries factor k\sqrt{k}
Queries must be fixed? No (online) No (online)

Gaussian noise scales like k/ε\sqrt{k}/\varepsilon instead of k/εk/\varepsilon, matching the improvement from advanced composition — but at the cost of approximate rather than pure DP.

Connection to Advanced Composition

Advanced composition and the Gaussian mechanism both exploit the same phenomenon: with high probability, privacy loss accumulates like O(kε)O(\sqrt{k}\,\varepsilon), not kεk\varepsilon.

Unified picture: square-root savings
  • Advanced composition (pure DP): Run kk mechanisms each ε\varepsilon-DP. Cumulative loss is O(kln(1/δ)ε)O\!\left(\sqrt{k\ln(1/\delta)}\,\varepsilon\right) with probability 1δ1-\delta.

  • Gaussian mechanism (approximate DP): Answer kk queries with 2\ell_2-calibrated noise. Error per query scales like k/ε\sqrt{k}/\varepsilon.

Both results pay a small failure probability δ\delta in exchange for a k\sqrt{k} improvement over the naive kεk\varepsilon bound. In both cases δ\delta should be cryptographically small.

Sparse Vector and Private Multiplicative Weights

Motivation: Answering Many Queries Cheaply

So far every mechanism we have studied pays a privacy cost proportional to the number of queries answered. Sequential composition says kk queries each at privacy level ε\varepsilon costs kεk\varepsilon total. Can we do better when most queries have values that fall below a threshold?

The key observation: reporting that an answer is below a threshold is cheap. If a verifier only needs to know which queries are above a threshold TT, we can inspect many queries privately while paying full privacy cost only for the ones we actually reveal.

The Sparse Vector Technique

Above-Threshold (Sparse Vector) Given a sequence of sensitivity-1 queries q1,q2,q_1, q_2, \ldots on dataset xx, a threshold TT, a count limit cc, and privacy parameter ε\varepsilon:

  1. Sample a noisy threshold T̂T+Lap(2ε)\hat{T} \leftarrow T + \mathrm{Lap}\!\left(\tfrac{2}{\varepsilon}\right).

  2. For each query qiq_i:

    • Sample νiLap(4cε)\nu_i \leftarrow \mathrm{Lap}\!\left(\tfrac{4c}{\varepsilon}\right).

    • If qi(x)+νiT̂q_i(x) + \nu_i \geq \hat{T}: output \top, decrement cc.

    • Else: output \bot.

    • Halt when c=0c = 0.

SVT Privacy Above-Threshold satisfies ε\varepsilon-differential privacy.

Proof sketch.

The crucial insight is that \bot outputs reveal essentially nothing about xx: saying “this query is below the noisy threshold” is a statement about noise, not data. The formal argument proceeds by noting that:

A coupling argument over adjacent x,yx, y bounds the log-likelihood ratio by ε\varepsilon.

Key insight

We may privately inspect arbitrarily many candidate queries but pay full privacy cost only for the (at most cc) queries that cross the threshold. Rejections are “free” in the privacy budget. This mirrors the logic of Report Noisy Max: the mechanism compresses its output, and the privacy analysis exploits that compression.

Accuracy.

If a query qiq_i satisfies qi(x)T+αq_i(x) \geq T + \alpha (well above threshold), it is reported \top with high probability; if qi(x)Tαq_i(x) \leq T - \alpha (well below), it is reported \bot with high probability. The error probability for a single query is eΩ(αε/c)e^{-\Omega(\alpha \varepsilon / c)}, so for c=O(1)c = O(1) and mm queries, the overall error is small when α=O(cεlogm)\alpha = O\!\left(\tfrac{c}{\varepsilon} \log m\right).

Application: private query release.

If an analyst submits queries one at a time and only cares which ones are significant (above threshold), SVT answers all of them at the same privacy cost as answering cc individually. This is useful when the “interesting” queries are sparse among a large pool of candidates.

Private Multiplicative Weights (PMW)

Sparse vector tells us which queries are significant; Private Multiplicative Weights uses those answers to build a synthetic database that answers future queries accurately.

Setting.

We have a true dataset xx over a universe 𝒰\mathcal{U} of records, and we want to maintain a candidate distribution 𝒛\mathbf{z} over 𝒰\mathcal{U} such that for any future linear query qq, q(𝒛)q(x)q(\mathbf{z}) \approx q(x).

Algorithm.

Initialize 𝒛(0)\mathbf{z}^{(0)} to the uniform distribution over 𝒰\mathcal{U}. At each round tt:

  1. The analyst submits query qtq_t.

  2. If |qt(𝒛(t))qt(x)|α|q_t(\mathbf{z}^{(t)}) - q_t(x)| \leq \alpha (small error): output the noisy answer and do not update (𝒛(t+1)=𝒛(t)\mathbf{z}^{(t+1)} = \mathbf{z}^{(t)}).

  3. Otherwise (significant mistake): update via multiplicative weights: 𝒛u(t+1)𝒛u(t)exp(ηqt(u)sgn(qt(𝒛(t))qt(x))),\mathbf{z}^{(t+1)}_u \;\propto\; \mathbf{z}^{(t)}_u \cdot \exp\!\Bigl(-\eta\, q_t(u) \cdot \mathrm{sgn}\bigl(q_t(\mathbf{z}^{(t)}) - q_t(x)\bigr)\Bigr), where η>0\eta > 0 is a learning rate. This multiplicatively downweights records uu that contribute to the mistake.

Potential function analysis.

Define the potential Φt=KL(x𝒛(t))=uxulnxu𝒛u(t)0.\Phi_t \;=\; \mathrm{KL}\!\left(x \,\|\, \mathbf{z}^{(t)}\right) \;=\; \sum_{u} x_u \ln \frac{x_u}{\mathbf{z}^{(t)}_u} \;\geq\; 0. Two facts drive the analysis:

PMW Convergence The number of significant updates (rounds in which the algorithm updates 𝒛\mathbf{z}) is at most T*=O(ln|𝒰|η2).T^* \;=\; O\!\left(\frac{\ln|\mathcal{U}|}{\eta^2}\right).

Proof.

Each significant mistake means |qt(𝒛(t))qt(x)|>α|q_t(\mathbf{z}^{(t)}) - q_t(x)| > \alpha, which causes Φt\Phi_t to drop by at least ηαO(η2)\eta\alpha - O(\eta^2) (by a Taylor expansion of ln\ln after the multiplicative update, setting η=α/2\eta = \alpha / 2). Since Φt0\Phi_t \geq 0 and Φ0ln|𝒰|\Phi_0 \leq \ln|\mathcal{U}|, there can be at most ln|𝒰|/(ηαO(η2))=O(ln|𝒰|/η2)\ln|\mathcal{U}| / (\eta\alpha - O(\eta^2)) = O(\ln|\mathcal{U}|/\eta^2) such drops.

Privacy.

Each significant round uses one noisy answer (via the Laplace mechanism at scale O(1/(εn))O(1/(\varepsilon n))) to decide whether to update. By the convergence theorem, only T*T^* such answers are ever used, so the total privacy cost is T*ε0T^* \cdot \varepsilon_0 for a per-query budget ε0\varepsilon_0. Choosing ε0=ε/T*\varepsilon_0 = \varepsilon / T^* gives ε\varepsilon-DP overall.

Accuracy.

After the synthetic database stabilizes (no more significant updates), it answers any query in the query class to within error α\alpha. Setting α=O(ln|𝒰|/n)\alpha = O(\sqrt{\ln|\mathcal{U}|} / \sqrt{n}) and the noise scale accordingly gives:

PMW Accuracy For any class 𝒬\mathcal{Q} of linear queries, PMW with appropriate parameters outputs a synthetic database 𝒛\mathbf{z} such that maxq𝒬|q(𝒛)q(x)|=O((ln|𝒰|)1/2n1/2)\max_{q \in \mathcal{Q}} \bigl|q(\mathbf{z}) - q(x)\bigr| \;=\; O\!\left(\frac{(\ln|\mathcal{U}|)^{1/2}}{n^{1/2}}\right) with high probability, under ε\varepsilon-differential privacy.

SVT + PMW together

Sparse Vector and PMW are complementary. SVT identifies which queries the current hypothesis answers badly (using privacy budget only for those). PMW uses those bad queries to update the hypothesis. Together they implement a private boosting loop: repeatedly find a hard query, update the synthetic data, repeat — until no hard query remains. This is the essence of the SmallDB algorithm (Chapter 7).

Paper Readings

Dwork, Naor, Reingold, Rothblum, Vadhan (2009) — On the Complexity of Differentially Private Data Release.

Introduces the Sparse Vector Technique as a tool for answering many queries while charging privacy cost only for those whose answers cross a significance threshold. The main result characterizes when private data release with low error is computationally feasible, and shows that restricting to above-threshold queries dramatically reduces the effective privacy cost relative to answering everything. The SVT mechanism analyzed in this chapter is a direct instantiation of these ideas.

Hardt and Rothblum (2010) — A Multiplicative Weights Mechanism for Privacy-Preserving Data Analysis.

Shows that the private multiplicative weights algorithm achieves near-optimal accuracy for releasing all linear queries over a data universe under differential privacy. The key insight is a potential function argument: the KL divergence from the true data distribution to the current synthetic hypothesis decreases by a fixed amount per significant update, bounding the total number of corrective rounds by O(log|𝒰|/η2)O(\log|\mathcal{U}|/\eta^2). This gives the first efficient differentially private synthetic data generator with provable accuracy guarantees for an exponentially large query class.

The US Census, Reconstruction, and Why DP Was Needed

Origin Story

When Cynthia Dwork and colleagues began thinking about privacy for statistical analysis of large datasets around 2001, the model they had in mind was the US Census. The Census is a great cause: it counts the population, determines political representation, and allocates hundreds of billions of dollars in federal funds—with no commercial interest involved. Crucially, unlike most data holders, the Census Bureau is legally mandated to protect confidentiality, providing a genuine customer for rigorous mathematical privacy guarantees.

The connection between differential privacy and the Census developed over several years. Adam Smith (later a co-inventor of DP) was among the early collaborators who recognized that the Bureau’s existing confidentiality methods—while well-intentioned—could not withstand the kind of reconstruction attacks that were becoming computationally feasible. In 2017, the Bureau carried out internal reconstruction tests, confirmed that their prior methods were insufficient, and decided to modernize using differential privacy. The 2020 decennial census was the result.

Why the Census Matters

The decennial census is a constitutionally mandated enumeration of all people—not just citizens—living in the United States. Its outputs drive:

Marginalized populations—undocumented immigrants, people experiencing homelessness, communities with historical distrust of government—are systematically harder to enumerate. States that invest more in outreach get more accurate (and advantageous) counts.

What the Census Collects

The 2020 decennial census form collected, for each person in each household:

What counts as a “race” on the Census form is explicitly political and has changed dramatically over time—Jews and Italians have at various points been proposed as separate races. Race is always self-identification; people change their declared race between censuses, and the Bureau does not challenge such changes.

The Census is governed by Title 13 of the US Code, which imposes strict confidentiality obligations:

Title 13 protections (key provisions)
  • Every Census Bureau employee takes a lifetime oath of confidentiality—binding even after leaving the Bureau.

  • Penalties: disclosing any personal information carries up to five years in prison, a $250,000 fine, or both.

  • Census data may not be shared with any other part of government for law enforcement or any non-statistical purpose. (This was enacted after the WWII internment of Japanese Americans, in part enabled by Census data.)

  • The Secretary of Commerce may publish statistics (tabulations) but not anything that “discloses the information reported by or on behalf of any particular respondent.”

  • “In no case shall information furnished be used to the detriment of any respondent.”

Because responding to the Census is legally required, confidentiality protections are essential for encouraging accurate responses, especially from people who fear the government. The Bureau does not do law enforcement; even people who are breaking the law should feel safe in reporting their true situation.

Why Privacy Harms Are Real

  1. Section 8 housing eviction. Federal housing leases specify maximum household occupancy. If Census data reveals that a household has more occupants than their lease permits, the family could be evicted and become homeless—a direct, concrete harm from privacy compromise.

  2. Legal prosecution. A family reports a 13-year-old girl where a prior census recorded a 3-year-old boy. In states where supporting gender re-identification is illegal, this could result in prosecution.

  3. Doxing and harassment. Even if your neighbors know your household is a same-sex couple, a compiled national list of gay households is qualitatively different from distributed local knowledge. Information known in a distributed fashion has different safety implications than information in a centralized, searchable list that could be weaponized.

The Bureau’s own rules: responses cannot be used to the detriment of any respondent. Each example above is a case where published statistics could, via reconstruction, be used to harm the very people who trusted the Bureau with their data.

Census Geography

The Bureau’s fundamental geographic unit is the census block—the smallest unit, ranging from zero to roughly 2,000 inhabitants (the density of a city block). The Bureau uses the analogy of pixels: it is acceptable to blur the pixels a little, as in an Impressionist painting—when you step back, you still see the correct picture.

Blocks aggregate upward in a hierarchy: BlockBlock GroupCensus TractCountyStateDivisionRegion\text{Block} \to \text{Block Group} \to \text{Census Tract} \to \text{County} \to \text{State} \to \text{Division} \to \text{Region} Additional overlapping geographic entities—zip code tabulation areas, school districts, voting districts—are also constructed from block-level data. American Indian, Alaska Native, and Native Hawaiian areas have their own separate spine because these communities cross state boundaries and have very small populations that require special handling.

The Old Method: Record Swapping

Before differential privacy, the 2010, 2000, and 1990 censuses used a method called record swapping:

  1. Identify “at-risk” households—those that stand out in their neighborhood (racial minorities in a non-diverse block, unusually large households, same-sex couples in an area without others like them, etc.).

  2. Find a “match” household elsewhere in the country that agrees on total population and voting-age population.

  3. Swap all the detailed records between the two households.

The exact algorithm was secret, may not have been fully algorithmic, and was not applied uniformly across demographic groups. The swapped dataset—the “100% data file”—was treated as the Bureau’s official reference, and all tabulations were computed from it.

The problem.

The swapping rate was low (typically a small fraction of households), which means the 100% data file was very close to the original Census Edited File (CEF). And as we will see next, no amount of swapping could protect against reconstruction from the sheer volume of statistics released.

Scale of the 2010 Census Release

From the 2010 census, the Bureau published:

This is a massive collection of accurate, fine-grained aggregate counts with essentially no noise added for privacy.

The Reconstruction Attack

The Bureau’s internal team (later published in 2025 after security clearance) showed that published statistics could reconstruct the 100% data file.

BEARS fields.

The attack focused on five fields (the acronym BEARS): Block, Ethnicity, Age, Race, Sex. Each individual can be characterized by their combination of BEARS values—their “person type.”

The reconstruction procedure.
  1. From the published tabulations, extract the count of each BEARS person-type in each block. This yields a large system of linear/integer constraints that any consistent microdata set must satisfy.

  2. Feed the constraints to a commercial integer program solver to reconstruct a candidate dataset X̂\hat{X} consistent with the published statistics.

  3. The reconstructed dataset X̂\hat{X} is called the Reconstructed 100% Data File (RHDF).

Solution variability.

The solver may find multiple solutions. The attackers exploited this by solving a second integer program: given the published solution, find the dataset ZZ maximizing distance from it—but the true dataset is also a valid solution. If this maximum distance is small, the true dataset cannot be far from the reconstruction. The attacker can certify how accurate the attack was using only public information.

In practice, most blocks had only one solution consistent with the published statistics, meaning the published data uniquely determined individual-level BEARS information for most people.

Re-identification.

Once BEARS fields are reconstructed, the attacker links the reconstructed dataset to commercial databases (voter rolls, credit records, etc.) that share block, age, race, and sex. Reconstruction followed by re-identification is then trivial.

Connection to the Fundamental Law

This attack is exactly the Fundamental Law of Information Recovery (Chapter 5) in action. The Bureau released overly accurate answers to far too many statistics—86 billion at the block level alone. By the Dinur–Nissim reconstruction theorem, this was blatantly non-private, regardless of the swapping applied beforehand. The Bureau knew about the 2003 reconstruction theorem before the 2010 census; the techniques to exploit it had simply become faster and cheaper.

The lawyers’ reaction.

When the Bureau’s statisticians and computer scientists presented these findings, the lawyers asked: “Can we retract the 2010 Census publications?” The data were already on the public web and could not be clawed back. The lawyers concluded: “We can’t do this again.” The Bureau’s argument to itself: the distinction between publishing microdata (protected by subsampling) and publishing tabular statistics (no explicit protection) is not justified. From enough accurate tabulations, one can reconstruct microdata without any sampling secrecy.

Why Swapping Was Not Enough

The Bureau’s own argument: since the RHDF closely reproduced the 100% data file (post-swapping), and the 100% data file was already very close to the original CEF (swapping was low-rate), the reconstruction was essentially recovering the true census microdata. The Bureau decided this violated its own confidentiality mandate.

No amount of swapping can protect against reconstruction when the number of published statistics exceeds the effective entropy of the dataset.

Concentrated Differential Privacy

The scale of the Census—billions of statistics, millions of geographic units, tight accuracy requirements for redistricting—motivated a variant of differential privacy called concentrated differential privacy.

Motivation.

Recall from advanced composition (Chapter 8): to achieve (ε,δ)(\varepsilon,\delta)-DP over kk mechanisms, each individual mechanism must use noise of order ε/(kln(1/δ))\varepsilon / (\sqrt{k \ln(1/\delta)}). The ln(1/δ)\sqrt{\ln(1/\delta)} factor is annoying: when δ\delta must be cryptographically small, this factor can be as large as 10, forcing 10×\times more noise.

The key insight: the εδ\varepsilon\delta guarantee is itself probabilistic. Why require each building block to never exceed ε/(kln1/δ)\varepsilon/(\sqrt{k}\sqrt{\ln 1/\delta})? If in expectation each step contributes ε/k\varepsilon/\sqrt{k}, and the excess cancels out, we get the same asymptotic behavior without the ln1/δ\sqrt{\ln 1/\delta} penalty.

Definition.

Informally, concentrated differential privacy (CDP) requires that the privacy loss random variable \mathcal{L} behaves like a Gaussian: k:Pr[>kε]eΘ(k2).\forall k:\quad \Pr[\mathcal{L} > k\varepsilon] \;\le\; e^{-\Theta(k^2)}. This is exactly the tail behavior of a Gaussian distribution—hence “concentrated.”

Why Gaussian noise achieves CDP

Adding noise from 𝒩(0,σ2)\mathcal{N}(0, \sigma^2) makes the privacy loss random variable itself sub-Gaussian with mean proportional to σ2\sigma^{-2}. This is why the Gaussian mechanism naturally fits the CDP framework.

Zero-concentrated DP (zCDP).

Dwork and Rothblum introduced an initial version of CDP. Bun and Steinke later introduced zero-concentrated differential privacy (zCDP), using a slightly different characterization of sub-Gaussian random variables that achieves exact closure under post-processing. zCDP is the variant used in the 2020 Census.

Practical benefit.

Under zCDP, composing kk mechanisms eliminates the ln(1/δ)\sqrt{\ln(1/\delta)} overhead entirely. For the Census, where δ\delta must be extremely small, this represents a factor of up to 10×10\times reduction in the noise that must be added—a massive accuracy gain for redistricting.

The Lawsuits: Why 16 States Sued

Following the Census Bureau’s adoption of differential privacy for the 2020 decennial census, sixteen states—predominantly Republican-led—brought suit, arguing that DP produced unreliable data. The stated technical argument:

“Because differential privacy creates false information by design, it prevents the states from accessing municipal-level information crucial to performing this essential government function.”

A few observations on this argument:

State-level counts are preserved.

Differential privacy in the 2020 Census (the TopDown algorithm) preserves exact state-level population totals, which are the constitutional basis for House apportionment and electoral college votes. DP noise is applied only at finer geographic levels. Any accuracy concerns about redistricting must be weighed against the accuracy gains from having a mathematically rigorous, auditable guarantee, versus the old swapping method whose error was uncharacterized and secret.

Paper Readings

Abowd et al. (2025) — The 2010 Census Confidentiality Protection Evaluation.

Using only publicly released 2010 Census tabulations, the authors reconstructed the BEARS fields (block, ethnicity, age, race, sex) for essentially all individuals in the 100% data file, then linked the reconstruction to commercial databases to re-identify a large fraction of the population. The paper was classified for years due to its sensitivity and released only after the 2020 Census was finalized; it provided the definitive technical justification for the Bureau’s adoption of differential privacy.

Abowd et al. (2022) — The 2020 Census Disclosure Avoidance System.

Full specification of the TopDown algorithm used in the 2020 Census: a hierarchical allocation of a global zCDP privacy budget that processes the geographic hierarchy from nation down to census block, using integer programming at each level to ensure consistency of counts across geographic units. The algorithm and its code are publicly available on GitHub, and it was tested against 2010 data during an extended public comment period — allowing affected communities, including Native American tribes whose geographic units cross state lines, to advocate for changes in budget allocation before the 2020 enumeration.

DP Protects Against Overfitting

Friedman’s Paradox

Consider a standard regression setting. We have a design matrix Xn×dX \in \mathbb{R}^{n \times d} where each row is an observation (a person) and each column is a feature. We observe an outcome vector YnY \in \mathbb{R}^n and believe it satisfies Y=Xβ+εY = X\beta + \varepsilon for some true weight vector β\beta and small noise ε\varepsilon. A natural data-analysis workflow is:

  1. Fit β\beta by minimizing ε\|\varepsilon\|.

  2. Inspect the coefficients: drop features whose fitted weight is near zero (“clearly irrelevant”).

  3. Refit the equation on the remaining features and report a clean model.

This seems entirely reasonable. Friedman’s paradox shows it is catastrophically wrong.

The setup.

Let every entry of XX be an independent draw from 𝒩(0,1)\mathcal{N}(0,1), and let YY also be a vector of independent 𝒩(0,1)\mathcal{N}(0,1) draws. There is no real relationship between XX and YY whatsoever.

The problem.

Even so, the procedure above finds “significant” predictive features. The reason is anti-concentration: by ordinary sampling variation, some features will, purely by accident, be slightly further from their expected value than others. The procedure selects those accidentally-extreme features and then declares victory — but the relationship is a statistical fluke, not a real signal.

Formally: we are implicitly taking the maximum over many random variables. The maximum of dd i.i.d. mean-zero variables is not mean-zero; it is Θ(logd)\Theta(\sqrt{\log d}). By keeping only the features with large fitted weights, we are conditioning on a high-probability event of the noise, then treating the conditioned noise as signal.

Key insight

The methodological error is adaptive feature selection: the decision of which features to keep is made by looking at the data, and then the same data are used to evaluate the selected features. This is a form of double-dipping.

Exploratory vs. Adaptive Data Analysis

In statistics, the general practice of “looking around in the data for a signal before deciding what to ask” is called exploratory data analysis (EDA). It is ubiquitous and has no universally accepted principled remedy.

In computer science the same phenomenon goes by a different name: adaptive data analysis. The analyst adapts the next question to the answers received so far. This dependence between queries and the data set is the root cause of overfitting.

Why naivety and malice are indistinguishable.

Friedman’s paradox shows that a completely well-intentioned analyst using a standard procedure can produce results indistinguishable from deliberate data manipulation. We therefore cannot rely on the good intentions of analysts when designing statistical methodology: we must build defenses that are robust even against the worst case.

Overfitting, formally.

Overfitting A predictor, classifier, or hypothesis overfits if it identifies a pattern that is specific to the data set used to find it and does not generalize to the distribution from which that data set was drawn.

Concretely: if a trained classifier achieves 95% accuracy on the training set but only 55% accuracy on fresh draws from the same distribution, it has overfit. The training effort was wasted; the model learned noise, not signal.

The Accuracy Adversary

We formalize the problem by defining an adversary whose sole goal is to cause overfitting.

Setup.

Fix a universe 𝒳\mathcal{X}, a distribution 𝒟\mathcal{D} on 𝒳\mathcal{X}, a data set X=(x1,,xn)X = (x_1,\ldots,x_n) drawn i.i.d. from 𝒟\mathcal{D}, and a class 𝒬\mathcal{Q} of counting queries: functions q:𝒳{0,1}q : \mathcal{X} \to \{0,1\}.

For a query qq define: μ̂(q,X)=1ni=1nq(xi)(empirical mean on X)μ(q)=𝔼z𝒟[q(z)](true distributional mean).\hat{\mu}(q, X) = \frac{1}{n}\sum_{i=1}^n q(x_i) \qquad\text{(empirical mean on }X\text{)} \qquad \mu(q) = \mathop{\mathbb{E}}_{z \sim \mathcal{D}}[q(z)] \qquad\text{(true distributional mean)}.

Accuracy Adversary The accuracy adversary is a computationally unbounded algorithm 𝒜\mathcal{A} that interacts adaptively with a mechanism MM operating on XX. Its goal is to find a query q𝒬q \in \mathcal{Q} such that |μ̂(q,X)μ(q)|>τ,\bigl|\hat{\mu}(q,X) - \mu(q)\bigr| > \tau, i.e., to find a query for which the data set XX is not τ\tau-representative of the population. The threshold τ>0\tau > 0 is a parameter chosen by the analyst (e.g., τ=0.03\tau = 0.03 corresponds to a polling accuracy of ±3%\pm 3\%).

The adversary is modeled as purely malicious for the same reason cryptographic security definitions assume the worst-case attacker: it makes the guarantee unconditional. An honest-but-naive analyst is captured as a special case.

Non-Adaptive Baseline: Chernoff Bound

If the queries are fixed before the data set is collected (non-adaptive), standard concentration bounds already give strong guarantees.

Non-Adaptive Accuracy (Chernoff Bound) For any fixed query qq and data set XX of size nn drawn i.i.d. from 𝒟\mathcal{D}: Pr[|μ̂(q,X)μ(q)|>τ]2e2nτ2.\Pr\bigl[|\hat{\mu}(q,X) - \mu(q)| > \tau\bigr] \;\le\; 2e^{-2n\tau^2}. By a union bound over mm fixed queries, to ensure that all mm queries are simultaneously τ\tau-accurate with probability 1β\ge 1-\beta, it suffices to have n=O(log(m/β)τ2).n = O\!\left(\frac{\log(m/\beta)}{\tau^2}\right). This grows only logarithmically in the number of queries.

The key word is “fixed in advance.” This guarantee fails completely if queries are chosen adaptively based on answers to previous queries.

The Killer Query

To see why adaptivity destroys non-adaptive accuracy guarantees, suppose the adversary has somehow learned the data set XX exactly. Define: q*(z)={1zX0zX.q^*(z) = \begin{cases} 1 & z \in X \\ 0 & z \notin X. \end{cases}

Then: μ̂(q*,X)=1(every element of X maps to 1)\hat{\mu}(q^*, X) = 1 \qquad\text{(every element of }X\text{ maps to 1)} μ(q*)=Prz𝒟[zX]=n|𝒳|0(data set is a tiny fraction of the universe).\mu(q^*) = \Pr_{z \sim \mathcal{D}}[z \in X] = \frac{n}{|\mathcal{X}|} \approx 0 \quad\text{(data set is a tiny fraction of the universe)}.

The gap is 1\approx 1, which exceeds any reasonable τ\tau. The killer query is trivial to construct once the data set is known.

How might an adversary learn XX? Via a coding query: define qcode(z)=2zq_{\mathrm{code}}(z) = 2^{-z} (treating elements as integers), then zX2z\sum_{z \in X} 2^{-z} is a binary encoding of XX. Alternatively, the adversary could launch a database reconstruction attack (as studied in Chapter 11). Either way: if the adversary learns XX, the game is over.

This motivates our goal: answer queries in a way that prevents the adversary from learning too much about XX, even adaptively.

Formal Model of Adaptive Data Analysis

The adaptive interaction.

The adversary 𝒜\mathcal{A} proceeds in rounds:

  1. Choose query Q1Q_1 (with no access to XX; this round is trivially non-adaptive).

  2. Receive answer A1=M(X,Q1)A_1 = M(X, Q_1) from mechanism MM.

  3. Choose Q2Q_2 based on A1A_1. Receive A2=M(X,Q2)A_2 = M(X, Q_2).

  4. \ldots

  5. Choose QiQ_i based on (A1,,Ai1)(A_1,\ldots,A_{i-1}). Receive AiA_i.

The adversary wins if any QiQ_i is bad for XX (i.e., |μ̂(Qi,X)μ(Qi)|>τ|\hat{\mu}(Q_i, X) - \mu(Q_i)| > \tau).

Why the first query is safe.

At round 1, 𝒜\mathcal{A} has not seen any answer from M(X,)M(X,\cdot). Therefore Q1Q_1 is completely independent of XX. By the Chernoff bound, Pr[X is bad for Q1]2e2nτ2\Pr[X \text{ is bad for } Q_1] \le 2e^{-2n\tau^2}, regardless of the adversary’s strategy.

Simple solution: data splitting.

Reserve 1/τ21/\tau^2 fresh samples for each query. Answer QiQ_i using its own reserved subsample (then discard those samples). This handles nτ2n\tau^2 queries but wastes data linearly. We want exponentially better.

Max-Information

The key to proving that differential privacy prevents overfitting is a new information-theoretic quantity introduced by Dwork et al.

Max-Information Let (𝑫,𝚽)(\mathbf{D}, \boldsymbol{\Phi}) be jointly distributed random variables, where 𝑫\mathbf{D} is a random data set and 𝚽\boldsymbol{\Phi} is a random query (or more generally, any random variable correlated with 𝑫\mathbf{D} via adaptive interaction). The max-information I(𝑫;𝚽)I_\infty(\mathbf{D}; \boldsymbol{\Phi}) is the smallest k0k \ge 0 such that for all dd in the support of 𝑫\mathbf{D} and all φ\varphi in the support of 𝚽\boldsymbol{\Phi}: Pr[𝑫=d𝚽=φ]2kPr[𝑫=d].\Pr[\mathbf{D} = d \mid \boldsymbol{\Phi} = \varphi] \;\le\; 2^k \cdot \Pr[\mathbf{D} = d].

Intuition.
Connection to mutual information.

Max-information is a worst-case variant of mutual information I(𝑫;𝚽)I(\mathbf{D}; \boldsymbol{\Phi}) from information theory. Standard mutual information measures the average reduction in uncertainty; max-information measures the worst-case increase in log-probability. The symmetry I(𝑫;𝚽)=I(𝚽;𝑫)I_\infty(\mathbf{D}; \boldsymbol{\Phi}) = I_\infty(\boldsymbol{\Phi}; \mathbf{D}) follows from Bayes’ theorem: the condition Pr[𝑫=d𝚽=φ]2kPr[𝑫=d]\Pr[\mathbf{D}=d \mid \boldsymbol{\Phi}=\varphi] \le 2^k \Pr[\mathbf{D}=d] is equivalent to Pr[𝚽=φ𝑫=d]2kPr[𝚽=φ]\Pr[\boldsymbol{\Phi}=\varphi \mid \mathbf{D}=d] \le 2^k \Pr[\boldsymbol{\Phi}=\varphi] (up to the same constant kk), by a Bayes’ theorem rearrangement.

Differential Privacy Bounds Max-Information

DP Bounds Max-Information

Let MM be an ε\varepsilon-differentially private mechanism operating on data sets of size nn. Let 𝚽\boldsymbol{\Phi} be the random query produced by any adaptive adversary interacting with MM, and let 𝑫\mathbf{D} be the random data set. Then: I(𝑫;𝚽)O(εn).I_\infty(\mathbf{D}; \boldsymbol{\Phi}) \;\le\; O(\varepsilon n).

Proof. We show Pr[𝑫=d𝚽=φ]eεnPr[𝑫=d]\Pr[\mathbf{D}=d \mid \boldsymbol{\Phi}=\varphi] \le e^{\varepsilon n} \cdot \Pr[\mathbf{D}=d] for all d,φd, \varphi, which gives k=O(εn)k = O(\varepsilon n) after taking log2\log_2.

Step 1 (Averaging argument). By definition of conditional probability: Pr[𝚽=φ]=dPr[𝚽=φ𝑫=d]Pr[𝑫=d].\Pr[\boldsymbol{\Phi}=\varphi] = \sum_{d'} \Pr[\boldsymbol{\Phi}=\varphi \mid \mathbf{D}=d'] \cdot \Pr[\mathbf{D}=d']. This is an average of Pr[𝚽=φ𝑫=d]\Pr[\boldsymbol{\Phi}=\varphi \mid \mathbf{D}=d'] over dd'. Therefore there exists some d*d^* achieving at most the average: Pr[𝚽=φ]Pr[𝚽=φ𝑫=d*].\Pr[\boldsymbol{\Phi}=\varphi] \;\ge\; \Pr[\boldsymbol{\Phi}=\varphi \mid \mathbf{D}=d^*]. \tag{1}

Step 2 (Group privacy). Any two data sets dd and dd' of size nn differ on at most nn entries. By group privacy of ε\varepsilon-DP applied nn times: Pr[𝚽=φ𝑫=d]eεnPr[𝚽=φ𝑫=d*].\Pr[\boldsymbol{\Phi}=\varphi \mid \mathbf{D}=d] \;\le\; e^{\varepsilon n} \cdot \Pr[\boldsymbol{\Phi}=\varphi \mid \mathbf{D}=d^*]. \tag{2}

Combining (1) and (2). Pr[𝚽=φ𝑫=d]eεnPr[𝚽=φ].\Pr[\boldsymbol{\Phi}=\varphi \mid \mathbf{D}=d] \;\le\; e^{\varepsilon n} \cdot \Pr[\boldsymbol{\Phi}=\varphi]. By Bayes’ theorem (symmetry of max-information), this is equivalent to Pr[𝑫=d𝚽=φ]eεnPr[𝑫=d].\Pr[\mathbf{D}=d \mid \mathbf{\Phi}=\varphi] \;\le\; e^{\varepsilon n} \cdot \Pr[\mathbf{D}=d].  ◻

The proof uses exactly two properties of differential privacy: post-processing (the adversary’s query choice is a post-processing of the DP outputs) and group privacy (all data sets are within nn substitutions of each other).

DP Protects Against Overfitting

We now combine the max-information bound with the standard Chernoff sampling assumption to prove the main result.

Assumption.

For a fixed query qq, the probability over a randomly drawn data set XX that XX is bad for qq (i.e., not τ\tau-representative) is at most 2cn2^{-cn} for some constant c>0c > 0 (this follows from the Chernoff bound with c=2τ2/ln2c = 2\tau^2 / \ln 2). Let BqB_q denote the set of data sets that are bad for qq.

DP Protects Against Overfitting

Let MM be ε\varepsilon-differentially private with εc/2\varepsilon \le c/2. Let 𝚽\boldsymbol{\Phi} be the random adaptive query produced by any adversary interacting with MM. Then: Pr𝑫,𝚽[𝑫B𝚽]2εncn2cn/2,\Pr_{\mathbf{D},\boldsymbol{\Phi}}\bigl[\mathbf{D} \in B_{\boldsymbol{\Phi}}\bigr] \;\le\; 2^{\varepsilon n - cn} \;\le\; 2^{-cn/2}, which is exponentially small in nn.

Proof. Pr[𝑫B𝚽]=φPr[𝚽=φ]Pr[𝑫Bφ𝚽=φ](law of total probability)φPr[𝚽=φ]dBφPr[𝑫=d𝚽=φ]φPr[𝚽=φ]dBφeεnPr[𝑫=d](by the max-info bound)=eεnφPr[𝚽=φ]Pr[𝑫Bφ](regroup)eεn2cn(Chernoff assumption)=2εncn.\begin{aligned} \Pr[\mathbf{D} \in B_{\mathbf{\Phi}}] &= \sum_\varphi \Pr[\mathbf{\Phi}=\varphi] \cdot \Pr[\mathbf{D} \in B_\varphi \mid \mathbf{\Phi}=\varphi] && \text{(law of total probability)}\\ &\le \sum_\varphi \Pr[\mathbf{\Phi}=\varphi] \sum_{d \in B_\varphi} \Pr[\mathbf{D}=d \mid \mathbf{\Phi}=\varphi]\\ &\le \sum_\varphi \Pr[\mathbf{\Phi}=\varphi] \sum_{d \in B_\varphi} e^{\varepsilon n} \Pr[\mathbf{D}=d] && \text{(by the max-info bound)}\\ &= e^{\varepsilon n} \sum_\varphi \Pr[\mathbf{\Phi}=\varphi] \cdot \Pr[\mathbf{D} \in B_\varphi] && \text{(regroup)}\\ &\le e^{\varepsilon n} \cdot 2^{-cn} && \text{(Chernoff assumption)}\\ &= 2^{\varepsilon n - cn}. \end{aligned} Setting εc/2\varepsilon \le c/2 gives 2cn/22^{-cn/2}, which is exponentially small. ◻

The key intellectual leap.

Overfitting is reframed as a win for the accuracy adversary. Once we define the adversary formally, standard tools from differential privacy — post-processing, group privacy, and composition — give a complete, quantitative, and mechanistic explanation of why DP prevents overfitting.

The Reusable Holdout

Standard holdout (and its failure mode).

The classical defense against overfitting is to reserve a holdout set HH that is never used during training. The analyst works freely on the training set TT, derives a hypothesis, and evaluates it once on HH. If HH gives a good result, the hypothesis is accepted.

The problem: if the hypothesis fails on HH, the analyst wants to try again. But now the choice of what to try next has been influenced by HH’s answer. The holdout set is tainted and cannot be safely reused. In practice, analysts use holdout sets many times, invalidating the statistical guarantees.

The fix: wrap HH in a DP mechanism.

 

Reusable Holdout

Train freely on TT (no privacy restrictions). But access the holdout set HH only through a differentially private mechanism. Because DP prevents the adversary from learning too much about HH, the holdout set can be queried repeatedly while maintaining valid statistical guarantees.

Conceptually: the accuracy adversary has the training set TT hardwired into its strategy. Its only access to HH is through the private mechanism. Theorem [th:dp-overfit] then guarantees that no adaptive sequence of queries can overfit HH.

The Algorithm: Numeric Sparse Vector

The reusable holdout has a concrete algorithmic instantiation. Given:

the algorithm handles each incoming statistical query q:𝒳[1,1]q : \mathcal{X} \to [-1,1] as follows:

  1. Draw a random sample STS \subseteq T (from the training set).

  2. Compare the holdout answer μ̂(q,H)+noise\hat{\mu}(q,H) + \text{noise} against the training estimate μ̂(q,S)\hat{\mu}(q,S).

  3. If the two estimates are close (within a threshold τ̃\tilde{\tau}): output the training estimate and continue. No privacy budget is spent.

  4. If the two estimates are far apart (the training answer is overfit): output the holdout estimate, decrement the overfitting budget, and continue.

  5. If the overfitting budget is exhausted: halt.

Numeric Sparse Vector Achieves Exponential Improvement The reusable holdout algorithm can answer exponentially many queries in total, as long as at most kmaxk_{\max} of them trigger the “overfit detected” branch. Only those kmaxk_{\max} holdout accesses spend privacy budget; the rest are answered from the training set for free.

The connection to Sparse Vector.

This algorithm is precisely Numeric Sparse Vector (a variant of the Sparse Vector Technique from Chapter 11), applied with the holdout mechanism as the private database and the analyst’s queries as the input stream. Sparse Vector was introduced as an abstract privacy tool; here it reappears as the heart of a practically motivated reusable holdout mechanism.

Paper Readings

Dwork et al. (2015) — Preserving Statistical Validity in Adaptive Data Analysis.

Shows that running adaptive statistical queries under differential privacy bounds the max-information II_\infty between the dataset and the sequence of query answers, which in turn implies that all reported p-values and confidence intervals remain honest. Classical statistical practice assumes queries are chosen independently of the data; this paper formalizes what goes wrong when they are not, and proves that DP is a sufficient condition for validity even under arbitrary adaptivity. The result reframes differential privacy as a tool for statistical integrity rather than purely for individual privacy, connecting the two halves of this course.

Foundations of Modern Cryptography

What is Cryptography?

Big-picture takeaway

Modern cryptography studies how to achieve secrecy, authenticity, proof, randomness, privacy, and computation even in adversarial environments. Cryptography makes the impossible possible.

What Problems Does Cryptography Solve?

Two Innovations of Modern Cryptography

Innovation 1: Base security on complexity theory

Instead of requiring information-theoretic impossibility, require only that breaking the scheme is computationally infeasible. The central primitive is a one-way function.

One-way function, informal ff is one-way if: given xx, easy to compute f(x)f(x); given f(x)f(x), computationally hard to find any xx' with f(x)=f(x)f(x')=f(x).

Hardness is computational, not information-theoretic.

A trapdoor function is a one-way function that becomes easy to invert given secret auxiliary information (the “trapdoor”). This is essential for public-key encryption: everyone can encrypt; only the receiver can decrypt.

Innovation 2: Security by reduction

Reduction paradigm

Break primitiveSolve hard problem.\text{Break primitive} \;\Longrightarrow\; \text{Solve hard problem.} If the underlying problem is believed hard, the primitive is secure. “Science wins either way”: either we get a secure scheme, or a supposedly hard problem turns out to be easy.

Complexity-Theoretic Background

Asymptotic notation

An algorithm has running time O(f(n))O(f(n)) if there exist constants CC and n0n_0 such that for all nn0n \ge n_0, the running time is at most Cf(n)C \cdot f(n). This captures the growth rate but hides constants and small-nn behavior. Example: sorting nn numbers requires Θ(nlogn)\Theta(n \log n) comparisons (both upper and lower bound).

Polynomial time and negligible functions

A problem is efficiently solvable if there exists a polynomial-time algorithm for it. In cryptography we want to argue the opposite: that no efficient algorithm can break a scheme. This requires care, since asserting “no polynomial-time algorithm exists” is an unproven conjecture for most problems of interest (and proving it would resolve P vs. NP).

We capture hardness probabilistically: a function μ(k)\mu(k) is negligible if it decreases faster than the inverse of any polynomial—for every polynomial pp, there exists k0k_0 such that μ(k)<1/p(k)\mu(k) < 1/p(k) for all k>k0k > k_0.

What does it mean for an algorithm to fail?

Saying an algorithm AA does not factor integers requires precision. Options:

The second formulation correctly captures that factoring a random integer is hard even if a constant fraction of inputs are easy.

Uniform vs. non-uniform computation

A Turing machine (or equivalently, a fixed program in C) is a uniform model: one program of fixed length works for all input sizes. A circuit family is a non-uniform model: one circuit per input size, and each circuit can be different (and can have hard-coded solutions for specific instances). Non-uniform circuits are strictly more powerful; in cryptography we usually work with uniform (Turing machine) adversaries, though the distinction matters in some proofs.

One-Way Functions

One-Way Function (informal) A function f:{0,1}*{0,1}*f : \{0,1\}^* \to \{0,1\}^* is one-way if:

  1. Easy to compute: f(x)f(x) can be computed in polynomial time.

  2. Hard to invert: for any polynomial-time algorithm AA, the probability Prx{0,1}k[f(A(f(x),1k))=f(x)]\Pr_{x \leftarrow \{0,1\}^k}\!\bigl[f(A(f(x),\, 1^k)) = f(x)\bigr] is negligible in kk.

Security parameter. The string 1k1^k (a sequence of kk ones) is fed to AA to ensure it can run in time polynomial in kk. Without this, AA might not have enough time to read the implicit security level.

Valid inversions. Note that AA wins if it produces any pre-image of f(x)f(x), not necessarily xx itself (since ff need not be injective).

Candidate: integer factoring.

Let f(a,b)=abf(a,b) = a \cdot b for kk-bit primes a,ba,b. Computing ff is easy (multiplication); inverting (factoring the product into its prime factors) is believed to be hard. RSA is built on this conjecture. Note: the naive formulation “given a random kk-bit integer, factor it” is too weak because roughly half of all integers are even and trivially factorable. The correct hardness conjecture restricts to products of two random kk-bit primes.

Candidate: lattice problems.

Problems such as finding the shortest vector in a lattice, or learning with errors (LWE), have been studied for decades without yielding polynomial-time solutions. They form the basis of post-quantum cryptography—schemes believed to resist quantum computers. (Ajtai 1996 initiated this direction; Google’s current post-quantum transition is likely lattice-based.)

Trapdoor Functions

Trapdoor One-Way Function A trapdoor function is a one-way function ff equipped with a secret trapdoor τ\tau such that, given τ\tau, inverting ff is easy. Without τ\tau, inversion is hard.

Trapdoor functions are essential for public-key encryption: the public key encodes ff, the private key encodes τ\tau. Anyone can encrypt (apply ff); only the key holder can decrypt (invert using τ\tau).

Finding Large Primes Efficiently

Building RSA requires generating large primes. This is surprisingly easy:

  1. By the prime number theorem, a random kk-bit integer is prime with probability approximately 1/(kln2)=Θ(1/k)1/(k \ln 2) = \Theta(1/k).

  2. Primality testing can be done in polynomial time (AKS, or probabilistic tests like Miller–Rabin).

  3. Algorithm: repeatedly sample a random kk-bit integer and test for primality. Expected number of trials: O(k)O(k). Each test runs in polynomial time in kk, so the whole procedure is efficient.

In practice, RSA uses primes of 1024 bits each; their product is a 2048-bit modulus. The randomization in key generation is essential: if the same prime were always chosen, an attacker could precompute.

One-Way Functions and Pseudorandom Generators

This chapter develops the formal theory underlying the primitives introduced in Chapter 13. The material follows Goldwasser–Bellare (GB) Sections 2.4.1, 3.1–3.4, and Barak Section 2.4.

Formal Definition of One-Way Functions

One-Way Function (GB Def. 2.1) A function f:{0,1}*{0,1}*f:\{0,1\}^* \to \{0,1\}^* is a one-way function if:

  1. Efficiently computable. There is a polynomial-time algorithm computing f(x)f(x).

  2. Hard to invert. For every PPT adversary 𝒜\mathcal{A} and every polynomial pp, for all sufficiently large kk: Prx{0,1}k[𝒜(1k,f(x))f1(f(x))]<1p(k).\Pr_{\,x \leftarrow \{0,1\}^k}\!\bigl[\mathcal{A}(1^k, f(x)) \in f^{-1}(f(x))\bigr] \;<\; \frac{1}{p(k)}.

Unpacking the definition
  • The adversary receives 1k1^k (the security parameter in unary, so the algorithm runs in time polynomial in kk) and f(x)f(x).

  • Success means finding any preimage of f(x)f(x), not necessarily xx itself.

  • The probability is over the uniform choice of xx and the adversary’s internal randomness.

  • “Hard” means success probability is negligible — smaller than 1/p(k)1/p(k) for every polynomial pp.

Important warning.

OWF hardness is directional (easy forward, hard backward), not the same as NP-hardness. OWF existence is an unproven assumption; it implies P \neq NP but is believed to be strictly stronger.

One-Way Permutation A one-way permutation is a one-way function f:{0,1}n{0,1}nf:\{0,1\}^n\to\{0,1\}^n that is also a bijection (one-to-one and onto). Equivalently, ff is an efficiently computable, length-preserving permutation of {0,1}n\{0,1\}^n that is hard to invert.

One-way permutations are strictly easier to work with than general one-way functions when constructing PRGs: because ff is a bijection, feeding a uniform nn-bit seed through ff still produces a uniform nn-bit output, which lets the hybrid argument go through cleanly.

Hard-Core Predicates

A one-way function ff hides its input xx when given f(x)f(x), but how much does it hide? A hard-core predicate extracts a single bit of xx that is provably hidden.

Hard-Core Predicate (GB Def. 2.48) A poly-time computable function B:{0,1}*{0,1}B:\{0,1\}^*\to\{0,1\} is a hard-core predicate for ff if for every PPT 𝒜\mathcal{A} and every polynomial pp, for all sufficiently large kk: Prx{0,1}k[𝒜(f(x),1k)=B(x)]12+1p(k).\Pr_{x\leftarrow\{0,1\}^k}\!\bigl[\mathcal{A}(f(x), 1^k) = B(x)\bigr] \;\le\; \frac{1}{2} + \frac{1}{p(k)}.

In words: given f(x)f(x), the adversary cannot guess B(x)B(x) with probability noticeably better than 1/21/2 (random guessing).

An alternative but equivalent characterization (GB Def. 2.50):

Hard-Core Predicate, Indistinguishability Form (GB Def. 2.50) BB is a hard-core predicate for ff if and only if (f(x),B(x))p(f(x),U1),\bigl(f(x),\, B(x)\bigr) \;\approx_p\; \bigl(f(x),\, U_1\bigr), where U1U_1 is a uniformly random bit independent of xx. That is, the bit B(x)B(x) looks like a fresh random bit to any poly-time observer who sees f(x)f(x).

The Goldreich–Levin Theorem

The most important result about hard-core predicates is that every one-way function has one — we need not search for ff-specific tricks.

Goldreich–Levin (GB Thm. 2.49) Let ff be any one-way function. Define f(xr)=f(x)r,x,r{0,1}k.f'(x \circ r) \;=\; f(x) \circ r, \qquad x,r \in \{0,1\}^k. (That is, ff' takes a 2k2k-bit input, outputs f(x)f(x) concatenated with rr.) Then B(xr)=x,r=i=1kxiri(mod2)B(x \circ r) \;=\; \langle x,\, r\rangle \;=\; \sum_{i=1}^k x_i r_i \pmod{2} is a hard-core predicate for ff'.

Why must rr be included in the output of ff'?

To compute B(xr)=x,rB(x\circ r)=\langle x,r\rangle, the receiver needs rr. So ff' reveals rr (which is public anyway) while hiding xx (since ff is one-way). If rr were hidden, even the legitimate user could not evaluate BB.

Proof sketch (by reduction).

Suppose 𝒜\mathcal{A} predicts B(xr)B(x\circ r) with advantage ε>1/p(k)\varepsilon > 1/p(k). One constructs a reduction \mathcal{B} that, given f(x)f(x), uses 𝒜\mathcal{A} as a subroutine to recover xx with non-negligible probability — contradicting that ff is a OWF. The key idea: x,rmod2\langle x,r\rangle \bmod 2 is a random parity of xx; random rr makes all such parities “look independent,” so any non-trivial prediction of the parity implies partial knowledge of xx.

Pseudorandom Generators: Definitions

A pseudorandom generator (PRG) stretches a short truly random seed into a longer output that is computationally indistinguishable from uniform randomness.

Poly-Time Indistinguishability (GB Def. 3.1) Distributions XX and YY over {0,1}\{0,1\}^\ell are poly-time indistinguishable, written XpYX \approx_p Y, if for every poly-time distinguisher DD: |Pr[D(X)=1]Pr[D(Y)=1]|=negl(k).|\Pr[D(X)=1] - \Pr[D(Y)=1]| \;=\; \mathrm{negl}(k).

Pseudorandom Distribution (GB Def. 3.2) A distribution XX over {0,1}(k)\{0,1\}^{\ell(k)} is pseudorandom if XpU(k)X \approx_p U_{\ell(k)}, where UnU_n denotes the uniform distribution on {0,1}n\{0,1\}^n.

Pseudorandom Generator (GB Def. 3.3) G:{0,1}k{0,1}(k)G:\{0,1\}^k \to \{0,1\}^{\ell(k)} is a pseudorandom generator (PRG) if:

  1. (k)>k\ell(k) > k (stretching: output is longer than input).

  2. GG is poly-time computable.

  3. G(Uk)pU(k)G(U_k) \approx_p U_{\ell(k)} (output is pseudorandom).

The input is called the seed (length kk); (k)\ell(k) is the expansion factor.

Why PRGs matter

A PRG lets us replace a long one-time-pad key with a short seed: encrypt as c=mG(s)c = m \oplus G(s) for |m|=(k)|m| = \ell(k) and seed |s|=k(k)|s|=k \ll \ell(k). The result is computationally (not perfectly) secret, but secure against all PPT adversaries.

Relationship to Barak Definition 2.10.

The PRG security condition G(Uk)pU(k)G(U_k)\approx_p U_{\ell(k)} is exactly the asymptotic indistinguishability (Definition 2.10 from Barak, see §1.3) applied to the two ensembles {G(Uk)}\{G(U_k)\} and {U(k)}\{U_{\ell(k)}\}.

Constructing a PRG from a One-Way Function

PRG from OWF (GB Thm. 3.4) If a one-way function exists, then a pseudorandom generator exists.

The proof is constructive and proceeds in two steps.

Step 1: The G1G^1 Construction (1-bit stretching)

G1G^1 — one-bit PRG extender Let ff be any OWF and let BB be the Goldreich–Levin hard-core predicate for the derived function f(xr)=f(x)rf'(x\circ r)=f(x)\circ r. Define G1(s)=f(s)B(s).G^1(s) \;=\; f(s) \;\circ\; B(s). Input: seed s{0,1}ks \in \{0,1\}^k. Output: (k+1)(k+1) bits. G1G^1 stretches the seed by exactly 1 bit.

Why G1G^1 is a PRG.

We must show (f(s),B(s))pUk+1(f(s), B(s)) \approx_p U_{k+1}. By Definition 2.50 (GB), the hard-core property gives (f(s),B(s))p(f(s),U1)(f(s), B(s)) \approx_p (f(s), U_1). Since ff is one-way, f(s)f(s) already “looks random” in the relevant sense, so (f(s),U1)p(Uk,U1)=Uk+1(f(s), U_1) \approx_p (U_k, U_1) = U_{k+1}. Chaining these two indistinguishabilities (using transitivity of p\approx_p), the output of G1G^1 is pseudorandom.

Step 2: The GQG^Q Construction (polynomial stretching)

A 1-bit extension is not useful on its own. We chain G1G^1 to produce polynomially many bits.

GQG^QQQ-bit PRG Let Q=Q(k)Q = Q(k) be any polynomial. Iterate:

  1. Set s0=ss_0 = s (the seed).

  2. For i=1,,Qi = 1, \ldots, Q: let si=f(si1)s_i = f(s_{i-1}) and bi=B(si1)b_i = B(s_{i-1}).

  3. Output b1b2bQb_1 \circ b_2 \circ \cdots \circ b_Q.

Equivalently, GQ(s)=B(s0)B(s1)B(sQ1),si=f(si1).G^Q(s) \;=\; B(s_0)\;\circ\; B(s_1)\;\circ\;\cdots\;\circ\; B(s_{Q-1}), \quad s_i = f(s_{i-1}). Output length: Q(k)Q(k) bits from a kk-bit seed.

The Hybrid Argument: Proving GQG^Q is a PRG

The hybrid argument — core technique

To show GQ(Uk)pUQG^Q(U_k) \approx_p U_Q, define a sequence of hybrid distributions H0,H1,,HQH_0, H_1, \ldots, H_Q interpolating between the two endpoints:

  • H0=GQ(Uk)H_0 = G^Q(U_k) (all QQ bits generated by the PRG).

  • HQ=UQH_Q = U_Q (all QQ bits truly random).

  • HiH_i (0<i<Q0 < i < Q): the first QiQ-i bits from the PRG, the last ii bits truly random.

Key step. Show Hi1pHiH_{i-1} \approx_p H_i for each ii. Each transition replaces one hard-core bit B(sQi)B(s_{Q-i}) with a truly random bit. By the hard-core predicate property (Definition 2.48), no PPT adversary can distinguish these with non-negligible advantage.

Conclusion. H0pH1ppHQH_0 \approx_p H_1 \approx_p \cdots \approx_p H_Q, so GQ(Uk)pUQ(k)G^Q(U_k) \approx_p U_{Q(k)} by transitivity.

Error accumulation.

Each step introduces indistinguishability error negl(k)\mathrm{negl}(k). Over Q(k)=poly(k)Q(k) = \mathrm{poly}(k) steps, total error is Q(k)negl(k)=negl(k)Q(k)\cdot\mathrm{negl}(k) = \mathrm{negl}(k) (a polynomial times a negligible function is negligible).

Why adjacent hybrids are indistinguishable.

Hi1H_{i-1} and HiH_i differ only in position QiQ-i: Hi1H_{i-1} has B(sQi)B(s_{Q-i}) (hard-core bit), HiH_i has a truly random U1U_1. Any distinguisher DD separating Hi1H_{i-1} from HiH_i yields an adversary breaking the hard-core predicate property of BB — contradicting OWF hardness. This is a reduction: DD \Rightarrow adversary against hard-core predicate \Rightarrow OWF inversion.

Why the chain of implications works

OWF G-L Thm\overset{\text{G-L Thm}}{\Longrightarrow} Hard-Core Predicate G1 construction\overset{G^1 \text{ construction}}{\Longrightarrow} 1-bit PRG GQ+hybrid\overset{G^Q + \text{hybrid}}{\Longrightarrow} poly(k)\mathrm{poly}(k)-bit PRG XOR with msg\overset{\text{XOR with msg}}{\Longrightarrow} Computationally secure stream cipher

Next-Bit Tests

There is a striking alternative characterization of PRGs: a string looks random if and only if no poly-time algorithm can predict its next bit from its previous bits.

Next-Bit Test (GB Def. 3.6) A poly-time algorithm TT is a next-bit test at position ii if, given the first ii bits of a string, TT predicts bit i+1i+1. TT succeeds at position ii if Pr[T(s1,,si)=si+1]>12+1p(k)\Pr\bigl[T(s_1,\ldots,s_i) = s_{i+1}\bigr] \;>\; \frac{1}{2} + \frac{1}{p(k)} for some polynomial pp and infinitely many kk.

Next-Bit Security (GB Def. 3.8) G:{0,1}k{0,1}(k)G:\{0,1\}^k\to\{0,1\}^{\ell(k)} passes all next-bit tests if for every poly-time TT, every polynomial pp, all large kk, and all 1i<(k)1\le i < \ell(k): Pr[T(G(s)1,,G(s)i)=G(s)i+1]12+1p(k),\Pr\bigl[T(G(s)_1,\ldots,G(s)_i) = G(s)_{i+1}\bigr] \;\le\; \frac{1}{2} + \frac{1}{p(k)}, where ss is a uniform random seed.

Statistical Test (GB Def. 3.9) A statistical test is any poly-time T:{0,1}{0,1}T:\{0,1\}^\ell\to\{0,1\}. TT distinguishes GG if |Pr[T(G(Uk))=1]Pr[T(U(k))=1]|1/p(k)|\Pr[T(G(U_k))=1]-\Pr[T(U_{\ell(k)})=1]|\ge 1/p(k) for infinitely many kk.

Next-Bit Tests \equiv All Statistical Tests (GB Thm. 3.10) GG is a PRG (passes all statistical tests) if and only if GG passes all next-bit tests.

Proof sketch (\Rightarrow).

If GG fails a statistical test TT — i.e., TT distinguishes G(Uk)G(U_k) from U(k)U_{\ell(k)} — then there exists a position ii such that TT distinguishes the distribution of the first i+1i+1 bits of GG from the first i+1i+1 bits of U(k)U_{\ell(k)}, even given that the first ii bits are the same. This directly yields a next-bit predictor.

Significance.

To prove GG is a PRG, it suffices to show next-bit unpredictability — a simpler, local condition — rather than fooling all possible statistical tests. This is why the hybrid argument works: each step only needs to argue about one bit at a time.

Two Intuitions for Randomness

Before the formal definition, it is worth grounding the notion of a PRG in two complementary intuitions about what it means for a bit string to “look” random.

Intuition 1: Passes all statistical tests.

A random sequence should be unbiased (equal numbers of 0s and 1s in the long run), should have every fixed-length pattern appear with the expected frequency, and should pass any other efficiently computable statistical test. A distinguisher in the formal definition is exactly such a test: it takes a string and says “random” or “not random.”

Intuition 2: Unpredictability.

Given any prefix of the sequence, a computationally bounded observer should not be able to guess the next bit with probability noticeably better than 12\tfrac{1}{2}. This is the next-bit test view.

Key fact

These two intuitions are equivalent for pseudorandom generators (GB Thm. 3.10, above): GG fools all poly-time statistical tests if and only if GG passes all next-bit tests.

Why restrict to polynomial-time distinguishers?

An exponential-time adversary given a string of length (n)\ell(n) could enumerate all 2n2^n seeds, compute G(seed)G(\text{seed}) for each, and check whether the string is in the range of GG. A random string of length (n)\ell(n) lands in the range with probability at most 2n/2(n)2^n / 2^{\ell(n)}, which is negligible when (n)>n\ell(n) > n. So exponential time can distinguish; we restrict to polynomial time because that is the realistic adversary model.

(Remark: for other applications — such as derandomization and complexity theory — people study pseudorandomness against weaker classes, e.g. log-space bounded tests. The connection to outcome indistinguishability from the fairness portion of this course is not a coincidence: OI was framed knowing exactly this type of poly-time indistinguishability formula.)

Why PRGs Are Practically Useful

True randomness is expensive.

Generating truly random bits requires a physical entropy source (thermal noise, radioactive decay, quantum measurement, atmospheric noise, lava lamps, …). These sources are slow and require special hardware. In contrast, a PRG lets you spend a small amount on a short truly random seed and then stretch it into as many pseudorandom bits as needed.

Derandomization.

An important open question: does randomness help computation? We do not know whether BPP=P\mathrm{BPP} = \mathrm{P} (roughly, whether every efficient randomized algorithm has an efficient deterministic simulation). PRGs are a tool for minimizing the number of truly random bits required by an algorithm, with the hope of eventually eliminating them entirely. If strong enough PRGs exist, BPP=P\mathrm{BPP} = \mathrm{P} follows.

PRGs vs. OWFs.

A PRG GG must certainly be hard to invert (otherwise, given an output, one could recover the seed and distinguish pseudo from truly random). In fact, every PRG is a OWF. The converse is also true: OWFs exist if and only if PRGs exist (a deep result; in class we prove the easier direction via the GL theorem and the GQG^Q construction).

Hybrid Argument: Proof Structure for Next-Bit \Leftrightarrow PRG

The proof that next-bit unpredictability implies full pseudorandomness uses a hybrid argument — the second of the two fundamental techniques in cryptography (the first being reductions).

Two fundamental crypto techniques
  1. Reduction: “If you could do XX, you could do YY” — used to derive contradictions.

  2. Hybrid argument: Interpolate between two distributions through a chain of intermediate hybrids; if the endpoints are distinguishable, some adjacent pair must be distinguishable, reducing to a simpler sub-problem.

Both appeared earlier in this course: reductions throughout crypto; the hybrid argument appeared in the kk-fold DP composition proof (walking one database toward another one person at a time).

Construction for this proof.

Assume for contradiction that some PPTM 𝒜\mathcal{A} distinguishes G(Uk)G(U_k) from U(n)U_{\ell(n)} with non-negligible advantage 1/R(n)\ge 1/R(n). Define (n)+1\ell(n)+1 hybrid distributions D0,D1,,D(n)D_0, D_1, \ldots, D_{\ell(n)}: Di=G(s)1,,G(s)(n)ifirst (n)i bits: pseudorandom,r1,,rilast i bits: truly random.D_i \;=\; \underbrace{G(s)_1,\;\ldots,\; G(s)_{\ell(n)-i}}_{\text{first (n)i\ell(n)-i bits: pseudorandom}},\; \underbrace{r_1,\;\ldots,\; r_i}_{\text{last $i$ bits: truly random}}.

Since 𝒜\mathcal{A} distinguishes D0D_0 from D(n)D_{\ell(n)} with advantage 1/R(n)\ge 1/R(n), and there are (n)\ell(n) steps in the chain, by averaging there must exist some index i*i^* such that |Pr[𝒜(Di*)=1]Pr[𝒜(Di*+1)=1]|1R(n)(n),\bigl|\Pr[\mathcal{A}(D_{i^*})=1] - \Pr[\mathcal{A}(D_{i^*+1})=1]\bigr| \;\ge\; \frac{1}{R(n)\cdot\ell(n)}, which is still non-negligible (since (n)\ell(n) is polynomial). But Di*D_{i^*} and Di*+1D_{i^*+1} differ only in whether position (n)i*\ell(n)-i^* is a pseudorandom bit G(s)jG(s)_j or a truly random bit rr — which yields a next-bit predictor for position (n)i*\ell(n)-i^*, contradicting our assumption.

Caveat

The conditioning required to extract a next-bit predictor from the adjacent hybrids involves some care (the prefix of the hybrid string is not entirely random). Goldwasser–Bellare carry out the remaining calculation; the structure is the same as the calculation at the start of this section.

The Blum–Blum–Shub (BBS) Generator

The BBS generator is a concrete, number-theory-based PRG with provable security under the Quadratic Residuosity assumption.

Setup.

Let p,qp, q be large primes with pq3(mod4)p \equiv q \equiv 3 \pmod{4}; let N=pqN = pq (Blum integer). Let QRN={xN*:x=y2modN for some y}QR_N = \{x \in \mathbb{Z}_N^* : x = y^2 \bmod N \text{ for some } y\} be the quadratic residues. The squaring function f(x)=x2modNf(x) = x^2 \bmod N on QRNQR_N is a one-way permutation under the Quadratic Residuosity Assumption: deciding whether an element of N*\mathbb{Z}_N^* is a quadratic residue is hard without knowing pp or qq.

Hard-core predicate.

The least significant bit B(x)=xmod2B(x) = x \bmod 2 is a hard-core predicate for f(x)=x2modNf(x)=x^2\bmod N under the Quadratic Residuosity Assumption.

Blum–Blum–Shub Generator Seed: x0QRNx_0 \in QR_N chosen uniformly at random.
Iteration: xi=xi12modNx_i = x_{i-1}^2 \bmod N, output bit bi=ximod2b_i = x_i \bmod 2.
Output: b1b2bQb_1 \circ b_2 \circ \cdots \circ b_Q.

Why BBS is notable.

Chapter Summary: The Implication Chain

From OWF to stream cipher
  1. OWF ff exists (assumed: factoring, discrete log, subset sum, …)

  2. \Rightarrow Hard-core predicate BB exists (Goldreich–Levin, GB Thm. 2.49)

  3. \Rightarrow G1(s)=f(s)B(s)G^1(s)=f(s)\circ B(s) is a 1-bit PRG (GB §3.2 + Def. 2.50)

  4. \Rightarrow GQG^Q is a poly(k)\mathrm{poly}(k)-bit PRG (hybrid argument)

  5. \Rightarrow Stream cipher Encs(m)=G|m|(s)m\mathrm{Enc}_s(m)=G^{|m|}(s)\oplus m is computationally secure

Randomness, Weak/Strong OWFs, and the Goldreich–Levin Proof

Why Randomness Is Essential in Key Generation

Both in the shared-key setting (two parties share a secret key) and in the public-key setting (one party publishes a public key; any sender can encrypt; only the receiver can decrypt), keys must be generated using randomness.

Quiz question

Why must we randomize when choosing keys? What goes wrong if key generation is deterministic?

Answer.

If key generation is deterministic, every party who runs the algorithm produces the same key. In the shared-key case, everyone would share the same secret; in the public-key case, everyone’s “private” key would be identical and publicly deducible. The requirement is unpredictability: different parties must produce different, independently unguessable keys. This mirrors the role of randomness in differential privacy — without it one could reverse-engineer which of two adjacent databases produced a given output.

Probabilistic Polynomial-Time Machines (PPTMs)

Probabilistic Polynomial-Time Machine (PPTM) A machine MM is a probabilistic polynomial-time machine (PPTM) if there exists a polynomial QQ such that for every input xx, M(x)M(x) runs in time at most Q(|x|)Q(|x|), where |x||x| denotes the bit-length of xx. MM may flip coins during its execution.

In cryptography, “easy” means computable by a PPTM, and “hard” means no PPTM succeeds (with non-negligible probability).

Negligible Functions

Negligible Function A function ν:0\nu : \mathbb{N} \to \mathbb{R}_{\ge 0} is negligible if for every constant c>0c > 0 there exists kck_c such that for all kkck \ge k_c: ν(k)<1kc.\nu(k) \;<\; \frac{1}{k^c}. Equivalently, ν\nu grows more slowly than the inverse of any polynomial. We write ν(k)=negl(k)\nu(k) = \mathrm{negl}(k).

Examples.

2k2^{-k}, 2k2^{-\sqrt{k}}, klogkk^{-\log k} are negligible. k5k^{-5} is not negligible (it is 1/poly1/\mathrm{poly}).

Key closure property.

The sum of polynomially many negligible functions is negligible: poly(k)negl(k)=negl(k).\mathrm{poly}(k) \cdot \mathrm{negl}(k) \;=\; \mathrm{negl}(k).

This is essential for composition: if each sub-protocol leaks only negligibly, running polynomially many sub-protocols in sequence still leaks negligibly in total. This is far nicer than differential privacy, where privacy losses add linearly (or sub-linearly via advanced composition, but never remain negligible for free).

Formalizing “Hard to Invert”: Two Attempts

Straw-man definition (too weak)

A first attempt: ff is hard to invert if it is not the case that there exists a PPTM MM such that for all yy, f(M(y))=yf(M(y)) = y. Formally: M,y such that M(y)f1(y) or M runs in time >|y|c.\forall M,\; \exists y \text{ such that } M(y) \notin f^{-1}(y) \text{ or } M \text{ runs in time } > |y|^c. This is too weak. It would allow a PPTM to invert ff on all but a single string of each length nn (for infinitely many nn), which is clearly not “hard.” The issue is that a finite set of exceptions can be hardcoded into the finite control of the machine, and the definition does not prevent inversion on a 1o(1)1 - o(1) fraction of inputs.

Proper definition: negligible success probability

One-Way Function — Strong Form ff is one-way if for every PPTM adversary 𝒜\mathcal{A} and every polynomial QQ, for all sufficiently large kk: Prx{0,1}k[f(𝒜(1k,f(x)))=f(x)]<1Q(k).\Pr_{\,x \leftarrow \{0,1\}^k}\!\bigl[f\!\left(\mathcal{A}(1^k, f(x))\right) = f(x)\bigr] \;<\; \frac{1}{Q(k)}. Equivalently, using the negligible notation: Prx{0,1}k[𝒜(1k,f(x))f1(f(x))]=negl(k).\Pr_{\,x \leftarrow \{0,1\}^k}\!\bigl[\mathcal{A}(1^k, f(x)) \in f^{-1}(f(x))\bigr] \;=\; \mathrm{negl}(k).

The adversary receives the security parameter 1k1^k (in unary, so algorithms run in time polynomial in kk) to prevent trivially ruling out constant-time machines.

Weak versus Strong One-Way Functions

Weak One-Way Function ff is a weak one-way function if there exists a polynomial QQ such that for every PPTM 𝒜\mathcal{A}, for all sufficiently large kk: Prx{0,1}k[𝒜(1k,f(x))f1(f(x))]11Q(k).\Pr_{\,x \leftarrow \{0,1\}^k}\!\bigl[\mathcal{A}(1^k, f(x)) \in f^{-1}(f(x))\bigr] \;\le\; 1 - \frac{1}{Q(k)}. That is, the adversary fails to invert with non-negligible probability — it does not have to fail nearly all the time, just a 1/Q(k)1/Q(k) fraction of the time.

Comparison.

Note the asymmetry: “success probability negl\le \mathrm{negl}” is strictly stronger than “failure probability 1/poly\ge 1/\mathrm{poly}”. (The latter allows, for example, success probability 11/n221 - 1/n^{22}, where the adversary is almost always right.)

Weak implies Strong (informal) If a weak one-way function exists, then a strong one-way function exists.

The construction amplifies hardness by evaluating ff on many independent inputs; if the adversary could invert all of them simultaneously, it would need to be almost surely correct on every sub-instance.

One-Way Functions Do Not Hide All Input Bits

A common misconception: if ff is one-way, then all bits of xx are hidden given f(x)f(x). This is false.

Example.

Let HH be a one-way function on nn-bit inputs. Define F(xr)=H(x)rF(x \circ r) = H(x) \circ r where x,r{0,1}nx, r \in \{0,1\}^n.

This same construction (f(xr)=f(x)rf'(x \circ r) = f(x) \circ r) appears in the Goldreich–Levin theorem. The point is: being one-way means some part of the input is hidden, but the definition does not require hiding every single bit.

Practical warning

Hashing does not automatically protect privacy. If a database releases only hash values of sensitive fields, the hash reveals nothing about fields that happen to be hard to invert, but it may expose fields that are easy to guess (e.g., a social security number from a small space). “It’s hashed” is not a privacy guarantee without further analysis.

Hardcore Predicates: Formal Definition

A predicate is a function B:{0,1}*{0,1}B : \{0,1\}^* \to \{0,1\} (output a single bit; “true” or “false” in logic).

Hardcore Predicate A poly-time computable function B:{0,1}*{0,1}B : \{0,1\}^* \to \{0,1\} is a hardcore predicate for ff if for every PPTM 𝒜\mathcal{A} there is a negligible function ν\nu such that for all sufficiently large kk: Prx{0,1}k[𝒜(1k,f(x))=B(x)]12+ν(k).\Pr_{x \leftarrow \{0,1\}^k}\!\bigl[\mathcal{A}(1^k,\, f(x)) = B(x)\bigr] \;\le\; \frac{1}{2} + \nu(k).

Intuition.

The Goldreich–Levin Hardcore Bit

Goldreich–Levin (1989) Let f:{0,1}k{0,1}*f : \{0,1\}^k \to \{0,1\}^* be any one-way function. Define G(xr)=f(x)r,x,r{0,1}k,G(x \circ r) \;=\; f(x) \circ r, \qquad x, r \in \{0,1\}^k, and the inner-product bit B(xr)=x,r:=i=1kxiri(mod2).B(x \circ r) \;=\; \langle x, r\rangle \;:=\; \sum_{i=1}^k x_i r_i \pmod{2}. Then BB is a hardcore predicate for GG.

Why rr is included in the output.

To evaluate B(xr)B(x \circ r), one needs both xx (hidden) and rr (which must therefore be revealed). So GG outputs rr in the clear while hiding xx via the OWF ff.

Geometric intuition.

rr specifies a random subset of bit positions of xx; B(xr)B(x \circ r) is the XOR of those bits. Although rr is public, the parity of the chosen bits still hides xx completely.

Polynomial-Time Indistinguishability (Revisited)

Recall (Chapter 14):

Poly-Time Indistinguishability of Ensembles Two families of distributions {Xn}\{X_n\} and {Yn}\{Y_n\} are poly-time indistinguishable, written {Xn}p{Yn}\{X_n\} \approx_p \{Y_n\}, if for every PPTM 𝒜\mathcal{A} and every polynomial RR, for all sufficiently large nn: |PrtXn[𝒜(t)=1]PrtYn[𝒜(t)=1]|<1R(n).\left| \Pr_{t \leftarrow X_n}[\mathcal{A}(t) = 1] \;-\; \Pr_{t \leftarrow Y_n}[\mathcal{A}(t) = 1] \right| \;<\; \frac{1}{R(n)}. Equivalently, the difference is negligible in nn.

This is a strong definition

For every polynomial-time distinguisher, for every polynomial bound on the advantage, the two families cannot be told apart once nn is large enough. The existence of pseudorandom generators — sequences indistinguishable from true randomness by any polynomial-time observer — shows this strong definition can actually be achieved under computational assumptions. Cryptography makes the impossible possible.

Proof that the GL Bit Is Hardcore

We prove: {(G(s),B(s))}p{(G(s),1B(s))},\bigl\{(G(s),\; B(s))\bigr\} \;\approx_p\; \bigl\{(G(s),\; 1 - B(s))\bigr\}, where s=xrs = x \circ r is drawn uniformly from {0,1}2k\{0,1\}^{2k}.

Unpacking: the red distribution is G(s)G(s) concatenated with the hardcore bit B(s)B(s); the blue distribution is G(s)G(s) concatenated with B(s)¯=1B(s)\overline{B(s)} = 1 - B(s). Both draw s=xrs = x \circ r with x,r{0,1}kx, r \leftarrow \{0,1\}^k independently.

Proof by contradiction

Assume

there exists a PPTM 𝒜\mathcal{A} and polynomial RR such that for infinitely many nn: pnqn1R(n),p_n - q_n \;\ge\; \frac{1}{R(n)}, where pn=Prs{0,1}2k[𝒜(G(s)B(s))=1],qn=Prs{0,1}2k[𝒜(G(s)B(s)¯)=1].p_n = \Pr_{s \leftarrow \{0,1\}^{2k}}[\mathcal{A}(G(s) \circ B(s)) = 1], \qquad q_n = \Pr_{s \leftarrow \{0,1\}^{2k}}[\mathcal{A}(G(s) \circ \overline{B(s)}) = 1]. (We handle the absolute value at the end; WLOG assume the red probability exceeds the blue probability for infinitely many nn.)

Construction.

Build a PPTM \mathcal{B} that, given G(s)=f(x)rG(s) = f(x) \circ r, guesses B(s)B(s) with probability non-negligibly greater than 1/21/2:

  1. Receive G(s)G(s) (i.e., f(x)rf(x) \circ r).

  2. Sample a fresh uniform bit Z{0,1}Z \in \{0,1\}.

  3. Run 𝒜\mathcal{A} on G(s)ZG(s) \circ Z.

  4. If 𝒜\mathcal{A} outputs 1, output ZZ (guess B(s)=ZB(s) = Z).

  5. If 𝒜\mathcal{A} outputs 0, output 1Z1 - Z (guess B(s)=1ZB(s) = 1-Z).

Analysis.

Pr[ correct]=Pr[Z=B(s)]Pr[𝒜(G(s)Z)=1Z=B(s)]+Pr[ZB(s)]Pr[𝒜(G(s)Z)=0ZB(s)].\Pr[\mathcal{B} \text{ correct}] \;=\; \Pr[Z = B(s)] \cdot \Pr[\mathcal{A}(G(s)\circ Z)=1 \mid Z=B(s)] + \Pr[Z \ne B(s)] \cdot \Pr[\mathcal{A}(G(s)\circ Z)=0 \mid Z\ne B(s)]. Since ZZ is an independent uniform bit, Pr[Z=B(s)]=1/2\Pr[Z = B(s)] = 1/2. The conditional on Z=B(s)Z = B(s) has the adversary 𝒜\mathcal{A} receiving a sample from the red distribution, giving success probability pnp_n. The conditional on ZB(s)Z \ne B(s) has 𝒜\mathcal{A} receiving the blue distribution; when 𝒜\mathcal{A} outputs 0, we correctly flip, giving probability 1qn1 - q_n. Therefore: Pr[ correct]=12pn+12(1qn)=12+pnqn212+12R(n).\Pr[\mathcal{B} \text{ correct}] \;=\; \frac{1}{2}\,p_n \;+\; \frac{1}{2}(1 - q_n) \;=\; \frac{1}{2} + \frac{p_n - q_n}{2} \;\ge\; \frac{1}{2} + \frac{1}{2R(n)}.

This is non-negligibly better than 1/21/2, contradicting the hardcore predicate property of BB.

Handling the absolute value.

If qn>pnq_n > p_n for infinitely many nn instead, define \mathcal{B} to flip the output of 𝒜\mathcal{A} (run 1𝒜()1 - \mathcal{A}(\cdot) as the distinguisher); this still runs in polynomial time and achieves the same advantage. At least one of the two cases must occur infinitely often, so the argument goes through.

Connection to Barak's notes

This proof is the asymptotic version of the non-asymptotic argument in Barak §2.4. The core idea is identical: a distinguisher with polynomial advantage pnqn1/R(n)p_n - q_n \ge 1/R(n) translates directly into a hardcore-bit guesser with advantage 1/(2R(n))\ge 1/(2R(n)) above 1/21/2.

Remark on P vs. NP.

All the hardness assumptions in this chapter (OWF existence, indistinguishability) are unproven. If P=NP\mathrm{P} = \mathrm{NP}, polynomial-time algorithms exist for inverting any OWF, and modern public-key cryptography collapses. The probability of P=NP\mathrm{P} = \mathrm{NP} is unknown.

Candidate One-Way Functions Revisited

Subset Sum Modulo MM

Parameters: nn elements a1,,anMa_1, \ldots, a_n \in \mathbb{Z}_M, target tMt \in \mathbb{Z}_M. The function fa(s)=iaisimodMf_a(s) = \sum_i a_i s_i \bmod M maps s{0,1}ns \in \{0,1\}^n to M\mathbb{Z}_M. Inverting it (finding a subset summing to tt) is a modular version of the knapsack problem. Hardness depends on the density δ=n/logM\delta = n / \log M:

The solution need not be unique; one-wayness only requires that some preimage is hard to find.

Discrete Logarithm

Let pp be a large prime and gg a generator of p*\mathbb{Z}_p^*, i.e., the powers g1,g2,,gp1g^1, g^2, \ldots, g^{p-1} enumerate all elements of {1,,p1}\{1, \ldots, p-1\}.

Discrete Logarithm Problem Given pp, gg, and yp*y \in \mathbb{Z}_p^*, find xx such that gxy(modp)g^x \equiv y \pmod{p}.

The forward direction (exponentiation: given xx, compute y=gxmodpy = g^x \bmod p) is easy via fast exponentiation. The inverse (given yy, find xx) is the discrete log problem, which is conjectured hard. The famous ElGamal cryptosystem is based on this hardness.

Post-Quantum Cryptography

Both integer factoring and discrete log can be solved in polynomial time on a quantum computer via Shor’s algorithm (1994). If large-scale quantum computers are built, these cryptosystems are broken.

Post-quantum cryptography refers to schemes whose security does not rely on the hardness of factoring or discrete log. The leading candidate is lattice-based cryptography, where hardness is based on problems like Learning With Errors (LWE). Interestingly, lattice algorithms (due to Lenstra–Lenstra–Lovász) were originally used to break knapsack cryptosystems; Regev and others later showed lattice problems could also be used to build secure systems.

GL Proof: Refined Case Analysis

The following is a more explicit version of the argument from §15.10, using conditional probabilities to make each case transparent.

Setup.

As before, \mathcal{B} receives G(s)=f(x)rG(s) = f(x) \circ r, samples a fresh uniform bit Z{0,1}Z \in \{0,1\}, and runs 𝒜\mathcal{A} on G(s)ZG(s) \circ Z.

Case 1: 𝒜\mathcal{A} outputs 1.

\mathcal{B} guesses B(s)=ZB(s) = Z. This is correct iff Z=B(s)Z = B(s), which happens with probability 12\tfrac{1}{2} (since ZZ is chosen uniformly, independent of ss). Conditioned on Z=B(s)Z = B(s), we are feeding 𝒜\mathcal{A} from the red distribution, so Pr[𝒜(G(s)Z)=1Z=B(s)]=pn.\Pr[\mathcal{A}(G(s)\circ Z)=1 \mid Z=B(s)] \;=\; p_n. Contribution to Pr[ correct]\Pr[\mathcal{B}\text{ correct}]: Pr[Z=B(s)]Pr[𝒜(G(s)Z)=1Z=B(s)]=12pn.\Pr[Z=B(s)] \cdot \Pr[\mathcal{A}(G(s)\circ Z)=1 \mid Z=B(s)] \;=\; \tfrac{1}{2}\,p_n.

Case 2: 𝒜\mathcal{A} outputs 0.

\mathcal{B} guesses B(s)=1ZB(s) = 1-Z. This is correct iff Z=1B(s)Z = 1-B(s) (i.e. ZB(s)Z \ne B(s)), which also happens with probability 12\tfrac{1}{2}. Conditioned on Z=1B(s)Z = 1-B(s), we are feeding 𝒜\mathcal{A} from the blue distribution, so Pr[𝒜(G(s)Z)=0Z=1B(s)]=1qn.\Pr[\mathcal{A}(G(s)\circ Z)=0 \mid Z=1-B(s)] \;=\; 1-q_n. Contribution to Pr[ correct]\Pr[\mathcal{B}\text{ correct}]: Pr[Z=1B(s)]Pr[𝒜(G(s)Z)=0Z=1B(s)]=12(1qn).\Pr[Z=1-B(s)] \cdot \Pr[\mathcal{A}(G(s)\circ Z)=0 \mid Z=1-B(s)] \;=\; \tfrac{1}{2}(1-q_n).

Total.

By the law of total probability: Pr[ correct]=12pn+12(1qn)=12+pnqn212+12R(n),\Pr[\mathcal{B}\text{ correct}] \;=\; \tfrac{1}{2}p_n + \tfrac{1}{2}(1-q_n) \;=\; \tfrac{1}{2} + \tfrac{p_n - q_n}{2} \;\ge\; \tfrac{1}{2} + \frac{1}{2R(n)}, which is non-negligibly better than 12\tfrac{1}{2}, contradicting the hardcore property.

Corollary: Hardcore Bit Is Indistinguishable from a Random Bit

The previous theorem showed: {G(s)B(s)}p{G(s)(1B(s))}.\bigl\{G(s) \circ B(s)\bigr\} \;\approx_p\; \bigl\{G(s) \circ (1-B(s))\bigr\}. A useful corollary strengthens this: the hardcore bit is indistinguishable from a uniformly random bit.

Hardcore Bit vs. Random Bit If BB is a hardcore predicate for GG, then {G(s)B(s)}s{0,1}2kp{G(s)U}s{0,1}2k,U{0,1},\bigl\{G(s) \circ B(s)\bigr\}_{s\leftarrow\{0,1\}^{2k}} \;\approx_p\; \bigl\{G(s) \circ U\bigr\}_{s\leftarrow\{0,1\}^{2k},\; U\leftarrow\{0,1\}}, where UU is a fresh uniform bit independent of ss.

Proof. Let 𝒜\mathcal{A} be any PPTM that distinguishes Xn=G(s)B(s)X_n = G(s)\circ B(s) from Yn=G(s)UY_n = G(s)\circ U. Define pn=Pr[𝒜(Xn)=1],qn=Pr[𝒜(Yn)=1].p_n = \Pr[\mathcal{A}(X_n)=1], \quad q_n = \Pr[\mathcal{A}(Y_n)=1]. Decompose YnY_n by conditioning on whether U=B(s)U = B(s) or U=1B(s)U = 1-B(s), each with probability 12\tfrac{1}{2}: qn=12Pr[𝒜(G(s)B(s))=1]+12Pr[𝒜(G(s)(1B(s)))=1]=12pn+12rn,q_n \;=\; \tfrac{1}{2}\,\Pr[\mathcal{A}(G(s)\circ B(s))=1] + \tfrac{1}{2}\,\Pr[\mathcal{A}(G(s)\circ(1-B(s)))=1] \;=\; \tfrac{1}{2}\,p_n + \tfrac{1}{2}\,r_n, where rn=Pr[𝒜(G(s)(1B(s)))=1]r_n = \Pr[\mathcal{A}(G(s)\circ(1-B(s)))=1]. Therefore: pnqn=pn12pn12rn=12(pnrn).p_n - q_n \;=\; p_n - \tfrac{1}{2}\,p_n - \tfrac{1}{2}\,r_n \;=\; \tfrac{1}{2}(p_n - r_n). By the previously proved theorem, pnrn=negl(n)p_n - r_n = \mathrm{negl}(n) (since G(s)B(s)G(s)\circ B(s) and G(s)(1B(s))G(s)\circ(1-B(s)) are already indistinguishable). Hence pnqn=negl(n)p_n - q_n = \mathrm{negl}(n), so 𝒜\mathcal{A} cannot distinguish XnX_n from YnY_n with non-negligible advantage. ◻

Crypto application: why encryption must be randomized

This corollary is the key insight behind semantic security. Suppose a public-key cryptosystem encrypts messages bit by bit. If encryptions of 00 and encryptions of 11 are computationally indistinguishable, then the exact same argument shows that encryptions of a fixed bit bb are indistinguishable from encryptions of a random bit UU.

Why must encryption be randomized? If encryption were deterministic, there would be exactly one ciphertext for 00 and one for 11; an adversary who sees the public key can compute both and compare — trivially distinguishing. Randomization ensures the set of possible ciphertexts for each plaintext overlaps in a computationally undetectable way.

Encryption and Semantic Security

Private-Key Encryption: Syntax

Private-Key Encryption Scheme A private-key encryption scheme is a triple (Gen,Enc,Dec)(\mathrm{Gen}, \mathrm{Enc}, \mathrm{Dec}):

  • Gen(1k)k\mathrm{Gen}(1^k) \to k: probabilistic key generation.

  • Enck(m)c\mathrm{Enc}_k(m) \to c: encryption of message mm under key kk.

  • Deck(c)m\mathrm{Dec}_k(c) \to m: decryption.

Correctness: Deck(Enck(m))=m\mathrm{Dec}_k(\mathrm{Enc}_k(m))=m for all k,mk,m.

Perfect Secrecy (Shannon)

Perfect Secrecy A scheme has perfect secrecy if Pr[M=mC=c]=Pr[M=m]\Pr[M=m\mid C=c]=\Pr[M=m] for all m,cm,c, equivalently Pr[Enck(m0)=c]=Pr[Enck(m1)=c]\Pr[\mathrm{Enc}_k(m_0)=c]=\Pr[\mathrm{Enc}_k(m_1)=c] for all m0,m1,cm_0,m_1,c.

The One-Time Pad (OTP) achieves perfect secrecy: c=mkc = m \oplus k for a uniformly random key kk of the same length as mm.

Shannon’s impossibility.

Any perfectly secret scheme requires |K||M||K|\ge|M| — the key must be at least as long as the message. This makes perfect secrecy impractical, motivating computational security.

Semantic Security

Semantic Security (Goldwasser–Micali) An encryption scheme (Gen,Enc,Dec)(\mathrm{Gen},\mathrm{Enc},\mathrm{Dec}) is semantically secure if for every PPT adversary 𝒜\mathcal{A}, every function ff, and every polynomial pp, for all sufficiently large kk: Pr[𝒜(1k,Enck(m))=f(m)]Pr[𝒜(1k)=f(m)]+1p(k).\Pr[\mathcal{A}(1^k, \mathrm{Enc}_k(m)) = f(m)] \;\le\; \Pr[\mathcal{A}(1^k) = f(m)] + \frac{1}{p(k)}. An adversary who sees the ciphertext learns nothing about the message beyond what she already knew.

IND-CPA Security

IND-CPA (Indistinguishability under Chosen Plaintext Attack) A scheme is IND-CPA secure if for every PPT adversary 𝒜\mathcal{A}: |Pr[b=b]12|<1poly(k),\left|\Pr[b'=b] - \frac{1}{2}\right| \;<\; \frac{1}{\mathrm{poly}(k)}, where the experiment is:

  1. Generate kGen(1k)k\leftarrow\mathrm{Gen}(1^k).

  2. 𝒜\mathcal{A} queries an encryption oracle Enck()\mathrm{Enc}_k(\cdot) adaptively.

  3. 𝒜\mathcal{A} submits two messages m0,m1m_0, m_1.

  4. Challenger picks b{0,1}b\leftarrow\{0,1\}, sends c*=Enck(mb)c^*=\mathrm{Enc}_k(m_b).

  5. 𝒜\mathcal{A} continues to query Enck()\mathrm{Enc}_k(\cdot), then outputs bb'.

Semantic Security \Longleftrightarrow IND-CPA A private-key encryption scheme is semantically secure if and only if it is IND-CPA secure.

Conceptual importance.

Semantic security is the “right” intuitive definition (nothing is leaked), while IND-CPA is the “right” technical definition (clean game, easy to use in reductions). Their equivalence means we can use whichever is convenient.

Stream Ciphers from PRGs

PRG-based Stream Cipher Let G:{0,1}k{0,1}(k)G:\{0,1\}^k\to\{0,1\}^{\ell(k)} be a PRG. Define: Encs(m)=G(s)m,Decs(c)=G(s)c,m{0,1}(k).\mathrm{Enc}_s(m) = G(s) \oplus m, \qquad \mathrm{Dec}_s(c) = G(s) \oplus c, \qquad m \in \{0,1\}^{\ell(k)}.

PRG Stream Cipher is IND-CPA If GG is a PRG, the stream cipher above is IND-CPA secure (for single-message security).

Proof sketch.

If 𝒜\mathcal{A} distinguishes Encs(m0)\mathrm{Enc}_s(m_0) from Encs(m1)\mathrm{Enc}_s(m_1), it distinguishes G(s)m0G(s)\oplus m_0 from G(s)m1G(s)\oplus m_1. Since XOR with a fixed message is a bijection, this implies distinguishing G(s)G(s) from U(k)U_{\ell(k)} — breaking the PRG.

Caution: single-use.

If the same seed ss is reused to encrypt two messages m,mm, m', the adversary sees G(s)mG(s)\oplus m and G(s)mG(s)\oplus m' and can XOR them to recover mmm\oplus m', completely breaking secrecy.

Public-Key Encryption

Private-key encryption requires the sender and receiver to share a secret key in advance. This is the key distribution problem: how do two parties who have never met establish a shared secret over a public channel?

Public-key encryption (PKE) resolves this by having each party hold a key pair: a public key they broadcast freely and a private key they keep secret. Anyone can encrypt to you using your public key; only you can decrypt using your private key.

Public-Key Encryption Scheme A public-key encryption scheme is a triple (Gen,Enc,Dec)(\mathrm{Gen}, \mathrm{Enc}, \mathrm{Dec}):

  • Gen(1k)(𝑝𝑘,𝑠𝑘)\mathrm{Gen}(1^k) \to (\mathit{pk}, \mathit{sk}): generate a public key and a secret key.

  • Enc𝑝𝑘(m)c\mathrm{Enc}_{\mathit{pk}}(m) \to c: encrypt message mm using the public key.

  • Dec𝑠𝑘(c)m\mathrm{Dec}_{\mathit{sk}}(c) \to m: decrypt using the secret key.

Correctness: Dec𝑠𝑘(Enc𝑝𝑘(m))=m\mathrm{Dec}_{\mathit{sk}}(\mathrm{Enc}_{\mathit{pk}}(m)) = m for all valid key pairs and messages.

IND-CPA for PKE.

The definition is the same as for private-key IND-CPA, except the adversary is given the public key 𝑝𝑘\mathit{pk} at the start. This is actually a stronger requirement: since the adversary has 𝑝𝑘\mathit{pk}, they can encrypt arbitrary messages themselves, so the scheme must remain secure even against adversaries with full encryption access.

Why encryption must be randomized.

In a public-key cryptosystem, if encryption were deterministic, any observer could encrypt both messages themselves (the public key is public) and compare against the ciphertext, immediately learning which message was encrypted. A secure scheme must have multiple possible encryptions of each message—i.e., encryption must sample from a distribution. A corollary: if encryptions of 00 are computationally indistinguishable from encryptions of 11, then by the same hybrid argument used in the GL hardcore bit proof, encryptions of any fixed bit bb are also indistinguishable from encryptions of a uniformly random bit.

Quadratic Residues and the QR Hardness Assumption

The Goldwasser–Micali scheme (below) builds on the computational hardness of distinguishing squares from non-squares modulo a composite.

Quadratic Residue Let N=pqN = pq be a product of two distinct odd primes. An element xN*x \in \mathbb{Z}_N^* is a quadratic residue mod NN (written xQRNx \in \mathrm{QR}_N) if there exists sN*s \in \mathbb{Z}_N^* with s2x(modN)s^2 \equiv x \pmod{N}. Otherwise xx is a quadratic non-residue (xQNRNx \in \mathrm{QNR}_N).

The Jacobi symbol.

For N=pqN = pq, the Jacobi symbol JN(x)=(xp)(xq)J_N(x) = \left(\frac{x}{p}\right)\left(\frac{x}{q}\right) (product of Legendre symbols) can be computed without knowing pp and qq.

For N=pqN = pq with pq3(mod4)p \equiv q \equiv 3 \pmod{4}, exactly half of the elements with JN(x)=1J_N(x)=1 are genuine QRs and half are pseudo-squares.

QR Hardness Assumption

Given N=pqN = pq (where p,qp,q are random kk-bit primes with pq3(mod4)p \equiv q \equiv 3 \pmod{4}) and xN*x \in \mathbb{Z}_N^* with JN(x)=1J_N(x) = 1, no PPT algorithm can determine whether xQRNx \in \mathrm{QR}_N with non-negligible advantage over 12\frac{1}{2}.

Key multiplicative structure.

QR ×\times QR == QR; QR ×\times QNR == QNR; QNR ×\times QNR == QR.
Multiplication in N*\mathbb{Z}_N^* corresponds to XOR of the “squareness bit.”

Goldwasser–Micali Probabilistic Encryption

Goldwasser–Micali (GM) Encryption Key generation. Choose random kk-bit primes pq3(mod4)p \equiv q \equiv 3 \pmod{4}, set N=pqN = pq. Choose yN*y \in \mathbb{Z}_N^* with JN(y)=1J_N(y) = 1 but yQNRNy \in \mathrm{QNR}_N (a pseudo-square). Publish 𝑝𝑘=(N,y)\mathit{pk}= (N, y); keep 𝑠𝑘=(p,q)\mathit{sk}= (p, q).

Encryption of a single bit b{0,1}b \in \{0,1\}. Choose rN*r \leftarrow \mathbb{Z}_N^* uniformly at random and output: c=r2ybmodN.c = r^2 \cdot y^b \bmod N.

  • b=0b = 0: c=r2c = r^2 is a random QR.

  • b=1b = 1: c=r2yc = r^2 y is a random pseudo-square (QNR with JN(c)=1J_N(c)=1).

Decryption. Using (p,q)(p,q), check whether cQRNc \in \mathrm{QR}_N. Output 0 if yes, 1 if no.

Multi-bit messages. Encrypt each bit independently with fresh randomness.

GM Security Under the QR hardness assumption, GM encryption is semantically secure (IND-CPA).

Why it is probabilistic.

Different random choices of rr produce different ciphertexts for the same message. This is necessary: a deterministic PKE scheme is never IND-CPA secure (the adversary simply encrypts both challenge messages and compares).

Homomorphic property.

If c1=Enc(b1)c_1 = \mathrm{Enc}(b_1) and c2=Enc(b2)c_2 = \mathrm{Enc}(b_2) (with independent randomness), then c1c2modN=Enc(b1b2),c_1 \cdot c_2 \bmod N \;=\; \mathrm{Enc}(b_1 \oplus b_2), since r12yb1r22yb2=(r1r2)2yb1+b2r_1^2 y^{b_1} \cdot r_2^2 y^{b_2} = (r_1 r_2)^2 y^{b_1 + b_2} and the QR/QNR parity of yb1+b2y^{b_1+b_2} corresponds to b1b2b_1 \oplus b_2. GM is thus a homomorphic encryption scheme with respect to XOR.

Chosen-Ciphertext Attacks

The IND-CPA model gives the adversary access to an encryption oracle. A stronger model gives access to a decryption oracle as well.

CCA Security (Two Variants) CCA-pre (non-adaptive): The adversary may query the decryption oracle Dec𝑠𝑘()\mathrm{Dec}_{\mathit{sk}}(\cdot) on any ciphertexts of their choice before receiving the challenge ciphertext cc^\star. The oracle is then removed.

CCA-post (adaptive, also called CCA2): The adversary retains access to Dec𝑠𝑘()\mathrm{Dec}_{\mathit{sk}}(\cdot) even after receiving cc^\star, with the single restriction that they may not query Dec𝑠𝑘(c)\mathrm{Dec}_{\mathit{sk}}(c^\star) directly.

Why CCA-post?

Giving the adversary a decryption oracle even after seeing the challenge may seem like overkill. The motivation is that in practice we rarely know exactly what capabilities an attacker has. By proving security against the strongest plausible adversary—one who can decrypt anything except the exact ciphertext they are trying to break—we get a guarantee that holds regardless of how the attacker acquires auxiliary decryption power.

Implication chain.

CCA-postCCA-preIND-CPA\text{CCA-post} \Rightarrow \text{CCA-pre} \Rightarrow \text{IND-CPA}. Each implication is strict: there exist schemes secure under the weaker model but broken by the stronger.

Malleability and Non-Malleability

Malleable Encryption Scheme An encryption scheme is malleable if an adversary, given a ciphertext α=Enc(m)\alpha = \mathrm{Enc}(m), can produce a different ciphertext βα\beta \ne \alpha such that Dec(β)\mathrm{Dec}(\beta) has a known relationship to mm (e.g., β\beta decrypts to 2m2m, or to 1m1-m, or to mtm \oplus t for a known tt).

Malleability is a problem because in a CCA setting the adversary can: (1) receive challenge ciphertext α\alpha encrypting unknown mm, (2) produce a related β\beta via the malleability attack, (3) submit βα\beta \ne \alpha to the decryption oracle, (4) learn Dec(β)\mathrm{Dec}(\beta), which reveals information about mm.

Non-Malleability A scheme is non-malleable if for every PPT adversary 𝒜\mathcal{A} and every efficiently computable relation RR on messages, given a challenge ciphertext α=Enc(m)\alpha = \mathrm{Enc}(m), 𝒜\mathcal{A} cannot produce βα\beta \ne \alpha such that R(m,Dec(β))=1R(m,\, \mathrm{Dec}(\beta)) = 1 with non-negligible probability.

Non-malleability is a stronger guarantee than semantic security: any function f(m)f(m) that the adversary could learn under a semantic-security break can be recast as a relation R(m,m)=𝟏[f(m)=f(m)]R(m, m') = \mathbf{1}[f(m) = f(m')], so non-malleability implies semantic security. The converse fails: a semantically secure scheme can be malleable (as GM demonstrates below).

The Six Notions of Security

Combining adversary power with break type yields six standard notions:

CPA CCA-pre CCA-post
Semantic security IND-CPA IND-CCA-pre IND-CCA2
Non-malleability NM-CPA NM-CCA-pre NM-CCA2

These are ordered by strength: NM-CCA2 is the strongest and IND-CPA the weakest. For most practical protocols (e.g., TLS), IND-CCA2 security is the target.

The GM Scheme is Malleable

Goldwasser–Micali is IND-CPA secure (Theorem [th:gm-sec]), but it is malleable under CCA, because the multiplicative structure of N*\mathbb{Z}_N^* is public.

Attack: produce another encryption of the same bit.

Given challenge α=r2ybmodN\alpha = r^2 \cdot y^b \bmod N (an encryption of bit bb): choose a fresh random sN*s \in \mathbb{Z}_N^* and set β=s2αmodN\beta = s^2 \cdot \alpha \bmod N. Since s2s^2 is a QR, multiplying by it preserves quadratic residuosity: β=(sr)2ybmodN,\beta = (sr)^2 \cdot y^b \bmod N, which is a fresh, independently distributed encryption of bb. The adversary can submit βα\beta \ne \alpha to the decryption oracle and learns bb.

Attack: produce an encryption of the flipped bit.

Set β=(1)αmodN\beta = (-1) \cdot \alpha \bmod N. Since 1-1 is a pseudo-square (QNR with Jacobi symbol +1+1) by the choice of pq3(mod4)p \equiv q \equiv 3 \pmod{4}, multiplying flips QR \leftrightarrow QNR: β is an encryption of 1b.\beta \text{ is an encryption of } 1-b. Decrypting β\beta via the CCA oracle reveals 1b1-b, hence bb.

Takeaway

The GM scheme’s homomorphic property (XOR on ciphertexts) is what makes it useful for certain applications—but it is also exactly what makes it malleable. Achieving NM-CCA2 security requires abandoning homomorphism or adding non-interactive zero-knowledge proofs of well-formedness (as in the Cramer–Shoup scheme).

Zero Knowledge

From Classical Proofs to Interactive Proofs

Classical proofs.

A classical mathematical proof is a checkable sequence of statements: fix axioms and rules of inference, and every line is either an axiom or the result of applying a deduction rule to earlier lines. This is the setting of Euclidean geometry, Peano arithmetic, and so on. (By Gödel’s incompleteness theorem, no such system can be simultaneously complete and consistent — but this will not concern us here.)

NP and polynomial witnesses.

The complexity class NP formalizes classical proofs: a language LL is in NP if membership has a polynomial-length, efficiently checkable proof. Formally, xLx \in L iff w\exists\, w with |w|=poly(|x|)|w| = \mathrm{poly}(|x|) and R(x,w)=1R(x, w) = 1 (where RR is polynomial-time).

The witness ww may not be unique: many satisfying assignments may exist for the same formula.

The limitation: co-NP.

Proving that a statement is false — a formula is unsatisfiable, two graphs are non-isomorphic, a graph has no Hamiltonian cycle — amounts to a “for all” quantifier. There is no known short proof of such statements (that would imply P = NP or NP = co-NP). Intuitively, it is easier to demonstrate a satisfying assignment than to argue that none exists.

Interactive proofs.

In an interactive proof system, the verifier is not passive. Instead of receiving a proof and checking it line by line, the verifier asks questions. This is particularly powerful for statements outside NP.

Interactive Proof System An interactive proof system for language LL is a protocol between a prover PP and verifier VV satisfying:

  • Completeness: if xLx \in L, VV accepts with probability 2/3\ge 2/3.

  • Soundness: if xLx \notin L, no prover P*P^* makes VV accept with probability >1/3> 1/3.

By repeating the protocol kk times and accepting only if all rounds accept, completeness can be boosted to 12Ω(k)1 - 2^{-\Omega(k)} and soundness error reduced to 2Ω(k)2^{-\Omega(k)}.

Graph Non-Isomorphism: An Interactive Proof

Graph isomorphism (GI) is in NP: prove GHG \cong H by exhibiting the isomorphism. But graph non-isomorphism (GNI) is not known to be in NP — there is no known short proof that two graphs are not isomorphic. Nevertheless, a powerful prover can convince a verifier interactively.

Protocol (one round).
  1. VV picks X{G,H}X \in \{G, H\} uniformly at random, computes a uniformly random isomorphic copy Y=φ(X)Y = \varphi(X), and sends YY to PP.

  2. PP identifies which of GG or HH the graph YY was derived from, and sends its guess b̂\hat{b} to VV.

  3. VV accepts iff b̂\hat{b} equals its original choice.

Repeat kk times independently.

Analysis.

GNI has an interactive proof even though it is not known to be in NP. Interactive proofs are provably more powerful than classical NP proofs (under standard assumptions).

Zero-Knowledge Proofs: Definition and Motivation

In practice, the prover often holds a secret witness — a satisfying assignment, a graph coloring, a Hamiltonian cycle, a private key — and wants to convince the verifier that the statement is true without revealing the witness.

Why keep the witness secret?

Zero-Knowledge Proof (Goldwasser–Micali–Rackoff) An interactive proof (P,V)(P, V) for LL is (computational) zero knowledge if for every PPT cheating verifier V*V^* and every auxiliary input zz, there exists a PPT simulator SS such that for all xLx \in L: ViewV*(P(x,w),V*(x,z))cS(x,z),\mathrm{View}_{V^*}(P(x,w),\, V^*(x,z)) \;\stackrel{c}{\approx}\; S(x, z), where ViewV*\mathrm{View}_{V^*} is the full transcript of the interaction seen by V*V^*.

Interpretation.

The simulator has no access to the prover or the witness ww, yet it produces transcripts computationally indistinguishable from real interactions. Since the verifier can generate equally good transcripts on its own, real transcripts cannot be leaking anything about ww. This is the exact analogue of semantic security: seeing the ciphertext (or the transcript) gives the adversary no advantage.

The Lady Tasting Tea

The statistician Muriel Bristol claimed to distinguish tea poured milk-first from tea-first. In a blind test with 8 cups, she identified all 8 correctly — an event with probability 282^{-8} if guessing at random. The test proves she has the ability, but reveals nothing about how: no information about her taste physiology, sensitivity, or method is ever disclosed.

This is an informal zero-knowledge proof of capability: the verifier is convinced of the fact, but learns nothing about the witness behind it.

Commitment Schemes

Physical intuition: the sealed envelope

You write your prediction on paper, seal it in an envelope, and hand it to the verifier. Before opening, the verifier has no idea what is inside (hiding). Once handed over, you cannot change the contents (binding). When opened, the verifier can check your claim.

Commitment Scheme A commitment scheme has two phases:

  1. Commit phase. The sender transmits com(v;r)\mathrm{com}(v;\, r) (where rr is fresh randomness) to the receiver. The sender is now bound to vv, but the receiver learns nothing about it.

  2. Open phase. The sender reveals (v,r)(v, r); the receiver verifies.

Hiding: A PPT receiver cannot distinguish com(0;r)\mathrm{com}(0; r) from com(1;r)\mathrm{com}(1; r) during the commit phase.
Binding: The sender cannot produce (v,r)(v', r') with vvv' \ne v opening the same commitment.

Information-theoretic vs. computational.

Each of hiding and binding can hold either information-theoretically (no algorithm, regardless of power, can break it) or computationally (no PPT algorithm can break it under a hardness assumption).

Fundamental impossibility

No commitment scheme can be simultaneously information-theoretically hiding and information-theoretically binding. All other three combinations are achievable.

Example (QR-based). Commit to bit bb by sending a random QR (if b=0b=0) or QNR with JN=1J_N = 1 (if b=1b=1) modulo NN. Binding is information-theoretic (a number is or is not a square; this cannot be changed). Hiding is computational: under the QR assumption, QRs and pseudo-squares are indistinguishable in poly time.

Interactive Proof for Quadratic Non-Residuosity

Both PP and VV know XN*X \in \mathbb{Z}_N^* with JN(X)=1J_N(X) = 1. The prover claims XQNRNX \in \mathrm{QNR}_N and knows the factorization of NN.

Protocol (one round).
  1. VV picks SN*S \leftarrow \mathbb{Z}_N^* and b{0,1}b \leftarrow \{0,1\} uniformly. Sends: Y={S2modNb=0S2XmodNb=1Y = \begin{cases} S^2 \bmod N & b = 0 \\ S^2 X \bmod N & b = 1 \end{cases}

  2. PP identifies bb (using the factorization to test whether YQRNY \in \mathrm{QR}_N) and sends b̂\hat{b} to VV.

  3. VV accepts iff b̂=b\hat{b} = b.

Analysis.

Zero-Knowledge Proof for Quadratic Residuosity

Now PP claims XQRNX \in \mathrm{QR}_N and knows ss with s2X(modN)s^2 \equiv X \pmod{N}. The goal is to prove this without revealing ss.

Protocol (one round).
  1. PP picks TN*T \leftarrow \mathbb{Z}_N^* uniformly. Sends α=T2XmodN\alpha = T^2 X \bmod N.

  2. VV picks b{0,1}b \leftarrow \{0,1\} and sends bb to PP.

  3. PP sends: Y={TSmodNb=0TmodNb=1Y = \begin{cases} TS \bmod N & b = 0 \\ T \bmod N & b = 1 \end{cases}

  4. VV checks: {Y2α(modN)b=0Y2Xα(modN)b=1\begin{cases} Y^2 \equiv \alpha \pmod{N} & b = 0 \\ Y^2 X \equiv \alpha \pmod{N} & b = 1 \end{cases}

Correctness.
Zero knowledge via the rewind simulator.

The real transcript distribution is:

The secret ss is always multiplied by a fresh uniform TT; the verifier never sees ss directly.

The simulator proceeds:

  1. Flip a coin to guess b̂{0,1}\hat{b} \in \{0,1\}.

  2. Pick uniform YN*Y' \in \mathbb{Z}_N^*.

  3. If b̂=0\hat{b}=0: set α=(Y)2\alpha' = (Y')^2; prepare to send YY'.
    If b̂=1\hat{b}=1: set α=(Y)2X\alpha' = (Y')^2 X; prepare to send YY'.

  4. Send α\alpha' to V*V^* and receive bactualb_{\mathrm{actual}}.

  5. If bactual=b̂b_{\mathrm{actual}} = \hat{b}: output the transcript (α,bactual,Y)(\alpha', b_{\mathrm{actual}}, Y').

  6. Otherwise: rewind V*V^* to its state before step 4 and retry.

In expectation, only 2 attempts suffice per round. In either case, the produced transcript is identically distributed to a real interaction: b=0b=0 gives (Y2,0,Y)(Y^2, 0, Y) for uniform YY; b=1b=1 gives (Y2X,1,Y)(Y^2 X, 1, Y) for uniform YY.

Zero-Knowledge Proof of Hamiltonicity

A graph G=(V,E)G = (V, E) is Hamiltonian if it contains a cycle visiting every vertex exactly once. Hamiltonicity is NP-complete, so the Hamiltonian cycle CC is the witness. The following protocol (from Barak’s notes, with the commitment scheme abstracted) convinces the verifier that GG is Hamiltonian without revealing CC.

Protocol (one round)

  1. Commit. PP picks a uniformly random permutation π\pi of V(G)V(G) and forms H=π(G)H = \pi(G) (same edges, vertices relabeled by π\pi). PP sends a commitment to each entry of the |V|×|V||V|\times|V| adjacency matrix of HH, one bit per entry.

  2. Challenge. VV picks b{0,1}b \leftarrow \{0,1\} and sends bb to PP.

  3. Response.

    • b=0b=0: PP opens all commitments and reveals π\pi. VV checks that HH is a valid permutation of GG.

    • b=1b=1: PP opens only the entries of the adjacency matrix of HH corresponding to the permuted cycle π(C)\pi(C) (i.e., the nn edges π(c1)π(c2),π(c2)π(c3),\pi(c_1)\pi(c_2),\;\pi(c_2)\pi(c_3),\;\ldots). VV checks these entries form a Hamiltonian cycle in HH.

Repeat kk times with fresh randomness from PP each round.

Correctness and Soundness

Zero Knowledge: The Rewind Simulator

Simulator for the Hamiltonicity protocol

The simulator SS for each round:

  1. Guess the challenge. Flip a coin: guess b̂{0,1}\hat{b} \in \{0,1\}.

  2. Prepare commitments.

    • b̂=0\hat{b}=0: commit to the adjacency matrix of a genuine random permutation π(G)\pi(G) (can open the whole matrix to pass b=0b=0).

    • b̂=1\hat{b}=1: commit to a matrix with 1s on an arbitrary Hamiltonian cycle and arbitrary values elsewhere (can open the cycle to pass b=1b=1).

  3. Run the (possibly cheating) verifier V*V^* and receive bactualb_{\mathrm{actual}}.

  4. If bactual=b̂b_{\mathrm{actual}} = \hat{b}: open the prepared commitments and output the transcript.
    If bactualb̂b_{\mathrm{actual}} \ne \hat{b}: rewind V*V^* to the start of this round and repeat from step 1.

In expectation, 2 attempts suffice.

The verifier sees either the whole permuted graph (but no cycle information) or just the cycle positions (but not the rest of the graph) — never both at once. The commitment scheme’s hiding property ensures that unopened entries reveal nothing. The Hamiltonian cycle CC is never disclosed.

Zero-Knowledge Proof for 3-Colorability

The canonical theoretical example: every NP language has a zero-knowledge proof.

Protocol.

Given graph G=(V,E)G = (V, E) and a 3-coloring χ\chi known to the prover:

  1. PP picks a uniformly random permutation π\pi of {1,2,3}\{1,2,3\}, applies it to get coloring πχ\pi\circ\chi, and commits to each vertex’s color: sends {Commit(π(χ(v)))}vV\{\mathrm{Commit}(\pi(\chi(v)))\}_{v\in V}.

  2. VV challenges with a random edge (u,w)E(u,w) \in E.

  3. PP opens the commitments for uu and ww, revealing π(χ(u))\pi(\chi(u)) and π(χ(w))\pi(\chi(w)).

  4. VV accepts iff the two revealed colors are distinct.

Repeat |E|k|E|\cdot k times.

Analysis.

NP \subseteq ZK (under computational assumptions) Under the assumption that one-way functions exist, every language in NP has a computational zero-knowledge interactive proof system.

This follows from 3-colorability having a ZK proof, combined with the NP-completeness of 3-coloring (via Cook–Levin and reduction): any NP language reduces to 3-coloring in polynomial time.

Connection to commitment schemes.

The ZK protocols above rely on commitments: binding ensures soundness (the prover cannot change the committed coloring or permutation after the challenge); hiding ensures zero knowledge (unopened commitments reveal nothing). Commitment schemes can be constructed from one-way functions.

Post-Quantum Cryptography: Lattice-Based Schemes

The cryptographic constructions discussed in this course — factoring-based (Goldwasser–Micali) and discrete-log-based systems — are not post-quantum secure. Shor’s algorithm solves both integer factorization and discrete logarithm in polynomial time on a quantum computer.

Lattice problems offer a post-quantum alternative. Ajtai (1996) introduced lattice problems with a remarkable worst-case to average-case reduction: solving random instances efficiently would imply solving the hardest instances efficiently. This gives a provable guarantee that factoring lacks: random instances are provably as hard as the worst case. Moreover, no efficient quantum algorithm for lattice problems is known.

Why lattice-based cryptography matters
  • Post-quantum: no known quantum speedup.

  • Worst-case hardness: security provably tied to hard worst-case instances, not just empirical hardness of random ones.

  • Versatility: supports fully homomorphic encryption and other advanced primitives not achievable from factoring alone.

ZK-SNARKs: Succinct Non-Interactive Zero Knowledge

Motivation: Privacy in Distributed Systems

Bitcoin introduced a pseudonymous transaction model: every user operates under a public key rather than a name. But pseudonymity is not anonymity. Because the blockchain is a public ledger, an observer can link transactions to the same pseudonym, and then link pseudonyms to identities via auxiliary information — precisely the linkage-attack strategy that defeated Netflix’s “anonymous” ratings (see Chapter 11).

ZK-SNARKs (Zero-Knowledge Succinct Non-Interactive Arguments of Knowledge) were developed, in part, to provide genuinely private transactions: a user proves they are authorized to spend funds without revealing which funds, in which wallet, at what time.

The SNARK Acronym Unpacked

Zero-Knowledge (ZK):

the verifier learns nothing beyond the truth of the statement (the simulator paradigm of Goldwasser–Micali–Rackoff).

Succinct (S):

the proof has size polylogN\mathrm{poly}\log N, where NN is the length of the witness, rather than poly(N)\mathrm{poly}(N).

Non-Interactive (NI):

no back-and-forth between prover and verifier; a single message suffices (achieved via the Fiat–Shamir heuristic).

Argument (A):

soundness holds only against computationally bounded provers (under cryptographic assumptions), not information-theoretically.

of Knowledge (K):

the prover does not merely show a witness exists; the protocol extracts the witness from any successful prover, proving that the prover genuinely “knows” it.

Construction: PCP + Merkle Tree + Fiat–Shamir

The construction proceeds in three steps:

Step 1: Probabilistically Checkable Proof (PCP).

By the PCP theorem, any NP witness ww of length NN can be encoded into a probabilistically checkable proof π\pi of length poly(N)\mathrm{poly}(N) such that a verifier who reads only polylogN\mathrm{poly}\log N randomly chosen positions of π\pi can check validity with high probability. This is remarkable: the verifier does not read the whole proof.

Step 2: Merkle Tree for Commitment and Selective Opening.

Naively, the prover would send all of π\pi to the verifier, which is poly(N)\mathrm{poly}(N) bits. Instead:

  1. The prover commits to π\pi by building a Merkle tree over the leaves π1,,πpoly(N)\pi_1,\ldots,\pi_{\mathrm{poly}(N)} and sending only the root hash h=MerkleRoot(π)h = \mathrm{MerkleRoot}(\pi).

  2. The verifier requests polylogN\mathrm{poly}\log N leaf positions.

  3. The prover opens each requested leaf with an authentication path (a sequence of sibling hashes of length O(logN)O(\log N)).

Each opening is itself a proof of membership in the Merkle tree, which can be verified against the root hh in O(logN)O(\log N) hash evaluations. The prover then gives a zero-knowledge interactive proof for each opening, ensuring no information about the unopened leaves is revealed.

Step 3: Fiat–Shamir Heuristic.

The protocol so far is interactive (the verifier sends random challenges). The Fiat–Shamir heuristic replaces every verifier message with the output of a cryptographic hash function applied to the transcript so far: ci=H(transcript up to round i).c_i \;=\; H(\text{transcript up to round }i). This makes the protocol non-interactive: the prover computes the “challenges” herself using the hash, then sends the entire transcript in one message. Security holds in the random oracle model, where HH is modeled as a truly random function.

ZK-SNARK Witness Size Using PCP + Merkle commitment + Fiat–Shamir, the resulting proof has |proof|=polylogN,|\text{proof}| = \mathrm{poly}\log N, where NN is the length of the original NP witness. The verifier runs in polylogN\mathrm{poly}\log N time.

Why this is remarkable.

For NP statements with witnesses of length, say, N=109N = 10^9 bits, a classical interactive ZK proof would require the verifier to process poly(109)\mathrm{poly}(10^9) data. A ZK-SNARK reduces this to polylog(109)900\mathrm{poly}\log(10^9) \approx 900 bits. The verifier’s work is essentially independent of the witness size.

Proofs of Work: Origins and Design

The Original Problem: Spam Deterrence

Proofs of work were invented in 1992 by Dwork and Naor for a purpose entirely unrelated to cryptocurrency: combating email spam.

The core observation: sending an email is essentially free for the sender but costly (in attention) for the recipient. If sending a single email required even a small amount of computation — say, 10 seconds of CPU time — then legitimate users would barely notice, but a spammer sending millions of emails would face an insurmountable computational burden.

Moderately Hard Functions

The technical object is a moderately hard function: a function ff such that

The Puzzle Structure

In Dwork and Naor’s scheme, the puzzle for a message mm sent to recipient rr is: find x such that H(m,r,bindingx)<T,\text{find } x \text{ such that } H(\underbrace{m, r,}_{\text{binding}} x) < T, where HH is a hash function and TT is a difficulty threshold. The message mm and recipient rr are bound into the puzzle, preventing reuse.

Trapdoor for legitimate bulk mailers.

Dwork and Naor’s original scheme included a trapdoor: a trusted authority could issue “puzzle masters” who can solve puzzles in O(1)O(1) time using a private key. This allowed legitimate bulk mailers (e.g., newsletters) to send efficiently while still imposing cost on unauthorized spammers.

Bitcoin Diverges from the Original Design

Bitcoin’s proof-of-work mechanism shares the high-level structure (find a nonce xx such that H(block header,x)<TH(\text{block header}, x) < T) but differs in two important ways:

  1. No trapdoor. Bitcoin’s hash-based PoW has no shortcut: every miner, including the protocol’s creators, must perform full brute-force search. This is a deliberate design choice for decentralization.

  2. Environmental cost. Without a trapdoor, all computation is wasted work. Bitcoin’s global mining network consumes electricity comparable to small countries. The Dwork–Naor design explicitly avoids this: legitimate senders with the trapdoor pay negligible cost; only spammers pay.

Implementation: Microsoft Outlook

Microsoft implemented a proof-of-work filter in Outlook: outgoing emails would include a small computational certificate, computed silently in the background. Mail servers could weight incoming mail higher or lower based on whether a valid certificate was present. This is a direct descendant of the Dwork–Naor design.

Key distinction

Dwork–Naor (1992): moderately hard, per-message-per-recipient, trapdoor exists for authorized bulk senders. Bitcoin (2008): moderately hard, global race, no trapdoor, no trusted authority — at the cost of enormous energy use.

Paper Readings

Goldwasser, Micali, Rackoff (1989) — The Knowledge Complexity of Interactive Proof Systems.

Introduces interactive proof systems and defines zero knowledge via the simulator paradigm: a proof is zero-knowledge if a polynomial-time simulator, without access to the prover or the witness, can produce transcripts computationally indistinguishable from real interactions. The paper proves that graph isomorphism has a zero-knowledge proof and introduces the notion of “knowledge complexity” to quantify how much information a proof leaks. The simulator paradigm established here is now the standard framework for defining security in virtually every area of modern cryptography, from encryption to multi-party computation.

Kilian (1992) — A Note on Efficient Zero-Knowledge Proofs and Arguments.

Combines probabilistically checkable proofs, Merkle tree commitments, and zero-knowledge proofs of knowledge into the first succinct argument system: the prover Merkle-commits to a PCP encoding of the witness, the verifier queries a polylogarithmic number of positions, and the prover responds with a ZK proof that the PCP verifier would accept the committed values — without ever revealing the PCP itself. Communication is polylog(|T|)\mathrm{polylog}(|T|) rather than polynomial, a dramatic improvement over raw ZK proofs. This construction is the conceptual ancestor of SNARKs, STARKs, and the shielded transaction system of Zcash discussed in Chapter 18.

Bridging Fairness and Privacy

Bitcoin and Blockchain: A Case Study in Distributed Trust

The Double-Spend Problem

Digital money faces a fundamental problem that physical cash does not: a digital file representing a coin can be copied. Alice could send Bob a digital coin and simultaneously send Carol the same coin. Digital signatures solve part of the problem — they prove Alice authorized a transaction — but they do not prevent Alice from signing two conflicting transactions.

Prior attempts.

Pre-Bitcoin digital currency schemes (e-cash, DigiCash) relied on a trusted central server to maintain a “spent coins” list. This is exactly what a bank does. Nakamoto’s insight was to eliminate the trusted central party entirely.

Blockchain as a Distributed Timestamp Server

A blockchain is an append-only linked list of blocks, where each block

  1. Contains a batch of transactions,

  2. Contains the cryptographic hash of the previous block (creating a chain: modifying any past block changes all subsequent hashes), and

  3. Contains a proof-of-work certificate.

Because blocks are linked by hashes, an adversary who wants to alter a historical transaction must recompute all subsequent blocks’ proofs of work — an infeasible task if the adversary controls less than half the network’s compute power.

Proof of Work as Byzantine Fault Tolerance

The core mechanism is the proof of work (see Section 17.12 for the 1992 origins). Miners compete to extend the chain: the first to find a valid nonce broadcasts the new block and receives the block reward. By the longest-chain rule (Nakamoto consensus), nodes accept the chain with the most cumulative work as the canonical history.

Why this prevents double-spend.

Suppose Alice broadcasts conflicting transactions T1T_1 (to Bob) and T2T_2 (to Carol). Both transactions propagate through the network, but only one can appear in the canonical chain. Nakamoto consensus resolves the conflict: whichever transaction gets mined first into the longest chain wins; the other is discarded. Alice would need to out-mine the honest network (controlling >50%>50\% of compute power) to retroactively rewrite history — a 51% attack.

Security via gambler’s ruin.

If an attacker controls fraction q<1/2q < 1/2 of compute power and an honest transaction has been confirmed with kk blocks of work on top of it, the probability that the attacker can reverse the transaction converges to (q/(1q))k(q/(1-q))^k, which is negligible for modest kk (e.g., Bitcoin conventionally waits for 6 confirmations \approx 60 minutes).

Incentive Mechanism

Nakamoto designed a self-sustaining incentive structure:

This aligns rational miners’ interests with honest participation: cheating (e.g., accepting double-spends) would undermine confidence in Bitcoin and destroy the value of the very coins they just earned.

Merkle Trees for Efficient Verification

Each block header commits to its transaction set via a Merkle tree: transactions are leaves; each internal node is the hash of its two children; the root hash is stored in the block header (a single 32-byte value regardless of how many transactions are in the block).

Practical benefit.

A light client (e.g., a mobile wallet) does not store the full blockchain. To verify that transaction TT is in block BB, it only needs the root hash (already stored in the block header) and the O(logn)O(\log n) sibling hashes along the path from TT’s leaf to the root — an authentication path. Full transaction data can be pruned after a block is sufficiently buried.

Privacy Limitations: Pseudonymity vs. Anonymity

Bitcoin’s white paper describes a “privacy model” based on pseudonymity: instead of using real names, users operate under public keys. But this is not anonymity.

Linkage attacks.

Because the blockchain is a public ledger, every transaction is visible. An adversary who can link one public key to a real identity (e.g., via an exchange that requires KYC, or via IP address logging when a transaction is first broadcast) can trace the graph of all that key’s transactions. Further, inputs to a transaction are often assumed to belong to the same wallet, allowing clustering.

Connection to Netflix de-anonymization.

This is the same structural problem as the Netflix Prize dataset (Chapter 11): releasing “anonymous” records with rich structure provides sufficient auxiliary information for re-identification. The blockchain is maximally rich in structure — a permanent, global, perfectly accurate record of every transaction ever made.

ZK-SNARKs as a Privacy-Preserving Upgrade

The pseudonymity failure of Bitcoin motivated the design of privacy coins such as Zcash, which use ZK-SNARKs (Section 17.11) to allow shielded transactions: a user proves in zero knowledge that

  1. They own a valid coin (i.e., know a secret key for a coin in the Merkle tree of unspent outputs), and

  2. They are not double-spending (the nullifier for this coin has not been revealed before),

without revealing which coin, which key, or how much is being transferred. The SNARK proof is succinct (polylogN\mathrm{poly}\log N) and non-interactive, making it compatible with blockchain’s trust model.

Course connection

Bitcoin illustrates the interplay of all three course themes:

  • Privacy: pseudonymity without DP or ZK is insufficient; linkage attacks succeed as they did on Netflix.

  • Cryptography: the system is built from digital signatures, hash functions, Merkle trees, and (in Zcash) ZK-SNARKs — every tool from this course’s second half.

  • Fairness: the incentive mechanism (Nakamoto consensus, selfish mining) raises questions about who controls the protocol and whether “one CPU, one vote” concentrates power in mining pools, mirroring algorithmic fairness concerns about concentration of decision-making power.

Selfish mining.

One known attack on Nakamoto consensus is selfish mining: a miner with fraction q>1/3q > 1/3 of compute power can earn disproportionate rewards by strategically withholding found blocks and releasing them to fork the honest chain. This violates the assumption that rational miners always broadcast blocks immediately, and is an active research area connecting mechanism design to cryptographic protocols.