$$
\begin{array}{l} = \sum_ {j \in \mathbb {V} \backslash \{0 \}} \sum_ {\mathcal {P} _ {l \in j}} \int_ {\boldsymbol {z} _ {\leq j}, \boldsymbol {z} _ {> j}} q (\boldsymbol {z} _ {0} \mid \boldsymbol {x}) \prod_ {i \in \mathcal {P} _ {l} \backslash \{0 \}} q \left(c _ {p a (i) \rightarrow i} \mid \boldsymbol {x}\right) q \left(\boldsymbol {z} _ {i} \mid \boldsymbol {z} _ {p a (i)}\right) \log \left(\frac {q \left(\boldsymbol {z} _ {j} \mid \boldsymbol {z} _ {p a (j)}\right)}{p \left(\boldsymbol {z} _ {j} \mid \boldsymbol {z} _ {p a (j)}\right)}\right) (56) \\ = \sum_ {j \in \mathbb {V} \backslash \{0 \}} \int_ {\boldsymbol {z} _ {\leq j}} q \left(\boldsymbol {z} _ {0} \mid \boldsymbol {x}\right) \prod_ {i \in \mathcal {P} _ {\leq j} \backslash \{0 \}} q \left(c _ {p a (i) \rightarrow i} \mid \boldsymbol {x}\right) q \left(\boldsymbol {z} _ {i} \mid \boldsymbol {z} _ {p a (i)}\right) \log \left(\frac {q \left(\boldsymbol {z} _ {j} \mid \boldsymbol {z} _ {p a (j)}\right)}{p \left(\boldsymbol {z} _ {j} \mid \boldsymbol {z} _ {p a (j)}\right)}\right) (57) \\ \times \sum_ {\mathcal {P} _ {> j}} \int_ {\mathbf {z} _ {> j}} \left[ \prod_ {k \in \mathcal {P} _ {> j}} q \left(c _ {p a (k) \rightarrow k} \mid \mathbf {x}\right) q \left(\mathbf {z} _ {k} \mid \mathbf {z} _ {p a (k)}\right)\right] (57) \\ = \sum_ {j \in \mathbb {V} \backslash \{0 \}} \int_ {\boldsymbol {z} _ {<   j}} \int_ {\boldsymbol {z} _ {j}} q (\boldsymbol {z} _ {0} \mid \boldsymbol {x}) \prod_ {i \in \mathcal {P} _ {\leq j} \backslash \{0 \}} q \left(c _ {p a (i) \rightarrow i} \mid \boldsymbol {x}\right) q \left(\boldsymbol {z} _ {i} \mid \boldsymbol {z} _ {p a (i)}\right) \log \left(\frac {q \left(\boldsymbol {z} _ {j} \mid \boldsymbol {z} _ {p a (j)}\right)}{p \left(\boldsymbol {z} _ {j} \mid \boldsymbol {z} _ {p a (j)}\right)}\right) (58) \\ = \sum_ {j \in \mathbb {V} \backslash \{0 \}} \int_ {\boldsymbol {z} _ {<   j}} \int_ {\boldsymbol {z} _ {j}} P (p a (j); \boldsymbol {z}, \boldsymbol {c}) q \left(c _ {p a (j) \rightarrow j} \mid \boldsymbol {x}\right) q \left(\boldsymbol {z} _ {j} \mid \boldsymbol {z} _ {p a (j)}\right) \log \left(\frac {q \left(\boldsymbol {z} _ {j} \mid \boldsymbol {z} _ {p a (j)}\right)}{p \left(\boldsymbol {z} _ {j} \mid \boldsymbol {z} _ {p a (j)}\right)}\right) (59) \\ = \sum_ {j \in \mathbb {V} \backslash \{0 \}} \int_ {\boldsymbol {z} _ {<   j}} P (p a (j); \boldsymbol {z}, \boldsymbol {c}) q \left(c _ {p a (j) \rightarrow j} \mid \boldsymbol {x}\right) \int_ {\boldsymbol {z} _ {j}} q \left(\boldsymbol {z} _ {j} \mid \boldsymbol {z} _ {p a (j)}\right) \log \left(\frac {q \left(\boldsymbol {z} _ {j} \mid \boldsymbol {z} _ {p a (j)}\right)}{p \left(\boldsymbol {z} _ {j} \mid \boldsymbol {z} _ {p a (j)}\right)}\right) (60) \\ = \sum_ {j \in \mathbb {V} \backslash \{0 \}} \int_ {\boldsymbol {z} <   j} P (p a (j); \boldsymbol {z}, \boldsymbol {c}) q \left(c _ {p a (j) \rightarrow j} \mid \boldsymbol {x}\right) \operatorname {K L} \left(q \left(\boldsymbol {z} _ {j} \mid \boldsymbol {z} _ {p a (j)}\right) \mid p \left(\boldsymbol {z} _ {j} \mid \boldsymbol {z} _ {p a (j)}\right)\right) (61) \\ \approx \frac {1}{M} \sum_ {m = 1} ^ {M} \sum_ {i \in \mathbb {V} \backslash \{0 \}} P (p a (i); \boldsymbol {z} ^ {(m)}, c) q \left(c _ {p a (i) \rightarrow i} \mid \boldsymbol {x}\right) (62) \\ \times \operatorname {K L} \left(q \left(\boldsymbol {z} _ {i} ^ {(m)} \mid p a \left(\boldsymbol {z} _ {i} ^ {(m)}\right)\right) \| p \left(\boldsymbol {z} _ {i} ^ {(m)} \mid p a \left(\boldsymbol {z} _ {i} ^ {(m)}\right)\right)\right) \\ = \frac {1}{M} \sum_ {m = 1} ^ {M} \sum_ {i \in \mathbb {V} \backslash \{0 \}} P (i; \boldsymbol {z} ^ {(m)}, c) \operatorname {K L} \left(q \left(\boldsymbol {z} _ {i} ^ {(m)} \mid p a \left(\boldsymbol {z} _ {i} ^ {(m)}\right)\right) \| p \left(\boldsymbol {z} _ {i} ^ {(m)} \mid p a \left(\boldsymbol {z} _ {i} ^ {(m)}\right)\right)\right), (63) \\ \end{array}
$$