$$
\begin{array}{l} \mathcal {L} _ {2} = \int q \left(\theta_ {\mathrm {d y n}}, \theta_ {\mathrm {d e c}}, \boldsymbol {s} _ {1: B}\right) \ln \frac {q \left(\boldsymbol {s} _ {1 : B}\right)}{p \left(\boldsymbol {s} _ {1 : B} \mid \theta_ {\mathrm {d y n}}\right)} d \theta_ {\mathrm {d y n}} d \theta_ {\mathrm {d e c}} d \boldsymbol {s} _ {1: B} (49) \\ = \int q \left(\theta_ {\mathrm {d y n}}, \theta_ {\mathrm {d e c}}, s _ {1: B}\right) \ln \left[ \frac {q \left(s _ {1}\right)}{p \left(s _ {1}\right)} \prod_ {b = 2} ^ {B} \frac {q \left(s _ {b}\right)}{p \left(s _ {b} \mid s _ {b - 1} , \theta_ {\mathrm {d y n}}\right)} \right] d \theta_ {\mathrm {d y n}} d \theta_ {\mathrm {d e c}} d s _ {1: B} (50) \\ = \int q \left(\theta_ {\mathrm {d y n}}, \theta_ {\mathrm {d e c}}, \boldsymbol {s} _ {1: B}\right) \ln \left[ \prod_ {j = 1} ^ {N} \frac {q \left(\boldsymbol {s} _ {1} ^ {j}\right)}{p \left(\boldsymbol {s} _ {1} ^ {j}\right)} \right] d \theta_ {\mathrm {d y n}} d \theta_ {\mathrm {d e c}} d \boldsymbol {s} _ {1: B} (51) \\ + \int q \left(\theta_ {\mathrm {d y n}}, \theta_ {\mathrm {d e c}}, s _ {1: B}\right) \ln \left[ \prod_ {b = 2} ^ {B} \prod_ {j = 1} ^ {N} \frac {q \left(s _ {b} ^ {j}\right)}{p \left(s _ {b} ^ {j} \mid s _ {b - 1} , \theta_ {\mathrm {d y n}}\right)} \right] d \theta_ {\mathrm {d y n}} d \theta_ {\mathrm {d e c}} d s _ {1: B} (52) \\ = \sum_ {j = 1} ^ {N} \int q \left(\theta_ {\mathrm {d y n}}, \theta_ {\mathrm {d e c}}, s _ {1: B}\right) \ln \left[ \frac {q \left(s _ {1} ^ {j}\right)}{p \left(s _ {1} ^ {j}\right)} \right] d \theta_ {\mathrm {d y n}} d \theta_ {\mathrm {d e c}} d s _ {1: B} (53) \\ + \sum_ {b = 2} ^ {B} \int q \left(\theta_ {\mathrm {d y n}}, \theta_ {\mathrm {d e c}}, \boldsymbol {s} _ {1: B}\right) \sum_ {j = 1} ^ {N} \ln \left[ \frac {q \left(\boldsymbol {s} _ {b} ^ {j}\right)}{p \left(\boldsymbol {s} _ {b} ^ {j} \mid \boldsymbol {s} _ {b - 1} , \theta_ {\mathrm {d y n}}\right)} \right] d \theta_ {\mathrm {d y n}} d \theta_ {\mathrm {d e c}} d \boldsymbol {s} _ {1: B} (54) \\ = \sum_ {j = 1} ^ {N} \int q \left(\boldsymbol {s} _ {1} ^ {j}\right) \ln \left[ \frac {q \left(\boldsymbol {s} _ {1} ^ {j}\right)}{p \left(\boldsymbol {s} _ {1} ^ {j}\right)} \right] d \boldsymbol {s} _ {1} ^ {j} (55) \\ + \sum_ {b = 2} ^ {B} \int q \left(\theta_ {\mathrm {d y n}}, \boldsymbol {s} _ {b - 1}, \boldsymbol {s} _ {b}\right) \sum_ {j = 1} ^ {N} \ln \left[ \frac {q \left(\boldsymbol {s} _ {b} ^ {j}\right)}{p \left(\boldsymbol {s} _ {b} ^ {j} \mid \boldsymbol {s} _ {b - 1} , \theta_ {\mathrm {d y n}}\right)} \right] d \theta_ {\mathrm {d y n}} d \boldsymbol {s} _ {b - 1} d \boldsymbol {s} _ {b} (56) \\ = \sum_ {j = 1} ^ {N} \int q \left(\boldsymbol {s} _ {1} ^ {j}\right) \ln \left[ \frac {q \left(\boldsymbol {s} _ {1} ^ {j}\right)}{p \left(\boldsymbol {s} _ {1} ^ {j}\right)} \right] d \boldsymbol {s} _ {1} ^ {j} (57) \\ + \sum_ {b = 2} ^ {B} \int q \left(\theta_ {\mathrm {d y n}}, \boldsymbol {s} _ {b - 1}\right) \sum_ {j = 1} ^ {N} \left[ \int q \left(\boldsymbol {s} _ {b} ^ {j}\right) \ln \frac {q \left(\boldsymbol {s} _ {b} ^ {j}\right)}{p \left(\boldsymbol {s} _ {b} ^ {j} \mid \boldsymbol {s} _ {b - 1} , \theta_ {\mathrm {d y n}}\right)} d \boldsymbol {s} _ {b} ^ {j} \right] d \theta_ {\mathrm {d y n}} d \boldsymbol {s} _ {b - 1} (58) \\ = \sum_ {j = 1} ^ {N} \operatorname {K L} \left(q \left(\boldsymbol {s} _ {1} ^ {j}\right) \| p \left(\boldsymbol {s} _ {1} ^ {j}\right)\right) + \sum_ {b = 2} ^ {B} \mathbb {E} _ {q \left(\theta_ {\mathrm {d y n}}, \boldsymbol {s} _ {b - 1}\right)} \left[ \sum_ {j = 1} ^ {N} \operatorname {K L} \left(q \left(\boldsymbol {s} _ {b} ^ {j}\right) \| p \left(\boldsymbol {s} _ {b} ^ {j} \mid \boldsymbol {s} _ {b - 1}, \theta_ {\mathrm {d y n}}\right)\right) \right], (59) \\ \end{array}
$$