## Appendix D Details on Meta-Learning for LSTD-Based Prediction  
Before deriving (52) and (53), for ease of representation, let us define inner loss function \(\mathcal{L}_{f}^{\rm inner}\), outer loss function \(\mathcal{L}_{f}^{\rm outer}\), and total loss function \(\mathcal{L}_{f}^{\rm total}\) as  
\[\mathcal{L}_{f}^{\rm inner}(\hat{b}_{f}^{k},v_{f}^{k}|\hat{b}^{k},\hat{v}^{k })=\left\|\frac{X_{f}^{\rm tr}(V_{f}^{(K)})^{k}}{(\hat{b}_{f}^{k})^{\dagger} \hat{b}_{f}^{k}}-(Y_{f}^{\rm tr})^{k}\right\|_{F}^{2}-\lambda_{1}\frac{(\hat{ b}_{f}^{k})^{\dagger}(\hat{b}^{k}(\hat{b}^{k})^{\dagger})\hat{b}_{f}^{k}}{( \hat{b}_{f}^{k})^{\dagger}\hat{b}_{f}^{k}}+\lambda_{2}||v_{f}^{k}-\hat{v}^{k}|| ^{2},\] (A6)  
\[\mathcal{L}_{f}^{\rm outer}(\hat{b}_{f}^{k},v_{f}^{k})=\left\| \frac{X_{f}^{\rm te}(V_{f}^{(K)})^{k}}{(\hat{b}_{f}^{k})^{\dagger}\hat{b}_{f} ^{k}}-(Y_{f}^{\rm te})^{k}\right\|_{F}^{2},\] (A7)  
and  
\[\mathcal{L}_{f}^{\rm total}(\hat{b}_{f}^{k},v_{f}^{k}|\hat{b}^{k},\hat{v}^{k },\alpha)=\mathcal{L}_{f}^{\rm inner}(\hat{b}_{f}^{k},v_{f}^{k}|\hat{b}^{k}, \hat{v}^{k})+\alpha\mathcal{L}_{f}^{\rm outer}(\hat{b}_{f}^{k},v_{f}^{k}),\] (A8)  
respectively. Because (A6) is scale-invariant to \((\hat{b}_{f}^{k})^{\dagger}\hat{b}_{f}^{k}\) (recall that \((V_{f}^{(K)})^{k}=v_{f}^{k}\otimes(\hat{b}_{f}^{k}(\hat{b}_{f}^{k})^{\dagger})\)), this can be considered as an unconstrained version of (38), i.e., \((\hat{b}_{f}^{k,*},v_{f}^{k,*})\) in (38) minimizes (A6). Analogously, (A8) can be considered as an unconstrained expression of (54) as \((\hat{b}_{f}^{k,\alpha},v_{f}^{k,\alpha})\) in (54) minimizes (A8).  
Assuming that the conditions of implicit function theorem [67] are satisfied with respect to \((\hat{b}_{f}^{k,\alpha},v_{f}^{k,\alpha})\), from the finite differentiation method [60], we can write the gradients for meta-learning as  
\[\
abla_{\hat{b}^{k}} \sum_{f=1}^{F}\left\|X_{f}^{\rm te}(V_{f}^{(K)})^{k,*}-(Y_{f}^{ \rm te})^{k}\right\|_{F}^{2}\] \[=\lim_{\alpha\to 0}\sum_{f=1}^{F}\frac{1}{\alpha}\Big{(}\frac{ \partial\mathcal{L}_{f}^{\rm total}}{\partial\bar{b}^{k}}(\hat{b}_{f}^{k,\alpha}, v_{f}^{k,\alpha}|\bar{b}^{k},\bar{v}^{k},\alpha)-\frac{\partial\mathcal{L}_{f}^{\rm total }}{\partial\bar{b}^{k}}(\hat{b}_{f}^{k,*},v_{f}^{k,*}|\bar{b}^{k},\bar{v}^{k},0 )\Big{)}\] \[=\lim_{\alpha\to 0}\frac{2\lambda_{1}}{\alpha}\sum_{f=1}^{F} \Big{(}\hat{b}_{f}^{k,*}(\hat{b}_{f}^{k,*})^{\dagger}-\hat{b}_{f}^{k,\alpha}( \hat{b}_{f}^{k,\alpha})^{\dagger}\Big{)}\bar{b}^{k}\] (A9)and  
\[\
abla_{\varphi^{k}} \sum_{f=1}^{F}\left\|X_{f}^{\text{te}}(V_{f}^{(K)})^{k,*}-(Y_{f}^{ \text{te}})^{k}\right\|_{F}^{2}\] \[=\lim_{a\to 0}\sum_{f=1}^{F}\frac{1}{a}\Big{(}\frac{\partial \mathcal{L}_{f}^{\text{total}}}{\partial\bar{v}^{k}}(\hat{b}_{f}^{k,a},v_{f}^{ k,a}|\bar{b}^{k},\bar{v}^{k},\bar{v}^{k},\bar{v}^{k},\bar{v}^{k},\bar{v}^{k}, \bar{v}^{k},0)\Big{)}\] \[=\lim_{a\to 0}\frac{2\lambda_{2}}{\alpha}\sum_{f=1}^{F}(v_{f}^{k,*} -v_{f}^{k,a}), \tag{10}\]  
which concludes the derivation of (52) and (53). A generalized proof along with useful characteristics of EP can be found in [60]. For initialization, the hyperparameter \(\bar{b}^{k}\) is set as the one-hot vector at position \(k\); while \(\bar{v}^{k}\) are chosen as all-zero vectors [52].