Robust Learning of Fixed-Structure Bayesian Networks

Yu Cheng, Ilias Diakonikolas, Daniel Kane, Alistair Stewart

Introduction

Probabilistic graphical models [KF09] provide an appealing and unifying formalism to succinctly represent structured high-dimensional distributions. The general problem of inference in graphical models is of fundamental importance and arises in many applications across several scientific disciplines, see [WJ08] and references therein. In this work, we study the problem of learning graphical models from data [Nea03, DSA11]. There are several variants of this general learning problem depending on: (i) the precise family of graphical models considered (e.g., directed, undirected), (ii) whether the data is fully or partially observable, and (iii) whether the structure of the underlying graph is known a priori or not (parameter estimation versus structure learning). This learning problem has been studied extensively along these axes during the past five decades, (see, e.g., [CL68, Das97, AKN06, WRL06, AHHK12, SW12, LW12, BMS13, BGS14, Bre15]) resulting in a beautiful theory and a collection of algorithms in various settings.

The main vulnerability of all these algorithmic techniques is that they crucially rely on the assumption that the samples are precisely generated by a graphical model in the given family. This simplifying assumption is inherent for known guarantees in the following sense: if there exists even a very small fraction of arbitrary outliers in the dataset, the performance of known algorithms can be totally compromised. It is important to explore the natural setting when the aforementioned assumption holds only in an approximate sense. Specifically, we study the following broad question:

Can we efficiently learn graphical models when a constant fraction of the samples are corrupted, or equivalently, when the model is slightly misspecified?

In this paper, we focus on the model of corruptions considered in [DKK+16] (Definition 1) which generalizes many other existing models, including Huber’s contamination model [Hub64]. Intuitively, given a set of good samples (from the true model), an adversary is allowed to inspect the samples before corrupting them, both by adding corrupted points and deleting good samples. In contrast, in Huber’s model, the adversary is oblivious to the samples and is only allowed to add bad points.

We would like to design robust learning algorithms for Question 1 whose sample complexity, NN, is close to the information-theoretic minimum, and whose computational complexity is polynomial in NN. We emphasize that the crucial requirement is that the error guarantee of the algorithm is independent of the dimensionality dd of the problem.

In this work, we study Question 1 in the context of Bayesian networks [JN07]. We focus on the fully observable case when the underlying network is given. In the non-robust setting, this learning problem is straightforward: the “empirical estimator” (which coincides with the maximum likelihood estimator) is known to be sample and computationally efficient [Das97]. In sharp contrast, even this most basic regime is surprisingly challenging in the robust setting. For example, the very special case of robustly learning a Bernoulli product distribution (corresponding to an empty network with no edges) was analyzed only recently in [DKK+16].

To formally state our results, we first give a detailed description of the corruption model we study.

Given 0<ϵ<1/20<\epsilon<1/2 and a distribution family P\mathcal{P}, the algorithm specifies some number of samples NN, and NN samples X1,X2,…,XNX_{1},X_{2},\ldots,X_{N} are drawn from some (unknown) ground-truth P∈PP\in\mathcal{P}. The adversary is allowed to inspect PP and the samples, and replaces ϵN\epsilon N of them with arbitrary points. The set of NN points is then given to the algorithm. We say that a set of samples is ϵ\epsilon-corrupted if it is generated by this process.

Note that PP is determined by GG and pp. We will frequently index pp as a vector. We use the notation pkp_{k} and the associated events Πk\Pi_{k}, where each k∈[m]k\in[m] stands for an (i,a)∈Γ(i,a)\in\Gamma lexicographically ordered.

Our Results.

We give the first efficient robust learning algorithm for Bayesian networks with a known graph GG. Our algorithm has information-theoretically near-optimal sample complexity, runs in time polynomial in the size of the input (the samples), and provides an error guarantee that scales near-linearly with the fraction of adversarially corrupted samples, under the following restrictions: First, we assume that each parental configuration is reasonably likely. Intuitively, this assumption seems necessary because we need to observe each configuration many times in order to learn the associated conditional probability to good accuracy. Second, we assume that each of the conditional probabilities is balanced, i.e., bounded away from and 11. This assumption is needed for technical reasons. In particular, we need this to show that a good approximation to the conditional probability table implies that the corresponding Bayesian network is close in total variation distance.

Our algorithm is given in Section 3. We first note that the sample complexity of our algorithm is near-optimal for learning Bayesian networks with known structure. The following sample complexity lower bound holds even without corrupted samples:

Let BNd,f\mathcal{BN}_{d,f} denote the family of Bernoulli Bayesian networks on dd variables such that every node has at most ff parents. The worst-case sample complexity of learning BNd,f\mathcal{BN}_{d,f}, within total variation distance ϵ\epsilon and with probability 9/109/10, is Ω(2f⋅d/ϵ2)\Omega(2^{f}\cdot d/\epsilon^{2}) for all f≤d/2f\leq d/2 when the graph structure is known.

Consider Bayes nets whose average in-degree is close to the maximum in-degree, that is, when m=Θ(2fd)m=\Theta(2^{f}d), the sample complexity lower bound in Fact 4 becomes Ω(m/ϵ2)\Omega(m/\epsilon^{2}), so our sample complexity is optimal up to polylogarithmic factors.

We remark that Theorem 3 is most useful when cc is a constant and the Bayesian network has bounded fan-in ff. In this case, the condition on α\alpha follows from the cc-balanced assumption: When both cc and ff are constants, α=min⁡(i,a)∈SPr⁡P[Πi,a]≥cf\alpha=\min_{(i,a)\in S}\Pr_{P}[\Pi_{i,a}]\geq c^{f} is also a constant, so the condition cf≥Ω(ϵlog⁡(1/ϵ))c^{f}\geq\Omega(\epsilon\sqrt{\log(1/\epsilon)}) automatically hold when ϵ\epsilon is smaller than some constant. On the other hand, the problem of learning Bayesian networks is less interesting when the fan-in is too large. For example, if some node has f=ω(log⁡(d))f=\omega(\log(d)) parents, then the size of the conditional probability table is at least 2f2^{f}, which is super-polynomial in the dimension dd.

Experiments.

We performed an experimental evaluation of our algorithm on both synthetic and real data. Our evaluation allowed us to verify the accuracy and the sample complexity rates of our theoretical results. In all cases, the experiments validate the usefulness of our algorithm, which significantly outperforms previous approaches, almost exactly matching the best rate without noise.

Related Work.

Question 1 fits in the framework of robust statistics [HR09, HRRS86]. Classical estimators from this field can be classified into two categories: either (i) they are computationally efficient but incur an error that scales polynomially with the dimension dd, or (ii) they are provably robust (in the aforementioned sense) but are hard to compute. In particular, essentially all known estimators in robust statistics (e.g., the Tukey median [Tuk75]) have been shown [JP78, Ber06, HM13] to be intractable in the high-dimensional setting. We note that the robustness requirement does not typically pose information-theoretic impediments for the learning problem. In most cases of interest (see, e.g., [CGR15, CGR16, DKK+16]), the sample complexity of robust learning is comparable to its (easier) non-robust variant. The challenge is to design computationally efficient algorithms.

Efficient robust estimators are known for various low-dimensional structured distributions (see, e.g., [DDS14, CDSS13, CDSS14a, CDSS14b, ADLS16, ADLS17, DLS18]). However, the robust learning problem becomes surprisingly challenging in high dimensions. Recently, there has been algorithmic progress on this front: [DKK+16, LRV16] give polynomial-time algorithms with improved error guarantees for certain “simple” high-dimensional structured distributions. The results of [DKK+16] apply to simple distributions, including Bernoulli product distributions, Gaussians, and mixtures thereof (under some natural restrictions). Since the works of [DKK+16, LRV16], computationally efficient robust estimation in high dimensions has received considerable attention (see, e.g., [DKS17, DKK+17, BDLS17, DKK+18a, DKS18b, DKS18a, HL18, KSS18, PSBR18, DKK+18b, KKM18, DKS18c, LSLC18]).

2 Overview of Algorithmic Techniques

Our algorithmic approach builds on the framework of [DKK+16] with new technical and conceptual ideas. At a high level, our algorithm works as follows: We draw an ϵ\epsilon-corrupted set of samples from a Bayesian network PP with known structure, and then iteratively remove samples until we can return the empirical conditional probability table.

First, we associate a vector F(X)F(X) to each sample XX so that learning the mean of F(X)F(X) to good accuracy is sufficient to recover the distribution. In the case of binary products, F(X)F(X) is simply XX, while in our case we need to take into account additional information about conditional means.

From this point, our algorithm will try to do one of two things: Either we show that the sample mean of F(X)F(X) is close to the conditional mean of the true distribution (in which case we can already learn the ground-truth Bayes net PP), or we are able to produce a filter, i.e., we can remove some of our samples, and it is guaranteed that we throw away more bad samples than good ones. If we produce a filter, we then iterate on those samples that pass the filter. To produce a filter, we compute a matrix MM which is roughly the empirical covariance matrix of F(X)F(X). We show that if the corruptions are sufficient to notably disrupt the sample mean of F(X)F(X), there must be many erroneous samples that are all far from the mean in roughly the same direction, and we can detect this direction by looking at the largest eigenvector of MM. If we project all samples onto this direction, concentration bounds of F(X)F(X) will imply that almost all samples far from the mean are erroneous, and thus filtering them out will provide a cleaner set of samples.

Section 2 contains some technical results specific to Bayesian networks that we need. Section 3 gives the details of our algorithm and an overview of its analysis. In Section 4, we present the experimental evaluations. In Section 5, we conclude and propose directions for future work.

Technical Preliminaries

The structure of this section is as follows: First, we bound the total variation distance between two Bayes nets in terms of their conditional probability tables. Second, we define a function F(x,q)F(x,q), which takes a sample xx and returns an mm-dimensional vector that contains information about the conditional means. Finally, we derive a concentration bound from Azuma’s inequality. Proofs from this section have been deferred to Appendix A.

Lemma 5 says that to learn a balanced fixed-structure Bayesian network, it is sufficient to learn all the relevant conditional means. However, each sample x∼Px\sim P gives us information about pi,ap_{i,a} only if x∈Πi,ax\in\Pi_{i,a}. To resolve this, we map each sample xx to an mm-dimensional vector F(x,q)F(x,q), and “fill in” the entries that correspond to conditional means for which the condition failed to happen. We will set these coordinates to their empirical conditional means qq:

When q=pq=p (the true conditional means), the expectation of the (i,a)(i,a)-th coordinate of F(X,p)F(X,p), for X∼PX\sim P, is the same conditioned on either Πi,a\Pi_{i,a} or ¬Πi,a\neg\Pi_{i,a}. Using the conditional independence properties of Bayesian networks, we will show that the covariance of F(x,p)F(x,p) is diagonal.

Finally, we will need a suitable concentration inequality that works under conditional independence properties. We can use Azuma’s inequality to show that the projections of F(X,q)F(X,q) on any direction vv is concentrated around the projection of the sample mean qq.

Robust Learning Algorithm

We first look into the major ingredients required for our filtering algorithm, and compare our proof with that for product distributions in [DKK+16] on a more technical level.

In Section 2, we mapped each sample XX to F(X,q)F(X,q) which contains information about the conditional means qq, and we showed that it is sufficient to learn the mean of F(X,q)F(X,q) to learn the ground-truth Bayes net.

Let MM denote the empirical covariance matrix of (F(X,q)−q)(F(X,q)-q). We decompose MM into three parts: One coming from the ground-truth distribution, one coming from the subtractive error (because the adversary can remove ϵN\epsilon N good samples), and one coming from the additive error (because the adversary can add ϵN\epsilon N bad samples). We will make use of the following observations:

The noise-free distribution has a diagonal covariance matrix.

The term coming from the subtractive error has no large eigenvalues.

These two observations imply that any large eigenvalues of MM are due to the additive error. Finally, we will reuse our concentration bounds to show that if the additive errors are frequently far from the mean in a known direction, then they can be reliably distinguished from good samples.

For the case of binary product distributions in [DKK+16], (1) is trivial because the coordinates are independent; but for Bayesian networks we need to expand the dimension of the samples and fill in the missing entries properly. Condition (2) is due to concentration bounds, and for product distributions it follows from standard Chernoff bounds, while for Bayes nets, we must instead rely on martingale arguments and Azuma’s inequality. The main difference between the proof of correctness of our algorithm and those given in [DKK+16] lies in analyzing the mean, covariance and tail bounds of F(X,q)F(X,q), and showing that its mean and covariance are well-behaved when qq is close to pp (see Lemma 24 in Appendix B).

First, we need to show that a large enough set of samples with no noise satisfy properties we expect from a representative set of samples. We need that the mean, covariance, and tail bounds of F(X,p)F(X,p) behave like we would expect them to. This happens with high probability. The details are given in Lemma 24 in Appendix B.1. We call a set of samples that satisfies these properties ϵ\epsilon-good for PP.

Our algorithm takes as input an ϵ\epsilon-corrupted multiset S′S^{\prime} of N=Ω~(mlog⁡(1/τ)/ϵ2)N={\widetilde{\Omega}}(m\log(1/\tau)/\epsilon^{2}) samples. We write S′=(S∖L)∪ES^{\prime}=(S\setminus L)\cup E, where SS is the set of samples before corruption, LL contains the good samples that have been removed or (in later iterations) incorrectly rejected by filters, and EE represents the remaining corrupted samples. We assume that SS is ϵ\epsilon-good. In the beginning, we have ∣E∣+∣L∣≤2ϵ∣S∣|E|+|L|\leq 2\epsilon|S|. As we add filters in each iteration, EE gets smaller and LL gets larger. However, we will prove that our filter rejects more samples from EE than SS, so ∣E∣+∣L∣|E|+|L| must get smaller.

We will prove Theorem 3 by iteratively running the following efficient filtering procedure:

Let 0<ϵ<1/20<\epsilon<1/2. Let PP be a cc-balanced Bayesian network on {0,1}d\{0,1\}^{d} with known structure GG. Assume each parental configuration of PP occurs with probability at least α≥Ω(ϵlog⁡(1/ϵ)/c)\alpha\geq\Omega(\epsilon\sqrt{\log(1/\epsilon)}/c). Let S′=S∪E∖LS^{\prime}=S\cup E\setminus L be a set of samples such that SS is ϵ\epsilon-good for PP and ∣E∣+∣L∣≤2ϵ∣S′∣|E|+|L|\leq 2\epsilon|S^{\prime}|. There is an algorithm that, given GG, ϵ\epsilon, and S′S^{\prime}, runs in time O~(d∣S′∣){\widetilde{O}}(d|S^{\prime}|), and either

Returns an S′′=S∪E′∖L′S^{\prime\prime}=S\cup E^{\prime}\setminus L^{\prime} such that ∣S′′∣≤(1−ϵdln⁡d)∣S′∣|S^{\prime\prime}|\leq(1-\frac{\epsilon}{d\ln d})|S^{\prime}| and ∣E′∣+∣L′∣<∣E∣+∣L∣|E^{\prime}|+|L^{\prime}|<|E|+|L|.

If this algorithm produces a subset S′′S^{\prime\prime}, then we iterate using S′′S^{\prime\prime} in place of S′S^{\prime}. We will present the algorithm establishing Proposition 9 in the following section. We first use it to prove Theorem 3.

Next we analyze the running time. Observe that we can filter out at most 2ϵN2\epsilon N samples, because we reject more bad samples than good ones. By Proposition 9, every time we produce a filter, we remove at least Ω~(d/ϵ)∣S′∣=Ω~(Nd/ϵ){\widetilde{\Omega}}(d/\epsilon)|S^{\prime}|={\widetilde{\Omega}}(Nd/\epsilon) samples. Therefore, there are at most O~(d){\widetilde{O}}(d) iterations, and each iteration takes time O~(d∣S′∣)=O~(Nd){\widetilde{O}}(d|S^{\prime}|)={\widetilde{O}}(Nd) by Proposition 9, so the overall running time is O~(Nd2){\widetilde{O}}(Nd^{2}). ∎

2 Algorithm Filter-Known-Topology

In this section, we present Algorithm 1 that establishes Proposition 9. We use X∈uSX\in_{u}S to denote that the point XX is drawn uniformly from the set of samples SS.

At a high level, Algorithm 1 computes a matrix MM, and shows that: either ∥M∥2\|M\|_{2} is small, and we can output the empirical conditional probabilities, or ∥M∥2\|M\|_{2} is large, and we can use the top eigenvector of MM to remove bad samples.

Our first step is to analyze the spectrum of MM, and in particular show that MM is close in spectral norm to wEMEw_{E}M_{E}. To do this, we begin by showing that the spectral norm of MS,0M_{S,0} is relatively small. Since SS is good, we have bounds on the second moments F(X,p)F(X,p). We just need to deal with the error from replacing pp with qq (see Appendix B.2 for the proof):

∥MS,0∥2≤O(ϵ+∑kPr⁡S[Πk](pk−qk)2+∑kPr⁡S[Πk](pk−qk)2)\|M_{S,0}\|_{2}\leq O(\epsilon+\sqrt{\sum_{k}\Pr_{S}[\Pi_{k}](p_{k}-q_{k})^{2}}+\sum_{k}\Pr_{S}[\Pi_{k}](p_{k}-q_{k})^{2}).

Next, we wish to bound the contribution to MM coming from the subtractive error. We show that this is small due to concentration bounds on PP and hence on SS. The idea is that for any unit vector vv, we have tail bounds for the random variable v⋅(F(X,q)−q)v\cdot(F(X,q)-q) and, since LL is a subset of SS, LL can at worst consist of a small fraction of the tail of this distribution.

wL∥ML∥2≤O(ϵlog⁡(1/ϵ)+ϵ∥p−q∥22)w_{L}\|M_{L}\|_{2}\leq O(\epsilon\log(1/\epsilon)+\epsilon\|p-q\|_{2}^{2}).

Finally, combining the above results, since MSM_{S} and MLM_{L} have small contribution to the spectral norm of MM when ∥p−q∥2\|p-q\|_{2} is small, most of it must come from MEM_{E}.

∥M−wEME∥2≤O(ϵlog⁡(1/ϵ)+∑kPr⁡S′[Πk](pk−qk)2+∑kPr⁡S′[Πk](pk−qk)2)\|M-w_{E}M_{E}\|_{2}\leq O\left(\epsilon\log(1/\epsilon)+\sqrt{\sum_{k}\Pr_{S^{\prime}}[\Pi_{k}](p_{k}-q_{k})^{2}}+\sum_{k}\Pr_{S^{\prime}}[\Pi_{k}](p_{k}-q_{k})^{2}\right).

Lemma 12 follows using the identity ∣S′∣M=∣S∣MS,0+∣E∣ME,0−∣L∣ML,0|S^{\prime}|M=|S|M_{S,0}+|E|M_{E,0}-|L|M_{L,0} and bounding the errors due to the diagonals of MEM_{E} and MLM_{L}.

The Case of Small Spectral Norm.

∑kPr⁡S′[Πk]2(pk−qk)2≤2ϵ∥M∥2+O(ϵlog⁡(1/ϵ)+1/α)\sqrt{\sum_{k}\Pr_{S^{\prime}}[\Pi_{k}]^{2}(p_{k}-q_{k})^{2}}\leq 2\sqrt{\epsilon\|M\|_{2}}+O(\epsilon\sqrt{\log(1/\epsilon)+1/\alpha}).

If ∥M∥2≤O(ϵlog⁡(1/ϵ)/α)\|M\|_{2}\leq O(\epsilon\log(1/\epsilon)/\alpha), then

The Case of Large Spectral Norm.

Now we consider the case when ∥M∥2≥Cϵln⁡(1/ϵ)/α\|M\|_{2}\geq C\epsilon\ln(1/\epsilon)/\alpha. We begin by showing that pp and qq are not too far apart from each other. The bound given by Lemma 15 is now dominated by the ∥M∥2\|M\|_{2} term. Lower bounding the Pr⁡S′[Πk]\Pr_{S^{\prime}}[\Pi_{k}] by α\alpha gives the following claim.

∥p−q∥2≤δ:=3ϵ∥M∥2/α\|p-q\|_{2}\leq\delta:=3\sqrt{\epsilon\|M\|_{2}}/\alpha.

Recall that v∗v^{*} is the largest eigenvector of MM. We project all the points F(X,q)F(X,q) onto the direction of v∗v^{*}. Next we show that most of the variance of (v∗⋅(F(X,q)−q))(v^{*}\cdot(F(X,q)-q)) comes from EE.

v∗T(wEME)v∗≥12v∗TMv∗v^{\ast T}(w_{E}M_{E})v^{\ast}\geq\frac{1}{2}v^{\ast T}Mv^{\ast}.

Claim 18 follows from the observation that ∥M−wEME∥2\|M-w_{E}M_{E}\|_{2} is much smaller than ∥M∥2\|M\|_{2}. This is obtained by substituting the bound on ∥p−q∥2\|p-q\|_{2} (in terms of ∥M∥2\|M\|_{2}) from Claim 17 into the bound on ∥M−wEME∥2\|M-w_{E}M_{E}\|_{2} given by Lemma 12.

Claim 18 implies that the tails of wEEw_{E}E are reasonably thick. In particular, we show that there must be a threshold T>0T>0 satisfying the desired property in Step 9 of our algorithm.

If Lemma 19 were not true, by integrating this tail bound, we can show that v∗TMEv∗v^{\ast T}M_{E}v^{\ast} would be small. Therefore, Step 11 of Algorithm 11 is guaranteed to find some valid threshold T>0T>0.

Finally, we show that the set of samples S′′S^{\prime\prime} we return after the filter is better than S′S^{\prime} in terms of ∣L∣+∣E∣|L|+|E|. This completes the proof of the second case of Proposition 9.

If we write S′′=S∪E′∖L′S^{\prime\prime}=S\cup E^{\prime}\setminus L^{\prime}, then ∣E′∣+∣L′∣<∣E∣+∣L∣|E^{\prime}|+|L^{\prime}|<|E|+|L| and ∣S′′∣≤(1−ϵdln⁡d)∣S′∣|S^{\prime\prime}|\leq(1-\frac{\epsilon}{d\ln d})|S^{\prime}|.

Claim 9 follows from the fact that SS is ϵ\epsilon-good, so we only remove at most (3exp⁡(T2/2)+ϵ/T2log⁡d)∣S∣(3\exp(T^{2}/2)+\epsilon/T^{2}\log d)|S| samples from SS. Since we remove more than twice as many samples from S′S^{\prime}, most of the samples we throw away are from EE. Moreover, we remove at least (1−ϵdln⁡d)∣S′∣(1-\frac{\epsilon}{d\ln d})|S^{\prime}| samples because we can show that the threshold TT is at most d\sqrt{d}.

Running Time of Our Algorithm 1

Experiments

We test our algorithms using data generated from both synthetic and real-world networks (e.g., the ALARM network [BSCC89]) with synthetic noise. All experiments were run on a laptop with 2.6 GHz CPU and 8 GB of RAM. We found that our algorithm achieves the smallest error consistently in all trials, and that the error of our algorithm almost matches the error of the empirical conditional probabilities of the uncorrupted samples. Moreover, our algorithm can easily scale to thousands of dimensions with millions of samples. The bottleneck of our algorithm is fitting millions of samples of thousands dimension all in the memory.

We draw the parameters of PP independently from [0,1/4]∪[3/4,1][0,1/4]\cup[3/4,1] uniformly at random, i.e., in a setting where the “balancedness” assumption does not hold. Our experiments show that our filtering algorithm works very well in this setting, even when the assumptions under which we can prove theoretical guarantees are not satisfied. This complements our theoretical results and illustrates that our algorithm is not limited by these assumptions and can apply to more general settings in practice.

In Figure 1, we compare the performance of (1) our filtering algorithm, (2) the empirical conditional probability table with noise, and (3) a RANSAC-based algorithm (see the end of Section 4 for a detailed description). We use the error of the empirical conditional mean without noise (i.e., MLE estimator with only good samples) as the gold standard, since this is the best one could hope for even if all the corrupted samples are identified. We tried various graph structures for the Bayes net PP and noise distributions, and similar patterns arise for all of them. In the top figure, the dependency graph of PP is a randomly generated tree, and the noise distribution is a binary product distribution; In the bottom figure, the dependency graph of PP is a random graph, and the noise distribution is the tree Bayes net used as the ground truth in the first experiment. The reader is referred to Appendix C.1 for a full description of how we generate the dependency graphs and noise distributions.

2 Semi-Synthetic Experiments

In the semi-synthetic experiments, we apply our algorithm to robustly learn real-world Bayesian networks. The ALARM network [BSCC89] is a classic Bayes net that implements a medical diagnostic system for patient monitoring.

Our experimental setup is as follows: The underlying graph of ALARM has 3737 nodes and 509509 parameters. Since the variables in ALARM can have up to 44 different values, we first transform it into an equivalent binary-valued Bayes net(see Appendix C.3 for more details). After the transformation, the network has d=61d=61 nodes and m=820m=820 parameters. We are interested in whether our filtering algorithm can learn a Bayes net that is “close” to ALARM when samples are corrupted; and how many corrupted samples can our algorithm tolerate. For ϵ=[0.05,0.1,…,0.4]\epsilon=[0.05,0.1,\ldots,0.4], we draw N=106N=10^{6} samples, where a (1−ϵ)(1-\epsilon)-fraction of the samples come from ALARM, and the other ϵ\epsilon-fraction comes from a noise distribution.

In Figure 2, we compare the performance of (1) our filtering algorithm, (2) the empirical conditional means with noise, and (3) a RANSAC-based algorithm. We use the error of the empirical conditional means without noise as the gold standard. We tried various noise distributions and observed similar patterns. In Figure 2, the noise distribution is a Bayes net with random dependency graphs and conditional probabilities drawn from [0,14]∪[34,1][0,\frac{1}{4}]\cup[\frac{3}{4},1] (same as the ground-truth Bayes net in Figure 1).

The experiments show that our filtering algorithm outperforms MLE and RANSAC, and that the error of our algorithm degrades gracefully as ϵ\epsilon increases. It is worth noting that even the ALARM network does not satisfy our balancedness assumption on the parameters, our algorithm still performs well on it and recovers the conditional probability table of ALARM in the presence of corrupted samples.

RANSAC uses subsampling in the hope of getting an estimator that is not affected too much by the noise. The hope is that a small subsample might not contain any erroneous points. The approach proceeds by computing many such estimators and appropriately selecting the best one.

In our experiments, we let RANSAC select 10%10\% of the samples uniformly at random, and repeat this process 100100 times. After a subset of samples are selected, we compute the empirical conditional means and estimate the total variation distance between the corresponding Bayes net and the ground truth. Since we know the ground truth, we can make it easier for RANSAC by selecting the best hypothesis that it ever produced during its execution.

The main conceptual message of our experimental evaluation of RANSAC is that it does not perform well in high dimensions for the following reason: To guarantee that there are very few noisy points for such a subsample, we must take an exponential (in the dimension) number of subsets. We are not the first to observe that RANSAC does not work for robustly learning high-dimensional distributions. Previously, [DKK+17] showed that RANSAC does not work in practice for the problem of robustly learning a spherical Gaussian.

Conclusions and Future Directions

In this paper, we initiated the study of the efficient robust learning for graphical models. We described a computationally efficient algorithm for robustly learning Bayesian networks with a known topology, under some mild assumptions on the conditional probability table. We evaluate our algorithm experimentally, and we view our experiments as a proof of concept demonstration that our techniques can be practical for learning fixed-structure Bayesian networks. A challenging open problem is to generalize our results to the case when the underlying directed graph is unknown.

This work is part of a broader agenda of systematically investigating the robust learnability of high-dimensional structured probability distributions. There is a wealth of natural probabilistic models that merit investigation in the robust setting, including undirected graphical models (e.g., Ising models), and graphical models with hidden variables (i.e., incorporating latent structure).

We are grateful to Daniel Hsu for suggesting the model of Bayes nets, and for pointing us to [Das97]. Yu Cheng is supported in part by NSF CCF-1527084, CCF-1535972, CCF-1637397, CCF-1704656, IIS-1447554, and NSF CAREER Award CCF-1750140. Ilias Diakonikolas is supported by NSF CAREER Award CCF-1652862 and a Sloan Research Fellowship. Daniel Kane is supported by NSF CAREER Award CCF-1553288 and a Sloan Research Fellowship.

References

Appendix A Omitted Proofs from Section 2

In this section, we give proofs for the technical lemmas in Section 2. Lemma 5 bounds the total variation distance between two balanced Bayesian networks in terms of their conditional probability tables. Lemma 5 is a simple corollary of Lemma 21.

Let PP and QQ be Bayesian networks with the same dependency graph GG. In terms of the conditional probability tables pp and qq of PP and QQ, we have:

Let AA and BB be two distributions on {0,1}d\{0,1\}^{d}. We have:

Fix i∈[d]i\in[d]. The events Πi,a\Pi_{i,a} form a disjoint partition of {0,1}d\{0,1\}^{d}. Dividing the sum above into this partition, we obtain

Let P≤iP_{\leq i} and Q≤iQ_{\leq i} be the distribution over the first ii coordinates of PP and QQ respectively. Let PiP_{i} and QiQ_{i} be the distribution of the ii-th coordinate of PP and QQ respectively.

The first and the fifth steps use Equation 2, the second step uses that the ii-th coordinate is independent of the first (i−1)(i-1) coordinates conditioned on Πi,a\Pi_{i,a}, and the third and fourth steps use Equation 1.

Now observe that the Pi∣Πi,aP_{i}\mid\Pi_{i,a} and Qi∣Πi,aQ_{i}\mid\Pi_{i,a} are Bernoulli distributions with means pi,ap_{i,a} and qi,aq_{i,a}. For p,q∈p,q\in, we have:

Lemma 5 gives a simpler expression for total variation distance between two cc-balanced binary Bayesian networks whose minimum probability of any Πk\Pi_{k} is at least ϵ\epsilon.

We associate a vector F(X)F(X) to each sample XX, so that F(X)F(X) contains information about the conditional means, and learning the mean of F(X)F(X) to good accuracy is sufficient to recover the distribution. Recall that qq is the vector of empirical conditional means, and we define F(x,q):{0,1}d→mF(x,q):\{0,1\}^{d}\to^{m} as follows (Definition 6): If x∈Πi,ax\in\Pi_{i,a}, then F(x,q)i,a=xiF(x,q)_{i,a}=x_{i}, otherwise F(x,q)i,a=qi,aF(x,q)_{i,a}=q_{i,a}.

We will prove some properties of FF. First, we note that FF is invertible in the following sense.

Fix q∈mq\in^{m} and j∈[d]j\in[d]. Given (x1,…,xj)(x_{1},\ldots,x_{j}), we can compute F(x,q)i,aF(x,q)_{i,a} for all (i,a)(i,a) with i≤ji\leq j. We can recover (x1,…,xj)(x_{1},\dots,x_{j}) from these F(x,q)i,aF(x,q)_{i,a} as well.

By the definition of F(x,q)F(x,q), to compute F(x,q)i,aF(x,q)_{i,a} we need to know xix_{i} and whether x∈Πi,ax\in\Pi_{i,a}. Note that whether or not x∈Πi,ax\in\Pi_{i,a} depends only on (x1,…,xi−1)(x_{1},\dots,x_{i-1}), so F(x,p)i,aF(x,p)_{i,a} is a function of (x1,…,xi−1,xi)(x_{1},\dots,x_{i-1},x_{i}).

We will show by induction that (x1,…,xj)(x_{1},\dots,x_{j}) can be recovered from all F(x,p)i,aF(x,p)_{i,a} with i≤ji\leq j. Since x1x_{1} has no parents, we have x1=F(x,p)1,a′x_{1}=F(x,p)_{1,a^{\prime}} for the empty bitstring a′a^{\prime}. For i>1i>1, we have that xi=F(x,p)i,ax_{i}=F(x,p)_{i,a} for the unique aa with x∈Πi,ax\in\Pi_{i,a}, and we can decide which aa based on (x1,…,xi−1)(x_{1},\dots,x_{i-1}). ∎

Next, we show that when q=pq=p (the true conditional probabilities), although the coordinates of F(X,p)F(X,p) are not independent, the mean of a coordinate of F(X,p)F(X,p) remains unchanged even if we condition on the values of previous coordinates.

Let k=(i,a)k=(i,a). Since we order the (i,a)(i,a)’s lexicographically, (F(X,p)1,…,F(X,p)k−1)(F(X,p)_{1},\dots,F(X,p)_{k-1}) includes F(X)j,a′F(X)_{j,a^{\prime}} for all (j,a′)(j,a^{\prime}) with j<ij<i. By Claim 22, these determine the value of the parents of XiX_{i}, i.e., whether or not Πi,a\Pi_{i,a} occurs.

We build on Claim 23 to show that, although the coordinates of F(X,p)F(X,p) are not independent, the first and second moments are the same as that of a product distribution of the marginal of each coordinate.

Finally, we will need a suitable concentration inequality that works under conditional independence. Lemma 8 shows that the projections of F(X,q)F(X,q) on any direction vv is concentrated around its mean.

Consider an x∈{0,1}dx\in\{0,1\}^{d}. If x∈Πi,ax\in\Pi_{i,a}, then we have F(x,p)i,a=F(x,q)i,a=xiF(x,p)_{i,a}=F(x,q)_{i,a}=x_{i} and so

If x∉Πi,ax\notin\Pi_{i,a}, then F(x,p)i,a=pi,aF(x,p)_{i,a}=p_{i,a} and F(x,q)i,a=qi,aF(x,q)_{i,a}=q_{i,a}, hence

An application of the Cauchy-Schwarz inequality gives that, if ∣v⋅(F(X,q)−q)∣≥T+∥p−q∥2|v\cdot(F(X,q)-q)|\geq T+\|p-q\|_{2} then ∣v⋅(F(x,p)−p)∣≥T|v\cdot(F(x,p)-p)|\geq T. Therefore, the probability of the former holding for XX must be at most the probability that the latter holds for XX. ∎

Appendix B Omitted Proofs from Sections 3

This section analyzes Algorithm 1 and gives the proof of Proposition 9.

The basic idea of the analysis is as follows: If the empirical conditional probability table qq is close to the true conditional probability table pp of PP, then outputting qq is correct. We know that we have enough samples that the empirical conditional probability table with no noise p~{\widetilde{p}} is a good approximation to pp. Therefore, we will be in good shape so long as the corruption of our samples does not introduce a large error in the conditional probability table.

Thinking more concretely about this error, we may split it into two parts: LL, the subtractive error, and EE the additive error. Using concentration results for PP, it can be shown that the subtractive errors cannot cause significant problems for the conditional probability table. It remains to consider additive errors. The bad samples in EE can introduce notable errors in the conditional probability table, since any given sample can be d\sqrt{d} far from the mean. If many of the corrupted samples line up in the same direction, this can lead to a notable discrepancy.

However, if many of these errors line up in some direction (which is necessary in order to have a large impact on the mean), the effects will be reflected in the first two moments. More concretely, if for some unit vector vv, the expectation of v⋅F(E,q)v\cdot F(E,q) is very far from the expectation of v⋅F(P,q)v\cdot F(P,q), this will force the variance of v⋅F(S′,q)v\cdot F(S^{\prime},q) to be large. This implies two things: First, it tells us that if v⋅F(S′,q)v\cdot F(S^{\prime},q) is small for all vv (a condition equivalent to ∥M∥2\|M\|_{2} being small), we know that qq is a good approximation to the true conditional probability table. Second, if ∥M∥2\|M\|_{2} is large, we can find a unit vector vv where v⋅F(S′,q)v\cdot F(S^{\prime},q) has large variance. A reasonable fraction of this variance must be coming from samples in EE that have v⋅F(X,q)v\cdot F(X,q) very far from the mean. On the other hand, using concentration bounds for v⋅F(P,q)v\cdot F(P,q), we know that very few valid samples are this far from the mean. This discrepancy will allow us to create a filter which rejects more samples from EE than from SS.

In Section B.1, we will provide a set of deterministic conditions that we expect from the good samples and show that they happen with high probability. In Section B.2, we will prove some structural lemmas about the spectrum of MM. In Section B.3, we will show that if ∥M∥2\|M\|_{2} is small, then we can output the empirical conditional probabilities. In Section B.4, we will show that if ∥M∥2\|M\|_{2} is large, then we can use the top eigenvector of MM to remove bad samples.

Given a large enough set SS of good samples drawn from the ground-truth Bayesian network PP, Lemma 24 states that, for X∈uSX\in_{u}S, the mean, covariance, and tail bounds of F(X,p)F(X,p) behave like we would expect them to. We call a set of samples that satisfies these properties ϵ\epsilon-good for PP.

Let SS be a set of Ω((mlog⁡(m/ϵ)+log⁡(1/τ))⋅log⁡2d⋅ϵ−2)\Omega((m\log(m/\epsilon)+\log(1/\tau))\cdot\log^{2}d\cdot\epsilon^{-2}) samples from PP. Let pp and p~{\widetilde{p}} denote the conditional probability tables of PP and of the empirical distribution given by SS respectively. Then, with probability at least 1−τ1-\tau, we have the following:

∣Pr⁡S[Πk]−Pr⁡P[Πk]∣≤ϵ|\Pr_{S}[\Pi_{k}]-\Pr_{P}[\Pi_{k}]|\leq\epsilon,

∑kPr⁡S[Πk](p~k−pk)2≤ϵ2\sum_{k}\Pr_{S}[\Pi_{k}]({\widetilde{p}}_{k}-p_{k})^{2}\leq\epsilon^{2},

For all unit vectors vv and T>0T>0, we have

For (i), by the Chernoff and union bounds, with probability at least 1−τ/101-\tau/10, we have that our empirical estimates for Pr⁡P[Πk]\Pr_{P}[\Pi_{k}] are correct to within ϵ\epsilon as long as we have at least O(log⁡(m/τ)/ϵ2)O(\log(m/\tau)/\epsilon^{2}) samples.

Note that for a fixed k=(i,a)k=(i,a), we have p~k{\widetilde{p}}_{k} is the empirical expectation of Pr⁡S[Πk]N\Pr_{S}[\Pi_{k}]N independent samples from a Bernoulli with probability pkp_{k}. By Chernoff bounds, when N≥Ω(mlog⁡(m/τ)/ϵ2)N\geq\Omega(m\log(m/\tau)/\epsilon^{2}), we have ∣p~k−pk∣≤ϵ/mPr⁡S[Πk]|{\widetilde{p}}_{k}-p_{k}|\leq\epsilon/\sqrt{m\Pr_{S}[\Pi_{k}]} with probability at least 1−τ/10m1-\tau/10m, . By a union bound, this holds for all kk except with probability at most 1/10τ1/10\tau. Then we have ∑kPr⁡S[Πk](p~k−pk)2≤ϵ2\sum_{k}\Pr_{S}[\Pi_{k}]({\widetilde{p}}_{k}-p_{k})^{2}\leq\epsilon^{2}.

For (iii) and (iv), we first prove this happens for a fixed vv and TT with sufficiently high probability and then take a union bound over a cover of vv and TT.

Let SS be a set of NN samples from PP. Let X∈uSX\in_{u}S and Y∼PY\sim P. For any unit vector vv and T≥0T\geq 0, we have that

Pr⁡[∣v⋅(F(X,p)−p)∣≥T]≤5exp⁡(−T2/2)/2+ϵ/(2T2)\Pr[|v\cdot(F(X,p)-p)|\geq T]\leq 5\exp(-T^{2}/2)/2+\epsilon/(2T^{2}),

with probability at least 1−exp⁡(−Ω(Nϵ2))1-\exp(-\Omega(N\epsilon^{2})).

By Lemma 8, we have Pr⁡[∣v⋅(F(Y,p)−p)∣≥T]≤2exp⁡(−T2/2)\Pr[|v\cdot(F(Y,p)-p)|\geq T]\leq 2\exp(-T^{2}/2). Hence,

is the sum of NN i.i.d. Bernoulli random variables, each with mean at most 2exp⁡(−T2/2)2\exp(-T^{2}/2). We use the following two versions of the Chernoff bound:

Let Z1,…,ZNZ_{1},\ldots,Z_{N} be i.i.d. Bernoullis with mean μ\mu. Then

Pr⁡[∑iZi/N≥(1+δ)μ]≤exp⁡(−δln⁡(1+δ)Nμ/2)\Pr[\sum_{i}Z_{i}/N\geq(1+\delta)\mu]\leq\exp(-\delta\ln(1+\delta)N\mu/2) for δ>0\delta>0.

Pr⁡[∑iZi/N≥ν]≤exp⁡(−D(ν∣∣μ)N)\Pr[\sum_{i}Z_{i}/N\geq\nu]\leq\exp(-D(\nu||\mu)N) for ν≥μ\nu\geq\mu, where D(ν∣∣μ)=νln⁡(ν/μ)+(1−ν)ln⁡((1−ν)/(1−μ))D(\nu||\mu)=\nu\ln(\nu/\mu)+(1-\nu)\ln((1-\nu)/(1-\mu)) is the KL-divergence between Bernoullis with probabilities ν\nu and μ\mu .

Here ZiZ_{i} is a Bernoulli random variable where Zi=1Z_{i}=1 if and only if for the ii-th sample in SS we have (v⋅(f(Xi,p)−p)≥T)(v\cdot(f(X_{i},p)-p)\geq T). Let ν1=ν1(T)=5exp⁡(−T2/2)/2\nu_{1}=\nu_{1}(T)=5\exp(-T^{2}/2)/2, ν2=ν2(T)=ϵ/(2T2)\nu_{2}=\nu_{2}(T)=\epsilon/(2T^{2}), and ν=ν(T)=ν1(T)+ν2(T)\nu=\nu(T)=\nu_{1}(T)+\nu_{2}(T). We want to prove that

happens with probability at most exp⁡(−Ω(Nϵ2))\exp(-\Omega(N\epsilon^{2})) for any T>0T>0.

We have μ=Pr⁡Y∼P[∣v⋅(f(Y,p)−p)∣≥T]≤2exp⁡(−T2/2)\mu=\Pr_{Y\sim P}[|v\cdot(f(Y,p)-p)|\geq T]\leq 2\exp(-T^{2}/2). Let T′=Θ(log⁡(1/ϵ))T^{\prime}=\Theta(\sqrt{\log(1/\epsilon)}) be such that 2μ(T′)=4exp⁡(−T′2/2)=ϵ2/(4T′4)=ν2(T′)22\mu(T^{\prime})=4\exp(-T^{\prime 2}/2)=\epsilon^{2}/(4T^{\prime 4})=\nu_{2}(T^{\prime})^{2}. For T≤T′T\leq T^{\prime}, we use bound (i), and for T≥T′T\geq T^{\prime}, we use bound (ii).

Since ν≥ν1≥5μ/4\nu\geq\nu_{1}\geq 5\mu/4, by (i), ∑iZi/N≥ν\sum_{i}Z_{i}/N\geq\nu with probability at most exp⁡(−Nln⁡(5/4)(ν−μ)/8)≤exp⁡(−Nν/180)\exp(-N\ln(5/4)(\nu-\mu)/8)\leq\exp(-N\nu/180). When T≤T′T\leq T^{\prime}, ν≥ν2=ϵ/(2T2)=Ω(ϵ/log⁡(1/ϵ))\nu\geq\nu_{2}=\epsilon/(2T^{2})=\Omega(\epsilon/\log(1/\epsilon)), and so ∑iZi/N≥ν1(T)\sum_{i}Z_{i}/N\geq\nu_{1}(T) with probability at most exp⁡(−Ω(Nϵ/log⁡(1/ϵ)))\exp(-\Omega(N\epsilon/\log(1/\epsilon))).

When T≥T′T\geq T^{\prime}, we have 2μ(T)≤ν2(T)22\mu(T)\leq\nu_{2}(T)^{2} and so ln⁡(ν2/μ)≥ln⁡(2/μ)/2≥T2/4\ln(\nu_{2}/\mu)\geq\ln(2/\mu)/2\geq T^{2}/4. Thus, we have

Using bound (ii), we get that Pr⁡[∣v⋅(f(X,p)−p)∣≥T]≥ν(T)\Pr[|v\cdot(f(X,p)-p)|\geq T]\geq\nu(T) with probability at most exp⁡(−Ω(Nϵ))\exp(-\Omega(N\epsilon)).

In either case, we can take a union bound with the probability that the variance was far above and get that both requirements hold with probability at least 1−exp⁡(−Ω(Nϵ2))1-\exp(-\Omega(N\epsilon^{2})). ∎

For (iii), we will use Claim 25 (ii) with ϵ′=ϵ/ln⁡(d)\epsilon^{\prime}=\epsilon/\ln(d). That is, when N≥Ω((mlog⁡(d/ϵ)+log⁡(1/τ))/ϵ′2)=Ω((mlog⁡(d/ϵ)+log⁡(1/τ))⋅log⁡2d⋅ϵ−2)N\geq\Omega((m\log(d/\epsilon)+\log(1/\tau))/\epsilon^{\prime 2})=\Omega((m\log(d/\epsilon)+\log(1/\tau))\cdot\log^{2}d\cdot\epsilon^{-2}), for every v′∈Cv^{\prime}\in\mathcal{C}, T′∈TT^{\prime}\in\mathcal{T}, we have

assuming (i) and (ii). This completes the proof of (v).

By a union bound, (i)-(v) all hold simultaneously with probability at least 1−τ1-\tau. ∎

B.2 Omitted Proofs from Section 3.2: Setup and Structural Lemmas

In this section, we prove some structural lemmas that we will need to prove Proposition 9.

First, we note that since the probabilities of the parental configurations are probabilities, the noise will not move them much. Abusing notation, we use α\alpha for the empirical minimum parental configuration.

For all kk, ∣Pr⁡S′[Πk]−Pr⁡S[Πk]∣≤2ϵ|\Pr_{S^{\prime}}[\Pi_{k}]-\Pr_{S}[\Pi_{k}]|\leq 2\epsilon and α≥(C′−3)ϵ≥ϵ\alpha\geq(C^{\prime}-3)\epsilon\geq\epsilon.

Proposition 9 requires that ∣E∣+∣L∣≤2ϵ∣S′∣|E|+|L|\leq 2\epsilon|S^{\prime}|. We have

Since SS is ϵ\epsilon-good, by Lemma 24 (i), ∣Pr⁡P[Πk]−Pr⁡S[Πk]∣≤ϵ|\Pr_{P}[\Pi_{k}]-\Pr_{S}[\Pi_{k}]|\leq\epsilon. Since we assume that min⁡kPr⁡P[Πk]≥4ϵ\min_{k}\Pr_{P}[\Pi_{k}]\geq 4\epsilon, α=min⁡kPr⁡S′[Πk]≥ϵ\alpha=\min_{k}\Pr_{S^{\prime}}[\Pi_{k}]\geq\epsilon. ∎

Our next step is to analyze the spectrum of MM, and in particular show that MM is close in spectral norm to wEMEw_{E}M_{E}. To do this, we begin by showing that the spectral norm of MS,0M_{S,0} is relatively small. Since SS is good, we have bounds on the second moments F(X,p)F(X,p). We just need to deal with the error from replacing pp with qq.

Lemma 10. ∥MS,0∥2≤O(ϵ+∑kPr⁡S[Πk](pk−qk)2+∑kPr⁡S[Πk](pk−qk)2)\|M_{S,0}\|_{2}\leq O(\epsilon+\sqrt{\sum_{k}\Pr_{S}[\Pi_{k}](p_{k}-q_{k})^{2}}+\sum_{k}\Pr_{S}[\Pi_{k}](p_{k}-q_{k})^{2}).

Let ASA_{S} denote the second-moment matrix of (F(X,p)−p)(F(X,p)-p) under SS.

First we will show that MSM_{S} is close to ASA_{S}, and then we will show that their diagonals are close which implies that MS,0M_{S,0} is close to AS,0A_{S,0}.

Now if ∣vT(MS−AS)v∣≤4+O(ϵ)|v^{T}(M_{S}-A_{S})v|\leq 4+O(\epsilon), then ∣vT(MS−AS)v∣≤(4+O(ϵ))∥B∥2|v^{T}(M_{S}-A_{S})v|\leq(4+O(\epsilon))\sqrt{\|B\|_{2}} and if ∣∣vT(MS−AS)v∣∣≥4+O(ϵ)||v^{T}(M_{S}-A_{S})v||\geq 4+O(\epsilon), then ∣vT(MS−AS)v∣≤2∣vT(MS−AS)v∣∥B∥2|v^{T}(M_{S}-A_{S})v|\leq 2\sqrt{|v^{T}(M_{S}-A_{S})v|}\sqrt{\|B\|_{2}} and so ∣vT(MS−AS)v∣≤4∥B∥2|v^{T}(M_{S}-A_{S})v|\leq 4\|B\|_{2}. Either way, we have ∣vT(MS−AS)v∣≤O(max⁡{∥B∥2,∥B∥2})|v^{T}(M_{S}-A_{S})v|\leq O(\max\{\sqrt{\|B\|_{2}},\|B\|_{2}\}). This holds for all vv and so

Now we can bound the spectral norm of BB in terms of its Frobenius norm:

Combining this with the bound on ∥MS−AS∥2\|M_{S}-A_{S}\|_{2} above, we obtain

For the diagonal entries of MSM_{S} and ASA_{S}, we have

Finally, we can put all this together, obtaining

Lemma 11. wL∥ML∥2≤O(ϵlog⁡(1/ϵ)+ϵ∥p−q∥22)w_{L}\|M_{L}\|_{2}\leq O(\epsilon\log(1/\epsilon)+\epsilon\|p-q\|_{2}^{2}).

Since L⊂SL\subset S, for any event AA, we have that ∣L∣Pr⁡L[A]≤∣S∣Pr⁡S[A]|L|\Pr_{L}[A]\leq|S|\Pr_{S}[A]. Note that for any xx, since ((F(x,q)−q)−(F(x,p)−p))i((F(x,q)-q)-(F(x,p)-p))_{i} is either or pi−qip_{i}-q_{i} for any ii, thus ∥(F(X,q)−q)−(F(X,p)−p)∥2≤∥p−q∥2\|(F(X,q)-q)-(F(X,p)-p)\|_{2}\leq\|p-q\|_{2}. Since SS is ϵ\epsilon-good for PP, by Lemma 24 (iii), we have

Also not that Pr⁡X∈uL[∣v⋅(F(X,q)−q)∣>d]=0\Pr_{X\in_{u}L}[|v\cdot(F(X,q)-q)|>\sqrt{d}]=0 since ∥F(X,q)−q∥2≤d\|F(X,q)-q\|_{2}\leq\sqrt{d}. By definition, ∥ML∥2\|M_{L}\|_{2} is the maximum over unit vectors vv of vTMLvv^{T}M_{L}v. For any unit vector vv, we have We write f(x)≪g(x)f(x)\ll g(x) for f(x)=O(g(x)).f(x)=O(g(x)).

The last inequality uses ∣L∣≤2ϵ∣S′∣|L|\leq 2\epsilon|S^{\prime}| and ∣S∣≤(1+2ϵ)∣S′∣|S|\leq(1+2\epsilon)|S^{\prime}|. ∎

Finally, combining the above results, since MSM_{S} and MLM_{L} have small contribution to the spectral norm of MM when ∥p−q∥2\|p-q\|_{2} is small, most of it must come from MEM_{E}.

Lemma 12. ∥M−wEME∥2≤O(ϵlog⁡(1/ϵ)+∑kPr⁡S′[Πk](pk−qk)2+∑kPr⁡S′[Πk](pk−qk)2)\|M-w_{E}M_{E}\|_{2}\leq O(\epsilon\log(1/\epsilon)+\sqrt{\sum_{k}\Pr_{S^{\prime}}[\Pi_{k}](p_{k}-q_{k})^{2}}+\sum_{k}\Pr_{S^{\prime}}[\Pi_{k}](p_{k}-q_{k})^{2}).

Note that ∣S′∣M=∣S∣MS,0+∣E∣ME,0−∣L∣ML,0|S^{\prime}|M=|S|M_{S,0}+|E|M_{E,0}-|L|M_{L,0}.

Note that each entry of any of these matrices has absolute value at most one since ∣F(x,q)−q∣k≤1|F(x,q)-q|_{k}\leq 1 for all x∈{0,1}dx\in\{0,1\}^{d} and k∈[m]k\in[m]. Thus we have

By the triangle inequality, Lemmas 10 and 11, and the assumption that ∣E∣+∣L∣≤2ϵ∣S′∣|E|+|L|\leq 2\epsilon|S^{\prime}|,

Using Lemma 27, we obtain that ϵ∥p−q∥22≤∑kPr⁡S′[Πk](pk−qk)2\epsilon\|p-q\|_{2}^{2}\leq\sum_{k}\Pr_{S^{\prime}}[\Pi_{k}](p_{k}-q_{k})^{2} and ∑kPr⁡S[Πk](pk−qk)2≤∑k(Pr⁡S′[Πk]+2ϵ)(pk−qk)2=O(∑kPr⁡S′[Πk](pk−qk)2)\sum_{k}\Pr_{S}[\Pi_{k}](p_{k}-q_{k})^{2}\leq\sum_{k}(\Pr_{S^{\prime}}[\Pi_{k}]+2\epsilon)(p_{k}-q_{k})^{2}=O(\sum_{k}\Pr_{S^{\prime}}[\Pi_{k}](p_{k}-q_{k})^{2}). ∎

B.3 Omitted Proofs from Section 3.2: The Case of Small Spectral Norm

In this section, we will prove that if ∥M∥2=O(ϵlog⁡(1/ϵ)/α)\|M\|_{2}=O(\epsilon\log(1/\epsilon)/\alpha), then we can output the empirical conditional means qq.

Since both terms are positive semidefinite, we have

Applying this with y=qy=q and Y=F(X,q)Y=F(X,q) for X∈uLX\in_{u}L (or X∈uEX\in_{u}E) completes the proof. ∎

When Πk\Pi_{k} does not occur, F(X,q)k=qkF(X,q)_{k}=q_{k}. Thus, we can write:

By Lemma 27, ∣Pr⁡S′[Πk]−Pr⁡S[Πk]∣≤2ϵ|\Pr_{S^{\prime}}[\Pi_{k}]-\Pr_{S}[\Pi_{k}]|\leq 2\epsilon, so we have ∣Pr⁡S′[Πk](pk−qk)−Pr⁡S[Πk](pk−qk)∣≤2ϵ∣pk−qk∣|\Pr_{S^{\prime}}[\Pi_{k}](p_{k}-q_{k})-\Pr_{S}[\Pi_{k}](p_{k}-q_{k})|\leq 2\epsilon|p_{k}-q_{k}|, i.e., ∣zk−zk′∣≤2ϵ∣pk−qk∣|z_{k}-z^{\prime}_{k}|\leq 2\epsilon|p_{k}-q_{k}|, and thus ∥z−z′∥2≤2ϵ∥p−q∥2\|z-z^{\prime}\|_{2}\leq 2\epsilon\|p-q\|_{2}. ∎

Lemma 15. ∑kPr⁡S′[Πk]2(pk−qk)2≤2ϵ∥M∥2+O(ϵlog⁡(1/ϵ)+1/α)\sqrt{\sum_{k}\Pr_{S^{\prime}}[\Pi_{k}]^{2}(p_{k}-q_{k})^{2}}\leq 2\sqrt{\epsilon\|M\|_{2}}+O(\epsilon\sqrt{\log(1/\epsilon)+1/\alpha}).

Note that μS′=q\mu^{S^{\prime}}=q. By Lemma 14, ∥(μS−q)−(D2(p−q))∥2≤O(ϵ(1+∥p−q∥2))\|(\mu^{S}-q)-(D^{2}(p-q))\|_{2}\leq O(\epsilon(1+\|p-q\|_{2})). Recall that wL=∣L∣/∣S′∣w_{L}=|L|/|S^{\prime}| and wE=∣E∣/∣S′∣w_{E}=|E|/|S^{\prime}|. By the triangle inequality,

where we used the assumption that α/ϵ\alpha/\epsilon is at least a sufficiently large constant and that ∥D−1∥2=1/α\|D^{-1}\|_{2}=1/\sqrt{\alpha}. When this last term is smaller than ∥D2(p−q)∥2/8\|D^{2}(p-q)\|_{2}/8, rearranging the inequality gives that

Otherwise, we have ∥D2(p−q)∥2=O(ϵ∥D2(p−q)∥2/α)\|D^{2}(p-q)\|_{2}=O\left(\sqrt{\epsilon\|D^{2}(p-q)\|_{2}/\sqrt{\alpha}}\right), and so ∥D2(p−q)∥2=O(ϵ/α)\|D^{2}(p-q)\|_{2}=O(\epsilon/\sqrt{\alpha}). In either case, we obtain

Corollary 16 (Part (i) of Proposition 9). If ∥M∥2≤O(ϵlog⁡(1/ϵ)/α)\|M\|_{2}\leq O(\epsilon\log(1/\epsilon)/\alpha), then

Recall that α=min⁡k∣Pr⁡S′[Πk]\alpha=\min_{k}|\Pr_{S^{\prime}}[\Pi_{k}]. By Lemma 27, ∣Pr⁡S′[Πk]−Pr⁡S[Πk]∣≤2ϵ|\Pr_{S^{\prime}}[\Pi_{k}]-\Pr_{S}[\Pi_{k}]|\leq 2\epsilon for any kk. Since SS is ϵ\epsilon-good, ∣Pr⁡P[Πk]−Pr⁡S[Πk]∣≤ϵ|\Pr_{P}[\Pi_{k}]-\Pr_{S}[\Pi_{k}]|\leq\epsilon. Combining these, we obtain ∣α−min⁡kPr⁡P[Πk]∣≤3ϵ|\alpha-\min_{k}\Pr_{P}[\Pi_{k}]|\leq 3\epsilon. By assumption min⁡kPr⁡P[Πk]≥4ϵ\min_{k}\Pr_{P}[\Pi_{k}]\geq 4\epsilon , so we have α=Θ(min⁡kPr⁡P[Πk])\alpha=\Theta(\min_{k}\Pr_{P}[\Pi_{k}]).

B.4 Omitted Proofs from Section 3.2: The Case of Large Spectral Norm

Now we consider the case when ∥M∥2≥Cϵln⁡(1/ϵ)/α\|M\|_{2}\geq C\epsilon\ln(1/\epsilon)/\alpha for some sufficiently large constant C>0C>0. We begin by showing that pp and qq are not too far apart from each other. The bound given by Lemma 15 is now dominated by the ∥M∥2\|M\|_{2} term. Lower bounding the Pr⁡S′[Πk]\Pr_{S^{\prime}}[\Pi_{k}] by α\alpha gives the following claim.

Claim 17. ∥p−q∥2≤δ:=3ϵ∥M∥2/α\|p-q\|_{2}\leq\delta:=3\sqrt{\epsilon\|M\|_{2}}/\alpha.

For sufficiently large CC, this last term is smaller than ϵCln⁡(1/ϵ)/α≤12ϵ∥M∥2\epsilon\sqrt{C\ln(1/\epsilon)/\alpha}\leq\frac{1}{2}\sqrt{\epsilon\|M\|_{2}}. Then we have ∑kPr⁡S′[Πk]2(pk−qk)2≤(5/2)ϵ∥M∥2\sqrt{\sum_{k}\Pr_{S^{\prime}}[\Pi_{k}]^{2}(p_{k}-q_{k})^{2}}\leq(5/2)\sqrt{\epsilon\|M\|_{2}}. Recall that α=min⁡kPr⁡S′[Πk]\alpha=\min_{k}\Pr_{S^{\prime}}[\Pi_{k}], so

Recall that v∗v^{*} is the largest eigenvector of MM. We project all the points F(X,q)F(X,q) onto the direction of v∗v^{*}. Next we show that most of the variance of (v∗⋅(F(X,q)−q))(v^{*}\cdot(F(X,q)-q)) comes from EE.

Claim 18. v∗T(wEME)v∗≥12v∗TMv∗v^{\ast T}(w_{E}M_{E})v^{\ast}\geq\frac{1}{2}v^{\ast T}Mv^{\ast}.

By assumption min⁡kPr⁡P[Πk]≥C′ϵ\min_{k}\Pr_{P}[\Pi_{k}]\geq C^{\prime}\epsilon for sufficiently large C′C^{\prime}, so we can assume ϵ/α≤1/6\epsilon/\alpha\leq 1/6. For large enough CC, ∥M∥2≥Cϵln⁡(1/ϵ)/α≥36ϵ/α\|M\|_{2}\geq C\epsilon\ln(1/\epsilon)/\alpha\geq 36\epsilon/\alpha, and hence the third term ϵ∥M∥2/α≤∥M∥2/6\sqrt{\epsilon\|M\|_{2}/\alpha}\leq\|M\|_{2}/6. Again for large enough CC, the first term is upper bounded by ∥M∥2/6\|M\|_{2}/6. Thus, we obtain 2∥M−wEME∥2≤∥M∥2=v∗TMv∗2\|M-w_{E}M_{E}\|_{2}\leq\|M\|_{2}=v^{\ast T}Mv^{\ast} as required. ∎

Claim 18 implies that the tails of EE are reasonably thick. In particular, the next lemma shows that is guaranteed to find some valid threshold T>0T>0 satisfying the desired property in Step 11 of Algorithm 1, otherwise by integrating the tail bound, we can show that v∗TMEv∗v^{\ast T}M_{E}v^{\ast} would be small.

Lemma 19. There exists a T≥0T\geq 0 such that

Pr⁡X∈uS′[∣v⋅(F(X,q)−q)∣>T+δ]>7exp⁡(−T2/2)+3ϵ/(T2ln⁡d).\qquad\Pr_{X\in_{u}S^{\prime}}[|v\cdot(F(X,q)-q)|>T+\delta]>7\exp(-T^{2}/2)+3\epsilon/(T^{2}\ln d).

Suppose for the sake of contradiction that this does not hold. Since E⊂S′E\subset S^{\prime}, for all events AA, it holds that ∣E∣⋅Pr⁡E[A]≤∣S′∣⋅Pr⁡S′[A]|E|\cdot\Pr_{E}[A]\leq|S^{\prime}|\cdot\Pr_{S^{\prime}}[A]. Thus, we have

Note that for any x∈{0,1}dx\in\{0,1\}^{d}, we have that

since F(x,q)F(x,q) and qq differ on at most dd coordinates. We have the following sequence of inequalities:

For sufficiently large C′C^{\prime} and CC, this gives the desired contradiction. ∎

Finally, we show that the set of samples S′′S^{\prime\prime} we return after the filter is better than S′S^{\prime} in terms of ∣L∣+∣E∣|L|+|E|. This completes the proof of the second case of Proposition 9.

Claim 20. (Part (ii) of Proposition 9). If we write S′′=S∪E′∖L′S^{\prime\prime}=S\cup E^{\prime}\setminus L^{\prime}, then ∣E′∣+∣L′∣<∣E∣+∣L∣|E^{\prime}|+|L^{\prime}|<|E|+|L| and ∣S′′∣≤(1−ϵdln⁡d)∣S′∣|S^{\prime\prime}|\leq(1-\frac{\epsilon}{d\ln d})|S^{\prime}|.

Note that (F(x,q)−q)(F(x,q)-q) is dd-sparse and has ∥F(x,q)−q∥∞≤1\|F(x,q)-q\|_{\infty}\leq 1, so we have ∣v⋅(F(x,q)−q)∣≤∥F(x,q)−q∥2≤d|v\cdot(F(x,q)-q)|\leq\|F(x,q)-q\|_{2}\leq\sqrt{d}. By Lemma 19, when ∥M∥2≥Cϵln⁡(1/ϵ)/α\|M\|_{2}\geq C\epsilon\ln(1/\epsilon)/\alpha for some sufficiently large constant C>0C>0, Step 11 of Algorithm 1 is guaranteed to find a threshold 0<T≤d0<T\leq\sqrt{d} such that

In particular, we can show that the number of remaining samples reduces by a factor of (1−ϵ/(dln⁡d))(1-\epsilon/(d\ln d)):

Since SS is ϵ\epsilon-good, by Lemma 24 (iii),

Using Claim 17, we have that for all x∈{0,1}dx\in\{0,1\}^{d}, ∥(F(x,q)−q)−(F(x,p)−p)∥2≤∥p−q∥2≤δ\|(F(x,q)-q)-(F(x,p)-p)\|_{2}\leq\|p-q\|_{2}\leq\delta. Therefore,

Since all the filtered samples L′∖LL^{\prime}\setminus L are in SS, we have

Thus ∣S′∣−∣S′′∣≥73(1−2ϵ)(∣L′∣−∣L∣)|S^{\prime}|-|S^{\prime\prime}|\geq\frac{7}{3}(1-2\epsilon)(|L^{\prime}|-|L|). Since ∣S′∣−∣S′′∣=∣E∣−∣L∣−∣E′∣+∣L′∣|S^{\prime}|-|S^{\prime\prime}|=|E|-|L|-|E^{\prime}|+|L^{\prime}|,

Because S′′⊂S′S^{\prime\prime}\subset S^{\prime}, we conclude that ∣E′∣+∣L′∣<∣E∣+∣L∣|E^{\prime}|+|L^{\prime}|<|E|+|L|. ∎

Appendix C Omitted Details from Section 4

In this section, we give a detailed description of the graph structures and noise distributions we used in our experimental evaluation.

In our experiments, when there is randomness in the dependency graphs of the ground-truth or in the noisy Bayesian networks, we repeat the experiment ten times and report the average error.

In the first experiment, the ground-truth Bayesian network PP is generated as follows: We first generate a random dependence tree for PP. We label the dd nodes {1,…,d}\{1,\ldots,d\}. Node 11 has no parents, and every node i>1i>1 has one parent drawn uniformly from {1,…,i−1}\{1,\ldots,i-1\}. The size of the conditional probability table of PP is 2d−12d-1 (one parameter for the first node and two parameters for all other nodes). We then draw these (2d−1)(2d-1) conditional probabilities independently and uniformly from [0,14]∪[34,1][0,\frac{1}{4}]\cup[\frac{3}{4},1].

The noise distribution is a binary product distribution with mean drawn independently and uniformly from $$ for each coordinate.

Synthetic Experiments with General Bayesian Networks.

In the second experiment, we generate the ground-truth network PP as follows: We start with an empty dependency graph with d=50d=50 nodes. We label the dd nodes {1,…,d}\{1,\ldots,d\} and require that parent nodes must have smaller index. We continue to try to increase the in-degree of a random node until the number of parameters m=∑i=1d2∣Parent(i)∣m=\sum_{i=1}^{d}2^{|\text{Parent}(i)|} exceeds the target m∈m\in. Then for each ii, we draw the ∣Parents(i)∣|\text{Parents(i)}| nodes uniformly from the set {1,…,i−1}\{1,\ldots,i-1\} to be the parents of variable ii.

The noise distribution is a tree-structured Bayes net generated in the same way as we generate the ground-truth network in the first experiment. The conditional probabilities of both PP and the noise distribution are drawn independently and uniformly from [0,14]∪[34,1][0,\frac{1}{4}]\cup[\frac{3}{4},1].

Semi-Synthetic Experiments with ALARM.

In the third experiment, the ground-truth network is a binary-valued Bayes net which is equivalent to the ALARM network. See Section C.3 for a detailed description of the conversion process. Specifically, it has d=61d=61 nodes and m=820m=820 parameters.

The noise distribution is a Bayes net generated using the same process as we create the ground-truth Bayes net in the second experiment. We start with an empty graph with d=61d=61 nodes and add edges until the number of parameters is roughly m=820m=820. The conditional probabilities of the noise distribution are again drawn from [0,14]∪[34,1][0,\frac{1}{4}]\cup[\frac{3}{4},1].

C.2 Estimating the Total Variation Distances between Two Bayesian Networks

C.3 Reduction to Binary-Valued Bayesian Networks

The results in this paper can be easily extended to multi-valued Bayesian networks. We can represent a dd-dimensional degree-ff Bayesian network over alphabet Σ\Sigma by an equivalent binary (i.e., alphabet of size 22) Bayesian network of dimension d⌈log⁡2(∣Σ∣)⌉d\lceil\log_{2}(|\Sigma|)\rceil and degree (f+1)⌈log⁡2(∣Σ∣)⌉(f+1)\lceil\log_{2}(|\Sigma|)\rceil. Such a reduction can be found in [CDKS17] and we give a high-level description here. Without loss of generality we can assume ∣Σ∣=2b|\Sigma|=2^{b}. We will split each variable into bb bits, with each of the 2b2^{b} possibilities denoting a single letter in Σ\Sigma. Each new bit will potentially depend on other bits of the same variable, as well as bits of the parent variables. This operation preserves balancedness when ∣Σ∣=2b|\Sigma|=2^{b}, and if ∣Σ∣|\Sigma| is not a power of 22 we need to first carefully pad the alphabet by splitting some letters in Σ\Sigma into two letters.

Our experiments for the ALARM network use this reduction. ALARM has an alphabet of size 44. The original dependency graph of ALARM has 3737 nodes, maximum in-degree 44, and 509509 parameters; and after the transformation, we get a binary-valued the network with 6161 nodes, maximum in-degree 77, and 820820 parameters.