SlowGuess/NeurIPS_2023_OCR huggingface dataset:
In this paper, we proposed a novel Hierarchical Gaussian Mixture based Task Generative Model (HTGM). HTGM models the generative process of task instances, and performs maximum likelihood estimation to learn task embeddings, which can help adjust prototypes acquired by the feature extractor and thus achieve better performance. Moreover, by explicitly modeling the distribution of tasks in the embedding space, HTGM can effectively detect the tasks that are drawn from distributions unseen during meta training. The extensive experimental results indicate the advantage of HTGM on both few-shot classification and novel task detection.
6 Broader Impact and Limitation
Our proposed method enables better novel task detection for meta-learning. In many areas requiring robust decisions, such as healthcare (as described in Sec. 1) and auto-driving, where the accuracy drop and uncertainty on novel tasks is inevitable, our model can raise an alarm to users (e.g., doctors and human drivers) for diagnosis and decision-making. However, as a probabilistic machine learning model, HTGM does not guarantee  $100\%$  accuracy. Also, it is noteworthy that the entropy of  $\pi (\pmb{\mu}_{y_i}^c |\mathbf{v}_\tau ,\pmb {\omega})$  (in Eq. (2)) is proportional to the partition function (i.e. the denominator in Eq. (2)). Thus, our approximation in Sec. 3.3 that replaces the partition function with its upper bound increases the entropy, leading to increased noise in the inferred class prototypes. As such, in scenarios such as serious disease treatment and auto-driving in complex environments, to avoid potential wrong decisions from the model, human intervention is still necessary.
This work was primarily finished during the internship of Yizhou Zhang (the first author) at NEC Laboratories America. Yizhou Zhang's work after the internship was partially supported by NSF Research Grant IIS-2226087 and the Annenberg Fellowship of the University of Southern California. We sincerely appreciate the comments and suggestions from the anonymous reviewers.
[1] Alessandro Achille, Michael Lam, Rahul Tewari, Avinash Ravichandran, Subhransu Maji, Charless C Fowlkes, Stefano Soatto, and Pietro Perona. Task2vec: Task embedding for meta-learning. In ICCV, pages 6430-6439, 2019.
[2] Brandon Amos and J. Zico Kolter. OptNet: Differentiable optimization as a layer in neural networks. In ICML, volume 70, pages 136-145. PMLR, 2017.
[3] Thomas L Athey, Benjamin D Pedigo, Tingshan Liu, and Joshua T Vogelstein. Autogmm: Automatic and hierarchical gaussian mixture modeling in python. arXiv preprint arXiv:1909.02688, 2019.
[4] M. Christopher Bishop. Pattern recognition and machine learning. Springer, 2006.
[5] Isaac S Chan and Geoffrey S Ginsburg. Personalized medicine: progress and promise. Annual review of genomics and human genetics, 12:217-244, 2011.
[6] Jiacheng Cheng and Nuno Vasconcelos. Learning deep classifiers consistent with fine-grained novelty detection. In CVPR, pages 1664-1673, 2021.
[7] Lu Cheng, Ruocheng Guo, Kai Shu, and Huan Liu. Causal understanding of fake news dissemination on social media. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, pages 148-157, 2021.
[8] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In ICML, pages 1126–1135. PMLR, 2017.
[9] Jacob Goldberger and Sam T Roweis. Hierarchical clustering of a mixture model. In NeurIPS, pages 505-512, 2005.
[10] Mengdi Huai, Chenglin Miao, Qiuling Suo, Yaliang Li, Jing Gao, and Aidong Zhang. Uncorrelated patient similarity learning. In Proceedings of the 2018 SIAM International Conference on Data Mining, pages 270-278. SIAM, 2018.
[11] Laurent Jacob, Jean-philippe Vert, and Francis Bach. Clustered multi-task learning: A convex formulation. In NIPS, 2008.
[12] Minki Jeong, Seokeon Choi, and Changick Kim. Few-shot open-set recognition by transformation consistency. In CVPR, pages 12566-12575, 2021.
[13] Ghassen Jerfel, Erin Grant, Tom Griffiths, and Katherine A Heller. Reconciling meta-learning and continual learning with online mixtures of tasks. NeurIPS, 32, 2019.
[14] Weisen Jiang, James T. Kwok, and Yu Zhang. Subspace learning for effective meta-learning. In Kamalika Chaudhuri, Stefanie Jegelka, Le Song, Csaba Szepesvári, Gang Niu, and Sivan Sabato, editors, International Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, volume 162 of Proceedings of Machine Learning Research, pages 10177-10194. PMLR, 2022.
[15] Zhuoliang Kang, Kristen Grauman, and Fei Sha. Learning with whom to share in multi-task feature learning. In ICML, 2011.
[16] Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
[17] Weihao Kong, Raghav Somani, Zhao Song, Sham M. Kakade, and Sewoong Oh. Meta-learning for mixed linear regression. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pages 5394-5404. PMLR, 2020.
[18] Abhishek Kumar and Hal Daumé III. Learning task grouping and overlap in multi-task learning. In ICML, pages 1723-1730, 2012.
[58] Pan Zhou, Yingtian Zou, Xiao-Tong Yuan, Jiashi Feng, Caiming Xiong, and Steven C. H. Hoi. Task similarity aware meta learning: theory-inspired improvement on MAML. In Cassio P. de Campos, Marloes H. Maathuis, and Erik Quaeghebeur, editors, Proceedings of the Thirty-Seventh Conference on Uncertainty in Artificial Intelligence, UAI 2021, Virtual Event, 27-30 July 2021, volume 161 of Proceedings of Machine Learning Research, pages 23-33. AUAI Press, 2021.
A Appendix for Details of Deriving HTGM
A.1 The lower-bound of the likelihood function
In this section, we provide the details of the lower-bound in Eq. (3). By introducing the approximated posterior  $q_{\phi}(\mathbf{v}_{\tau}|\mathcal{D}_{\tau}^{\mathrm{s}})$ , the likelihood in Eq. (1) becomes (the superscript * is neglected for clarity)
$$
\begin{array}{l} \ell (\mathcal {D} _ {\tau}, \boldsymbol {\theta}) = \frac {1}{n} \sum_ {i = 1} ^ {n} \log p _ {\boldsymbol {\theta}} (\mathbf {e} _ {i} | y _ {i}) + \frac {1}{n} \sum_ {i = 1} ^ {n} \log \left(\int_ {\mathbf {v} _ {\tau}} p (y _ {i} | \mathbf {v} _ {\tau}) p (\mathbf {v} _ {\tau}) d \mathbf {v} _ {\tau}\right) \\ = \frac {1}{n} \sum_ {i = 1} ^ {n} \log p _ {\boldsymbol {\theta}} (\mathbf {e} _ {i} | y _ {i}) + \frac {1}{n} \sum_ {i = 1} ^ {n} \log \left(\int_ {\mathbf {v} _ {\tau}} p (y _ {i} | \mathbf {v} _ {\tau}) p (\mathbf {v} _ {\tau}) \frac {q _ {\phi} (\mathbf {v} _ {\tau} | \mathcal {D} _ {\tau} ^ {\mathbf {s}})}{q _ {\phi} (\mathbf {v} _ {\tau} | \mathcal {D} _ {\tau} ^ {\mathbf {s}})} d \mathbf {v} _ {\tau}\right) \\ = \frac {1}{n} \sum_ {i = 1} ^ {n} \log p _ {\boldsymbol {\theta}} (\mathbf {e} _ {i} | y _ {i}) + \frac {1}{n} \sum_ {i = 1} ^ {n} \log \left(\int_ {\mathbf {v} _ {\tau}} q _ {\phi} (\mathbf {v} _ {\tau} | \mathcal {D} _ {\tau} ^ {\mathbf {s}}) \frac {p (y _ {i} | \mathbf {v} _ {\tau}) p (\mathbf {v} _ {\tau})}{q _ {\phi} (\mathbf {v} _ {\tau} | \mathcal {D} _ {\tau} ^ {\mathbf {s}})} d \mathbf {v} _ {\tau}\right) \\ \geq \frac {1}{n} \sum_ {i = 1} ^ {n} \log p _ {\boldsymbol {\theta}} (\mathbf {e} _ {i} | y _ {i}) + \frac {1}{n} \sum_ {i = 1} ^ {n} \int_ {\mathbf {v} _ {\tau}} q _ {\phi} (\mathbf {v} _ {\tau} | \mathcal {D} _ {\tau} ^ {\mathbf {s}}) \left[ \log p (y _ {i} | \mathbf {v} _ {\tau}) + \log p (\mathbf {v} _ {\tau}) - \log q _ {\phi} (\mathbf {v} _ {\tau} | \mathcal {D} _ {\tau} ^ {\mathbf {s}}) \right] d \mathbf {v} _ {\tau} \\ = \frac {1}{n} \sum_ {i = 1} ^ {n} \log p _ {\boldsymbol {\theta}} (\mathbf {e} _ {i} | y _ {i}) + \frac {1}{n} \sum_ {i = 1} ^ {n} \int_ {\mathbf {v} _ {\tau}} q _ {\boldsymbol {\phi}} (\mathbf {v} _ {\tau} | \mathcal {D} _ {\tau} ^ {\mathbf {s}}) \Big [ \log p (y _ {i} | \mathbf {v} _ {\tau}) + \log p (\mathbf {v} _ {\tau}) \Big ] d \mathbf {v} _ {\tau} - \int_ {\mathbf {v} _ {\tau}} q _ {\boldsymbol {\phi}} (\mathbf {v} _ {\tau} | \mathcal {D} _ {\tau} ^ {\mathbf {s}}) \log q _ {\boldsymbol {\phi}} (\mathbf {v} _ {\tau} | \mathcal {D} _ {\tau} ^ {\mathbf {s}}) d \mathbf {v} _ {\tau} \\ = \frac {1}{n} \sum_ {i = 1} ^ {n} \log p _ {\boldsymbol {\theta}} (\mathbf {e} _ {i} | y _ {i}) + \frac {1}{n} \sum_ {i = 1} ^ {n} \mathbb {E} _ {\mathbf {v} _ {\tau} \sim q _ {\phi} (\mathbf {v} _ {\tau} | \mathcal {D} _ {\tau} ^ {\mathfrak {s}})} \left[ \log p (y _ {i} | \mathbf {v} _ {\tau}) + \log p (\mathbf {v} _ {\tau}) \right] + H (q _ {\phi} (\mathbf {v} _ {\tau} | \mathcal {D} _ {\tau} ^ {\mathfrak {s}})) \\ = \frac {1}{n} \sum_ {i = 1} ^ {n} \log p _ {\boldsymbol {\theta}} (\mathbf {e} _ {i} | y _ {i}) + \frac {1}{n} \sum_ {i = 1} ^ {n} \mathbb {E} _ {\mathbf {v} _ {\tau} \sim q _ {\phi} (\mathbf {v} _ {\tau} | \mathcal {D} _ {\tau} ^ {\mathbf {s}})} \left[ \log p (y _ {i} | \mathbf {v} _ {\tau}) + \log \left(\sum_ {z _ {\tau} = 1} ^ {r} p (\mathbf {v} _ {\tau} | z _ {\tau}) p (z _ {\tau})\right) \right] + H \left(q _ {\phi} (\mathbf {v} _ {\tau} | \mathcal {D} _ {\tau} ^ {\mathbf {s}})\right) \tag {9} \\ \end{array}
$$
where the fourth step uses Jensen's inequality. This completes the derivation of Eq. (3).
A.2 The upper-bound of the partition function
In Sec. 3.3, we apply an upper bound on the partition function in Eq. (2) for solving the challenging 2. The derivation of the upper bound is as follows.
$$
\begin{array}{l} \int_ {\boldsymbol {\mu} _ {y _ {i}} ^ {\mathsf {c}}} \exp \left[ - E _ {\omega} \left(\boldsymbol {\mu} _ {y _ {i}} ^ {\mathsf {c}}; \mathbf {v} _ {\tau}\right) \right] d \boldsymbol {\mu} _ {y _ {i}} ^ {\mathsf {c}} = \int_ {\boldsymbol {\mu} _ {y _ {i}} ^ {\mathsf {c}}} \exp \left[ - \min  \left(\left\{\left| \left| \boldsymbol {\mu} _ {y _ {i}} ^ {\mathsf {c}} - \mathbf {W} _ {j} \mathbf {v} _ {\tau} \right| \right| _ {2} ^ {2} \right\} _ {j = 1} ^ {N}\right) \right] d \boldsymbol {\mu} _ {y _ {i}} ^ {\mathsf {c}} \\ = \int_ {\boldsymbol {\mu} _ {y _ {i}} ^ {\mathbf {c}}} \max  \left(\left\{\exp \left[ - \left\| \boldsymbol {\mu} _ {y _ {i}} ^ {\mathbf {c}} - \mathbf {W} _ {j} \mathbf {v} _ {\tau} \right\| _ {2} ^ {2} \right] \right\} _ {j = 1} ^ {N}\right) d \boldsymbol {\mu} _ {y _ {i}} ^ {\mathbf {c}} <   \int_ {\boldsymbol {\mu} _ {y _ {i}} ^ {\mathbf {c}}} \sum_ {j = 1} ^ {N} \exp \left[ - \left\| \boldsymbol {\mu} _ {y _ {i}} ^ {\mathbf {c}} - \mathbf {W} _ {j} \mathbf {v} _ {\tau} \right\| _ {2} ^ {2} \right] d \boldsymbol {\mu} _ {y _ {i}} ^ {\mathbf {c}} \tag {10} \\ = \sum_ {j = 1} ^ {N} \int_ {\boldsymbol {\mu} _ {y _ {i}} ^ {\mathbf {c}}} \exp \left[ - \left\| \boldsymbol {\mu} _ {y _ {i}} ^ {\mathbf {c}} - \mathbf {W} _ {j} \mathbf {v} _ {\tau} \right\| _ {2} ^ {2} \right] d \boldsymbol {\mu} _ {y _ {i}} ^ {\mathbf {c}} = N \sqrt {\pi^ {d}} \\ \end{array}
$$
where the last equation is from the multidimensional Gaussian integral. This completes the derivation of the upper bound of the partition function.
Note that replacing the partition function with its upper bound increases the noise in the inferred class mean. This is because that the entropy of distribution  $\pi (\pmb{\mu}_{y_i}^{\mathrm{c}}|\mathbf{v}_\tau ,\boldsymbol {\omega})$ $(\pmb{\mu}_{y_i}^{\mathrm{c}}$  is a class mean) in Eq. (2) is that:
$$
\begin{array}{l} H (\pi) = - \int \pi \left(\boldsymbol {\mu} _ {y _ {i}} ^ {c} | \mathbf {v} _ {\tau}, \boldsymbol {\omega}\right) \log \pi \left(\boldsymbol {\mu} _ {y _ {i}} ^ {c} | \mathbf {v} _ {\tau}, \boldsymbol {\omega}\right) d \boldsymbol {\mu} _ {y _ {i}} ^ {c} \\ = \int \pi \left(\boldsymbol {\mu} _ {y _ {i}} ^ {\mathrm {c}} | \mathbf {v} _ {\tau}, \omega\right) \log Z d \boldsymbol {\mu} _ {y _ {i}} ^ {\mathrm {c}} + \int \pi \left(\boldsymbol {\mu} _ {y _ {i}} ^ {\mathrm {c}} | \mathbf {v} _ {\tau}, \omega\right) E _ {\omega} \left(\boldsymbol {\mu} _ {y _ {i}} ^ {\mathrm {c}}; \mathbf {v} _ {\tau}\right) ] d \boldsymbol {\mu} _ {y _ {i}} ^ {\mathrm {c}} \tag {11} \\ = \log Z + \bar {E} _ {\omega} \\ \end{array}
$$
where  $\bar{E}_{\omega}$  is the average energy and  $Z$  is the partition function. From this formula, we see that replacing  $Z$  with its upper bound increases the entropy of  $\pi(\pmb{\mu}_{y_i}^c | \mathbf{v}_\tau, \omega)$ , the distribution where  $\pmb{\mu}_{y_i}^c$  is sampled and/or inferred. Since entropy is a metric that measures the uncertainty of a random variable, increased entropy means that our estimation to  $\pmb{\mu}_k^c$  is more uncertain, or in other words, more
noisy. This leads to a decreasing accuracy of meta-learning since the class mean  $\mu_{y_i}^{\mathrm{c}}$  is an important parameter to estimate in meta-learning. To alleviate this issue, we proposed to include an negative sampling term as in Eq. (4) to increase the distance between different class means so that the noise in the class mean estimation, which is brought by the upper bound approximation of  $Z$ , will not seriously influence the accuracy.
A.3 The proof of Theorem 3.1
Proof. Let  $B_{j}$  denote a sphere in  $\mathbb{R}^d$ . Its center is at  $\mathbf{W}_j\mathbf{v}_{\tau}$  and its radius is  $D_{hl}/2$ . Because  $\mathbf{W}_h\mathbf{v}_{\tau}$  and  $\mathbf{W}_l\mathbf{v}_{\tau}$  ( $1 \leq h, l \leq N$ ) is the pair with the smallest Euclidean distance  $D_{hl}$ , for any pair of balls  $B_j$  and  $B_m$  we have  $B_j \cap B_m$  is a null set (a set with 0 volume in  $\mathbb{R}^d$ ).
In other words, there is no overlap between any pair of spheres. Therefore, if we compute the integral over the joint of all spheres, we have
$$
\int_ {\boldsymbol {\mu} _ {k} ^ {\mathsf {C}} \in \bigcup_ {m = 1} ^ {N} B _ {m}} \exp \left[ - E _ {\omega} \left(\boldsymbol {\mu} _ {k} ^ {\mathsf {C}}; \mathbf {v} _ {\tau}\right) \right] d \boldsymbol {\mu} _ {k} ^ {\mathsf {C}} = \sum_ {m = 1} ^ {N} \int_ {\boldsymbol {\mu} _ {k} ^ {\mathsf {C}} \in B _ {m}} \exp \left[ - E _ {\omega} \left(\boldsymbol {\mu} _ {k} ^ {\mathsf {C}}; \mathbf {v} _ {\tau}\right) \right] d \boldsymbol {\mu} _ {k} ^ {\mathsf {C}} \tag {12}
$$
Also, because there is no overlap between any pair of spheres, for each point  $\pmb{\mu}_k^{\mathrm{c}}\in B_m$  , we have
$$
- \min  \left(\left\{\left| \left| \boldsymbol {\mu} _ {k} ^ {\mathbf {c}} - \mathbf {W} _ {j} \mathbf {v} _ {\tau} \right| \right| _ {2} ^ {2} \right\} _ {j = 1} ^ {N}\right) = - \left| \left| \boldsymbol {\mu} _ {k} ^ {\mathbf {c}} - \mathbf {W} _ {m} \mathbf {v} _ {\tau} \right| \right| _ {2} ^ {2} \tag {13}
$$
Therefore, we have the following derivation from Eq. (12).
$$
\begin{array}{l} \int_ {\boldsymbol {\mu} _ {k} ^ {\mathbf {c}} \in \bigcup_ {m = 1} ^ {N} B _ {m}} \exp \left[ - E _ {\omega} \left(\boldsymbol {\mu} _ {k} ^ {\mathbf {c}}; \mathbf {v} _ {\tau}\right) \right] d \boldsymbol {\mu} _ {k} ^ {\mathbf {c}} = \sum_ {m = 1} ^ {N} \int_ {\boldsymbol {\mu} _ {k} ^ {\mathbf {c}} \in B _ {m}} \exp \left[ - E _ {\omega} \left(\boldsymbol {\mu} _ {k} ^ {\mathbf {c}}; \mathbf {v} _ {\tau}\right) \right] d \boldsymbol {\mu} _ {k} ^ {\mathbf {c}} \tag {14} \\ = \sum_ {m = 1} ^ {N} \int_ {\boldsymbol {\mu} _ {k} ^ {\mathbf {c}} \in B _ {m}} \exp \left[ - \left\| \boldsymbol {\mu} _ {k} ^ {\mathbf {c}} - \mathbf {W} _ {m} \mathbf {v} _ {\tau} \right\| _ {2} ^ {2} \right] d \boldsymbol {\mu} _ {k} ^ {\mathbf {c}} = N \int_ {\boldsymbol {\mu} _ {k} \in B _ {m}} \exp \left[ - \left\| \boldsymbol {\mu} _ {k} ^ {\mathbf {c}} - \mathbf {W} _ {m} \mathbf {v} _ {\tau} \right\| _ {2} ^ {2} \right] d \boldsymbol {\mu} _ {k} ^ {\mathbf {c}} \\ \end{array}
$$
Meanwhile, since  $\bigcup_{m=1}^{N} B_m$  is a sub-area of the entire  $\mathbb{R}^d$  space, we have
$$
\int_ {\boldsymbol {\mu} _ {k} ^ {\mathrm {c}} \in \bigcup_ {m = 1} ^ {N} B _ {m}} \exp \left[ - E _ {\omega} \left(\boldsymbol {\mu} _ {k} ^ {\mathrm {c}}; \mathbf {v} _ {\tau}\right) \right] d \boldsymbol {\mu} _ {k} ^ {\mathrm {c}} \leq \int_ {\boldsymbol {\mu} _ {k} ^ {\mathrm {c}}} \exp \left[ - E _ {\omega} \left(\boldsymbol {\mu} _ {k} ^ {\mathrm {c}}; \mathbf {v} _ {\tau}\right) \right] d \boldsymbol {\mu} _ {k} ^ {\mathrm {c}} \tag {15}
$$
As  $B_{m}$  is a sphere, we can convert the integral into spherical coordinates. Thus we have:
$$
\begin{array}{l} \int_ {\boldsymbol {\mu} _ {k} \in B _ {m}} \exp \left[ - \left| \left| \boldsymbol {\mu} _ {k} ^ {\mathrm {c}} - \mathbf {W} _ {m} \mathbf {v} _ {\tau} \right| \right| _ {2} ^ {2} \right] d \boldsymbol {\mu} _ {k} ^ {\mathrm {c}} = \frac {2 \sqrt {\pi^ {d}}}{\Gamma (\frac {d}{2})} \int_ {0} ^ {D _ {h l} / 2} \exp (- r ^ {2}) r ^ {d - 1} d r \\ = \frac {\sqrt {\pi^ {d}}}{\Gamma (\frac {d}{2})} \int_ {0} ^ {D _ {h l} / 2} \exp (- r ^ {2}) r ^ {d - 2} (2 r d r) \\ = \frac {\sqrt {\pi^ {d}}}{\Gamma (\frac {d}{2})} \int_ {0} ^ {D _ {h l} ^ {2} / 4} \exp (- t) t ^ {\frac {d}{2} - 1} d t \tag {16} \\ = \frac {\sqrt {\pi^ {d}} \gamma (\frac {d}{2} , D _ {h l} ^ {2} / 4)}{\Gamma (\frac {d}{2})} \\ \end{array}
$$
where  $\gamma (\cdot ,\cdot)$  is lower incomplete gamma function and  $\Gamma (\cdot)$  is gamma function  $(\Gamma (x)$  the limitation of  $\gamma (x,y)$  when  $y\to +\infty$  ). According to the definition of lower incomplete gamma function, when  $D_{hl}^{2} / 4\rightarrow +\infty$  , we have
$$
\lim  _ {D _ {h l} \rightarrow \infty} \int_ {\boldsymbol {\mu} _ {k} ^ {\mathsf {c}} \in B _ {m}} \exp \left[ - E _ {\omega} \left(\boldsymbol {\mu} _ {k} ^ {\mathsf {c}}; \mathbf {v} _ {\tau}\right)\right] d \boldsymbol {\mu} _ {k} ^ {\mathsf {c}} = \sqrt {\pi^ {d}} \tag {17}
$$
$$
\lim  _ {D _ {h l} \rightarrow \infty} \int_ {\boldsymbol {\mu} _ {k} ^ {\mathbb {C}}} \exp \left[ - E _ {\omega} \left(\boldsymbol {\mu} _ {k} ^ {\mathbb {C}}; \mathbf {v} _ {\tau}\right)\right] d \boldsymbol {\mu} _ {k} ^ {\mathbb {C}} \geq N \sqrt {\pi^ {d}} \tag {18}
$$
Since  $N\sqrt{\pi^d}$  is its upper bound, based on the squeeze theorem, we have
$$
\lim  _ {D _ {h l} \rightarrow \infty} \int_ {\boldsymbol {\mu} _ {k} ^ {\mathbf {C}}} \exp \left[ - E _ {\omega} \left(\boldsymbol {\mu} _ {k} ^ {\mathbf {c}}; \mathbf {v} _ {\tau}\right)\right] d \boldsymbol {\mu} _ {k} ^ {\mathbf {c}} = N \sqrt {\pi^ {d}} \tag {19}
$$
which completes the proof of Theorem 3.1. Moreover, from Equation 16, we know that the error ratio of the approximation, denoted as  $AER$ , can be bounded:
$$
A E R = \frac {N \sqrt {\pi^ {d}} - \int_ {\boldsymbol {\mu} _ {k} ^ {\mathrm {c}}} \exp \left[ - E _ {\omega} \left(\boldsymbol {\mu} _ {k} ^ {\mathrm {c}} ; \mathbf {v} _ {\tau}\right) \right] d \boldsymbol {\mu} _ {k} ^ {\mathrm {c}}}{N \sqrt {\pi^ {d}}} <   1 - \frac {\gamma (\frac {d}{2} , D _ {h l} ^ {2} / 4)}{\Gamma (\frac {d}{2})} = 1 - \frac {\gamma (\frac {d}{2} , D _ {h l} ^ {2} / 4)}{(\frac {d}{2} - 1) !} \tag {20}
$$
which monotonously decreases to 0 as  $D_{hl}$  increases to  $+\infty$
A.4 The proof of Theorem 3.2
Before starting the proof, we need to clarify the notations. When optimizing Eq. (3) in meta-training stage, we compute the class prototypes  $\pmb{\mu}_{1}^{\mathrm{c}},\dots,\pmb{\mu}_{N}^{\mathrm{c}}$  with both support sample means  $\{\pmb{\mu}_1^{\mathrm{c}},\dots,\pmb{\mu}_N^{\mathrm{c}}\}^s$  and query sample means  $\{\pmb{\mu}_1^{\mathrm{c}},\dots,\pmb{\mu}_N^{\mathrm{c}}\}^q$  (see Fig. 2). In Sec. 3.4, since during meta-testing stage we have no query samples, for clarity we omitted the notations to denote the  $j$ -th class mean of support set as  $\pmb{\mu}_{j}^{\mathrm{c}}$ . In the proof of the Theorem 3.2, we rigorously denote the support sample means of class  $j$  as  $\pmb{\mu}_{j}^{\mathrm{c,s}}$  and the query sample means of class  $j$  as  $\pmb{\mu}_{j}^{\mathrm{c,q}}$ .
Proof. Recall the Eq. (3):
$$
\begin{array}{l} \ell_ {\mathrm {H T G M - L}} \left(\mathcal {D} _ {\tau}; \boldsymbol {\theta}, \boldsymbol {\omega}\right) = \frac {1}{n} \sum_ {i = 1} ^ {n} \left(\log p _ {\boldsymbol {\theta}, \boldsymbol {\omega}} \left(\mathbf {e} _ {i} \mid y _ {i}\right) + \mathbb {E} _ {\mathbf {v} _ {\tau} \sim q _ {\phi} \left(\mathbf {v} _ {\tau} \mid \mathcal {D} _ {\tau} ^ {\mathrm {s}}\right)} \left[ \log p _ {\boldsymbol {\omega}} \left(y _ {i} \mid \mathbf {v} _ {\tau}\right) + \log \sum_ {z _ {\tau} = 1} ^ {r} p (\mathbf {v} _ {\tau} \mid z _ {\tau}) p (z _ {\tau}) \right]\right) \\ + H \left(q _ {\phi} \left(\mathbf {v} _ {\tau} \mid \mathcal {D} _ {\tau} ^ {\mathrm {S}}\right)\right) \tag {21} \\ \end{array}
$$
By substituting the sampled  $\mathbf{v}_{\tau}$  into it, we can acquire:
$$
\begin{array}{l} \ell_ {\mathrm {H T G M - L}} \left(\mathcal {D} _ {\tau}; \boldsymbol {\theta}, \omega\right) = \frac {1}{n} \sum_ {i = 1} ^ {n} \left(\log p _ {\boldsymbol {\theta}, \omega} \left(\mathbf {e} _ {i} \mid y _ {i}\right) + \left[ \log p _ {\boldsymbol {\omega}} \left(y _ {i} \mid \mathbf {v} _ {\tau}\right) + \log \sum_ {z _ {\tau} = 1} ^ {r} p \left(\mathbf {v} _ {\tau} \mid z _ {\tau}\right) p \left(z _ {\tau}\right) \right]\right) \tag {22} \\ + H \left(q _ {\phi} \left(\mathbf {v} _ {\tau} \mid \mathcal {D} _ {\tau} ^ {\mathbf {S}}\right)\right) \\ \end{array}
$$
Note that not every term in the Eq. (22) (the above likelihood function) contains class means  $\pmb{\mu}^{\mathrm{c}}$ . Only  $\{p_{\omega}(y_i|\mathbf{v}_{\tau})\}$  and  $\{p_{\theta ,\omega}(\mathbf{e}_i|y_i)\}$  are involved with  $\pmb{\mu}^{\mathrm{c}}$ . Thus, optimizing  $\pmb{\mu}^{\mathrm{c}}$  to maximize  $\ell_{\mathrm{HTGM - L}}(\mathcal{D}_{\tau};\boldsymbol {\theta},\boldsymbol {\omega})$  is equivalent to maximizing the following objective function  $L(\pmb{\mu}^{\mathrm{c}})$ :
$$
L \left(\boldsymbol {\mu} ^ {\mathrm {c}}\right) = \sum_ {j = 1} ^ {N} \log p _ {\boldsymbol {\omega}} \left(y _ {i} = j \mid \mathbf {v} _ {\tau}\right) + \sum_ {i = 1} ^ {n} \log p _ {\boldsymbol {\theta}, \boldsymbol {\omega}} \left(\mathbf {e} _ {i} \mid y _ {i}\right) \tag {23}
$$
Moreover, since every term is involved with at most one individual  $\pmb{\mu}_j^{\mathrm{c}}$ , we can separately optimize each individual  $\pmb{\mu}_j^{\mathrm{c}}$ . We denote the embedding of the  $i$ -th sample in class  $j$  as  $\mathbf{e}_i^{(j)}$ . The objective function for each individual  $\pmb{\mu}_j^{\mathrm{c}}$  is:
$$
\begin{array}{l} L (\pmb {\mu} _ {j} ^ {\mathsf {c}}) = \log p _ {\omega} (y _ {i} = j | \mathbf {v} _ {\tau}) + \sum_ {i = 1} ^ {K} \log p _ {\pmb {\theta}, \omega} (\mathbf {e} _ {i} ^ {(j)} | y _ {i} = j) \\ = \log \pi \left(\boldsymbol {\mu} _ {j} ^ {\mathrm {c}} \mid \mathbf {v} _ {\tau}, \boldsymbol {\omega}\right) + \sum_ {i = 1} ^ {K} \log \mathcal {N} \left(\mathbf {e} _ {i} ^ {(j)} \mid \boldsymbol {\mu} _ {j} ^ {\mathrm {c}}, \sigma^ {2} \mathbf {I}\right) \tag {24} \\ = - \frac {1}{2 \sigma^ {2 d}} \sum_ {i} ^ {K} | | \mathbf {e} _ {i} ^ {(j)} - \boldsymbol {\mu} _ {j} ^ {\mathbf {c}} | | _ {2} ^ {2} - \min _ {l} | | \mathbf {W} _ {l} \mathbf {v} _ {\tau} - \bar {\boldsymbol {\mu}} _ {j} ^ {\mathbf {c}} | | _ {2} ^ {2} + c o n s t a n t \\ \end{array}
$$
The maximum likelihood estimation  $\bar{\pmb{\mu}}_j^{\mathrm{c}}$  of  $\pmb{\mu}_j^{\mathrm{c}}$  should maximize the above objective function. It is equivalent to find a solution set  $\pmb{\mu}_j^{\mathrm{c}} = \bar{\pmb{\mu}}_j^{\mathrm{c}}, l = l^*$  that can minimize the following function:
$$
L \left(\boldsymbol {\mu} _ {j} ^ {\mathrm {c}}, l\right) = \frac {1}{2 \sigma^ {2 d}} \sum_ {i} ^ {K} \left| \left| \mathbf {e} _ {i} ^ {(j)} - \boldsymbol {\mu} _ {j} ^ {\mathrm {c}} \right| \right| _ {2} ^ {2} + \left| \left| \mathbf {W} _ {l} \mathbf {v} _ {\tau} - \boldsymbol {\mu} _ {j} ^ {\mathrm {c}} \right| \right| _ {2} ^ {2} \tag {25}
$$
We first compute the partial derivative of the above function with respect to  $\pmb{\mu}_j^c$ :
$$
\frac {\partial L \left(\boldsymbol {\mu} _ {j} ^ {\mathrm {c}} , l\right)}{\partial \boldsymbol {\mu} _ {j} ^ {\mathrm {c}}} = \frac {1}{\sigma^ {2 d}} \sum_ {i} ^ {K} \left(\boldsymbol {\mu} _ {j} ^ {\mathrm {c}} - \mathbf {e} _ {i} ^ {(j)}\right) + 2 \left(\boldsymbol {\mu} _ {j} ^ {\mathrm {c}} - \mathbf {W} _ {l} \mathbf {v} _ {\tau}\right) = \frac {1}{\sigma^ {2 d}} \left(K \boldsymbol {\mu} _ {j} ^ {\mathrm {c}} - \sum_ {i} ^ {K} \mathbf {e} _ {i} ^ {(j)}\right) + 2 \left(\boldsymbol {\mu} _ {j} ^ {\mathrm {c}} - \mathbf {W} _ {l} \mathbf {v} _ {\tau}\right) \tag {26}
$$