Private Convex Optimization via Exponential Mechanism
Sivakanth Gopi, Yin Tat Lee, Daogao Liu
Introduction
Differential Privacy (DP), introduced in [DMNS06, DKM+06], is increasingly becoming the universally accepted standard in privacy protection. We see an increasing array of adoptions in industry [App17, EPK14, BEM+17, DKY17] and more recently the US census bureau [Abo16, KCK+18]. Differential privacy allows us to quantify the privacy loss of an algorithm and is defined as follows.
A randomized mechanism is -differentially private if for any neighboring databases and any subset of outputs, one has
In this paper, we say and are neighboring databases if they agree on all the user inputs except for a single user’s input.
where is the true minimizer of .
One of the first mechanisms invented in differential privacy, the exponential mechanism, was proposed by [MT07] precisely to solve this. It involves sampling from the density
Here controls the privacy-vs-utility tradeoff, large ensures that we get a good solution but less privacy and small ensures that we get good privacy but we lose utility. Suppose is the sensitivity of , where the supremum is over all neighboring databases . Then choosing , the exponential mechanism satisfies -DP.
Exponential mechanism is widely used both in theory and in practice, such as in mechanism design [HK12], convex optimization [BST14, MV21], statistics [WZ10, WM10, AKRS19], machine learning and AI [ZP19]. Even for infinite and continuous domains, exponential mechanism can be implemented efficiently for many problems [HT10, CSS13, KT13, BV19, CKS20]. There are also several variants and generalizations of the exponential mechanism which can improve its utility based on different assumptions [TS13, BNS13, RS16, LT19]. See [LT19] for a survey of these results.
DP Empirical Risk Minimization (DP-ERM)
In many applications, the loss function is given by the average of the loss of each user:
where is the collection of users and is the loss function of user .
In particular, [BST14] shows that exponential mechanism in (2) achieves the optimal excess empirical risk of under -DP. On the other hand, [BST14, BFTT19, BFGT20] show that noisy gradient descent on achieves an excess empirical risk of
under -DP, which is also shown to be optimal [BST14]. This is a significant improvement over the exponential mechanism.
Exponential mechanism is a universally powerful tool in differential privacy. However, nearly all of the previous works on DP-ERM rely on noisy gradient descent or its variants to achieve the significant improvement over exponential mechanism under -DP. One natural question is whether noisy gradient descent has some extra ability that exponential mechanism lacks or we didn’t use exponential mechanism optimally in this setting. This brings us to the first question.
Can we obtain the optimal empirical risk in (1) under -DP using exponential mechanism?
DP Stochastic Convex Optimization (DP-SCO)
Beyond the privacy guarantee and the empirical risk guarantee, another important guarantee is the generalization guarantee. Formally, we assume the users are sampled from an unknown distribution over convex functions. We define the loss function as
We want to design a DP mechanism which outputs given users independently sampled from and minimize the excess population loss
where is the minimizer of . We call the problem of minimizing the excess population loss in (6) as DP Stochastic Convex Optimization (DP-SCO). By a suitable modification of noisy stochastic gradient descent, [BFTT19, FKT20] show that one can achieve the optimal population loss of
[BFTT19] bounds the generalization error by showing that running SGD on smooth functions is stable and [FKT20] proposes an iterative localization technique. Note that only the algorithm for smooth functions in [BFTT19] can achieve both optimal empirical risk and optimal population loss at the same time, with the price of taking more gradient queries and loss of efficiency. It is unclear to us how one can obtain both using current techniques for non-smooth functions. This brings us to the second question.
Can we achieve both the optimal empirical risk and the optimal population loss for non-smooth functions with the same algorithm?
Sampling
Without extra smoothness assumptions on , currently, there is no optimally efficient algorithm for both problems. For example, with oracle access to gradients of , the previous best algorithms for DP-SCO use:
queries to (by combining [FKT20], Moreau-Yosida regularization and cutting plane methods),
queries to [AFKT21],
queries to [KLL21].
Combining these results, this gives an algorithm for DP-SCO that uses
many queries to . Although the information lower bound for non-smooth functions with the gradient queries is open, it is unlikely that the answer involves four different cases.
In this paper, we focus on the function value query (zeroth order query) on . This query is weaker than gradient query as it obtains times less information. They are used in many practical applications such as clinical trials and ads placement when the gradient is not available and is also useful in bandit problems. This brings us to the third question.
Can we obtain an algorithm with optimal query complexity for DP-SCO for zeroth order query model?
1 Our Contributions
then, for a suitable choice of and , we recover the optimal excess risk in (4) for DP-ERM and optimal population loss in (7) for DP-SCO. Finally, we give an algorithm to sample from the density (8) with nearly optimal number of queries to (See Figure 1). To the best of our knowledge, our algorithm is the first whose query complexity has polylogarithmic dependence in both dimension and accuracy (in TV distance).
Let be a convex set with diameter and be a family of convex functions on where is -Lipschitz for all . Given a database , for any , See Theorem 6.2 for general conclusions for all the regularized exponential mechanism
is -DP with expected excess empirical loss
for some appropriate choices of and . Furthermore, if is -Lipschitz for all , we can sample using queries in expectation to the values of .
Let be a convex set with diameter and be a family of convex functions on where is -Lipschitz for all . Given a database of samples from some unknown distribution . For any , See Theorem 6.9 for general conclusions for all . the regularized exponential mechanism
is -DP with expected excess population loss
for some appropriate choice of and . Furthermore, if is -Lipschitz for all , we can sample using queries in expectation to the values of and the expected number of queries is optimal up to logarithmic terms.
For DP-SCO, we provide a nearly matching information-theoretic lower bound on the number of value queries (Section 7), proving the optimality of our sampling algorithm. Moreover, when is already strongly convex, our proof shows the exponential mechanism (without adding a regularizer) itself simultaneously achieves both the optimal excess empirical risk and optimal population loss.
In a concurrent and independent work, [GTU22] study the DP properties of Langevin Diffusion, and provide optimal/best known private empirical risk and population loss under both pure-DP () and approximate-DP () constraints. Utility/privacy trade-off of non-convex functions is also discussed.
Techniques
The main contribution of this paper is the discovery that adding regularization terms in exponential mechanism leads to optimal algorithms for DP-ERM and DP-SCO. For this, we develop some important tools that could be of independent interest. We now briefly discuss each of the main tools.
To analyze the privacy of the regularized exponential mechanism, we need to bound the privacy curve between a strongly log-concave distribution and its Lipschitz perturbation in the exponent. [MASN16] gave a nearly tight (up to constants) privacy guarantee of exponential mechanism if the distribution satisfies Logarithmic Sobolev inequality (LSI). Since strongly log-concave distributions satisfy LSI, their result immediately gives the -DP guarantee of our algorithm. However, this gives a sub-optimal privacy bound because it does not fully take advantage of the strongly log-concave property.
Instead, we show directly that the privacy curve between a strongly log-concave distribution and its Lipschitz perturbation in the exponent is upper bounded by the privacy curve of an appropriate Gaussian mechanism. This new proof uses the notion of tradeoff function introduced in [DRS19] and the isoperimetric inequality for strongly log-concave distribution.
This proves that the privacy curve for distinguishing between is upper bounded the privacy curve of a Gaussian mechanism with sensitivity and noise scale 1.
which is precisely the upper bound guaranteed by the theorem.
2 Generalization Error of Sampling
Many important and fundamental problems in machine learning, optimization and operations research are special cases of SCO, and ERM is a classic and widely-used approach to solve it, though their relationships are not well-understood. If one can solve the ERM problem optimally and get the exact optimal solution to minimizing (see Equation 3), then [SSSSS09] showed will also be a good solution to the SCO for strongly convex functions. But in most situations, solving ERM optimally costs too much or even impossible. Can we find a approximately good solution to ERM and hope that it is also a good solution for SCO? [Fel16] provides a negative answer and shows there is no good uniform convergence between and , that is there always exists such that is large. This fact forces us to find approximate solution to ERM with very high accuracy, which makes the algorithms inefficient.
Prior works proposed a few interesting ways to overcome this difficulty, such as the uniform stability in [HRS16] and the iterative localization technique in [AFKT21]. Roughly speaking, uniform stability means that if running algorithms on neighboring datasets lead to similar output distributions, then the generalization error of the ERM algorithm is bounded. Thus a good solution to ERM obtained by a stable algorithm is also a good solution for SCO. [BFTT19] makes use of the stability of running SGD on smooth functions to get a tight bound on the population loss for DP-SCO.
Recall and are defined in Equation (3) and (5) respectively. Our result enriches the toolbox of bounding the generalization error and provides new insights for this problem.
Suppose is a family of -strongly convex functions over and is -Lipschitz for any two functions in the family. For any and suppose the samples in data set are drawn i.i.d from the underlying distribution, then by sampling from density , the population loss satisfies
Considering two neighboring datasets and , our result is based on bounding the Wasserstein distance between the distributions proportional to and , which means the sampling scheme is stable and leads to the term in generalization error. The other term is excess empirical loss of the sampling mechanism. One advantage of our result is that it works for both smooth and non-smooth functions. Moreover, we may choose the value carefully and get a solution with both optimal empirical loss and optimal population loss.
3 Non-smooth Sampling and DP Convex Optimization
Implementing the exponential mechanism involves sampling from a log-concave distribution. When the negative log-density function is smooth, i.e. the gradient of is Lipschitz, there are many efficient algorithms for this sampling tasks such as [Dal17, LSV18, MMW+21, CV19, DMM19, SL19, CDWY20, LST20]. For example, if and each is -strongly convex with -Lipschitz gradient,For convenience, we used to denote the function in this and Section 5. we can sample in iterations with error in total variation distance and each iteration involves computing one [LST21]. Note that this is nearly linear time when and the error in total variation distance can be translated to an extra error in the -DP guarantee.
Our result is based on the alternating sampler proposed in [LST21] and a new rejection sampling scheme.
Furthermore, each steps accesses only many and samples from for many in expectation with .
Preliminaries
A DP algorithm usually satisfies a collection of -DP guarantees for each , i.e., for each there exists some smallest for which is -DP. By collecting all of them together, we can form the privacy curve or privacy profile which fully characterizes the privacy of a DP algorithm.
One can explicitly calculate the privacy curve of a Gaussian mechanism as
where is the Gaussian cumulative distribution function (CDF) [BW18].
Given two (continuous) distributions , we define the trade-off functionTradeoff curves in [DRS19] are defined using type I and type II errors. The definition given here is equivalent to their definition for continuous distributions. as
It is easy to compute explicitly the tradeoff function for Gaussian mechanism [DRS19],
iff
2 Optimization
Here we collect some properties of functions which are useful for optimization and sampling.
3 Distribution Distance and Divergence
We present some distribution distances or divergences mentioned or used in this work.
[Rén61, Rényi Divergence] Suppose and are measures with . The Rényi divergence of order between and is defined as
We follow the convention that . Rényi Divergence of orders are defined by continuity. For , the limit in Rényi Divergence equals to the Kullback-Leibler divergence of from , which is defined as following:
The Kullback–Leibler divergence between probability measures and is defined by
where is the set of all couplings of and .
The total variation distance between two probability measures and on a sigma-algebra of subsets of the sample space is defined via
4 Isoperimetric Inequality for Strongly Log-concave Distributions
The cumulative distribution function (CDF) of one-dimensional standard Gaussian distribution will be denoted by . The following Lemma relates the expanding property of log-concave measures with .
The property above implies the concentration of Lipschitz functions over log-concave measures.
Fix some . Let , so . Let Since is -Lipschitz, implies that Therefore and so
We obtain the other inequality by applying the above inequality to ∎
GDP of Regularized Exponential Mechanism
In this section, we prove our DP result (Theorem 2.1). The proof uses the isoperimetric inequality for strongly log-concave measures [Led99]. Intuitively, the privacy loss random variable will be -Lipschitz under the hypothesis and isoperimetric inequality implies that any Lipschitz function will be as concentrated as a Gaussian with appropriate standard deviation. This allows us compare the privacy curve to that of a Gaussian mechanism. In our proof, it is actually more convenient to compare tradeoff curves () which are equivalent to privacy curves via convex duality (Proposition 3.3 and Theorem 2.1).
We finish by calculating the integrals that showed up in the proof.
As a corollary to Theorem 4.1, we can bound any divergence measure that decreases under post-processing such as Renyi divergence or KL divergence. In particular, this also implies Renyi Differential Privacy [Mir17] of our algorithm.
By Theorem 2.10 in [DRS19], if , then there exists a randomized algorithm such that and . Therefore for any divergence measure which decreases under post-processing we have,
Efficient Non-smooth Sampling
In this section, we will present an efficient sampling scheme for (non-smooth) functions to complement our main result first. Specifically, we study the following problem about sampling from a (non-smooth) log-concave distribution.
Our sampler is based on the alternating sampling algorithm in [LST21] (See algorithm 1). This algorithm reduces the problem of sampling from to sampling from for some fixed and for roughly many different . When the step size is very small, the later problem is easier because the distribution is almost like a Gaussian distribution. For our problem, we will pick the largest step size such that we can sample using only many steps.
Given a -strongly convex function defined on with an initial point . Let the distance for any . Suppose the step size , the target accuracy and the number of step . Then, Algorithm 1 returns a random point that has total variation distance to the distribution proportional to .
Now, we show that Line 1 in Algorithm 1 can be implemented by a simple rejection sampling. The idea is to pick step size small enough such that is essentially a constant function for a random . The precise algorithm is given in Algorithm 2.
Let be the distribution proportional to and let be the distribution proportional to . Then, we have that
Let be the distribution returns by Algorithm 2. Then, we have that
For the distribution by the algorithm, we sample , then accept the sample if . Hence, we have
Since is uniform between and , we have the result.
Finally, for the expectation of , we note that
and that the probability that the loop pass step is exactly . Hence, we have
Taking expectation over gives the result. ∎
Now, we are already to prove our main result. This shows that if , then the algorithm indeed implements Line 1 correctly up to small error.
Let be the distribution given by and is the distribution outputted by the algorithm. By Lemma 5.3, we have
We split the into two terms and . The first term is the sum of all terms added to when (including the initial term ). The second term is the sum when . Hence, we have and hence
For the term , by a calculation similar to Lemma 5.3, we have
Denote a function . Since each is -Lipschitz, Lemma 5.4 shows that
By Markov inequality, for any , we know
As , if , we know
Hence, we have and
As for the term , we know that
Note that the term involves only less than many and . Lemma 5.4 shows that for any , we have
Under the event for all appears in , we have
Therefore, we have and
Picking , we have that
It remains to bound the term . We know the probability the algorithm enters the -th phase is at most . Hence we know . Similarly, by Gaussian Concentration and union bound, we have
Under the event that for all appears in , we have
Combining Theorem 5.2 and Lemma 5.5, we have the following result:
Furthermore, each steps accesses only many in expectation and samples from for many with .
DP Convex Optimization
In this section we present our results about DP-ERM and DP-SCO.
In this subsection, we state our result for the DP-ERM problem (3). Briefly speaking, our main result (Theorem 2.1) shows that sampling from for some appropriately chosen is -DP and achieves the optimal empirical risk in (4). Our sampling scheme in Section 5 provides an efficient implementation. We start with the following lemma which shows the utility guarantee for the sampling mechanism.
This is first shown by [KV06] for any linear function , and [BST14] extends it to any convex function with a slightly worse constant.
The excess empirical risk is bounded by . Moreover, if are already -strongly convex, then sampling with probability proportional to is -differentially private where
The excess empirical risk is bounded by .
The privacy guarantee follows directly from our main result Theorem 2.1, and the bound on excess empirical loss can be proved by Lemma 6.1. ∎
Before we state the implementation results on DP-ERM, we need the following technical lemma:
For any constants and , if , one has
Without loss of generality, we assume and want to find an appropriate value of such that . Denote and since for , we know that . It is equivalent to solve the equation , which is equivalent to . Note that decreases as increases, which implies that we can set . ∎
Combining the sampling scheme (Theorem 5.6) and our analysis on DP-ERM, we can get the efficient implementation results on DP-ERM directly.
With same assumptions in Theorem 6.2, and assume is -Lipschitz over for all . For any constants and , there is an efficient sampler to solve DP-ERM which has the following guarantees:
The scheme is -differentially private;
The expected excess empirical loss is bounded by . In particular, if , the expected excess empirical loss is bounded by If , the expected excess empirical loss is bounded by .
queries to the values on in expectation and takes the same number of samples from some Gaussian restricted to the convex set .
By Lemma 6.3, we can set to make . For our setting, Theorem 6.2 shows that we have and hence we can take
Putting it into the excess empirical loss bound of and setting , we get the result on the empirical loss.
Particularly, consider the case when . We know the excess empirical loss is bounded by . Note that for . Under the assumption that , we know . The case when also follows similarly.
To make it algorithmic, we apply Theorem 5.6 with the accuracy on the total variation distance to be for some large enough constant . This leads to -DP and an extra empirical loss and hence we use rather than or in the final loss term.
The running time follows from Theorem 5.6. ∎
2 DP-SCO and Generalization Error
As mentioned before, one can reduce the DP-SCO (5) to DP-ERM (3) by the iterative localization technique proposed by [FKT20]. But this method forces us to design different algorithms for DP-ERM and DP-SCO, and may lead to a large constant in the final loss. In this section, we show that the exponential mechanism can achieve both the optimal empirical risk for DP-ERM and the optimal population loss for DP-SCO by simply changing the parameters. The bound on the generalization error works beyond differential privacy and can be useful for other (non-private) optimization settings.
The proof will make use of one famous inequality: Talagrand transportation inequality. Recall for two probability distributions , the Wasserstein distance is equivalently defined as
where the infimum is over all couplings of
To prove our main result on bounding the generalization error of sampling mechanism, we need the following lemma.
For any learning algorithm and dataset drawn i.i.d from the underlying distribution , let be a neighboring dataset formed by replacing a random element of with a freshly sampled . If is the output of with , then
Now we begin to state and prove our main result on the generalization error.
Suppose is a family -strongly convex functions over such that is -Lipschitz for all . For any and dataset drawn i.i.d from the underlying distribution , let be a neighboring dataset formed by replacing a random element of with a freshly sampled ,
If we sample our solution from density , we can bound the excess population loss as:
We form a neighboring data set by replacing a random element of by a freshly sampled Let and . By Corollary 4.3, we have
By the assumptions, we know both and are -strongly convex and by Theorem 6.5, we have
By Lemma 6.6 and properties of Wasserstein distance, we have
where the last inequality follows from Lemma 6.1. ∎
With the bounds on generalization error, we can get our first result on DP-SCO.
If users in the data-set are drawn i.i.d. from the underlying distribution , the excess population loss is bounded by . Moreover, if are already -strongly convex, then sampling with probability proportional to is -differentially private where
The excess population loss is bounded by .
The first part about privacy is a restatement of our result on DP-ERM (Theorem 6.4). The excess population loss (See Equation (6)) follows from the bound on generalization error (Theorem 6.7) and utility guarantee (Lemma 6.1). ∎
We give an implementation result of our DP-SCO result.
With same assumptions in Theorem 6.8, and assume is -Lipschitz over for all . For and , there is an efficient algorithm to solve DP-SCO which has the following guarantees:
The algorithm is -differentially private;
The expected population loss is bounded by
where is an arbitrary constant to be chosen.
queries of the values of in expectation and takes the same number of samples from some Gaussian restricted to the convex set .
As for the non-typical case when , one can use the bound in Theorem 6.4 and the bound on generalization error (Theorem 6.7) . Particularly, one can achieve expected population loss .
By Theorem 6.8, sampling from when is -DP. Besides, we can set for arbitrarily large constant to make the mechanism -differentially private, achieving tight population loss and decrease the running time. Then the population loss is upper bounded by
By setting , the population loss is upper bounded by
To make it algorithmic, we also apply Theorem 5.6 with the accuracy on the total variation distance to be for some large enough constant . This leads to an extra empirical loss and hence we use rather than in the final loss term. The runtime follows from Theorem 5.6. ∎
Information-theoretic Lower Bound for DP-SCO
In this section, we prove an information-theoretic lower bound for the query complexity required for DP-SCO (with value queries), which matches (up to some logarithmic terms) the query complexity achieved by our algorithm (in Theorem 6.9). Our proof is similar to the previous works like [ACCD12, DJWW15] with some modifications.
Therefore
where denotes the output of any algorithm mapping from the observation to , and the probability is taken over the distribution of the underlying , the observation and any additional randomness in the algorithm.
Now we continue our proof of the lower bound. We will make use of the property of the Bayes risk.
Suppose that is uniformly sampled from , then any estimate obeys
where the first inequality follows from the definition of Bayes risk , the second inequality follows by Lemma 7.3 and the last inequality follows by the Cauchy-Schwartz inequality.
To complete the proof, it suffices to show that
Assuming Equation (18) first, which will be established later. Then we know that
We will complete the proof of Lemma 7.4 by showing the following bounded total variation distance.
The convexity of the KL divergence suggests that
As we are considering linear functions, without loss of generality we can assume for each and any , and for any and . We name this assumption Orthogonal Query. Roughly speaking, for any algorithm, we can modify it to satisfy the Orthogonal Query. Whenever the algorithm wants to query some point, we can use Gram–Schmidt process to query another point and satisfy Orthogonal Query, and recover the function value at the original point queried by the algorithm.
By the chain-rule of KL-divergence, if we define to be the distribution of th observation conditional on , and , then we have
Fix such that . Since the algorithm is deterministic and is fixed given . Let so .
where is the -th coordinate of . Summing over the terms, one has
where the last line follows from the fact that for each , as we only query one user for -th step.
Having Lemma 7.4, we can complete the proof of Theorem 7.1.
of Theorem 7.1. As discussed before, we know
where the last line follows from Lemma 7.4. We now set and , so that . Hence one has
Note that Theorem 7.1 almost gives us what we want, except that the Lipschitz constant of the functions in the hard distribution is bounded only on average by . To get distributions over -Lipschitz functions, we just condition on the bad event not happening.
In particularly, for some constant , we know
By the concentration of spherical Gaussians, we know if , then
We can choose the constant large enough, such that , which implies
If we use the distributions conditioned on rather than the Gaussians, and scale the constant to satisfy the assumption on Lipschitz continuity, we can prove the statement. Particularly, let . If the algorithm can only make observations, we know
which proves the lower bound claimed in the Corollary statement. ∎
where and is the output of .
Suppose we have a sampling algorithm that takes queries. We use it to sample from proportional to on with total variation distance .
where the last term involving is due to the total variation distance between and . Setting and using the diameter of is and , we have
Note that we set . Comparing with (19), we have
and hence . If , we have
and hence . If , we can construct our function only on the first dimensions to get a lower bound Combining all cases gives the result. ∎