Dwork Roth 2014 - Sparse Vector Technique
Summary
When a long (possibly adaptive) stream of sensitivity-1 queries must be monitored but only a few exceed a public threshold , the sparse vector technique answers “above/below” at privacy cost that depends only on the number of above-threshold queries, not the stream length. AboveThreshold (halts after one hit) is -DP with noisy threshold and per-query noise ; Sparse restarts it times, using composition; NumericSparse also releases noisy values. Accuracy is for , matching Laplace answers to the big queries up to a factor.
Overview
Independent perturbation of queries makes privacy degrade proportionally to (or with advanced composition). If we only care about which queries lie above a threshold, we can “discard the numeric answer to queries that lie significantly below the threshold, and merely report that they do indeed lie below”. The technique is simple (add noise, report whether the noisy value exceeds the threshold) and “our emphasis is on the analysis, showing that privacy degrades only with the number of queries which actually lie above the threshold”. It is an online mechanism; the non-interactive analogue is to iterate Report Noisy Max or the exponential mechanism.
Setting. sensitivity-1 queries (possibly adaptive), one public threshold (per-query thresholds change nothing), a small number of expected above-threshold queries. The algorithm works with a noisy threshold ; is public but is not.
Main Content
Algorithm 1 - AboveThreshold (p. 57)
T_hat = T + Lap(2/eps) for each query i: nu_i = Lap(4/eps) if f_i(D) + nu_i >= T_hat: output a_i = TOP; halt else: output a_i = BOTTOMInput: private database , adaptively chosen stream of sensitivity-1 queries , threshold . Output: stream of responses.
Theorem 3.23 (p. 57)
AboveThreshold is -differentially private, no matter how long the stream is.
Proof (pp. 57-58)
Fix neighbours . Let be the outputs on ; an output has the form with for and . Internal randomness: the noisy threshold and perturbations . Fix and take probabilities over and . Let , now deterministic. Then
Change variables and . Since each is 1-sensitive, so is , hence and . Under this shift the indicator maps to the same event on : . Because the Laplace densities have scales and , shifting by at most costs a factor and shifting by at most costs . Therefore . (Proof due to Salil Vadhan.)
Definition 3.9 - -accuracy (pp. 58-59)
A stream-answering algorithm outputting for queries is -accurate w.r.t. threshold if, except with probability at most , it does not halt before and for all : and for all : .
What can go wrong: may be far from ; a small count may get large noise and be reported above; a large count may get negative noise and be reported below. Each happens with probability exponentially small in , so is allocated to threshold error and to query noise.
Theorem 3.24 (p. 59)
For any sequence of queries with (the only query near or above the threshold is possibly the last), AboveThreshold is -accurate for
Proof (pp. 59-60)
It suffices to show that except with probability : . Then for : , so ; for : ; and for with , so and the algorithm does not halt early. With : requires ; and by a union bound requires . The second dominates.
Multiple above-threshold queries: Sparse
Algorithm 2 - Sparse (p. 61)
if delta == 0: sigma = 2c/eps else: sigma = sqrt(32 c ln(1/delta)) / eps T_hat_0 = T + Lap(sigma); count = 0 for each query i: nu_i = Lap(2*sigma) if f_i(D) + nu_i >= T_hat_count: output TOP; count += 1; T_hat_count = T + Lap(sigma) else: output BOTTOM if count >= c: halt
Theorem 3.25 (pp. 60-61)
Sparse is -differentially private.
Proof (pp. 60-61)
Sparse is exactly equivalent to running AboveThreshold on the stream, restarting it on the remaining stream each time it halts, times in total, with if and otherwise. (Check: AboveThreshold’s noisy-threshold scale equals in the first case and in the second.) Each run is -DP by Thm. 3.23. By basic composition runs with are -DP; by advanced composition (Thm. 3.20) runs with are -DP.
Theorem 3.26 (p. 62)
For any queries with , Sparse is -accurate for
Proof (p. 62). Sparse consists of calls of AboveThreshold; if each call is -accurate then Sparse is -accurate. Apply Thm. 3.24 with and equal to or .
Releasing the values: NumericSparse
Algorithm 3 - NumericSparse (p. 63)
Like Sparse, but when a query is above threshold it outputs with , where the budget is split as: if , , ; else , ; and if , else . Thresholds and per-query noise use (noisy threshold , query noise ). Outputs otherwise.
Theorem 3.27 (p. 62)
NumericSparse is -differentially private.
Proof (p. 62). If , NumericSparse is the adaptive composition of Sparse with the Laplace mechanism at privacy parameters (answering the released values, noise scale ). If it is the composition of Sparse with the Laplace mechanism at . Privacy follows by simple composition.
Definition 3.10 - Numeric accuracy (p. 63)
For answers in : -accurate w.r.t. if, except with probability at most , the algorithm does not halt before , for all : , and for all : .
Theorem 3.28 (pp. 63-64)
For any queries with , NumericSparse is -accurate for
Proof (p. 64). Two conditions: (i) for , , holding with probability by the accuracy of Sparse; (ii) for , , holding with probability by the accuracy of the Laplace mechanism.
Take-away (p. 64)
If at most of a stream of queries have answers above , those above the threshold can be answered up to error . This accuracy equals, up to constants and a factor, what one would get if the identities of the large queries were known in advance and answered by the Laplace mechanism: the technique “fish[es] out the identities of these large queries almost ‘for free’, paying only logarithmically for the irrelevant queries”. The same guarantee could come from finding them with the exponential mechanism then answering with Laplace, but SVT is trivial to run and allows adaptively chosen queries.
Bibliographic notes (Sec. 3.7, pp. 64-65). Randomized response: Warner (1965). Laplace mechanism: Dwork et al. Exponential mechanism: McSherry and Talwar. Simple composition claimed in Dwork et al. [21], proof in Appendix B due to Dwork and Lei (McSherry and Mironov obtained a similar proof). Sections 3.5.1-3.5.2 are taken almost verbatim from Dwork, Rothblum, Vadhan; prior “evolution of confidence” arguments (Dinur, Dwork, Nissim) showed deterioration for specific mechanisms. Near-tightness of composition without coordinated noise: Dwork, Naor, Vadhan. SVT abstracts a technique of Dwork-Naor-Reingold-Rothblum-Vadhan (indicator vectors in the proof of their Lemma 4.4) and found wide use (Roth-Roughgarden; Dwork-Naor-Pitassi-Rothblum; Hardt-Rothblum); the proof of Thm. 3.23 is due to Salil Vadhan.
Examples
Monitoring 1000 metrics, one anomaly (own simulation). sensitivity-1 queries with true value 0 except query 700 with value 200; threshold ; . Theorem 3.24 with gives . The theorem’s condition holds because every query except the last has value . In 2000 runs AboveThreshold halted at query 700 every time, with no early false alarm and no miss. With anomalies at queries 100, 400, 800 (value 300, , , ), Sparse returned at exactly and halted after the third; .
import numpy as np, math
rng = np.random.default_rng(0)
def above_threshold(values, T, eps, rng=rng):
"""Alg. 1. Returns index of first above-threshold query (or None)."""
T_hat = T + rng.laplace(0, 2 / eps)
for i, v in enumerate(values):
if v + rng.laplace(0, 4 / eps) >= T_hat:
return i
return None
def sparse(values, T, c, eps, delta=0.0, rng=rng):
"""Alg. 2. Returns list of booleans (True = above threshold) until c hits."""
sigma = 2 * c / eps if delta == 0 else math.sqrt(32 * c * math.log(1 / delta)) / eps
T_hat, count, out = T + rng.laplace(0, sigma), 0, []
for v in values:
if v + rng.laplace(0, 2 * sigma) >= T_hat:
out.append(True); count += 1; T_hat = T + rng.laplace(0, sigma)
else:
out.append(False)
if count >= c:
break
return out
values = np.zeros(1000); hits = [100, 400, 800]; values[hits] = 300
print([i for i, b in enumerate(sparse(values, 150, 3, 2.0)) if b]) # [100, 400, 800]Connections
- Marketing measurement. Many measurement systems continuously monitor large panels of metrics (conversion rate by geo, spend pacing, brand lift by creative) and act only when one crosses a threshold. SVT is the DP analogue: the stream of “all clear” answers is free, and privacy is spent only when an alert fires. Practical caveat: the noisy threshold is reused until a hit, so the false-alarm rate depends on the shared noise; choose with margin and use per alert.
- Compare multiple testing: monitoring metrics inflates false alarms by a factor in , exactly like a Bonferroni-type correction (Multiple Testing Corrections).