Title: EMPIRICAL BAYES TRANSDUCTIVE META-LEARNING WITH SYNTHETIC GRADIENTS

Abstract: We propose a meta-learning approach that learns from multiple tasks in a transductive setting, by leveraging the unlabeled query set in addition to the support set to generate a more powerful model for each task. To develop our framework, we revisit the empirical Bayes formulation for multi-task learning. The evidence lower bound of the marginal log-likelihood of empirical Bayes decomposes as a sum of local KL divergences between the variational posterior and the true posterior on the query set of each task. We derive a novel amortized variational inference that couples all the variational posteriors via a meta-model, which consists of a synthetic gradient network and an initialization network. Each variational posterior is derived from synthetic gradient descent to approximate the true posterior on the query set, although where we do not have access to the true gradient. Our results on the Mini-ImageNet and CIFAR-FS benchmarks for episodic few-shot classification outperform previous state-of-the-art methods. Besides, we conduct two zero-shot learning experiments to further explore the potential of the synthetic gradient.

1. INTRODUCTION:

While supervised learning of deep neural networks can achieve or even surpass human-level performance (He et al., 2015; Devlin et al., 2018) , they can hardly extrapolate the learned knowledge beyond the domain where the supervision is provided. The problem of solving rapidly a new task after learning several other similar tasks is called meta-learning (Schmidhuber, 1987; Bengio et al., 1991; Thrun & Pratt, 1998) ; typically, the data is presented in a two-level hierarchy such that each data point at the higher level is itself a dataset associated with a task, and the goal is to learn a meta-model that generalizes across tasks. In this paper, we mainly focus on few-shot learning (Vinyals et al., 2016) , an instance of meta-learning problems, where a task t consists of a query set d t := {(x t,i , y t,i )} n i=1 serving as the test-set of the task and a support set d l t :={(x l t,i ,y l t,i )} n l i=1 serving as the train-set. In meta-testing1 , one is given the support set and the inputs of the query set x t := {x t,i } n i=1 , and asked to predict the labels y t := {y t,i } n i=1 . In meta-training, y t is provided as the ground truth. The setup of few-shot learning is summarized in Table 1 .

A important distinction to make is whether a task is solved in a transductive or inductive manner, that is, whether x t is used. The inductive setting is what was originally proposed by Vinyals et al. (2016) , in which only d l t is used to generate a model. The transductive setting, as an alternative, has the advantage of being able to see partial or all points in x t before making predictions. In fact,

Support set:

Query set d l t := {(x l t,i , y l t,i )} n l i=1

x t := {x t,i } n i=1 y t = {y t,i } n i=1

Meta-training Meta-testing:

Table 1 : The setup of few-shot learning. If task t is used for meta-testing, y t is not given to the model. Nichol et al. (2018) notice that most of the existing meta-learning methods involve transduction unintentionally since they use x t implicitly via the batch normalization (Ioffe & Szegedy, 2015) .

Explicit transduction is less explored in meta-learning, the exception is Liu et al. (2018) , who adapted the idea of label propagation (Zhu et al., 2003) from graph-based semi-supervised learning methods.

We take a totally different path that meta-learn the "gradient" descent on x t without using y t .

Due to the hierarchical structure of the data, it is natural to formulate meta-learning by a hierarchical Bayes (HB) model (Good, 1980; Berger, 1985) , or alternatively, an empirical Bayes (EB) model (Robbins, 1985; Kucukelbir & Blei, 2014) . The difference is that the latter restricts the learning of meta-parameters to point estimates. In this paper, we focus on the EB model, as it largely simplifies the training and testing without losing the strength of the HB formulation.

The idea of using HB or EB for meta-learning is not new: Amit & Meir (2018) derive an objective similar to that of HB using PAC-Bayesian analysis; Grant et al. (2018) show that MAML (Finn et al., 2017) can be understood as a EB method; Ravi & Beatson (2018) consider a HB extension to MAML and compute posteriors via amortized variational inference. However, unlike our proposal, these methods do not make full use of the unlabeled data in query set. Roughly speaking, they construct the variational posterior as a function of the labeled set d l t without taking advantage of the unlabeled set x t . The situation is similar in gradient based meta-learning methods (Finn et al., 2017; Ravi & Larochelle, 2016; Li et al., 2017b; Nichol et al., 2018; Flennerhag et al., 2019) and many other meta-learning methods (Vinyals et al., 2016; Snell et al., 2017; Gidaris & Komodakis, 2018) , where the mechanisms used to generate the task-specific parameters rely on groundtruth labels, thus, there is no place for the unlabeled set to contribute. We argue that this is a suboptimal choice, which may lead to overfitting when the labeled set is small and hinder the possibility of zero-shot learning (when the labeled set is not provided).

In this paper, we propose to use synthetic gradient (Jaderberg et al., 2017) to enable transduction, such that the variational posterior is implemented as a function of the labeled set d l t and the unlabeled set x t . The synthetic gradient is produced by chaining the output of a gradient network into autodifferentiation, which yields a surrogate of the inaccessible true gradient. The optimization process is similar to the inner gradient descent in MAML, but it iterates on the unlabeled x t rather than on the labeled d l t , since it does not rely on y t to compute the true gradient. The labeled set for generating the model for an unseen task is now optional, which is only used to compute the initialization of model weights in our case. In summary, our main contributions are the following:

1. In section 2 and section 3, we develop a novel empirical Bayes formulation with transduction for meta-learning. To perform amortized variational inference, we propose a parameterization for the variational posterior based on synthetic gradient descent, which incoporates the contextual information from all the inputs of the query set.

2. In section 4, we show in theory that a transductive variational posterior yields better generalization performance. The generalization analysis is done through the connection between empirical Bayes formulation and a multitask extension of the information bottleneck principle. In light of this, we name our method synthetic information bottleneck (SIB).

3. In section 5, we verify our proposal empirically. Our experimental results demonstrate that our method significantly outperforms the state-of-the-art meta-learning methods on few-shot classification benchmarks under the one-shot setting. MAML is an inductive method since, for a task t, it first constructs the variational posterior (with parameter θ K ) as a function of the support set d l t , and then test on the unlabeled x t ; while SIB uses a better variational posterior as a function of both d l t and x t : it starts from an initialization θ 0 t (d l t ) generated using d l t , and then yields θ K t by running K synthetic gradient steps on x t .

2. META-LEARNING WITH TRANSDUCTIVE INFERENCE:

The goal of meta-learning is to train a meta-model on a collection of tasks, such that it works well on another disjoint collection of tasks. Suppose that we are given a collection of N tasks for training.

The associated data is denoted by D := {d t := (x t , y t )} N t=1 . In the case of few-shot learning, we are given in addition a support set d l t in each task. In this section, we revisit the classical empirical Bayes model for meta-learning. Then, we propose to use a transductive scheme in the variational inference by implementing the variational posterior as a function of x t .

2.1. EMPIRICAL BAYES MODEL:

Due to the hierarchical structure among data, it is natural to consider a hierarchical Bayes model with the marginal likelihood

p f (D) = ψ p f (D|ψ)p(ψ) = ψ N t=1 wt p f (d t |w t )p(w t |ψ) p(ψ).

(1)

The generative process is illustrated in Figure 1 (a, in red arrows): first, a meta-parameter ψ (i.e., hyper-parameter) is sampled from the hyper-prior p(ψ); then, for each task, a task-specific parameter w t is sampled from the prior p(w t |ψ); finally, the dataset is drawn from the likelihood p f (d t |w t ).

Without loss of generality, we assume the log-likelihood model factorizes as

EQUATION

)

It is the setting advocated by Minka (2005) , in which the generative model p(x t,i |w t ) can be safely ignored since it is irrelevant to the prediction of y t . To simplify the presentation, we still keep the notation p f (d t |w t ) for the likelihood of the task t and use t to specify the discriminative model, which is also referred to as the task-specific loss, e.g., the cross entropy loss. The first argument in t is the prediction, denoted by ŷt,i = ŷt,i (f (x t,i ), w t ), which depends on the feature representation f (x t,i ) and the task-specific weight w t .

Note that rather than following a fully Bayesian approach, we leave some random variables to be estimated in a frequentist way, e.g., f is a meta-parameter of the likelihood model shared by all tasks, for which we use a point estimate. As such, the posterior inference about these variables will be largely simplified. For the same reason, we derive the empirical Bayes (Robbins, 1985; Kucukelbir & Blei, 2014) by taking a point estimate on ψ. The marginal likelihood now reads as

EQUATION

We highlight the meta-parameters as subscripts of the corresponding distributions to distinguish from random variables. Indeed, we are not the first to formulate meta-learning as empirical Bayes. The overall model formulation is essentially the same as the ones considered by Amit & Meir (2018) ; Grant et al. (2018) ; Ravi & Beatson (2018) . Our contribution lies in the variational inference for empirical Bayes.

2.2. AMORTIZED INFERENCE WITH TRANSDUCTION:

As in standard probabilistic modeling, we derive an evidence lower bound (ELBO) on the log version of (3) by introducing a variational distribution q θt (w t ) for each task with parameter θ t :

EQUATION

The variational inference amounts to maximizing the ELBO with respect to θ 1 , . . . , θ N , which together with the maximum likelihood estimation of the meta-parameters, we have the following optimization problem:

EQUATION

However, the optimization in ( 5), as N increases, becomes more and more expensive in terms of the memory footprint and the computational cost. We therefore wish to bypass this heavy optimization and to take advantage of the fact that individual KL terms indeed share the same structure. To this end, instead of introducing N different variational distributions, we consider a parameterized family of distributions in the form of q φ(•) , which is defined implicitly by a deep neural network φ taking as input either d l t or d l t plus x t , that is, q φ(d l t ) or q φ(d l t ,xt) . Note that we cannot use entire d t , since we do not have access to y t during meta-testing. This amortization technique was first introduced in the case of variational autoencoders (Kingma & Welling, 2013; Rezende et al., 2014) , and has been extended to Bayesian inference in the case of neural processes (Garnelo et al., 2018) .

Since d l t and x t are disjoint, the inference scheme is inductive for a variational posterior q φ(d l t ) . As an example, MAML (Finn et al., 2017) takes q φ(d l t ) as the Dirac delta distribution, where φ(d l t ) = θ K t , is the K-th iterate of the stochastic gradient descent

EQUATION

)

In this work, we consider a transductive inference scheme with variational posterior q φ(d l t ,xt) . The inference process is shown in Figure 1 (a, in green arrows). Replacing each q θt in (5) by q φ(d l t ,xt) , the optimization problem becomes

EQUATION

In a nutshell, the meta-model to be optimized includes the feature network f , the hyper-parameter ψ from the empirical Bayes formulation and the amortization network φ from the variational inference.

3. UNROLLING EXACT INFERENCE WITH SYNTHETIC GRADIENTS:

It is however non-trivial to design a proper network architecture for φ(d l t , x t ), since d l t and x t are both sets. The strategy adopted by neural processes (Garnelo et al., 2018) is to aggregate the information from all individual examples via an averaging function. However, as pointed out by Kim et al. (2019) , such a strategy tends to underfit x t because the aggregation does not necessarily attain the most relevant information for identifying the task-specific parameter. Extensions, such as attentive neural process (Kim et al., 2019) and set transformer (Lee et al., 2019a) , may alleviate this issue but come at a price of O(n2 ) time complexity. We instead design φ(d l t , x t ) to mimic the exact inference arg min θt D KL (q θt (w t ) p ψ,f (w t |d t )) by parameterizing the optimization process with respect to θ t . More specifically, consider the gradient descent on θ t with step size η:

EQUATION

We would like to unroll this optimization dynamics up to the K-th step such that θ K t = φ(d l t , x t ) while make sure that θ K t is a good approximation to the optimum θ t , which consists of parameterizing (a) the initialization θ 0 t and (b) the gradient ∇ θt D KL (q θt (w t ) p ψ,f (w t |d t )).

By doing so, θ K t becomes a function of φ, ψ and x t 2 , we therefore realize q φ(d l t ,xt) as q θ K t . For (a), we opt to either let θ 0 t = λ to be a global data-independent initialization as in MAML (Finn et al., 2017) or let θ 0 t = λ(d l t ) with a few supervisions from the support set, where λ can be implemented by a permutation invariant network described in Gidaris & Komodakis (2018) . In the second case, the features of the support set will be first averaged in terms of their labels and then scaled by a learnable vector of the same size.

For (b), the fundamental reason that we parameterize the gradient is because we do not have access to y t during the meta-testing phase, although we are able to follow (8) in meta-training to obtain q θ t (w t ) ∝ p f (d t |w t )p ψ (w t ). To make a consistent parameterization in both meta-training and meta-testing, we thus do not touch y t when constructing the variational posterior. Recall that the true gradient decomposes as

EQUATION

under a reparameterization w t = w t (θ t , ) with ∼ p( ), where all the terms can be computed without y t except for ∂ t ∂ ŷt,i . Thus, we introduce a deep neural network ξ(ŷ t,i ) to synthesize it. The idea of synthetic gradients was originally proposed by Jaderberg et al. (2017) to parallelize the back-propagation. Here, the purpose of ξ(ŷ t,i ) is to update θ t regardless of the groundtruth labels, which is slightly different from its original purpose. Besides, we do not introduce an additional loss between ξ(ŷ t,i ) and ∂ t ∂ ŷt,i since ξ(ŷ t,i ) will be driven by the objective in (7). As an intermediate computation, the synthetic gradient is not necessarily a good approximation to the true gradient.

To sum up, we have derived a particular implementation of φ(d l t , x t ) by parameterizing the exact inference update, namely (8), without using the labels of the query set, where the meta-model φ includes an initialization network λ and a synthetic gradient network ξ, such that φ(x t ) = θ K t , the K-th iterate of the following update:

EQUATION

)

The overall algorithm is depicted in Algorithm 1. We also make a side-by-side comparison with MAML shown in Figure 1 . Rather than viewing (10) as an optimization process, it may be more precise to think of it as a part of the computation graph created in the forward-propagation. The computation graph of the amortized inference is shown in Figure 2 ,

As an extension, if we were deciding to estimate the feature network f in a Bayesian manner, we would have to compute higher-order gradients as in the case of MAML. This is inpractical from a computational point of view and needs technical simplifications (Nichol et al., 2018) . By introducing a series of synthetic gradient networks in a way similar to Jaderberg et al. (2017) , the computation will be decoupled into computations within each layer, and thus becomes more feasible. We see this as a potential advantage of our method and leave this to our future work3 .

Classifier forward SGD θ 0 SGD SGD θ 1 θ K x t f(x t ) f x l t f(x l t ) init y l t θ f(x) . detach() ŷ grad Classifier backward ∇ θ D KL ξ( ŷ ) ≈ ∂ℓ ∂ ŷ ξ λ Classifier forward ŷ t Loss y t KL ℓ t D KL (q θ K∥p ψ ) + -ELBO

Synthetic gradient module:

Figure 2 : The computation graph to compute the negative ELBO, where the input and output of the synthetic gradient module are highlighted in red. The detach() is used to stop the back-propagation down to the feature network. Note that we do not include every computation for simplicity.

Algorithm 1 Variational inference with synthetic gradients for empirical Bayes 1: Input: the dataset D; the step size η; the number of inner iterations K; pretrained f . 2: Initialize the meta-models ψ, and φ = (λ, ξ).

3: while not converged do 4:

Sample a task t and the associated query set d t (plus optionally the support set d l t ).

5::

Compute the initialization θ 0 t = λ or θ 0 t = λ(d l t ).

6::

for k = 1, . . . , K do 7:

Compute θ k t via (10).

8:

end for 9:

Compute w t = w t (θ K t , ) with ∼ p( ).

10:

Update ψ ← ψ -η ∇ ψ D KL (q θ K t (ψ) p ψ ). 11: Update φ ← φ -η ∇ φ D KL (q φ(xt) p f • p ψ ).

12:

Optionally, update f ← f + η ∇ f log p f (d t |w t ). 13: end while

4. GENERALIZATION ANALYSIS OF EMPIRICAL BAYES VIA THE CONNECTION TO INFORMATION BOTTLENECK:

The learning of empirical Bayes (EB) models follows the frequentist's approach, therefore, we can use frequentist's tool to analyze the model. In this section, we study the generalization ability of the empirical Bayes model through its connection to a variant of the information bottleneck principle Achille & Soatto (2017); Tishby et al. (2000) .

Abstract form of empirical Bayes From (3), we see that the empirical Bayes model implies a simpler joint distribution since

EQUATION

which is equal to the log-density of N iid samples drawn from the joint distribution

p(w, d, t) ≡ p ψ,f (w, d, t) = p f (d|w, t)p ψ,f (w)p(t) 4 (12)

up to a constant if we introduce a random variable to represent the task and assume p(t) is an uniform distribution. We thus see that this joint distribution embodies the generative process of empirical Bayes. Correspondingly, there is another graphical model of the joint distribution characterizes the inference process of the empirical Bayes:

q(w, d, t) ≡ q φ (w, d, t) = q φ (w|d, t)q(d|t)q(t),

where q φ (w|d, t) is the abstract form of the variational posterior with amortization, includes both the inductive form and the transductive form. The coupling between p(w, d, t) and q(w, d, t) is due to p(t) ≡ q(t) as we only have access to tasks through sampling.

We are interested in the case that the number of tasks N → ∞, such as the few-shot learning paradigm proposed by Vinyals et al. (2016) , in which the objective of ( 7) can be rewritten in an abstract form of E q(t) E q(d|t) E q(w|d,t) -log p(d|w, t) + D KL q(w|d, t) p(w) .

In fact, optimizing this objective is the same as optimizing ( 7) from a stochastic gradient descent point of view.

The learning of empirical Bayes with amortized variational inference can be understood as a variational EM in the sense that the E-step amounts to aligning q(w|d, t) with p(w|d, t) while the M-step amounts to adjusting the likelihood p(d|w, t) and the prior p(w).

Connection to information bottleneck:

The following theorem shows the connection between ( 14) and the information bottleneck principle. Theorem 1. Given distributions q(w|d, t), q(d|t), q(t), p(w) and p(d|w, t), we have

EQUATION

where I q (w; d|t) := D KL q(w, d|t) q(w|t)q(d|t) is the conditional mutual information and H q (w|d, t) := E q(w,d,t) [-log q(w|d, t)] is the conditional entropy. The equality holds when ∀t : D KL (q(w|t) p(w)) = 0 and D KL (q(d|w, t) p(d|w, t)) = 0.

In fact, the lower bound on ( 14) is an extention of the information bottleneck principle (Achille & Soatto, 2017) under the multi-task setting, which, together with the synthetic gradient based variational posterior, inspire the name synthetic information bottleneck of our method. The tightness of the lower bound depends on both the parameterizations of p f (d|w, t) and p ψ (w) as well as the optimization of ( 14). It thus can be understood as how well we can align the inference process with the generative process. From an inference process point of view, for a given q(w|d, t), the optimal likelihood and prior have been determined. In theory, we only need to find the optimal q(w|d, t) using the information bottleneck in (19). However, in practice, minimizing ( 14) is more straightforward.

Generalization of empirical Bayes meta-learning:

The connection to information bottleneck suggests that we can eliminate p(d|w, t) and p(w) from the generalization analysis of empirical Bayes meta-learning and define the generalization error by q(w, d, t) only. To this end, we first identify the empirical risk for a single task t with respect to particular weights w and dataset d as

EQUATION

The true risk for task t with respect to w is then the expected empirical risk E d∼q(d|t) L t (w, d). Now, we define the generalization error with respect to q(w, d, t) as the average of the difference between the true risk and the empirical risk over all possible t, d, w:

gen(q) := E q(t)q(d|t)q(w|d,t) E d∼q(d|t) L t (w, d) -L t (w, d)

= E q(t)q(d|t)q(w|t) L t (w, d) -E q(t)q(d|t)q(w|d,t) L t (w, d),

where q(w|t) is the aggregated posterior of task t.

Next, we extend the result from Xu & Raginsky (2017) and derive a data-dependent upper bound for gen(q) using mutual information. Theorem 2. Denote by z = (x, y). If t (ŷ i (f (x i ), w), y i ) ≡ t (w, z i ) is σ-subgaussian under q(w|t)q(z|t), then L t (w, d) is σ/ √ n-subgaussian under q(w|t)q(d|t) due to the iid assumption, and gen(q) ≤ 2σ 2 n I q (w; d|t).

Plugging this back to Theorem 1, we obtain a different interpretation for the empirical Bayes ELBO. Corollary 1. If t is chosen to be the negative log-likelihood, minimizing the population objective of empirical Bayes meta-learning amounts to minimizing both the expected generalization error and the expected empirical risk:

(14) ≥ n 2σ 2 gen(q) 2 + E q(t)q(d|t)q(w|d,t) L t (w, d).

(17)

The Corollary 1 suggests that ( 14) amounts to minimizing a regularized empirical risk minimization.

In general, there is a tradeoff between the generalization error and the empirical risk controlled by the coefficient n 2σ 2 , where n = |d| is the cardinality of d. If n is small, then we are in the overfitting regime. This is the case of the inductive inference with variational posterior q(w|d l , t), where the support set d l is fairly small by the definition of few-shot learning. On the other hand, if we were following the transductive setting, we expect to achieve a small generalization error since the implemented variational posterior is a better approximation to q(w|d, t). However, keeping increasing n will potentially over-regularize the model and thus yield negative effect. An empirical study on varying n can be found in Table 5 in Appendix D.

5. EXPERIMENTS:

In this section, we first validate our method on few-shot learning, and then on zero-shot learning (no support set and no class description are available). Note that many meta-learning methods cannot do zero-shot learning since they rely on the support set.

5.1. FEW-SHOT CLASSIFICATION:

We compare SIB with state-of-the-art methods on few-shot classification problems. Our code is available at https://github.com/amzn/xfer. Network architectures Following Gidaris & Komodakis (2018) ; Qiao et al. (2018) ; Gidaris et al. (2019) , we implement f by a 4-layer convolutional network (Conv-4-64 or Conv-4-128 5 ) or a WideResNet (WRN-28-10) (Zagoruyko & Komodakis, 2016) . We pretrain the feature network f (•) on the 64 training classes for a stardard 64-way classification. We reuse the feature averaging network proposed by Gidaris & Komodakis (2018) as our initialization network λ(•), which basically averages the feature vectors of all data points from the same class and then scales each feature dimension differently by a learned coefficient. For the synthetic gradient network ξ(•), we implement a three-layer MLP with hidden-layer size 8k. Finally, for the predictor ŷij (•, w i ), we adopt the cosine-similarity based classifier advocated by Chen et al. (2019) and Gidaris & Komodakis (2018) . Training details We run SGD with batch size 8 for 40000 steps, where the learning rate is fixed to 10 -3 . During training, we freeze the feature network. To select the best hyper-parameters, we sample 1000 tasks from the validation classes and reuse them at each training epoch.

5.1.2. COMPARISON TO STATE-OF-THE-ART META-LEARNING METHODS:

In Table 2 , we show a comparison between the state-of-the-art approaches and several variants of our method (varying K or f (•)). Apart from SIB, TPN (Liu et al., 2018) and CTM (Li et al., 2019) are also transductive methods.

First of all, comparing SIB (K = 3) to SIB (K = 0), we observe a clear improvement, which suggests that, by taking a few synthetic gradient steps, we do obtain a better variational posterior as promised. For 1-shot learning, SIB (when K = 3 or K = 5) significantly outperforms previous methods on both MiniImageNet and CIFAR-FS. For 5-shot learning, the results are also comparable.

It should be noted that the performance boost is consistently observed with different feature networks, which suggests that SIB is a general method for few-shot learning.

However, we also observe a potential limitation of SIB: when the support set is relatively large, e.g., 5-shot, with a good feature network like WRN-28-10, the initialization θ 0 t may already be close to some local minimum, making the updates later less important.

For 5-shot learning, SIB is sligtly worse than CTM (Li et al., 2019) and/or Gidaris et al. (2019) . CMT (Li et al., 2019) can be seen as an alternative way to incorporate transduction -it measures the similarity between a query example and the support set while making use of intra-and inter-class relationships. Gidaris et al. (2019) uses in addition the self-supervision as an auxilary loss to learn a richer and more transferable feature model. Both ideas are complementary to SIB. We leave these extensions to our future work. Since our variational posterior relies only on x t , SIB is also applicable to zero-shot problems (i.e., no support set available). We first look at a toy multi-task problem, where I(w t ; d t ) is tractable.

5.2. ZERO-SHOT REGRESSION: SPINNING LINES:

Denote by D train := {d t } N t=1 the train set, which consists of datasets of size n: d = {(x i , y i )} n i=1 . We construct a dataset d by firstly sampling iid Gaussian random variables as inputs: x i ∼ N (µ, σ 2 ). Then, we generate the weight for each dataset by calculating the mean of the inputs and shifting with a Gaussian random variable w : w = 1 n i x i + w , w ∼ N (µ w , σ 2 w ). The output for x i is y i = w • x i . We decide ahead of time the hyperparameters µ, σ, µ w , σ w for generating x i and y i . Recall that a weighted sum of iid Gaussian random variables is still a Gaussian random variable. Specifically, if w = i c i x i and

x i ∼ N (µ i , σ 2 i ), then w ∼ N ( i c i µ i , i c 2 i σ 2 i )

. Therefore, we have p(w) = N (µ + µ w , 1 n σ 2 + σ 2 w ). On the other hand, if we are given a dataset d of size n, the only uncertainty about w comes from w , that is, we should consider x i as a constant given d. Therefore, the posterior p(w|d) = N ( 1 n n i=1 x i + µ w , σ 2 w ). We use a simple implementation for SIB: The variational posterior is realized by

EQUATION

t is a mean squared error, implies that p(y|x, w) = N (wx, 1); p ψ (w) is a Gaussian distribution with parameters ψ ∈ R 2 ; The synthetic gradient network ξ is a three-layer MLP with hidden size 8.

In the experiment, we sample 240 tasks respectively for both D train and D test . We learn SIB and BNN on D train for 150 epochs using the ADAM optimizer (Kingma & Ba, 2014) , with learning rate 10 -3 and batch size 8. Other hyperparameters are specified as follows: n = 32, K = 3, µ = 0, σ = 1, µ w = 1, σ w = 0.1. The results are shown in Figure 3 . On the left, both D KL (q θ K t (w t ) p(w t |d t )) and D KL (p ψ (w) p(w)) are close to zero indicating the success of the learning. More interestingly, in the middle, we see that θ 0 t , θ 1 t , . . . , θ 4 t evolves gradually towards the ground truth, which suggests that the synthetic gradient network is able to identify the descent direction after meta-learning.

6. CONCLUSION:

We have presented an empirical Bayesian framework for meta-learning. To enable an efficient variational inference, we followed the amortized inference paradigm, and proposed to use a transductive scheme for constructing the variational posterior. To implement the transductive inference, we make use of two neural networks: a synthetic gradient network and an initialization network, which together enables a synthetic gradient descent on the unlabeled data to generate the parameters of the amortized variational posterior dynamically. We have studied the theoretical properties of the proposed framework and shown that it yields performance boost on MiniImageNet and CIFAR-FS for few-shot classification.

Proof. Denote by q(w|t) := E q(d|t) q(w|d, t)q(d|t) the aggregated posterior of task t. ( 14) can be decomposed as E q(t) E q(d|t) E q(w|d,t) -log p(d|w, t) + D KL q(w|d, t) p(w) (20)

= E q(t) E q(d|t) E q(w|d,t) log q(w|d, t)q(w|t) p(d|w, t)p(w)q(w|t)

= E q(t) E q(d|t) E q(w|d,t) log q(w|d, t) q(w|t) + E q(t) E q(d|t) E q(w|d,t) -log p(d|w, t)

+ E q(t) E q(d|t) E q(w|d,t) log q(w|t) p(w)

= I q (w; d|t) + H q,p (d|w, t) + E q(t) D KL (q(w|t) p(w)) (23) ≥ I q (w; d|t) + H q,p (d|w, t).

(

EQUATION

The inequality is because D KL (q(w|t) p(w)) ≥ 0 for all t's. Besides, we used the notation H q,p , which is the conditional cross entropy. Recall that D KL q(d|w, t) p(d|w, t) = -H q (d|w, t) + H q,p (d|w, t) ≥ 0. We attain the lower bound as desired if this inequality is applied to replace H q,p (d|w, t) by H q (d|w, t).

The following lemma and theorem show the connection between I q (w; d|t) and the generalization error. We first extend Xu (2016, Lemma 4.2). Lemma 1. If, for all t, f t (X, Y ) is σ-subgaussain under P X ⊗ P Y , then

EQUATION

Proof. The proof is adapted from the proof of Xu (2016, Lemma 4.2). 

LHS ≤ E:

EQUATION

The second inequality was due to the Donsker-Varadhan variational representation of KL divergence and the definition of subgaussain random variable.

Theorem 2. Denote by z = (x, y). If t (ŷ i (f (x i ), w), y i ) ≡ t (w, z i ) is σ-subgaussian under q(w|t)q(z|t), then L t (w, d) is σ/ √ n-subgaussian under q(w|t)q(d|t) due to the iid assumption, and gen(q) ≤ 2σ 2 n I q (w; d|t).

Proof. First, if t (ŷ(f (x), w), y) is σ-subgaussian under q(w|t)q(z|t), by definition, Table 3 : Multi-source domain adaptation results on PACS with ResNet-18 features. Three domains are used as the source domains keeping the fourth one as target.

EQUATION

By Lemma 1, we have gen(q) = E q(t) E q(w|d,t)q(d|t) L t (w, d) -E q(w|t)q(d|t) L t (w, d)

≤ 2σ 2 n I(w; d|t) (37) as desired.

B ZERO-SHOT CLASSIFICATION: UNSUPERVISED MULTI-SOURCE DOMAIN ADAPTATION:

A more interesting zero-shot multi-task problem is unsupervised domain adaptation. We consider the case where there exists multiple source domains and a unlabeled target domain. In this case, we treat each minibatch as a task. This makes sense because the difference in statistics between two minibatches are much larger than in the traditional supervised learning. The experimental setup is similar to few-shot classification described in Section 5.1, except that we do not have a support set and the class labels between two tasks are the same. Hence, it is possible to explore the relationship between class labels and self-supervised labels to implement the initialization network λ without resorting to support set. We reuse the same model implementation for SIB as described in Section 5.1. The only difference is the initialization network. Denote by z t := {z t,i } n i=1 the set of self-supervised labels of task t, the initialization network λ is implemented as follows: θ 0 t = λ -η ∇ θ L t ẑt ŷt (f (x t ), w t (θ, )), f (x t ) , z t ,

where λ6 is a global initialization similar to the one used by MAML; L t is the self-supervised loss, ẑt is the set of predictions of the self-supervised labels. One may argue that θ 0 t = λ would be a simpler solution. However, it is insufficient since the gap between two domains can be very large. The initial solution yielded by ( 38) is more dynamic in the sense that θ 0 t is adapted taking into account the information from x t .

In terms of experiments, we test SIB on the PACS dataset (Li et al., 2017a) , which has 7 object categories and 4 domains (Photo, Art Paintings, Cartoon and Sketches), and compare with stateof-the-art algorithms for unsupervised domain adaptation. We follow the standard experimental setting (Carlucci et al., 2019) , where the feature network is implemented by ResNet-18. We assign a self-supervised label z t,i to image i by rotating the image by a predicted degree. This idea was originally proposed by Gidaris et al. (2018) for representation learning and adopted by Xu et al. (2019) for domain adaptation. The training is done by running ADAM for 60 epochs with learning rate 10 -4 . We take each domain in turns as the target domain. The results are shown in Table 3 . It can be seen that SIB-Rot (K = 3) improves upon the baseline SIB-Rot (K = 0) for zero-shot classification, which also outperforms state-of-the-art methods when the baseline is comparable.

C IMPORTANCE OF SYNTHETIC GRADIENTS:

To further verify the effectiveness of the synthetic gradient descent, we implement an inductive version of SIB inspired by MAML, where the initialization θ 0 t is generated exactly the same way as SIB using λ(d l t ), but it then follows the iterations in (6) as in MAML rather than follows the iterations in (10) as in standard SIB.

:

To distinguish from testing and training within a task, meta-testing and meta-training are referred to as testing and training over tasks.

θ K t is also dependent of f . We deliberately remove this dependency to simplify the update of f .

We do not insist on Bayesian estimation of the feature network because most Bayesian versions of CNNs underperform their deterministic counterparts.

Conv-4-64 consists of 4 convolutional blocks each implemented with a 3 × 3 convolutional layer followed by BatchNorm + ReLU + 2 × 2 max-pooling units. All blocks of Conv-4-64 have

feature channels. Conv-4-128 has 64 feature channels in the first two blocks and 128 feature channels in the last two blocks.

λ is overloaded to be both the network and its parameters.

Figures and Tables:

Figure 1: (a) The generative and inference processes of the empirical Bayes model are depicted in solid and dashed arrows respectively, where the meta-parameters are denoted by dashed circles due to the point estimates. A comparison between MAML (6) and our method (SIB) (10) is shown in (b) and (c).MAML is an inductive method since, for a task t, it first constructs the variational posterior (with parameter θ K ) as a function of the support set d l t , and then test on the unlabeled x t ; while SIB uses a better variational posterior as a function of both d l t and x t : it starts from an initialization θ 0 t (d l t ) generated using d l t , and then yields θ K t by running K synthetic gradient steps on x t .

We choose standard benchmarks of few-shot classification for this experiment. Each benchmark is composed of disjoint training, validation and testing classes. MiniImageNet is proposed by Vinyals et al. (2016), which contains 100 classes, split into 64 training classes, 16 validation classes and 20 testing classes; each image is of size 84×84. CIFAR-FS is proposed by Bertinetto et al. (2018), which is created by dividing the original CIFAR-100 into 64 training classes, 16 validation classes and 20 testing classes; each image is of size 32×32. Evaluation metrics In few-shot classification, a task (aka episode) t consists of a query set d t and a support set d l t . When we say the task t is k-way-n l -shot we mean that d l t is formed by first sampling k classes from a pool of classes; then, for each sampled class, n l examples are drawn and a new label taken from {0, . . . , k -1} is assigned to these examples. By default, each query set contains 15k examples. The goal of this problem is to predict the labels of the query set, which are provided as ground truth during training. The evaluation is the average classification accuracy over tasks.

) ≤ E P (T ) 2σ 2 D KL (P (X, Y |T ) P (X|T )P (Y |T )) (27) ≤ 2σ 2 E P (T ) D KL (P (X, Y |T ) P (X|T )P (Y |T )) (28) = 2σ 2 I(X; Y |T ).

Average classification accuracies (with 95% confidence intervals) on the test-set of Mini-ImageNet and CIFAR-FS. For evaluation, we sample 2000 and 5000 episodes respectively for MiniImageNet and CIFAR-FS and test three different architectures as the feature extractor: Conv-4-64, Conv-4-128 and WRN-28-10. We train SIB with learning rate 0.001 and try different numbers of synthetic gradient steps K.

Table content: <table/>

Left: the mean-square errors on D test , E t D KL (q θ K t (w t ) p(w t |d t )), D KL (p ψ (w) p(w)) and the estimate of I(w; d) ≈ E t D KL (q θ K t (w t ) p ψ (w t )). Middle: the predicted y's by y = θ k t x for k = 0, . . . , 4. Right: the predictions of SIB.

Table content: <table><tr><td>GT of task 1</td></tr><tr><td>SIB predictions</td></tr><tr><td>GT of task 2</td></tr><tr><td>SIB predictions</td></tr><tr><td>GT of task 3</td></tr><tr><td>SIB predictions</td></tr><tr><td>Figure 3:</td></tr></table>

Peer review (iclr2020):
This paper addresses the issue of meta-learning in a transductive learning setting. That is, it aims to learn a model from multiple tasks and make it generalise to a new task in order to solve it efficiently. In the transductive setting, the query set (i.e., containing the unlabeled test data) of the new task is taken into account when learning the model. This paper takes the empirical Bayes approach to meta-learning. In order to utilise the test data that do not access to groundtruth labels, it proposes to use synthetic gradient to implement the tranductive learning. A multi-layer perceptron network is used to systhesize the gradient. Theoretical analysis is conducted to demonstrate the generalization capability of the proposed model and reveal its connection to the information bottleneck principle in the literature of neural networks. Overall, this is a well organised and nicely presented work. The idea on how to utilise the unlabeled test data to realise tranductive learning is novel; the analysis is thorough; and experimental study is provided to show the effectiveness of the proposed method. Meanwhile, this work can address the following issues: 1. The first paragraph on page 5, which describes the key step of syntheising gradient, can be made clearer; 2. In the experimental study, Table 1 compares various methods with the proposed one. It will be helpful to clearly indicate for each method in comparison whether/how it also utilises the query set. This will give more context in interpreting the comparison results; 3. The advantage of the proposed method seems to diminish quickly from 1-shot to 5-shot settings. Does this mean in the case of 5 (or more)-shot setting, considering unlabeled test data with the proposed method could even adversely affect the meta-learning performance? Please comment. 4. Since the proposed method works in a tranductive manner, it is presumed that the whole model needs to be retrained/updated once a new set of query data (e.g., for the same task or another new task) is given? In other words, how does the trained model generalise to unseen unlabeled test data? Please provide some discussion on this issue. 5. Finally, how is the computational complexity of training the proposed EB model?