Quantum Entropy Scoring for Fast Robust Mean Estimation and Improved Outlier Detection
Yihe Dong, Samuel B. Hopkins, Jerry Li
Introduction
We study outlier-robust statistics in high dimensions, focusing on the question: can theoretically sound outlier robust algorithms have practical running times for large, high-dimensional data sets? We address two related problems: robust mean estimation, which is primarily theoretical, and an applied counterpart, outlier detection.
Robust mean estimation Our main theoretical contribution is the first nearly-linear time algorithm for robust mean estimation with nearly-optimal error. Here the goal is to estimate the mean of a -dimensional distribution given -corrupted samples – that is, i.i.d. samples, an unknown -fraction of which have been maliciously corrupted. Under (for instance) the assumption that the covariance of is bounded by , it has been long known to be possible in exponential time to estimate by having . In particular, this rate of error is independent of .
Polynomial-time algorithms provably achieving such -independent error became known only recently, starting with the works . Until our work, the running time of algorithms with provably -independent error remained suboptimal by polynomial factors in or : the fastest running time achieved before this work was . (Here notation hides logarithmic factors in and ). While these running times represent a dramatic improvement over previous exponential-time algorithms, there are still many interesting regimes where the additional runtime overheads these algorithms incur render them impractically slow. We give the first algorithm for robust mean estimation with running time which achieves error . Note that this running time is nearly-linear in the input size . Similar to prior works, our algorithm has information-theoretically optimal sample complexity and nearly-optimal error rates in both the bounded-covariance and sub-Gaussian regimes.
We compare our method to baselines based on PCA and Euclidean distances, as well as more sophisticated algorithms from existing literature based on nearest-neighbor distances. Our algorithm has nearly-linear running time in theory, and simple implementations in practice incur minimal overhead beyond standard spectral methods, allowing us to run on -dimensional data with no special optimizations and -dimensional data with a fast approximate implementation. It can therefore be used in practice to complement existing approaches to outlier detection in exploratory data analysis.
For us, an outlier is an element of a data set which was generated according to a different process than the majority of the data. For instance, we may imagine that our samples were sampled i.i.d. from a distribution over , where is the distribution of inliers, is the distribution of outliers, and is a small number – that is, we imagine that a constant fraction of our data may be outliers.
For this discussion, we also informally imagine that is sufficiently distinct from that the set of outliers could be approximately identified by brute-force search over subsets of samples, if given unlimited computational resources. Otherwise, outlier detection is not a meaningful problem, and robust mean estimation is easy (because the empirical mean will be a good estimator). Under these circumstances, what makes identifying outliers and estimating the mean in their presence difficult? Chiefly:
Outliers may not be identifiable in isolation. On its own, a typical outlier may look much like a typical inlier . For instance, it could be , and may have similar distance to the nearest few neighboring samples, especially in high dimensions where samples are far apart.
Outliers still introduce bias, collectively Even if individual outliers look innocuous, the collective effect a modified -fraction of samples can still substantially change the empirical distribution of . As a result, even simple statistical tasks like estimating the mean or covariance of require sophisticated estimators: naively pruning individual outliers and then employing standard empirical estimators typically leads to far-suboptimal error rates. For example, an -fraction of which are all slightly biased in a single direction may shift the empirical mean of , but this bias will be difficult to detect by looking at small numbers of samples at once. This also demonstrates that successful outlier detection can require global geometric information about a high-dimensional dataset, such as whether or not a direction exists in which many (say, ) samples are unusually biased.
Outliers may be inhomogeneous. Outliers need not exhibit unusual bias in only one direction, or all have the same norm, or lie in a single cluster. Rather, if a dataset exhibits several forms of corruption, there may be as many different-looking kinds of outliers. In the theoretical robust mean estimation setting, the adversary producing -corrupted samples may corrupt samples by biasing them in some direction, another samples by unusually enlarging their norms, and so forth.
Since robust mean estimation involves a malicious adversary, all of the above phenomena must be addressed by our robust mean estimation algorithm. In the empirical section of this paper, we focus on designing an outlier detection method suited to situations where at least one of them occurs – in other cases, existing methods (such as those based on Euclidean norms or local neighborhoods of individual samples ) may be more appropriate.
2 QUE: Quantum Entropy Scoring
Recent innovations in robust mean estimation rely on the following crucial observation about -corrupted samples from a distribution with covariance . Namely: any subset of samples which shift the empirical mean by distance more than in some direction also introduce an eigenvalue of magnitude greater than to the empirical covariance.
In robust mean estimation, this leads to (amongst others) the filter algorithm of , one of the first to achieve dimension-independent error rates. Roughly speaking, the algorithm iterates the following until the empirical covariance has small spectral norm: (1) compute the top eigenvector of the empirical covariance of , then (2) throw out samples whose projections is unusually large, where is the empirical mean of the corrupted dataset. For outlier detection this suggests a natural scoring rule – let the outlier score of sample be proportional to .
The main drawback of these algorithms is that they do not adequately account for inhomogeneity of outliers. For the filter, this leads to a worst-case running time of , because the filter operation (which can be implemented in time) may have to be repeated as many as times if the adversary introduces outliers lying in orthogonal directions. The rule may miss outliers causing a large eigenvalue of , but in a direction orthogonal to the top eigenvector .
Our first observation is that any eigenvalue/eigenvector – not just the top ones – of the empirical covariance with must be due to outliers. We therefore consider the intermediate goal of finding a distribution over directions containing information about as many outlier directions as possible. We formalize this as the following entropy-regularized convex program over positive semidefinite matrices:
QUE scores are also appealing from a computational perspective: we show that a list of approximate QUE scores can be computed from in nearly-linear time, by appropriate use of Johnson-Lindenstrauss sketching and efficient computation of the matrix exponential by series expansion. This is crucial to both the nearly-linear running time of our algorithm for robust mean estimation and to the scalability of our outlier detection method.
In Section 1.4 we describe refinements of QUE scoring which fit it into the matrix multiplicative weights framework , leading to our nearly-linear time algorithms for robust mean estimation. We give two very similar algorithms, one for when the distribution of inliers is only assumed to have bounded covariance, and one when the inliers are assumed to be subgaussian. The resulting algorithms are conceptually similar to the following modification of the filter mentioned above: until , compute QUE scores , throw out data points with , and repeat. (To obtain provable guarantees, our final algorithms are somewhat more complex: in some iterations we use QUE scores based on certain reweightings of the data learned in previous iterations.)
In Section 1.5 we describe experiments validating the QUE scoring rule on both synthetic and real data sets. We show that it performs especially well by comparison to local-neighborhood methods and to scoring based on only the top eigenvector in data sets where the inliers are close to isotropic (or can be made so by applying data whitening procedures) and in which there are heterogeneous outliers.
3 Related work
Robust mean estimation: The study of robust statistics and in particular robust mean estimation began with major works by Anscombe, Huber, Tukey and others in the 1960s . The literature on polynomial-time algorithms for robust statistics has exploded in recent years, following works by Diakonikolas et al and Lai, Rao and Vempala giving the first polynomial-time algorithms for robust mean estimation with dimension-independent (or nearly dimension-indepedent) error . A full survey is beyond our scope here – see e.g. the recent theses for a thorough account. Particularly relevant to our work is the recent work of Cheng, Diakonikolas, and Ge who design an algorithm for robust mean estimatin with running time – the first to achieve nearly linear time for constant – by appeal to nearly linear time solvers for packing and covering semidefinite programs . Our algorithms carry two advantages over this prior work: first, our algorithm runs in nearly linear time for any choice of , and second, because we avoid the scaling and appeal to semidefinite programming, our theoretical ideas lead to a practical method for outlier detection. The techniques of Diakonikolas et al. were later extended to robust covariance estimation ; it remains an interesting direction to extend our techniques to covariance estimation.
Concurrent work: After this manuscript was initially submitted, we became aware of the concurrent work , which also obtains a nearly-linear time algorithm for robust mean estimation of distributions with bounded covariance. The algorithm of also obtains subgaussian confidence intervals (see e.g. ), which the algorithm in this work does not. By contrast, the algorithms in our work also obtain improved rates of error with respect to when the underlying distribution is sub-Gaussian, and our method is sufficiently practical that we are able to implement parts of it to run our experiments on outlier detection. (The method of relies on nearly-linear time solvers for packing/covering semidefinite programs, which are not yet practical.) Finally, implicit in the work is a reduction from arbitrary to the case ; we describe this reduction and some consequences in Appendix B.1.
Outlier detection Detection of outliers goes back nearly to the beginning of statistics itself . Even restricting to the high dimensional case it has a literature too broad to survey here. Much recent work has focused on so-called local outlier factor-based methods, which assign outlier scores based on the local density of other samples near each – see e.g. and further references in . We find that QUE scoring compares favorably to such local methods in high-dimensional datasets like we describe in Section 1.1 – see Sections 1.5 and 7 for details.
4 Robust mean estimation: results and algorithm overview
We turn to our algorithm for robust mean estimation, deferring details to Sections 2—4.
Let be a distribution on . We say that are an -corrupted set of samples from if they are first drawn i.i.d. from , then modified by an adversary who may adaptively inspect all the samples, remove of them, and replace them with arbitrary vectors in .
Note that -corruption is a stronger outlier model than the mixture model we described in Section 1; our algorithms also work in this milder mixture model. Our main theoretical result is:
For every and there are algorithms QUEScoreFilter ,s.g.-QUEScoreFilter with running time , such that for every distribution on with mean and covariance , given -corrupted samples from , QUEScoreFilter produces such that if , and s.g.-QUEScoreFilter produces such that if is sub-Gaussian with , all with probability at least .
For the bounded covariance case, the term information-theoretically optimal up to constant factors. The other term, , is information-theoretically optimal up to the logarithmic factors in the even without corruptions. For the sub-Gaussian case, the term is believed to be necessary for computationally efficient algorithms (see e.g the statistical-query lower bound ), although that term can be made by using computationally-intractable estimators such as Tukey median, and the latter is information-theoretically optimal . The term is information-theoretically optimal even without corruptions.
In this section we discuss our algorithm for the bounded-covariance case in the setting that the adversary may not remove samples, leaving technical details and the modifications necessary to handle removed samples and sub-Gaussian to Section 4.
Let be a dataset with the property that partitions into with and , where . Given , the goal is to find a vector with .
Like prior algorithms for robust mean estimation, ours maintains a weight vector with , initialized to . The algorithm iteratively decreases the weight of points suspected to be outliers that are causing to be large. Some prior algorithms, e.g. the filter of instead iteratively throw out points suspected to be outliers. However, since those algorithms are (necessarily) randomized, they can also be viewed as weighting points, where the weight of is the probability it has not been thrown out. The algorithm we present here can also be implemented by throwing out points in a randomized fashion – we discuss further in the appendix. A key insight of recent work on robust mean estimation is that it suffices to find weights which place almost as much mass on as does the uniform weighting and whose empirical covariance is small. This is formalized in the following lemma. For a weight vector , let , , and . Let be the spectral norm of a matrix .
Let be as in Definition 1.3. Suppose that is a weight vector such that and is mostly good, by which we mean , where are the indicators of and are restricted to respectively. (Intuitively, is mostly good if it results by removing from the uniform weighting more weight from than from .) Then .
Lemma 1.2 captures the following geometric intuition: if the bad points receive enough weight in to cause , then an -fraction of the mass of is on which are unusually correlated with the vector , which leads to a large maximum eigenvalue in . Prior works employ a variety of methods to find a mostly good weight vector with . Perhaps the simplest is the filter of , which iterates: While , compute its top eigenvector and naive spectral scores . Throw out with large and repeat.
The filter ensures that the weight vector it maintains is mostly good because (in an averaged sense) can be large only for which are corrupted. This is because the (weighted) sum of all scores , while the contribution to this sum from has . (Here we ignore some details about centering at rather than .) Thus, the from must make up almost all of . Simple approaches to removing or downweighting with large then remove strictly more weight from than from .
However, filtering based on naive spectral scores alone faces a barrier to achieving nearly-linear running-time. If the corruptions are split among many orthogonal directions, the naive spectral filter will have to find those directions one at a time. Thus, it may require iterations (leading to running time) to arrive at with .
Our main idea is that by replacing naive spectral scores with slightly modified QUE scores, each iteration of the filter can take into account projections of each sample onto many large eigenvectors of . We show that our modified QUE scores maintain the property that , and so downweighting according to removes more mass from than . However, filtering with QUE scores makes faster progress than with naive spectral scores: roughly speaking, we show that only rounds of filtering according to QUE scores are required to find a mostly-good weight vector with .
The core of our algorithm is a subroutine, DecreaseSpectralNorm, to take a mostly good weight vector with and in rounds of QUE filtering produce another mostly good with . Repeating this subroutine times and then outputting the resulting yields our main algorithm. An outline of this subroutine is presented as Algorithm 1. We first establish a rigorous sense in which downweighting according to outlier scores makes progress: it decreases the weighted average of the scores while removing more weight from bad points than good.
There is a downweighting algorithm which takes a density matrix and a mostly good weight vector and produces a mostly good weight vector by downweighting points with large score such that so long as . Furthermore, .
Let us give a geometric interpretation to Lemma 1.3: it establishes that if then the quadratic form of decreases in the directions defined by , since
This guarantee becomes more meaningful as the entropy increases, because it suggests the quadratic form of has decreased in more directions. To make this formal, we appeal to the matrix multiplicative weights framework. DecreaseSpectralNorm applies downweighting iteratively using a sequence of entropy-maximizing density matrices chosen according to the matrix multiplicactive weights update rule, leading to a series of mostly good weight vectors such that . We choose
where is the input weight vector, , and results from applying the downweighting of Lemma 1.3 to using (if ). The following lemma is a special case of the standard (local norm) regret bound for matrix multiplicative weights.
For any , if for all , then
Now we sketch the analysis of DecreaseSpectralNorm.
If is mostly good, with , then DecreaseSpectralNorm produces mostly good with .
Since by Lemma 1.3, we have for all , and hence for all , so and satisfy the hypotheses of Lemma 1.4. By our choice of and for all , (4) implies
If , then DecreaseSpectralNorm performs downweighting, and by Lemma 1.3 and (2) (which we establish rigorously in supplemental material), . Otherwise, by hypothesis . Using this bound and dividing by , we obtain . Choosing completes the proof sketch. ∎
Running time: Our overall algorithm only requires iterations of DecreaseSpectralNorm, and the latter only requires iterations of downweighting, so we just have to implement downweighting in nearly-linear time. We show in supplemental material that this can be done by avoiding representing any of the matrices explicitly in memory: instead, we maintain only low-rank sketches of them. This leads to some approximation error in computing the QUE scores, but we show that approximations to the QUE scores suffice for all arguments above.
For remaining technical details and full proofs, see Sections 5-9 of supplemental materials.
5 Outlier detection: algorithm and experimental results
In this section, we empirically evaluate outlier detection using QUE scoring. We must work with data containing well-defined and known inliers and outliers so that we can compare our results to ground-truth. We generate such data sets in three distinct ways, leading to three main experiments. (In supplemental material we also study some outlier-detection data sets appearing in prior work .)
Synthetic: We create synthetic data sets in dimensions and samples with an -fraction of inhomogeneous outliers in directions by sampling from a mixture of Gaussians , where are standard basis vectors, with and . The outliers are the samples from . By varying and the distribution of outlier weights, we demostrate in this simplified model how max-entropy outlier scoring improves on baseline algorithms in the presence of inhomogeneous outliers. We choose the scaling because then standard calculations predict that if the outliers from will contribute an eigenvalue greater than to the overall empirical covariance.
Mixed – word embeddings: We create a data set consisting of word embeddings drawn from several sources. Inliers are the -dimensional GloVe embeddings () of the words in a random word long section of a novel (we use Sherlock Holmes) and outliers are embeddings of the first paragraphs of featured Wikipedia articles from May 2019 .
Perturbed – images: We create a data set consisting of CIFAR10 images some of which have artificially-introduced dead pixels. Inliers are random CIFAR images (restricted to the red color channel). Outliers are random CIFAR images, partitioned into groups , such that for each group a random coordinate and a random value is chosen and for each we set .
Metric: All the methods we evaluate produce a vector of scores . We use the standard ROCAUC metric to compare these scores to a ground-truth partition into inlier and outlier sets. is simply the probability that a randomly chosen outlier is scored higher than a random inlier.
Whitening: Scoring methods based on the projection of data points onto large eigenvectors of the empirical covariance work best when those eigenvectors correspond to directions in which many outliers lie. In particular, if , the covariance of , itself has large eigenvalues then such spectral methods perform poorly. We assume access to a whitening transformation , which captures a small amount of prior knowledge about the distribution of inliers . For best performance should approximate since form an isotropic set of vectors. Of course, to compute exactly would require knowing which points are inliers, but we find that relatively naive approximations suffice. In particular, if a clean dataset whose distribution is similar to the distribution of inliers is available, its empirical covariance can be used to find a good whitening transformation . In our synthetic data we use . In our word embeddings experiment, we obtain using the empirical covariance of the embedding of another random section of Sherlock Holmes. In our CIFAR-10 experiment, we obtain from the empirical covariance of a fresh sample of randomly chosen images from CIFAR-10.
High-dimensional scaling: Implementing Algorithm 2 by explicitly forming the matrix and performing a singular value decomposition (SVD) to compute is feasible on relatively low-dimensional data (). See Section 7 for discussion and results of a nearly-linear time implementation.
Robust mean estimation: results and preliminaries
for all even. We say a distribution over and mean is sub-gaussian with variance proxy , if for all unit vectors , the distribution of is sub-Gaussian with variance proxy . Intuitively, a sub-Gaussian distribution is simply any distribution which concentrates as well as a Gaussian.
With this terminology in place, we are now ready to state our main results on robust mean estimation. Our first result is for robust mean estimation under the assumption of bounded covariance:
Let be a distribution on with mean and covariance . Let be sufficiently small, and let . Let be an -corrupted set of samples from of size . There is an algorithm which takes and , and outputs so that with probability , we have
Moreover, the algorithm runs in time .
We make two observations about this problem. First, it is well-understood (see e.g. ) that error is unavoidable for this problem, no matter how many samples are given. Second, observe that the rate is necessary for this problem even without corruptions. Thus, up to log factors, and the dependence on , this guarantee is information-theoretically optimal. We note also that the algorithm does not need to know exactly; any upper bound will suffice (with commensurate weakening in the error rate).
We also prove a strong statement for the case of robust mean estimation for sub-gaussian distributions:
Let be an isotropic sub-gaussian distribution with variance proxy and mean . Let be sufficiently small, and let . Let be an -corrupted set of samples from of size . There is an algorithm which takes , and , and outputs so that with probability , we have
Moreover, the algorithm runs in time .
It is suspected, based on statistical-query lower bounds, that error is incurred by any computationally-efficient algorithm in this setting, although is the minimax optimal dependence of the error rate on . Moreover, is the minimax rate for mean estimation for Gaussians without noise. Thus, the error guarantees of this algorithm are minimax optimal up to constants and the factor .
This algorithm assumes that the distribution is isotropic. There is evidence that such an assumption is necessary to get error beyond using computationally efficient (i.e. poly-time) algorithms . In our theorem statement above we also assume that the variance proxy is at most . This is done for simplicity: it is easily verifiable that our algorithm works (with an appropriate scaling in front of the error guarantee) if the variance proxy is PSD upper bounded by for any .
Before we describe our techniques, we require a few additional algorithmic tools, which we describe below.
2 Soft selection of subsets of points
In our presentation of our filtering algorithm for robust mean estimation, it will be convenient for us to work with a “soft” version of the filter. Instead of wholly removing points that we deem suspicious, we will maintain a set of weights for each point, and downweight those that we find suspicious. In this section, we establish notation for dealing with such operations. However, we briefly remark that, as we will explain later in Appendix A.3, the same results (up to log factors) can be established using “hard” filtering more akin to the algorithms presented in prior work, e.g. .
Throughout this paper, we will let denote the simplex in dimensions, and we let
Typically when the set is understood, we will omit the dependence on in the notation. For any set , we let where is the vector for and otherwise, and similarly we let .
3 Naive pruning
One primitive we will require will be the ability to removes points which are “obviously” outliers. It is well-known that there exist randomized nearly-linear time algorithms for achieving this. For completeness we prove this lemma in Appendix A.
There is an algorithm NaivePrune with the following guarantees. Let , and let . Let be a set of points so that there exists a ball of radius and a subset so that , and . Then runs in time and with probability outputs a set of points so that , and is contained in a ball of radius .
In the case where the output of NaivePrune satisfies the conditions of the lemma, we say that NaivePrune succeeds.
4 The one-dimensional filter
An important algorithmic primitive for us will be an univariate soft outlier removal step. The sub-problem considered here is as follows: we are given a set of nonegative scores , with the guarantee that there is a small subset so that , that is, they contribute a majority of the mass of the points. The goal is to then either downweight (or remove) the overall set of scores in such a way so that more mass from is removed than from outside of , or alternatively, more points are removed from than from outside . An algorithm for achieving this via downweighting has already been described in , and a randomized algorithm that achieves the same sorts of guarantees with high probability by removing points is implicit in the filtering algorithm of (e.g. in Algorithm 3 in Appendix A of ). In this paper, we will require a slight strengthening of these algorithms. We require that not only do we remove more weight from the bad points than the good points, but we also decrease the overall sum by a constant factor. We observe that while we will present a method for acheving this via downweighting, one can achieve the same guarantee (with high probability) by removing points. In the main text, we choose to present the soft downweighting method for robust mean estimation for simplicity. See Appendix A.3 for details.
Formally, we describe an algorithm 1DFilter and prove the following guarantee for the algorithm. The algorithm and its analysis are fairly straightforward so we defer the formal descriptions and proofs to Appendix A.2.
Let , let , and let and be non-negative numbers so that . Let . Suppose there exist two disjoint sets so that , and moreover,
Then runs in time and outputs so that:
more weight is removed from than , i.e. , and
the weighted sum of the has decreased, i.e. satisfies
In particular, note that if and , then this algorithm runs in nearly linear time.
As mentioned previously, there is also a randomized strategy that avoids downweighting and achieves the same guarantee with high probability (up to logarithmic factors in runtime). Our overall robust mean estimation algorithm (for both settings presented in the paper) can be instantiated using this algorithm rather than 1DFilter. While as far as we know this yields no theoretical improvements for robust mean estimation (indeed, our analysis of it proves bound which are worse by logarithmic factors than our analysis of soft downweighting), it is much closer to the practical outlier detection method used in the experiments in Section 1.5 and also to prior algorithms presented in , and may be of instructive value. For this reason we describe this algorithm in Appendix A.3.
5 Matrix Multiplicative weights
We will use the following form of the MMW update, which is essentially the same as presented in . In each iteration , the player chooses an action , receives a gain matrix , and receives reward . Then the player sees . In , they demonstrate that if the player plays according to the entropy regularizer (or equivalently, matrix multiplicative weights), namely,
Here, for any symmetric matrix , we let denote . Equivalently, by rearranging terms, and taking a supremum over of (8), we obtain that the update satisfies
An MMW algorithm for robust mean estimation with bounded covariance
In this section we describe the algorithm which achieves Theorem 2.1. We first identify a deterministic condition on the set of inliers under which our algorithm is guaranteed to be correct. It is a very mild condition: at a high level, it simply states that the empirical mean of the samples is converging to the true mean, and the empirical covariance is bounded.
We say a set of points is -good with respect to a distribution with mean and covariance if the following two properties hold:
The following is a generalization of Lemma A.18 in , which states that, with high probability, any set of i.i.d. points from a distribution with bounded covariance will contain a large set which is good with respect to that distribution. For completeness we prove this lemma in Appendix B.
Let , and let be a positive integer. Let be a distribution with mean and covariance , and let be independent draws from . Then, with probability , there exists a set so that the following two conditions are simultaneously satisfied:
is -good with respect to , where
for some universal constants .
In particular, observe that for constant and for , we have that and .
Throughout we will let , where is -good with respect to , and . For any , we let denote the restriction of to the indices in , and similarly define .
Our set of weights of interest will be slightly different than those considered in prior papers, but morally captures the same concept, up to issues of reweighting. We will always guarantee that the weights we consider lie within the following set:
Intuitively, weights in the set are what happens when we start with the uniform weighting and remove weight from points in the data set, always removing at least as much mass from the bad set as we do from the good set.
2 Geometric lemmata
We first prove the following sequence of structural lemmata. The first, which is implicit in the earlier work, and which is in some sense the fundamental geometric fact which guides our algorithmic design, gives an upper bound on the deviation between the weighted empirical mean of the data set and the true mean of the distribution in terms of the spectral norm of the weighted covariance of the dataset.
Let be as above, and let . Then
Let . We have the following sequence of identities:
We now upper bound each term separately. By Cauchy-Schwarz, we have
We now turn our attention to and . Both bounds will follow from the following claim:
Let be so that , for all , and . Then, for any , we have
Here (a) follows since , and (b) follows from the definition of spectral norm, and the assumption on . Thus, by taking square roots and combining terms, we have
With this claim, we can now bound and . To bound , let for and otherwise, and let if , and otherwise. Then, applying the claim with yields that
Similarly, to bound , let if and otherwise, and let for all . Again, letting , we get that
as well. Combining these three bounds, and using the fact that , yields that
Simplifying this expression then yields the desired bound on . ∎
We also require the following linear algebraic fact:
Let so that . Then .
We first observe that if , then
and so , as claimed. ∎
3 General algorithm description, bounded second moment
In this section we describe the algorithm we would like to run via matrix multiplicative weights, and demonstrate that it will terminate in a small number of iterations, when given good approximations to the entropic scores.
The algorithm, which we call QUEScoreFilter , proceeds in epochs, and takes as input a corrupted dataset , and a score oracle . Initially, in epoch , we let . Then, in epoch , the algorithm proceeds iteratively as follows. First, approximately compute , and if , then we terminate and output .
where is as in Algorithm 3, namely,
for all , where is defined in (10) (the choice of in the approximation here as well as for is arbitrary; any constant sufficiently small will suffice). In Section 5 we will demonstrate how to implement such an approximate score oracle in (randomized) nearly-linear time by sketching.
4 Correctness of QUEScoreFilter
We first prove correctness. The main lemma is the following per-epoch guarantee:
The following invariants always hold. For all epochs , we have:
, and
If and , then epoch finishes after iterations, and outputs so that .
We first show how the lemma implies the theorem.
We now prove the runtime bound. In every iteration, besides the call the the oracle, the only costly operations are the approximate top eigenvalue computations and running 1DFilter. However, the approximate top eigenvalue computations can be done in time via power method since we only ask for a constant multiplicative approximation, and the bound on implies that 1DFilter runs in time. ∎
We first show that for some universal constant . Let if and otherwise. Then, we have
Here (a) follows from . This completes the proof of the claim. ∎
Notice that Claim 3.7 immediately implies that the first invariant always holds. We now turn to proving the second invariant. Let be the number of iterations that the epoch runs for. Observe that for all , we have that , and so we are indeed in the setting of the guarantee in Section 2.5. Thus, by (8), since , we obtain the following regret bound:
where the second inequality follows by our choice of . We claim that for all , we must have . There are two cases. If we enter the if statement in Line 18, then
and , so this is clearly satisfied. Otherwise, the desired bound follows by Claim 3.7. Thus overall, by (14) we have that
By Lemma 3.4, we further have that for all , and so this implies that
Simplifying both sides yields that if for some sufficiently large constant , then . Thus after iterations, we must terminate. ∎
An MMW algorithm for robust mean estimation for sub-gaussian distributions
In this section we give an analog of the result in Section 3 but but in the setting where the distribution is subgaussian, and has identity covariance. We again first identify a deterministic condition for the inlers under which our algorithms will succeed. In this case, we need a stricter analog of -goodness. Specifically, we will require:
Let be a distribution with covariance and mean . We say a set of points is -subgaussian good (or -s.g. good for short) with respect to if there exist universal constants so that the following inequalities are satisfied:
and , and
For any subset so that , we have
For conciseness, when the parameters are understood, we will omit them and refer to the data set as s.g.-good.
We have the following concentration inequality. The proof is very similar to that of Lemmata 2.1.8 and 2.1.9 in . For completeness we include a proof of this lemma in Appendix C.
Let , where is subgaussian with variance proxy . Then, for any sufficiently small, we have that is -s.g. good with probability , where
In particular, note that when , then Lemma 4.1 implies that i.i.d. samples from an isotropic sub-gaussian distribution is -s.g. good with probability . We will also require the following simple consequences of subgaussian goodness.
Let be an isotropic distribution. Let be -s.g. good w.r.t. . Then:
for all with and , and for all unit vectors , we have
if satisfies and , then
We first prove the first claim. Let be anything so that and . Then since all quantities on the LHS of the expression are nonnegative, we have that
Now let . This set is clearly convex, and moreover, by inspection, the vertices of are exactly given by where . Thus, by convexity, the maximum of the RHS of (20) over is obtained by for some with . But then we have
by the s.g.-goodness of . This completes the proof of the first bullet point.
We now turn our attention to the second claim. We have that
by the first claim. Further expanding, we have
Putting it all together yields (18). To prove (19), simply observe that
In the first inequality we have used the definition of subgaussian goodness and convexity. ∎
As a result, we also have the following tail bound on mean shifts caused by small subsets of points:
Let be an isotropic distribution. Let be -s.g. good w.r.t. . Then:
for all with and , we have
if satisfies and , then
We first prove the first claim. Fix any unit vector . Then we have
where (a) follows from Cauchy-Schwarz, and (b) follows from Fact 4.2. By taking square roots and a supremum over all unit vectors , we obtain the desired conclusion.
where the last line follows from subgaussian goodness, and applying the first claim with . ∎
As before, we will require a lemma which relates the mean shift caused by a small fraction of points to spectral deviations. However, because in this case we will assume that our data is subgaussian, we will be able to prove stronger statements, which will in turn allow us to achieve much better error. We first record the following simple fact, which states that if we have a set of weights that puts almost all of its mass on a good set, then the restriction of that set of weights to the good set satisfies the conditions of the lemmata proved in the above section.
Let , and suppose , where is -s.g. good, and . Let . Then and .
We first show that, no matter what, the smallest eigenvalue of the empirical covariance we choose cannot be too small. Formally, for the remainder of the section, let
Let . Suppose , where is -s.g. good, and . Let . Then
Let be defined by if and otherwise. By Lemma 3.4, we know that
Let . Suppose , where is -s.g. good, and . Let , and let . Then
Before we prove this lemma, observe that if , and then the RHS of the lemma simplifies to .
Let . As before, we have the following sequence of identities:
We treat the two terms on the RHS separately. We first consider . We continue expanding, and observe:
where (a) follows from two applications of Corollary 4.3, and (b) follows from Cauchy-Schwarz and subgaussian goodness.
We now turn our attention to bounding . We have
Focusing in on the first term in the RHS, we have
where (a) follows from Cauchy-Schwarz. and (b) follows since places at most mass on . Now observe that
by Fact 4.2, where we take the convention that for . Hence, combining terms, recalling the definition of , and taking square roots, we have
Solving for yields the desired claim. ∎
2 Algorithm description
The algorithm is quite similar to the algorithm presented in Section 3 for the bounded covariance case. The formal pseudocode is presented in Algorithm 4. For any , let and be as in Section 3. However, we will require a slightly stronger notion of score oracle than before.
Recall that before, given a dataset , and a sequence of weights , the score oracle is asked to produce multiplicative approximations to where is defined as (10). One consequence of this is that this allows us to produce multiplicative approximations to . However, we will require multiplicative approximations to , which cannot be obtained black-box via multiplicative approximations to the original scores.
Given and such an oracle , the algorithm again proceeds in epochs. Initially, we let . In epoch , we proceed as follows. First, compute . If , we terminate and output .
Otherwise, we let . Then, in iteration , we first (approximately) compute . If , we terminate and let . Otherwise, we let be prescribed by the MMW update with parameter . Then, produce the gain matrix is given as follows.
That is, we find the largest -percentile of the scores weighted by the current weights, and run the univariate filter on these set of weights, leaving the other weights unchanged. Finally, we output the gain matrix . Notice that this matrix may not be PSD.
Observe that the fact that the includes a negative identity term does not affect these scores at all, and indeed we can take to be as in (11), since the parameter is chosen in any case to normalize to have trace .
As before, the choice of constants here is arbitrary, and any constants sufficiently small will work. In Section 5 we construct such an approximate augmented score oracle in nearly-linear time.
3 Correctness of s.g.-QUEScoreFilter
The rest of this section is dedicated to the proof of the following theorem:
The following invariants always hold. There exists some universal constant so that for all epochs , we have:
, and
then epoch terminates after iterations, and outputs so that .
We first demonstrate how this lemma proves Theorem 4.7.
By our condition on , after at most iterations, we must have that
Since , Lemma 4.6 implies that for sufficiently small, we have
We now turn to bounding the runtime. As in Theorem 3.5, it is clear that we make at most calls to the oracle every epoch, and 1DFilter runs in time . Moreover, the approximate eigenvalue computations can still be done in time since we may run power method on , as we can evaluate matrix-vector multiplications against this matrix in time. This completes the proof. ∎
The proof of Lemma 4.8 breaks down into two parts. First, we will show that assuming we have not yet made sufficient progress, we remain in the regime where the filter is guaranteed to make progress, i.e., the majority of the mass of the are from bad points. This is captured in the following lemma:
At time , suppose that . Then and .
Then, we will show that this implies that the regret bounds of MMW guarantee that we make constant progress in logarithmically many iterations:
Suppose for all , Lemma 4.9 holds, where . Then, .
The condition that implies that in this case, we will run the univariate filter. Let and let , and let and the restriction of to and , respectively. Observe that , and therefore . We then have
We now turn to lower bound the contribution from . First observe that
where (a) follows from Fact 4.2 and since , and the last inequality follows by our assumption on . Therefore
where (a) follows since is the -percentile, (b) follows from the guarantee of Theorem 2.4, (c) follows from (27), and (d) follows from our assumption on . Rearranging terms completes the proof. ∎
We now show that this is enough to guarantee Lemma 4.10, which guarantees we make constant multiplicative progress in every epoch.
Observe that if we terminate prematurely we clearly satisfy the lemma. Thus we may assume we do not terminate until timestep . Lemma 4.9 then implies that no matter which update we do at time for , we have the guarantee that
Moreover, by Lemma 3.4, we have that , and hence by our choice of . Therefore by our regret bound, we have
By Lemma 4.5, we know that for all , we must have
This will allow us to simplify a number of expressions. In particular, since , this implies that all positive eigenvalues of are smaller than , and (30) implies that all negative eigenvalues are bounded in absolute value by , by our assumption on . Hence
Finally, we observe that (30) and Lemma 3.4 together imply that either
In the case of (33), we are clearly done, so we may assume that we are in the case of (34). Thus, plugging in (31), (32), and (34) into (29), and dividing by , we obtain
where (a) follows from (28), and (b) follows since , and since is a large constant factor larger than , by assumption. This completes the proof. ∎
Fast approximate score oracles
Our main result in this section is the following, which says that it is possible to achieve such approximations with high probability in nearly linear time:
If the output of ApproxScores satisfies the conditions of Lemma 5.1, we say that ApproxScores succeeds.
We need a few tools which are standard in the design of fast algorithms based on matrix multiplicative weights. The first is the standard Johnson-Lindenstrauss dimension reduction lemma:
Let be a matrix whose entries are i.i.d. samples from . For every vector and every ,
We also require the following, slightly stronger version of the JL guarantee, which states that it preserves matrix inner products:
Let . Suppose for some symmetric . Let have i.i.d. entries from . There is a universal constant such that for all ,
Notice that . By the Hanson-Wright inequality together with standard arguments about averages of i.i.d. sub-exponential random variables, for every ,
To finish the proof it will be enough to show that
We will also make use of Taylor series approximations to the matrix exponential function. The next lemma helps to control the errors incurred by such approximations.
(Note that when implementing our outlier detction algorithms we approximate the matrix exponential by Chebyshev polynomials rather than Taylor series.)
2 Efficient approximate score oracles
The estimate for the scores will then be given by
and the estimate for will be given by
The formal pseudocode is given in Algorithm 5.
We first demonstrate that ApproxScores indeed runs in the claimed runtime:
runs in time .
Note that ApproxScores is an approximate augmented score oracle, and so it is also clearly an approximate score oracle. In the remainder of this section, we show:
We now condition on the event that the following three events hold simultaneously:
By our choice of , Lemma 5.2, and a union bound, we know that (40) holds with probability at least . By instantiating Lemma 5.3 with and respectively, we also know that (41) and (42) each hold with probability at least . Thus, by a union bound, all three conditions hold simultaneously with probability at least . We claim that conditioned on these three events, the conditions of the lemma are satisfied. Indeed, we have
Lemmata 5.5 and 5.6 together immediately imply Lemma 5.1.
Robust mean estimation: putting it all together
In this section, we formally combine the guarantees derived in the previous sections to prove Theorems 2.1 and 2.2.
Given the machinery we’ve developed, the algorithm is straightforward to describe. Given a corrupted dataset and , run to obtain a pruned dataset . Center all points in with the empirical mean of . Then, run , with , and the parameter in ApproxScores set to . The formal pseudocode is presented in Algorithm 6.
Recall that by definition, we may assume that , where is a set of i.i.d. samples from , and . Let be as in (9). We condition on four events:
for all ,
succeeds,
, where is -good with respect to , and , and
every time it is called, ApproxScores suceeds.
By Chebyshev’s inequality, and an union bound over all points in , the first bullet point holds with probability at least . By a further union bound and by adjusting constants in our choices of , all four of these conditions hold simultaneously with probability at least . We now claim that, conditional on these four events, we output a so that . Indeed, the first two conditions imply that NaivePrune does not throw away any points in , and moreover, all points in the set satisfy after centering. Thus, since the scores output by ApproxScores satisfy the necessary conditions for Theorem 3.5, it follows that the final output satisfies , as claimed.
We now turn to runtime. Since each epoch runs for at most iterations, and so we run for at most iterations, the total time spent running ApproxScores is at most . Thus overall the algorithm runs in time , as claimed. ∎
2 Proof of Theorem 2.2
Again, the algorithm is straightforward. Given a corrupted dataset , parameters and , run to obtain a pruned dataset . Center all points in with the empirical mean of . Then, as above, run , with , and the parameter in ApproxScores set to . The formal pseudocode is presented in Algorithm 7.
We now prove correctness. The proof is very similar to the proof presented above.
Recall that by definition, we may assume that , where is a set of i.i.d. samples from , and . Let be as in (16) and (17), and let be as in (21). We condition on four events:
for all ,
succeeds,
is -s.g. good with respect to ,
every time it is called, ApproxScores suceeds.
By standard concentration inequalities for chi-squared random variables, and an union bound over all points in , the first bullet point holds with probability at least . By a further union bound and by adjusting constants in our choices of , all four of these conditions hold simultaneously with probability at least . We now claim that, conditional on these four events, we output a so that
Notice that in this case, by our choice of , and for we have that
Letting for some constant sufficiently large, by (16) and (17), we now have the following inequalities for each term in the above sum:
where (a) follows from the arithmetic mean-geometric mean inequality. Thus, overall we conclude that, assuming (43), we have
for some universal constants sufficiently large, as desired. It now remains to demonstrate that (43) is satisfied.
The first two conditions imply that NaivePrune does not throw away any points in , and moreover, all points in the set satisfy after centering. By standard arguments, this implies that , for . Thus, since the scores output by ApproxScores satisfy the necessary conditions for Theorem 3.5, it follows that the final output satisfies , as claimed.
We now turn to runtime. Since each epoch runs for at most iterations, and so we run for at most iterations, the total time spent running ApproxScores is at most . Thus overall the algorithm runs in time , as claimed. ∎
Outlier detection: additional experiments and fast implementation
In this section we compare QUE scoring against some additional outlier detection methods from prior literature. We also discuss and describe experiments involving our nearly-linear time implementation of QUE scoring.
The work compares a number of outlier detection methods (mainly those based on -NN distances) on several datasets, both low and high dimensional. We evaluate QUE scoring on the InternetAds dataset from , with a -fraction of outliers. Unlike the experiments on our CIFAR-10 and text embedding data, to replicate the experimental setting of prior work as closely as possible we perform no whitening or other preprocessing.
We find that QUE scoring is outperformed by LOF/-NN-based methods on the InternetAds dataset. Choosing for QUE, we find the ROCAUC scores in the below table.
To elucidate the difference between the InternetAds setting where -NN methods perform well and the other experimental settings in this paper, we offer the following histograms demonstrating that the distribution of nearest-neighbor distances is markedly distinct for inliers and outliers in both data sets, but only in the InternetAds dataset do inliers have smaller -NN distances.
2 Scaling up: a nearly-linear time implementation of QUE scoring
Most of the experiments we present involving QUE scores employ the following approach to compute them. Given , explicitly form the empirical covariance in memory. Use SciPy’s expm function to compute the matrix exponential , then compute . (This in turn uses the scaling and squaring algorithm for the matrix exponential of Al-Mohy and Higham .)
While we are already able to run experiments in or more dimensions using this approach, it requires at least memory to store the covariance, and somewhat more time to form and exponentiate it. We also implement an approximate method to compute QUE scores, whose running time is . We demonstrate in this section that outlier detection from approximate QUE scores still improves over baseline methods on several data sets. The technique here is very similar to the one used in Section 5 to approximate the scores used in the fast robust mean estimation algorithm. At a high level, the idea is the same: approximate the exponential with a low-degree polynomial, and sketch this using Johnson-Lindenstrauss matrices. However, we make a couple of additional optimizations here.
We use the following approximate method, inspired by our sketching approach to compute QUE scores from our nearly linear time algorithm for robust mean estimation.
Approximate the matrix exponential by Chebyshev polynomials of degree , along with scaling and squaring when .
For the empirical covariance of , use fast versions of the Johnson-Lindenstrauss method to approximate for all and .
Note that using the expansion into powers , right or left matrix-vector multiplication by can be accomplished in time. As in the fast JL transform , we take where is a sparse random matrix, is a diagonal matrix with random entries, and is a Hadamard matrix. Fast Fourier transform methods may be used to compute matrix-vector multiplications in time , leading to nearly-linear running time of this approach in theory. In practice, we use standard matrix multiplication; this still allows for experiments in thousands of dimensions.
3 Approximate whitening
Using approximate QUE scores reduces the running time of our outlier detection algorithm from quadratic to nearly-linear if whitened data is already available or there is no desire to preprocess/whiten the data. However, as we discussed in Section 1.5, QUE scoring works best with whitened data. If given a corrupted dataset and a clean dataset which is distributed similarly to the inliers of the dataset , we would like to compute whitened data . Unfortunately, even forming the matrix requires quadratic time (and computing the matrix inverse is slower still).
We investigate an approximate whitening procedure which avoids computing the entire matrix . Instead, we compute the top eigenvectors and eigenvalues of and approximate the inverse as , where is the projector to the orthogonal complement of . We use and demonstrate that even in conjunction with our approximate QUE scoring algorithm we still obtain a nonnegligible improvement over baseline methods.
References
Appendix A Deferred details from Section 2
The algorithm is straightforward: choose a random point in , and check if strictly more than points lie within a ball of radius around this point. If so, include all points with distance at most from this point. If not, repeat, and run for iterations. We now prove correctness.
By the triangle inequality, if we ever randomly select a point from , then we terminate, and in this case it is easy to see that the output satisfies the desired property. Thus, it is easy to see that the probability we have not terminated after iterations is at most . Suppose we have terminated. Then in that iteration, we selected a point that has distance at most to more than other points in . This implies that it has distance at most to some point in . By triangle inequality, this implies that all points in are at distance at most from , and so the output in this iteration must satisfy the claims of the Lemma. ∎
We note that if one wishes to obtain a deterministic linear-time algorithm for this problem, it is also possible to do so, albeit using radius . The algorithm is again simple: simply take the coordinate-wise median of all the data points, and take all points with distance at most from this point. It is not hard to see that the coordinate-wise median can differ in each coordinate from the points in by at most , and so its distance to each point in can be at most . While this is worse by a polynomial factor than the guarantee obtained above, since in the end our overall guarantees depend only logarithmically on , this does not change our runtime guarantees by more than a logarithmic factor.
A.2 Omitted details from Section 2.4
The algorithm 1DFilter is quite simple. For , and for any positive integer , define
Observe that the form a monotone decreasing sequence. The algorithm will simply find the smallest so that via binary search, and outputs . The formal pseudocode for the algorithm is given in Algorithm 8.
We now prove that this algorithm satisfies Theorem 2.4. We say any set of weights satisfying is admissible. We first show that the sequence of weights we produce is always admissible, under some mild conditions:
Let be an integer so that is admissible, and . Then is admissible.
Because , we have that . As a result, if , we must have . Therefore, we have the following two inequalities:
Consequently, we remove more mass from the weights in than from in going from to . Since by assumption is admissible, this immediately implies that is admissible as well. ∎
By induction, Lemma A.1 guarantees that the output weights remain admissible, and the termination condition of the algorithm guarantees that the output satisfies (5). It suffices to bound the runtime of the algorithm.
First, observe that there must exist a valid in the range we are searching. We first observe that
For any constant , the maximizer of the function in the range is achieved by , so for all . Setting , and letting , we conclude that
Thus, there exists some within our specified range which satisfies the conclusion. Finally, to bound the runtime, observe that every iteration runs in time, This is true in the real RAM model; in practice we can run any iteration in time by exponentiation via repeated doubling to compute all the , so we pay at most an additional log factor and we can run for at most iterations, which completes the proof. ∎
A.3 The randomized hard filter
In this section we show that a randomized outlier removal method, rather than soft downweighting, can achieve the more or less the same guarantees as 1DFilter. Formally, we show:
Let , let , and let . Let satisfy
Let be non-negative scalars, and let . Suppose there exist two disjoint sets so that , and moreover,
Then runs in time and outputs so that with probability , we have:
not too many more points from are removed than from i.e.
the sum of the has decreased, i.e. satisfies
The algorithm itself is very easy to describe. First, let . Then, while , throw away each point from with probability , where , and let be the set of remaining points. At termination, we simply output the set . The formal pseudocode of this algorithm is given in Algorithm 9.
As a brief aside, we note that this differs slightly from the algorithm presented in , as there the algorithm randomly selects a threshold, and throws away all points above this threshold. However, the key property which the previous algorithm used of this random threshold was that for all , we had that \Pr[\mbox{iis thrown out}]=\tau_{i}/\tau_{\max}(T). Therefore a very similar analysis can be adapted for either case. However, the algorithm in only succeeds with constant probability, and a martingale-style argument (as in ) is needed to ensure that it works.
The remainder of this section is dedicated to the proof of Theorem A.2. Our first lemma is similar to Lemma A.1.
Suppose that . Then, if we let be the random set obtained by throwing away each point from with probability , then:
For , let be the random variable which is if we throw out in and otherwise. Then
To prove (47), we break into two cases depending on . Suppose that . Then by Bernstein’s inequality, we have
Combining these two cases, and simplifying yields the desired claim. ∎
We now show that with high probability, we do not need to repeat this procedure too many times before the sum decreases by a constant factor.
Let , and let . Then, the probability that Algorithm 9 runs for more than iterations is at most .
Let . For , let
For all , we claim that conditional on the event that the algorithm has not terminated yet, and all points from have been removed, for , then after iterations, all points from have been removed with probability at least . Indeed, for all , in every iteration, if it has not been already removed, then it is removed with probability at least . Thus after iterations, the probability that any point from remains is at most . Therefore, by a union bound, after iterations, conditioned on the event that the algorithm hasn’t terminated yet, the probability that any point from for any is at most . However, if all points from are removed, for all , then if is the remaining set, we have , so if all such points are removed, then the algorithm must either terminate or have already terminated. This proves the claim by setting . ∎
Theorem A.2 follows from Lemma A.3 and Lemma A.4, by appropriately adjusting parameters.
It is straightforward for the full matrix multiplicative weights algorithm to use the randomized filter rather than the downweighting-based method. Given an -corrupted dataset of size initally, we do the following. At every instance where we pass to the filter, simply run the randomized filter instead of the downweighting-based method, and output the set of weights which is for every point that remains after running the randomized filter, and otherwise.
The guarantee of the randomized filter is slightly weaker than the guarantee of the downweighting-based method, so we cannot use black-box use the analysis presented beforehand to also analyze the algorithm instantiated with the weights given by the randomized filter. This is because our guarantee allows for slightly more good points than bad points to be removed per run of the algorithm. However, since the matrix multiplicative weights routine runs for at most polylogarthmically many iterations, by setting , we can guarantee that at the end of all of the runs, we have removed at most data points from . It is straightforward to verify that (up to a factor of 2), the same analysis for matrix multiplicative works with this slightly weaker guarantee, for sufficiently small. For conciseness, we omit the proof.
Appendix B Omitted proofs from Section 3
The contents of Section B.1 were added after we were made aware of and hence do not represent independent contributions of the present paper. In this section, we demonstrate the following reduction, which is also implicit in :
Let and be so that . Let be a distribution over with mean and covariance . Let be an -corrupted set of samples from of size . Then there is an efficient algorithm which, given and , produces an -corrupted set of samples of size from a distribution with mean , and covariance .
Despite this, we believe that our algorithm is still of independent interest, for a number of reasons. First, our algorithm is much simpler than combining this reduction with the algorithm presented in . We believe this is of independent mathematical interest. Additionally, it is this simplicity which allows us to design a practical outlier detection method, as presented in Section 1.5. Second, this reduction appears to preserve statistical accuracy only in the regime where aim for error bounds as in Theorem 2.1. In particular, it cannot achieve error below . For instance, if it is combined with the result in for isotropic sub-Gaussian distributions that can achieve error in time , then the overall algorithm will still achieve error , which is statistically suboptimal. In contrast, by slightly modifying our algorithm as in Theorem 2.2, we are able to achieve runtime while achieving error , for all sufficiently small.
The reduction is straightforward: obliviously group the samples in into buckets, each of size , and produce the set which simply takes each bucket, and takes the average the data points in that bucket. First, assume there is no corruption. Then, each bucket contains i.i.d. samples from , and so their average is distributed as , where the mean of is still , and their variance is . Since an adversary can only corrupt of these buckets, and there are a total of buckets, the desired conclusion follows immediately. ∎
B.2 Proof of Lemma 3.1
Before we prove this lemma, we require the following matrix Chernoff bound:
Let be a sequence of independent, random, PSD matrices. Assume that for all , and suppose . Then, there is some universal constant so that for all , we have
Let be the event , and let . We claim this set satisfies the properties claimed.
In particular, we let , by simplifying we obtain that . Let be the event that .
by Markov’s inequality, we have . We additionally have that for any unit vector ,
where the third line follows from Cauchy-Schwartz, the last line follows from (48), and since . Taking a supremum over all unit vectors yields that . Therefore, conditioned on both and , we have
We now turn our attention to the claimed bound on the covariance. Let be as above. Then, by assumption we have , and moreover we have
for some universal constant . Let be the event that (50) holds. Then, conditioned on both and holding, we have
as claimed, where (a) follows since centering the second moment matrix can only decrease its top eigenvalue. Thus, (49) and (51) imply that, conditioned on events simultaneously, the set is -good with respect to . By a union bound, these three events happen simultaneously with probability at least , as claimed. ∎
Appendix C Omitted proofs from Section 4
The two concentration bounds in (16) are standard (see e.g. ). Thus in this section, we focus on proving the concentration bounds corresponding to the bounds in (17). Since the two proofs are very similar, we will only prove the bound on ; the bound on will follow almost identically by substituting the appropriate Chernoff bound.
Let be i.i.d. from an isotropic subgaussian distribution over with variance proxy . Without loss of generality assume that the mean of the distribution is . It follows from the Hanson-Wright inequality and a standard net argument (see e.g. Lemma 2.1.7 in ) that there exist universal constants so that for all , we have:
In particular, applying this bound to any fixed with yields that
for a different choice of universal constant . Hence, by a union bound over all of size , we obtain that
where is the binary entropy of . For , there exists a universal constant so that . Plugging this in, and by our definition of , we obtain that
as claimed. To obtain the corresponding bound for , simply use a Chernoff style bound (e.g. Lemma 2.1.6 in ) instead of (53). ∎