Multi-task learning aims to explore task relatedness to improve individual tasks, which is of particular significance in the challenging scenario that only limited data is available for each task. To tackle this challenge, we propose variational multi-task learning (VMTL), a general probabilistic inference framework for learning multiple related tasks. We cast multi-task learning as a variational Bayesian inference problem, in which task relatedness is explored in a unified manner by specifying priors. To incorporate shared knowledge into each task, we design the prior of a task to be a learnable mixture of the variational posteriors of other related tasks, which is learned by the Gumbel-Softmax technique. In contrast to previous methods, our VMTL can exploit task relatedness for both representations and classifiers in a principled way by jointly inferring their posteriors. This enables individual tasks to fully leverage inductive biases provided by related tasks, therefore improving the overall performance of all tasks. Experimental results demonstrate that the proposed VMTL is able to effectively tackle a variety of challenging multi-task learning settings with limited training data for both classification and regression. Our method consistently surpasses previous methods, including strong Bayesian approaches, and achieves state-of-the-art performance on five benchmark datasets.

§ INTRODUCTION

Multi-task learning [9] exploits knowledge shared among related tasks to improve their overall performance. This is especially significant when only limited data is available for each task. The central goal in multi-task learning is to explore task relatedness to improve each individual task [3, 59], which is non-trivial since the underlying relationships among tasks can be complicated and highly nonlinear [57]. Early works deal with this by learning shared features, designing regularizers imposed on parameters [41, 26, 25, 23] or exploring priors over parameters [22, 4, 53, 58, 59]. Recently, multi-task deep neural networks have been developed, learning shared representations in the feature layers while keeping classifier layers independent [36, 42, 60, 34]. Some methods  [35, 27, 10, 15] learn a small number of related tasks based on one shared input. However, lots of training data is usually available. Few-shot learning [13] addresses multi-task learning with limited data, but usually relies on a large number of related tasks. Further, in general, most existing works explore either representations or classifiers for shared knowledge, leaving exploring them jointly an open problem.

In this work, we tackle the following challenging multi-task learning setting [36]: each task contains very limited training data and only a handful of related tasks are available to gain shared knowledge from. In addition, instead of sharing the same input, each of the multiple tasks has its own input space from a different domain and these tasks are related by sharing the same target space, e.g., the same class labels in classification tasks. In this setting, it is difficult to learn a proper model for each task independently without overfitting [36, 57]. It is therefore crucial to leverage the inductive bias [5] provided by related tasks learned simultaneously.

To address this, we propose variational multi-task learning (VMTL), a novel variational Bayesian inference approach that can explore task relatedness in a unified way. Specifically, as shown in Fig. <ref>, we develop a probabilistic latent variable model by treating both the feature representation and the classifier as latent variables. To explore task relatedness, we place conditional priors over the latent variables, which are dependent on data from other related tasks. By doing so, multi-task learning is cast as the joint variational inference of feature representations and classifiers for all tasks in a single unified framework. The probabilistic framework enables the model to better capture the uncertainty caused by limited data in each task [14].

A graphical illustration of the proposed model for multi-task learning. ($\mathbf{x}_{t, n}$, $\mathbf{y}_{t, n}$) is the $n$-th sample from task $t$. $\mathbf{w}_t$ and $\mathbf{z}_{t, n}$ are the introduced latent variables, i.e., a classifier/regressor and representation, respectively, whose priors are conditioned on the data from other tasks, $\mathcal{D}_{1:T \backslash t}$.

To leverage the knowledge provided by related tasks, we propose to specify the priors of each task as a mixture of the variational posteriors of other tasks. In particular, the mixing weights are constructed with the Gumbel-Softmax technique [24] and jointly learned with the probabilistic modeling parameters by back-propagation. The obtained Gumbel-Softmax priors enable the model to effectively explore different correlation patterns among tasks and, more importantly, provide a unified way to explore shared knowledge jointly for representations and classifiers.
We validate the effectiveness of the proposed VMTL by extensive evaluation on five multi-task learning benchmarks with limited data for both classification and regression. The results demonstrate the benefit of variational Bayesian inference for modeling multi-task learning. VMTL consistently achieves state-of-the-art performance and surpasses previous methods on all tasks.

§ METHODOLOGY

Consider a set of $T$ related tasks, each of which is a classification or regression problem. Tasks in this paper share the same label space for classification or the same target space for regression but have different distributions. Each task $t$ has its own training data $\mathcal{D}_t = \{ \mathbf{x}_{t,n}, \mathbf{y}_{t,n}\}_{n=1}^{N_t}$, where ${N_t}$ is the number of training samples. We consider the challenging setting where each task has limited labeled data, which makes it difficult to learn a proper model for each task independently [36, 57]. In contrast to most previous works, we will explore the knowledge shared among tasks for learning both the classifiers/regressors and representations of each task. Note that in this section we derive our methodology mainly using terminologies related to classification tasks, but it is also applicable to regression tasks.

§.§ Variational Multi-Task Learning

To better capture uncertainty caused by limited data, we explore multi-task learning in a probabilistic framework. We define the conditional predictive distribution: $p(\mathcal{Y}_t|\mathcal{X}_t, \mathcal{D}_{1:T \backslash t})$ with respect to the current task $\mathcal{D}_t$: ${\mathcal{Y}_t} = \{\mathbf{y}_{t,n}\}^{N_t}_{n=1}$ and ${\mathcal{X}_t} = \{\mathbf{x}_{t,n}\}^{N_t}_{n=1}$, where we use $\mathcal{D}_{1:T\backslash t}$ to denote the data from all tasks excluding $\mathcal{D}_t$ of task $t$.
From a probabilistic perspective, jointly learning multiple tasks amounts to maximizing the conditional predictive log-likelihood as follows:

\begin{equation}
\frac{1}{T}  \sum_{t=1}^{T}  \log  p(\mathcal{Y}_t|\mathcal{X}_t, \mathcal{D}_{1:T \backslash t})
= \frac{1}{T}  \sum_{t=1}^{T} \sum_{n=1}^{N_t} \log  p(\mathbf{y}_{t, n}|\mathbf{x}_{t, n}, \mathcal{D}_{1:T \backslash t}).
\label{cll}
\end{equation}

We condition the prediction for samples in each task on the data of other tasks, $\mathcal{D}_{1:T \backslash t}$, to leverage the shared knowledge from related tasks.

The probabilistic multi-task learning formalism in (<ref>) provides a general framework to explore task relatedness by conditioning on other tasks. More importantly, it enables the model to incorporate shared knowledge from related tasks into the learning of both the classifier and the feature representation in a unified way by specifying their priors.

We introduce the latent variables $\mathbf{w}_t$ and $\mathbf{z}_{t, n}$ to represent the classifier and the latent representation of the sample $\mathbf{x}_{t, n}$, respectively. The joint distribution for the task $t$ can be factorized as

\begin{equation}
\begin{aligned}
p(\mathcal{Y}_t, \mathcal{Z}_t, \mathbf{w}_t|\mathcal{X}_t, \mathcal{D}_{1:T \backslash t})
&= \prod_{n=1}^{N_t}  p(\mathbf{y}_{t, n}|\mathbf{z}_{t, n}, \mathbf{w}_t) p(\mathbf{z}_{t, n}|\mathbf{x}_{t, n}, \mathcal{D}_{1:T \backslash t} ) p(\mathbf{w}_{t}|\mathcal{D}_{1:T \backslash t}),
\end{aligned}
\end{equation}

where we use $\mathcal{Z}_t = \{ \mathbf{z}_{t,n}\}_{n=1}^{N_t}$ to collectively represent the set of latent representations of samples in task $t$. Here, we specify conditional priors dependent on other tasks to explore task relatedness. The probabilistic latent variables capture uncertainties at different levels: $\mathbf{z}_{t, n}$ captures the uncertainty of each sample, while $\mathbf{w}_t$ works at the categorical level.
A graphical illustration of the probabilistic latent variable model is shown in Fig. <ref>.

Solving the model for multi-task learning involves inferring the true joint posterior $p (\mathcal{Z}_t, \mathbf{w}_t |\mathcal{D}_{1:T} )$ over all latent variables $\mathcal{Z}_t$ and $\mathbf{w}_t$, which is generally intractable. We introduce a variational joint distribution $q(\mathcal{Z}_t, \mathbf{w}_t| \mathcal{D}_t)$ for the current task to approximate the true posterior. Also under the conditional independence assumption, the joint variational posterior distribution can be factorized with respect to classifiers and latent representations as follows:

\begin{equation}
\begin{aligned}
q(\mathcal{Z}_t, \mathbf{w}_t|\mathcal{D}_t)
= q_{\theta}(\mathbf{w}_{t}|\mathcal{D}_t) \prod_{n=1}^{N_t} q_{\phi}(\mathbf{z}_{t, n}|\mathbf{x}_{t, n}),
\end{aligned}
\end{equation}

where $q_{\theta}(\mathbf{w}_{t}|\mathcal{D}_t)$ and $q_{\phi}(\mathbf{z}_{t, n}|\mathbf{x}_{t, n})$ are variational posterior distributions for classifiers and latent representations respectively, and $\theta$ and $\phi$ are the associated parameters. For computational feasibility, they are defined as fully factorized Gaussians, as is common practice [31, 6].

To obtain a good approximation, the variational posterior should be close to the true posterior. This is usually achieved by minimizing the Kullback-Leibler (KL) divergence between them:

\begin{equation}
\mathbb{D}_{\rm{KL}} \big[ q(\mathcal{Z}_t, \mathbf{w}_t|\mathcal{D}_t) || p(\mathcal{Z}_t, \mathbf{w}_t |\mathcal{D}_{1:T})\big].
\label{kl}
\end{equation}

By applying Bayes’ rule to the true posterior, we derive the evidence lower-bound (ELBO) with the probabilistic classifier and representation for the conditional predictive log-likelihood in (<ref>) :

\begin{equation}
\begin{aligned}
\frac{1}{T}    \sum_{t=1}^{T}  \log   p( \mathcal{Y}_t  |\mathcal{X}_t,  \mathcal{D}_{1:T \backslash t} )  \geq  \frac{1}{T}\sum^T_{t=1}\bigg\{ \sum^{N_t}_{n=1} \Big\{ \mathbb{E}_{\mathbf{w}_t\sim q_{\theta}} \mathbb{E}_{{\mathbf{z}_{t,n}}\sim q_{\phi}} [ \log p(\mathbf{y}_{t, n}|\mathbf{z}_{t, n}, \mathbf{w}_t) ] & \\
- \mathbb{D}_{\rm{KL}} [q_{\phi}(\mathbf{z}_{t, n}|\mathbf{x}_{t, n}) || p(\mathbf{z}_{t, n}|\mathbf{x}_{t, n}, \mathcal{D}_{1:T \backslash t})] \Big\}  - \mathbb{D}_{\rm{KL}} \big[ q_{\theta}(\mathbf{w}_t|\mathcal{D}_{t}) || p(\mathbf{w}_t|\mathcal{D}_{1:T \backslash t}) \big]\bigg\}.
\label{vmtl_elbo}
\end{aligned}
\end{equation}

The objective function provides a general probabilistic inference framework for multi-task learning. As priors naturally serve as regularizations in Bayesian inference, they offer a unified way of sharing information across multiple tasks for improving both classifiers and representations. The detailed derivation is given in the supplementary materials.

In what follows, we will describe the specification of the prior distributions over the classifier and the representation, as well as their variational posterior distributions.

§.§ Learning Task Relatedness via Gumbel-Softmax Priors

The proposed variational multi-task inference framework enables related tasks to provide supportive information for the current task through the conditional priors of the latent variables. It offers a unified way to incorporate shared knowledge from related tasks into the inference of representations and classifiers for individual tasks.

To leverage the shared knowledge, we propose to specify the prior of the classifier for the current task using the variational posteriors over classifiers of other tasks:

\begin{equation}
\begin{aligned}
p(\mathbf{w}^{(\eta)}_t|\mathcal{D}_{1:T \backslash t}) :=  \sum_{i \neq t} \mathcal{\alpha}_{ti} q_{\theta}(\mathbf{w}^{(\eta-1)}_i|\mathcal{D}_i),
\end{aligned}
\label{pw_gumbel}
\end{equation}

where $\eta$ denotes the $\eta$-th iteration. In practice, to avoid entanglement among tasks, we define the prior of task $t$ in the current iteration to be a combination of the variational posteriors [44] of the remaining tasks from the last iteration. Particularly, our designed prior resembles the empirical Bayesian prior [22, 4, 51, 49] in that the prior of each task is specified by the observed data of other tasks, which provides a principled way to explore the shared knowledge among multiple tasks.

During training, we aim to have each task learn more shared knowledge from its most relevant tasks, while maximally reducing the interference from irrelevant tasks.
To this end, we adopt the Gumbel-Softmax technique learn the mixing weights for all related tasks and define the mixing weights as follows:

\begin{equation}
\mathcal{\alpha}_{ti} = \frac{ \exp ( (\log \pi_{ti}  + g_{ti} ) / \tau) }{ \sum_{i \neq t} \exp( (\log \pi_{ti} + g_{ti} ) / \tau))}.
\label{gumbel}
\end{equation}

Here $\alpha_{ti}$ is the mixing weight that indicates the relatedness between tasks $t$ and $i$. $\pi_{ti}$ is the learnable parameter in the Gumbel-Softmax formulation, which denotes the probability of two tasks transferring positive knowledge.

$g_{ti}$ is sampled from a Gumbel distribution, using inverse transform sampling by drawing $u \sim \text{Uniform}(0, 1)$ and computing $g = - \log( - \log(u))$. $\tau$ is the softmax temperature.

By using the Gumbel-Softmax technique, our model effectively handles possible negative transfer between tasks. The Gumbel-Softmax technique encourages the model to reduce the interference from the less relevant tasks by minimizing the corresponding mixing weights. The more negative the effects of interference between pairwise tasks are, the smaller the mixing weight is likely to be.

With respect to the inference of the variational posteriors, we define them as fully factorized Gaussians for each class independently:

\begin{equation}
\begin{aligned}
q_{\theta}(\mathbf{w}_t| \mathcal{D}_{t}) = \prod_{c=1}^{C} q_{\theta}(\mathbf{w}_{t,c}| \mathcal{D}_{t,c}) = \prod_{c=1}^{C}\mathcal{N}(\boldsymbol{\mu}_{t,c},\text{diag}(\boldsymbol{\sigma}^2_{t,c})).
\end{aligned}
\label{qw}
\end{equation}

where $\boldsymbol{\mu}_{t,c}$ and $\boldsymbol{\sigma}^2_{t,c}$ can be directly learned with back-propagation [6].

As an alternative to direct inference, classifiers can also be inferred by the amortization technique [19], which will further reduce the computational cost. In particular, different classes share the inference network to generate the parameters of the specific classifier. In practice, the inference network takes the mean of the feature representations in each class as input and returns the parameters $\boldsymbol{\mu}_{t,c}$  and $\boldsymbol{\sigma}_{t,c}$ for $\mathbf{w}_{t,c}$.
The amortized classifier inference enables the cost to be shared across classes, which reduces the overall cost. Therefore, it offers an effective way to handle scenarios with a large number of object classes and can still produce competitive performance, as shown in our experiments, even in the presence of the amortization gap [11].

In a similar way to (<ref>), we specify the prior over the latent representation $\mathbf{z}_{t, n}$ of a sample $\mathbf{x}_{t, n}$ as a mixture of distributions conditioned on the data of every other task, as follows:

\begin{equation}
p(\mathbf{z}^{(\eta)}_{t, n}|\mathbf{x}_{t, n}, \mathcal{D}_{1:T \backslash t}) := \sum_{i \neq t} {\beta}_{ti} q_{\phi}(\mathbf{z}^{(\eta-1)}_{t, n}|\mathbf{x}_{t,n}, \mathcal{D}_i).
\label{pz_gumbel}
\end{equation}

Here, $\beta$ is the mixing weight which is defined in a similar way as in (<ref>). The conditional distribution $q_{\phi}(\mathbf{z}_{t, n}| \mathbf{x}_{t,n}, \mathcal{D}_i)$ on the right hand side of (<ref>) indicates that we leverage the data $\mathcal{D}_i$ from every other task $i$ to help the model infer the latent representation of $\mathbf{x}_{t,n}$. The contribution of each other task is determined by the learnable mixing weight. In practice, the distribution $q_{\phi}(\mathbf{z}_{t, n}| \mathbf{x}_{t,n}, \mathcal{D}_i)$ is inferred by an amortized network [16, 31].

To be more specific, the inference network takes an aggregated representation of $\mathbf{x}_{t,n}$ and $\mathcal{D}_i$ as input and returns the parameters of distribution $q_\phi$.
The aggregated representation is formulated as (<ref>) which is established by the cross attention mechanism [28].
The sample $\mathbf{x}_{t,n}$ from the current task acts as a query, and $D_{i,c}$ plays the roles of the key and the value. $D_{i,c}$ includes samples from the $i$-th task, which have the same label as $\mathbf{x}_{t, n}$. This is formulated as:

\begin{equation}
\begin{aligned}
f(\mathbf{x}_{t, n}, \mathcal{D}_i)
= \mathrm{DotProduct}(\mathbf{x}_{t, n},D_{i,c},D_{i,c}) :=\mathrm{softmax} (\frac{\mathbf{x}_{t,n}{D^\top_{i,c}}}{\sqrt{d}})D_{i,c},
\label{agg}
\end{aligned}
\end{equation}

where $f$ is the aggregation function, and $D_{i,c}$ is a matrix, with each row containing a sample from class $c$ of the $i$-th related task. $d$ is the dimension of the input feature.

Since we are dealing with supervised learning in this work, class labels of training samples are always available at training time.  The intuition here is to find similar samples to help build the representation of the current sample.

The inference of the variational posterior $q_{\phi}(\mathbf{z}_{t, n}|\mathbf{x}_{t, n})$ over latent representations is also achieved using the amortization technique [16, 31]. The amortized inference network takes $\mathbf{x}_{t,n}$ as input and returns the statistics of its probabilistic latent representation.

§.§ Empirical Objective Function

By integrating (<ref>) and (<ref>) into (<ref>), we obtain the following empirical objective for variational multi-task learning with Gumbel-Softmax priors:

\begin{equation}
\begin{aligned}
& \hat{\mathcal{L}}_{\rm{VMTL}}(   \theta, \phi, \alpha, \beta) = \frac{1}{T}\sum^T_{t=1}  \bigg\{\sum^{N_t}_{n=1}\Big\{  \frac{1}{ML}\sum_{\ell=1}^{L}\sum_{m=1}^{M} \big[ -\log p(\mathbf{y}_t|\mathbf{z}_{t, n}^{(\ell)}, \mathbf{w}_{t}^{(m)}) \big]\\
& + \mathbb{D}_{\rm{KL}} \big[ q_{\phi}(\mathbf{z}_{t, n}|\mathbf{x}_{t, n}) || \sum_{i \neq t} {\beta}_{ti} q_{\phi}(\mathbf{z}_{t, n}| \mathbf{x}_{t, n}, \mathcal{D}_i) \big] \Big\} + \mathbb{D}_{\rm{KL}} \big[ q_{\theta}(\mathbf{w}_t|\mathcal{D}_t) || \sum_{i \neq t} \alpha_{ti} q_{\theta}(\mathbf{w}_i|\mathcal{D}_{i}) \big]\bigg\},
\end{aligned}
\label{empirical loss}
\end{equation}

where $\mathbf{z}_{t, n}^{(\ell)} \sim  q_{\phi}(\mathbf{z}_{t, n}|\mathbf{x}_{t, n})$ and $\mathbf{w}_{t}^{(m)} \sim q_{\theta}(\mathbf{w}_t|\mathcal{D}_t)$. To sample from the variational posteriors, we adopt the reparameterization trick [31]. $L$ and $M$ are the number of Monte Carlo samples for the variational posteriors of latent representations and classifiers, respectively.  In practice, $L$ and $M$ are set to 10, which yields good performance while being computationally efficient. We investigate the sensitivity of $L$ and $M$ in the supplementary materials.
${\theta}$ represents the statistical parameters associated with the classifiers or the inference parameters for the amortized classifier; ${\phi}$ denotes parameters of the shared inference network for the latent representation.

We minimize this empirical objective function to optimize the model parameters jointly. The log-likelihood term is implemented as the cross-entropy loss.
In the practical implementation of the KL terms, we adopt the closed-form solution based on its upper bound as done in [39], e.g.,
$ \mathbb{D}_{\rm{KL}} \big[ q(\mathbf{w}_t) || \sum_{i \neq t} \alpha_{ti} q(\mathbf{w}_i) \big] \leq \sum_{i \neq t} \alpha_{ti} \mathbb{D}_{\rm{KL}} \big[ q(\mathbf{w}_t) ||  q(\mathbf{w}_i) \big]$.
Minimizing the KL terms encourages the model to leverage shared knowledge provided from related tasks at the instance level for representations and at the categorical level for classifiers.

At test time, we obtain the prediction for a test sample $\mathbf{x}_t$ by calculating the following probability using Monte Carlo sampling:

\begin{equation}
p(\mathbf{y}_t|\mathbf{x_t})  \approx  \frac{1}{ML} \sum_{l=1}^{L}\sum_{m=1}^{M} p(\mathbf{y}| \mathbf{z}_t^{(l)}, \mathbf{w}_t^{(m)}),
\end{equation}

where we draw samples from posteriors: $\mathbf{z}_t^{(l)} \sim q_{\phi}(\mathbf{z}|\mathbf{x}) $ and $ {\mathbf{w}_t}^{(m)} \sim  q_{\theta}(\mathbf{w}|\mathcal{D}_t)$.

§ RELATED WORKS

Multi-Task Learning Settings There are mainly two typical multi-task learning settings: single-input multi-output (SIMO) and multi-input multi-output (MIMO). In the first setting different tasks are assumed to share the same input data during both training and testing [57]. Recently, this setting has been integrated into deep neural networks to boost performance for multi-label prediction [42, 47] and various pixel-level prediction tasks, such as depth prediction, semantic segmentation and surface normal prediction [10, 15, 27, 35, 37, 55]. In the multi-input multi-output setting, each task has its own input from a different domain and output [36, 60, 4, 56]. Tasks are related by sharing the same target space, e.g., class label space or regression target space. This setting, which is the focus of our work, is made challenging by the distribution shift between different tasks.

Probabilistic Multi-Task Learning This has been widely developed to explore shared priors for all tasks. The relationships among multiple tasks are investigated by designing priors over model parameters [54, 50, 2, 4] under the Bayesian framework, or sharing the covariance structure of parameters [12]. In particular, Bakker et al. [4] adopted a Bayesian approach which introduces a joint learnable prior distribution that allows similar tasks to share model parameters and others to be more loosely connected. In contrast to these works, our probabilistic modeling explores task relatedness by specifying priors under the variational Bayesian inference framework.

Regularization-based Multi-Task Learning   This has been extensively investigated [57], with the aim of exploring different constraints, e.g., $l_{\infty,1}$ and $l_{p,q}$ norms, imposed on model parameters or features as regularizers [3, 33, 41, 26, 25, 23]. In doing so, similar tasks are encouraged to share the same parameter patterns or the same subset of features.
In particular, Long et al. [36] exploited the task relatedness underlying parameter tensors to regularize the maximum a posteriori estimation. This method was also developed for the multi-input multi-output setting.
In our work, we explore shared knowledge for feature representations and classifiers/regressors jointly in a single framework.

Gumbel-Softmax Technique This technique [24] was recently introduced into multi-task learning for exploring task relationships.
In some multi-task learning models, it is used for searching the optimal architecture for each task by assigning kernels in each convolutional layer [8], choosing the child node during the forward pass [21], or controlling whether the sub-module is skipped [48]. These works were exclusively for the single-input multi-output setting. In our work, we also adopt the Gumbel-Softmax technique for multi-task learning, using it to learn different correlation patterns for individual tasks. In this way, each task is encouraged to find the most relevant tasks for leveraging the shared knowledge, while reducing interference by irrelevant tasks.

§ EXPERIMENTS

We conduct extensive experiments to evaluate the proposed VMTL on five benchmark datasets for both classification and regression tasks. We perform comprehensive comparisons with previous methods and ablation studies to gain insights into the effectiveness of our methods. We report the major experimental results here and provide more results in the supplementary materials.

§.§ Datasets

Office-Home [52] contains images from four domains/tasks: Artistic (A), Clipart (C), Product (P) and Real-world (R). Each task contains images from $65$ object categories collected under office and home settings. There are about $15,500$ images in total.

Office-Caltech [17] contains the ten categories shared between Office-31 [43] and Caltech-256 [20]. One task uses data from Caltech-256 (C), and the other three tasks use data from Office-31, whose images were collected from three distinct domains/tasks, namely Amazon (A), Webcam (W) and DSLR (D). There are $8 \sim 151$ samples per category per task, and $2,533$ images in total.

ImageCLEF [36], the benchmark for the ImageCLEF domain adaptation challenge, contains $12$ common categories shared by four public datasets/tasks: Caltech-256 (C), ImageNet ILSVRC 2012 (I), Pascal VOC 2012 (P), and Bing (B). There are $2,400$ images in total.

DomainNet [40] is a large-scale dataset with approximately 0.6 million images distributed among 345 categories. It contains six distinct domains: Clipart (C), Infograph (I), Painting (P), Quickdraw (Q), Real (R) and Sketch (S). Due to the large number of object categories, this is an extremely challenging benchmark for multi-task learning with limited data. To the best of our knowledge, it has therefore not been used for multi-task learning before.

Rotated MNIST [32] is adopted for angle regression tasks. Each digit denotes one task and the tasks are related because they share the same rotation angle space. Each image is rotated by $0^\circ$ through $90^\circ$ in intervals of $10^\circ$, where the rotation angle is the regression target.

§.§ Experimental Settings

Implementation Details
We adopt the standard evaluation protocols [57] for the  Office-Home, Office-Caltech and ImageCLEF datasets, randomly selecting $5\%$, $10\%$, and $20\%$ of samples from each task in the dataset as the training set, using the remaining samples as the test set [36].
Note that when we use $5\%$, $10\%$ and $20\%$ of labeled data for training, there are on average about $3$, $6$ and $12$ samples per category per task, respectively.
For the large-scale DomainNet dataset, we set the splits to $1\%$, $2\%$ and $4\%$, which also results in an average of $3$, $6$ and $12$ samples per category per task, respectively. For the regression dataset, Rotated MNIST, we set the splits to $0.1\%$ and $0.2\%$, which results in an average of $6$ and $12$ samples per task per angle, respectively. For a fair comparison, all methods in our paper share the same split documents.

The performance in terms of average accuracy with a 95% confidence interval under different proportions of training data on Office-Home, Office-Caltech and ImageCLEF. Best viewed in color.

tableEffectiveness of variational Bayesian representations ($\mathbf{z}$) and classifiers ($\mathbf{w}$).

$\mathbf{z}$      $\mathbf{w}$     5%     10%     20%

$\times$     $\times$
50.4$\pm$0.1     59.5$\pm$0.1     65.6$\pm$0.1

$\checkmark$     $\times$
57.4$\pm$0.0     64.4$\pm$0.1     68.5$\pm$0.1

$\times$     $\checkmark$
56.8$\pm$0.1     63.7$\pm$0.1     68.5$\pm$0.1

$\checkmark$     $\checkmark$
58.3$\pm$0.1     65.0$\pm$0.0     69.2$\pm$0.2

tablePerformance comparison of our Gumbel-Softmax priors with other alternative priors.

Priors     5%     10%     20%

57.5$\pm$0.0     64.4$\pm$0.1     68.5$\pm$0.1

Learnable weighted
57.2$\pm$0.2     64.2$\pm$0.2     68.9$\pm$0.2

58.3$\pm$0.1     65.0$\pm$0.0     69.2$\pm$0.2

Following the experimental settings in [36], we adopt the VGGnet [45], remove the final classifier layer and employ the remaining model to pre-extract the input feature $\mathbf{x}$. From the input, we infer its latent representation $\mathbf{z}$ using amortized inference by multi-layer perceptrons (MLPs) [31].
In our experiments, the temperature of the Gumbel-Softmax priors (<ref>) and (<ref>) is annealed using the same schedule applied in [24]: we start with a high temperature and gradually anneal it to a small but non-zero value.
For the KL-divergence in (<ref>), we use the annealing scheme from [7].

We adopt the Adam optimizer [29] with a learning rate of 1e-4 for training. All the results are obtained based on a $95$% confidence interval from five runs. The detailed network architectures are given in the supplementary materials. The code will be available at https://github.com/autumn9999/VMTL.git.

Baselines Since the multi-task learning setting with limited training data is relatively new, most previous methods designed under other settings are not directly applicable due to the distribution shift between different tasks. To enable a comprehensive comparison, we implement several strong baselines including both Bayesian and non-Bayesian approaches.
The single-task learning (STL) is implemented by task-specific feature extractors and classifiers without sharing knowledge among tasks. The basic multi-task learning (BMTL) is a deterministic model, which has a shared feature extractor and task-specific classifiers. Meanwhile, we define variational Bayesian extensions of STL and BMTL, which we name  VSTL and VBMTL, by placing priors as uninformative standard Gaussian distributions (details can be found in the supplementary materials).
VSTL and VBMTL serve as baselines to directly demonstrate the benefits of the probabilistic modeling of multi-task learning based on variational Bayesian inference.
We use VMTL-AC to represent our proposed method with amortized classifiers. We compare against four representative methods [4, 27, 36, 42], which are implemented by following the same experimental setup as our methods.
Details of the implementation can be found in supplementary materials.

§.§ Results

We demonstrate the effectiveness of our VMTL in handling very limited data, the benefits of variational Bayesian representations and classifiers, and the effectiveness of Gumbel-Softmax priors in learning task relationships.
Detailed information can be found in the supplementary materials.

Effectiveness in Handling Limited Data Our methods are highly effective at handling scenarios with very limited data. To show this, we compare our VMTL and VMTL-AC with other baselines, including single-task baselines (STL and VSTL) and multi-task baselines (BMTL and VBMTL) on the Office-Home, Office-Caltech and  ImageCLEF datasets. We employ a large range of train-test splits, from $5\%$ to $60\%$.
As shown in Fig. <ref>, our proposed VMTL outperforms the baselines on all three datasets with limited data (less than $20\%$) by large margins. The proposed VMTL-AC achieves comparable performance to VMTL on most benchmarks, despite the amortization gap.

We observe that the proposed methods not only show dominant performance in the setting with limited data but also produce comparable even better performance than baselines in the setting with large amounts of data, which demonstrates the effectiveness of our methods in handling challenging scenarios with limited training data.
The proposed methods show less significant improvements under the setting with larger amounts of training data than the setting with limited data. The reason could be that the knowledge transfer becomes less crucial since individual tasks suffer less from over-fitting caused by limited data. Compared with other multi-task learning methods, the proposed methods still show certain improvements under the setting with large amounts of training data.

Effectiveness of Variational Bayesian Approximation
We investigate the effect of variational Bayesian inference for representations and classifiers separately. We conduct these experiments on the Office-Home dataset. The results with different train-test splits are shown in Table <ref>, which indicates whether
$\mathbf{z}$ and $\mathbf{w}$ are probabilistic or not, e.g., a $\times$ for $\mathbf{w}$ means a deterministic classifier.
More detailed experimental results are provided in the supplementary materials. As can be seen, both variational Bayesian representations and classifiers can benefit performance. This benefit becomes more significant when training data is very limited, which indicates the effectiveness of leveraging shared knowledge by conditioning priors on related tasks. In addition, in Fig. <ref>, VSTL demonstrates to be a very strong Bayesian model, which again demonstrates the benefits of variational Bayesian representations and classifiers, even without explicitly leveraging shared knowledge among tasks.

Effectiveness of Gumbel-Softmax Priors
The introduced Gumbel-Softmax priors provide an effective way to learn data-driven task relationships.
To demonstrate this, we compare with two alternatives without the Gumbel-Softmax technique in Table <ref>, including the mean and the learnable weighted posteriors of other tasks. The proposed Gumbel-Softmax priors perform the best, consistently surpassing other alternatives. We would like to highlight that the advantage of Gumbel-Softmax priors is even larger under very limited training data, e.g., $5\%$, which creates a challenging scenario where it is crucial to leverage shared knowledge provided by related tasks. To further investigate the learned Gumbel-Softmax priors, we visualize the values of the mixing weights $\alpha$ and $\beta$ for both VMTL and VMTL-AC. The results on Office-Home with the $5\%$ split are shown in Fig. <ref>. We can see that the relatedness among tasks is relatively sparse, which could avoid interference by irrelevant tasks. It is worth noting that the mixing weight between tasks is higher when they are more correlated. For instance, the task Real_World is closer to Art than to Clipart.

Tasks show different correlation patterns $\alpha_t$ and $\beta_t$ for classifiers ($\mathbf{w}$) and representations ($\mathbf{z}$). Similar tasks are more correlated, e.g.,  is closer to  than .

Comparison with Other Methods

The comparison results on the small-scale Office-Home, Office-Caltech, ImageCLEF datasets and large-scale  DomainNet dataset are shown in Tables <ref>, <ref>, <ref> and <ref>, respectively. The average accuracy of all tasks is used for overall performance measurement. The best results are marked in bold, while the second-best are marked by underlining.

Performance comparison (normalized mean squared errors) for rotation angle regression.

Performance comparison of different methods on the Office-Home dataset.

max width =

2*Methods     5c|5%             5c|10%       5c20%

A        C        P        R        Avg.      A        C        P        R        Avg.      A        C        P        R        Avg.

36.7$\pm$0.4     30.8$\pm$0.5      67.5$\pm$0.3      61.7$\pm$0.3     49.2$\pm$0.2
50.4$\pm$0.3     40.8$\pm$0.3      74.4$\pm$0.4      67.5$\pm$0.4     58.3$\pm$0.1
54.6$\pm$0.4     50.6$\pm$0.4      81.3$\pm$0.2      73.1$\pm$0.3     64.9$\pm$0.1

37.9$\pm$0.3 	   33.3$\pm$0.5 	   69.0$\pm$0.6 	    64.0$\pm$0.2     51.1$\pm$0.1
52.0$\pm$0.4 	   43.1$\pm$0.2     76.2$\pm$0.4      69.4$\pm$0.3     60.2$\pm$0.2
55.9$\pm$0.3 	   52.0$\pm$0.5 	   81.2$\pm$0.5 	    73.8$\pm$0.2     65.8$\pm$0.2

Bakker et al. [4]
40.0$\pm$0.1	   33.6$\pm$0.3	   69.8$\pm$0.4	   63.6$\pm$0.3	   52.8$\pm$0.1
52.5$\pm$0.3	   42.3$\pm$0.4	   75.7$\pm$0.5	   69.5$\pm$0.5	   60.0$\pm$0.2
61.3$\pm$0.2	   56.5$\pm$0.2	   81.7$\pm$0.3	   75.4$\pm$0.2	   68.7$\pm$0.2

Long et al. [36]

47.8$\pm$0.4     37.9$\pm$0.2      73.6$\pm$0.3      70.4$\pm$0.2      57.4$\pm$0.1
57.2$\pm$0.3     43.3$\pm$0.1      78.7$\pm$0.3      74.4$\pm$0.1      63.4$\pm$0.2
65.1$\pm$0.3     46.7$\pm$0.2      79.9$\pm$0.3      76.6$\pm$0.3      67.1$\pm$0.1

Kendall et al. [27]
40.2$\pm$0.2	   33.6$\pm$0.4	   69.5$\pm$0.2	   63.7$\pm$0.1	   51.8$\pm$0.1
49.1$\pm$0.1	   38.7$\pm$0.3	   73.4$\pm$0.2	   67.4$\pm$0.3	   57.2$\pm$0.2
59.5$\pm$0.3	   53.8$\pm$0.3	   80.1$\pm$0.1	   73.6$\pm$0.4	   66.8$\pm$0.2

Qian et al. [42]
37.9$\pm$0.3	   31.4$\pm$0.2	   67.7$\pm$0.3	   62.4$\pm$0.2	   49.9$\pm$0.2
47.1$\pm$0.2	   37.2$\pm$0.1	   70.5$\pm$0.2	   66.3$\pm$0.3	   55.3$\pm$0.1
58.3$\pm$0.2	   53.5$\pm$0.3	   79.8$\pm$0.2	   73.1$\pm$0.3	   66.2$\pm$0.1

37.6$\pm$0.4 	   31.5$\pm$0.3 	   68.5$\pm$0.2 	   63.8$\pm$0.2 	   50.4$\pm$0.1
51.0$\pm$0.2 	   41.6$\pm$0.1 	   76.0$\pm$0.3 	   69.2$\pm$0.3 	   59.5$\pm$0.1
56.6$\pm$0.3 	   51.8$\pm$0.5 	   80.9$\pm$0.3 	   72.9$\pm$0.4 	   65.6$\pm$0.1

38.6$\pm$0.5	   32.8$\pm$0.8	   69.2$\pm$0.1	   64.5$\pm$0.3	   51.3$\pm$0.1
53.2$\pm$0.2	   43.1$\pm$0.5	   76.6$\pm$0.3	   70.5$\pm$0.5	   60.9$\pm$0.1
58.2$\pm$0.3	   53.1$\pm$0.4	   81.9$\pm$0.2	   74.8$\pm$0.3	   67.0$\pm$0.2

51.6$\pm$0.4 	   37.6$\pm$0.2 	   69.8$\pm$0.3 	   66.5$\pm$0.1 	   56.3$\pm$0.1
58.3$\pm$0.4 	   47.0$\pm$0.4 	   77.2$\pm$0.3 	   72.8$\pm$0.3	   63.8$\pm$0.1
62.2$\pm$0.2 	   53.3$\pm$0.3 	   81.9$\pm$0.2 	   75.7$\pm$0.1 	   68.3$\pm$0.1

53.5$\pm$0.1	   39.2$\pm$0.2	   71.5$\pm$0.3	   69.0$\pm$0.1	   58.3$\pm$0.1
60.2$\pm$0.2	   47.5$\pm$0.2	   78.2$\pm$0.3	   74.0$\pm$0.2	   65.0$\pm$0.0
64.0$\pm$0.3	   53.5$\pm$0.4	   82.5$\pm$0.2	   76.8$\pm$0.1	   69.2$\pm$0.2

Performance comparison of different methods on the Office-Caltech dataset.

max width=

2*Methods     5c|$5\%$             5c|10%            5c20%

A     W     D     C     Avg.     A     W     D     C     Avg.      A     W     D     C     Avg.

87.4$\pm$0.4     87.9$\pm$0.3     96.4$\pm$0.5      82.8$\pm$0.2     88.6$\pm$0.3
92.8$\pm$0.5     97.7$\pm$0.3     87.8$\pm$0.2      84.3$\pm$0.4     90.7$\pm$0.2
94.9$\pm$0.2     92.8$\pm$0.4     95.2$\pm$0.6      86.7$\pm$0.6     92.4$\pm$0.3

88.3$\pm$0.3	   89.1$\pm$0.4	   97.0$\pm$0.2	   81.4$\pm$0.5	   89.0$\pm$0.2
93.1$\pm$0.2	   96.6$\pm$0.4	   90.0$\pm$0.5	   84.5$\pm$0.3	   91.1$\pm$0.2
95.5$\pm$0.4	   94.5$\pm$0.2	   96.0$\pm$0.6	   87.7$\pm$0.4	   93.4$\pm$0.3

Bakker et al. [4]
93.2$\pm$0.2	   94.0$\pm$0.3      94.7$\pm$0.3	   85.4$\pm$0.4	   91.8$\pm$0.1
94.9$\pm$0.4	   97.6$\pm$0.5	    96.6$\pm$0.5	   90.9$\pm$0.4	   95.0$\pm$0.2
95.2$\pm$0.2	   94.4$\pm$0.4	    99.5$\pm$0.3	   91.3$\pm$0.1	   95.1$\pm$0.1

Long et al. [36]
92.7$\pm$0.2    94.3$\pm$0.2    97.1$\pm$0.2    89.2$\pm$0.6    93.4$\pm$0.2
95.0$\pm$0.3    98.1$\pm$0.4    95.0$\pm$0.5    91.3$\pm$0.2    94.8$\pm$0.3
95.5$\pm$0.3    94.9$\pm$0.1    99.2$\pm$0.3    91.0$\pm$0.4    95.1$\pm$0.1

Kendall et al. [27]
93.6$\pm$0.4	   92.5$\pm$0.2	   95.0$\pm$0.5	   83.9$\pm$0.5	   91.2$\pm$0.3
94.9$\pm$0.5	   96.2$\pm$0.4	   93.6$\pm$0.3	   90.4$\pm$0.2	   93.8$\pm$0.2
95.4$\pm$0.7	   93.2$\pm$0.4	   99.2$\pm$0.4	   91.2$\pm$0.3	   94.7$\pm$0.3

Qian et al. [42]
92.6$\pm$0.3	   90.9$\pm$0.2	   95.7$\pm$0.4	   85.2$\pm$0.6	   91.1$\pm$0.3
94.2$\pm$0.4	   97.0$\pm$0.4	   95.0$\pm$0.3	   90.2$\pm$0.3	   94.1$\pm$0.3
95.7$\pm$0.4	   94.1$\pm$0.2	   99.2$\pm$0.5	   91.1$\pm$0.4	   95.0$\pm$0.2

90.0$\pm$0.7    89.4$\pm$0.8    95.0$\pm$1.1    83.5$\pm$0.5    89.5$\pm$0.3
93.6$\pm$0.1    97.0$\pm$0.6    92.1$\pm$0.7    86.3$\pm$0.4    92.3$\pm$0.2
95.0$\pm$0.2    94.5$\pm$0.7    96.0$\pm$1.2    86.8$\pm$0.2    93.1$\pm$0.1

90.3$\pm$1.5	   91.3$\pm$0.5	   97.1$\pm$0.0	   84.4$\pm$0.9	   90.8$\pm$0.6
94.2$\pm$0.1	   97.0$\pm$0.0	   93.8$\pm$0.5	   87.9$\pm$0.3	   93.2$\pm$0.2
95.5$\pm$0.1	   94.6$\pm$0.3	   96.0$\pm$0.9	   87.8$\pm$0.4	   93.5$\pm$0.1

93.5$\pm$0.2	   95.4$\pm$0.3	   96.7$\pm$0.3	   90.0$\pm$0.3	   93.9$\pm$0.1
94.9$\pm$0.1	   97.1$\pm$0.4	   97.9$\pm$0.0	   90.6$\pm$0.3	   95.1$\pm$0.0
95.5$\pm$0.2	   96.4$\pm$0.4	   98.6$\pm$0.3	   90.3$\pm$0.4	   95.2$\pm$0.1

93.7$\pm$0.2	   95.2$\pm$0.3	   96.4$\pm$0.4	   89.7$\pm$0.4	   93.8$\pm$0.1
95.4$\pm$0.1	   97.6$\pm$0.1	   97.4$\pm$0.4	   90.9$\pm$0.2	   95.3$\pm$0.0
95.6$\pm$0.2	   95.6$\pm$0.4	   98.4$\pm$0.5	   91.1$\pm$0.3	   95.2$\pm$0.1

Performance comparison of different methods on the ImageCLEF dataset.

max width=

2*Methods     5c|5%             5c|10%      5c20%

C     I     P     B     Avg.     C     I     P     B    Avg.     C     I     P     B    Avg.

85.4$\pm$0.6     71.4$\pm$0.4     57.7$\pm$0.2     36.0$\pm$0.2     62.6$\pm$0.2
88.9$\pm$0.5     77.8$\pm$0.3     64.3$\pm$0.2     47.6$\pm$0.5     69.7$\pm$0.3
92.9$\pm$0.6     84.6$\pm$0.3     72.5$\pm$0.4     54.6$\pm$0.6     76.2$\pm$0.3

87.0$\pm$0.4	   73.2$\pm$0.5	   60.5$\pm$0.4	   39.0$\pm$0.3	   64.9$\pm$0.3
89.6$\pm$0.3	   79.1$\pm$0.6	   66.6$\pm$0.3	   48.0$\pm$0.2	   70.8$\pm$0.3
93.3$\pm$0.3	   87.3$\pm$0.3	   72.7$\pm$0.5	   55.4$\pm$0.5	   77.2$\pm$0.2

Bakker et al. [4]
90.9$\pm$0.4	   85.4$\pm$0.6	   68.1$\pm$0.3	   51.4$\pm$0.5	   73.9$\pm$0.3
91.0$\pm$0.5	   87.1$\pm$0.3	   73.4$\pm$0.4	   54.5$\pm$0.2	   76.5$\pm$0.4
94.4$\pm$0.5	   90.6$\pm$0.4	   74.2$\pm$0.4	   57.9$\pm$0.3	   79.3$\pm$0.4

Long et al. [36]
90.1$\pm$0.5    76.5$\pm$0.5    72.8$\pm$0.3    54.9$\pm$0.4     73.7$\pm$0.4
93.3$\pm$0.4    83.2$\pm$0.6    70.4$\pm$0.4    56.3$\pm$0.4     75.8$\pm$0.2
94.4$\pm$0.4    89.2$\pm$0.5    75.8$\pm$0.5    59.4$\pm$0.3     79.7$\pm$0.3

Kendall et al. [27]
93.2$\pm$0.6	   86.1$\pm$0.4	   68.6$\pm$0.3	   50.4$\pm$0.4	   74.6$\pm$0.2
91.9$\pm$0.3	   88.9$\pm$0.5	   74.3$\pm$0.3	   52.4$\pm$0.2	   76.9$\pm$0.3
93.3$\pm$0.4	   91.0$\pm$0.2	   75.6$\pm$0.2	   56.9$\pm$0.4	   79.2$\pm$0.3

Qian et al. [42]
91.6$\pm$0.3	   85.8$\pm$0.4	   68.4$\pm$0.3	   50.2$\pm$0.4	   74.0$\pm$0.4
90.7$\pm$0.4	   88.1$\pm$0.6	   75.6$\pm$0.4	   54.6$\pm$0.3	   77.3$\pm$0.3
93.1$\pm$0.3	   92.1$\pm$0.5	   74.4$\pm$0.7	   55.8$\pm$0.6	   78.9$\pm$0.5

88.3$\pm$0.5     73.2$\pm$0.5     61.2$\pm$0.9     40.0$\pm$0.8     65.7$\pm$0.4
90.6$\pm$0.8     79.3$\pm$0.2     66.3$\pm$0.5     51.9$\pm$0.6     72.0$\pm$0.3
92.9$\pm$0.5     86.5$\pm$0.2     71.9$\pm$0.8     56.0$\pm$0.8     76.8$\pm$0.3

88.8$\pm$0.7	   75.0$\pm$0.8	   62.9$\pm$0.3	   41.7$\pm$1.6	   67.1$\pm$0.3
91.1$\pm$0.2	   80.7$\pm$0.6	   69.0$\pm$0.8	   51.1$\pm$1.3	   73.0$\pm$0.7
93.7$\pm$0.3	   87.9$\pm$0.6	   73.7$\pm$1.2	   56.7$\pm$0.2	   78.0$\pm$0.2

89.3$\pm$0.6	   81.5$\pm$0.8	   72.3$\pm$0.4	   59.5$\pm$0.8	   75.7$\pm$0.3
92.8$\pm$0.4	   85.9$\pm$0.3	   71.9$\pm$0.6	   59.9$\pm$0.3	   77.6$\pm$0.2
92.9$\pm$0.3	   88.0$\pm$0.4	   78.6$\pm$0.2	   60.5$\pm$0.2	   80.0$\pm$0.1

91.5$\pm$0.2	   83.5$\pm$0.6	   71.6$\pm$0.8	   58.2$\pm$0.7	   76.2$\pm$0.3
94.2$\pm$0.2	   86.0$\pm$0.5	   71.7$\pm$0.6	   59.8$\pm$0.4	   77.9$\pm$0.2
93.9$\pm$0.1	   89.4$\pm$0.2	   78.0$\pm$0.4	   59.5$\pm$0.4	   80.2$\pm$0.1

Performance comparison of different methods on the large-scaled  DomainNet dataset.

max width =

2*Methods     7c|1%     7c2%

C     I     P     Q     R     S     Avg.    C     I     P     Q     R     S     Avg.

STL    15.0$\pm$0.3    4.0$\pm$0.4    19.7$\pm$0.3    7.5$\pm$0.2    50.6$\pm$0.2    9.6$\pm$0.4     17.7$\pm$0.2
20.5$\pm$0.2    6.6$\pm$0.3    26.0$\pm$0.4    7.2$\pm$0.2    56.5$\pm$0.3    14.0$\pm$0.3    21.8$\pm$0.3

VSTL    18.9$\pm$0.2	   5.4$\pm$0.3	   23.5$\pm$0.2	   15.2$\pm$0.4	   54.5$\pm$0.3	   12.2$\pm$0.3    21.6$\pm$0.1
26.4$\pm$0.1	   8.9$\pm$0.3	   30.9$\pm$0.3	   20.2$\pm$0.3	   60.7$\pm$0.2	   17.8$\pm$0.1    27.5$\pm$0.1

Bakker et al. [4]
20.2$\pm$0.2	   5.8$\pm$0.1	   26.2$\pm$0.2	   21.0$\pm$0.1	       52.8$\pm$0.2	   14.7$\pm$0.1	   23.5$\pm$0.1
23.4$\pm$0.1	   8.6$\pm$0.1	   32.5$\pm$0.3	   21.5$\pm$0.3	       58.7$\pm$0.2	   19.2$\pm$0.2	   27.3$\pm$0.1

Long et al. [36]
19.1$\pm$0.2	   8.1$\pm$0.1	       30.7$\pm$0.2	   5.7$\pm$0.1	       57.1$\pm$0.2	   15.1$\pm$0.1	       22.6$\pm$0.1
24.3$\pm$0.3	   11.0$\pm$0.2	       36.6$\pm$0.1	   7.0$\pm$0.2	       60.9$\pm$0.1	   18.0$\pm$0.3	       26.3$\pm$0.2

Kendall et al. [27]
17.5$\pm$0.1	   4.5$\pm$0.1      24.4$\pm$0.2	   19.4$\pm$0.3	   50.7$\pm$0.1	   11.6$\pm$0.1	   21.3$\pm$0.1
23.5$\pm$0.2	   7.7$\pm$0.3      32.7$\pm$0.2	   22.5$\pm$0.2	   60.2$\pm$0.1	   18.5$\pm$0.2	   27.5$\pm$0.1

Qian et al. [42]
20.6$\pm$0.1	   6.4$\pm$0.3      27.2$\pm$0.2	   19.6$\pm$0.1	   52.7$\pm$0.3	   13.5$\pm$0.2	   23.3$\pm$0.2
26.0$\pm$0.2	   8.9$\pm$0.2      34.5$\pm$0.1	   20.9$\pm$0.3	   62.6$\pm$0.2	   21.0$\pm$0.1	   29.0$\pm$0.1

18.3$\pm$0.1	   5.2$\pm$0.2	   22.3$\pm$0.1	   15.0$\pm$0.1	   53.3$\pm$0.1	   11.8$\pm$0.2    21.0$\pm$0.1
26.2$\pm$0.2	   8.7$\pm$0.2	   30.3$\pm$0.2	   20.7$\pm$0.1	   59.6$\pm$0.2	   17.8$\pm$0.2    27.2$\pm$0.1

18.1$\pm$0.3	   5.2$\pm$0.1	   23.0$\pm$0.4	   13.4$\pm$0.2	   53.9$\pm$0.3	   12.0$\pm$0.4	   20.9$\pm$0.3
26.2$\pm$0.5	   8.9$\pm$0.3	   30.7$\pm$0.3	   17.5$\pm$0.2	   59.9$\pm$0.4	   17.5$\pm$0.1	   26.8$\pm$0.2

19.8$\pm$0.2	   6.6$\pm$0.2	       24.1$\pm$0.4	   12.1$\pm$0.2	   52.3$\pm$0.1	   13.6$\pm$0.1	   21.4$\pm$0.1
26.5$\pm$0.2	   9.7$\pm$0.2	       30.6$\pm$0.2	   14.6$\pm$0.1	   58.2$\pm$0.2	   18.3$\pm$0.2	   26.3$\pm$0.0

25.2$\pm$0.1	   8.8$\pm$0.1	   30.1$\pm$0.1	   13.2$\pm$0.3	   56.4$\pm$0.3	   17.5$\pm$0.3	   25.2$\pm$0.1
31.1$\pm$0.1	   11.9$\pm$0.1	   35.1$\pm$0.1	   17.1$\pm$0.1	   61.6$\pm$0.0	   21.9$\pm$0.1	   29.8$\pm$0.0

Our proposed methods achieve the best performance on all four datasets with different train-test splits. On the most challenging setting with $5\%$ training data, VMTL shows a large performance advantage over the baselines.

This demonstrates the effectiveness of VMTL in exploring relatedness to improve the performance of each task from limited data. VMTL-AC can also produce comparable performance and is better than most previous methods.

We would like to highlight that Bakker et al. [4], a Bayesian method for multi-task learning optimized by an expectation-maximization algorithm, produce very competitive performance.

Long et al. [36] use point estimation to find approximate values of model parameters.
However, our methods consistently outperform Bakker et al. [4] and Long et al. [36], which shows the great effectiveness of our variational Bayesian inference for multi-task learning.
In addition, the methods [27] and [42] weigh multiple loss functions by considering the homoscedastic uncertainty of each task, which shows the benefit of modeling uncertainty, while they are also outperformed by our methods.

It is also worth mentioning that VMTL-AC demonstrates computational advantages as well, with faster convergence than VMTL due to amortized learning. Besides, we find that VMTL-AC demonstrates good robustness against adversarial attacks. This could be due to the fact that amortized learning applies the mean feature representations to generate classifiers, which is more robust to attacks. Due to space limit, more experiments and detailed discussions about the amortized classifier are provided in the supplementary materials.

In addition, we apply our methods to a regression task on Rotated MNIST for rotation angle estimation. The comparison results are shown in Fig. <ref>. The proposed VMTL and VMTL-AC outperform other methods with lower average NMSE. For some digits/tasks, e.g. $0, 6, 9$, their NMSE are higher than other digits/tasks. The reason could be that these digits have some degree of rotational invariance, which makes it harder for them to regress their target angles.

§ CONCLUSION

In this paper, we develop variational multi-task learning (VMTL), a novel variational Bayesian inference approach for simultaneously learning multiple tasks. We propose a probabilistic latent variable model to explore task relatedness, where we introduce stochastic variables as the task-specific classifiers and latent representations in a single Bayesian framework. In doing so, multi-task learning is cast as a variational inference problem, which provides a unified way to jointly explore knowledge shared among representations and classifiers by specifying priors.
We further introduce Gumbel-Softmax priors, which offer an effective way to learn the task relatedness in a data-driven manner for each task.
We evaluate VMTL on five benchmark datasets of multi-task learning under both classification and regression. Results demonstrate the effectiveness of our variational multi-task learning and our method delivers state-of-the-art performance.

§ ACKNOWLEDGMENT

This work is financially supported by the Inception Institute of
Artificial Intelligence, the University of Amsterdam and the allowance
Top consortia for Knowledge and Innovation (TKIs) from the Netherlands
Ministry of Economic Affairs and Climate Policy.

[1]
A. A. Alemi, I. Fischer, J. V. Dillon, and K. Murphy.
Deep variational information bottleneck.
arXiv preprint arXiv:1612.00410, 2016.

[2]
C. Archambeau, S. Guo, and O. Zoeter.
Sparse bayesian multi-task learning.
In NIPS, volume 1, page 41, 2011.

[3]
A. Argyriou, T. Evgeniou, and M. Pontil.
Multi-task feature learning.
In Advances in neural information processing systems, pages
41–48, 2007.

[4]
B. Bakker and T. Heskes.
Task clustering and gating for bayesian multitask learning.
Journal of Machine Learning Research, 4(May):83–99, 2003.

[5]
J. Baxter.
A model of inductive bias learning.
Journal of artificial intelligence research, 12:149–198, 2000.

[6]
C. Blundell, J. Cornebise, K. Kavukcuoglu, and D. Wierstra.
Weight uncertainty in neural network.
In International Conference on Machine Learning, pages
1613–1622. PMLR, 2015.

[7]
S. R. Bowman, L. Vilnis, O. Vinyals, A. M. Dai, R. Jozefowicz, and S. Bengio.
Generating sentences from a continuous space.
arXiv preprint arXiv:1511.06349, 2015.

[8]
F. J. Bragman, R. Tanno, S. Ourselin, D. C. Alexander, and J. Cardoso.
Stochastic filter groups for multi-task cnns: Learning specialist and
generalist convolution kernels.
In Proceedings of the IEEE International Conference on Computer
Vision, pages 1385–1394, 2019.

[9]
R. Caruana.
Multitask learning.
Machine learning, 28(1):41–75, 1997.

[10]
Z. Chen, V. Badrinarayanan, C.-Y. Lee, and A. Rabinovich.
Gradnorm: Gradient normalization for adaptive loss balancing in deep
multitask networks.
In International Conference on Machine Learning, pages
794–803. PMLR, 2018.

[11]
C. Cremer, X. Li, and D. Duvenaud.
Inference suboptimality in variational autoencoders.
arXiv preprint arXiv:1801.03558, 2018.

[12]
H. Daumé III.
Bayesian multitask learning with latent hierarchies.
arXiv preprint arXiv:0907.0783, 2009.

[13]
C. Finn, P. Abbeel, and S. Levine.
Model-agnostic meta-learning for fast adaptation of deep networks.
arXiv preprint arXiv:1703.03400, 2017.

[14]
C. Finn, K. Xu, and S. Levine.
Probabilistic model-agnostic meta-learning.
In Proceedings of the 32nd International Conference on Neural
Information Processing Systems, pages 9537–9548, 2018.

[15]
Y. Gao, H. Bai, Z. Jie, J. Ma, K. Jia, and W. Liu.
Mtl-nas: Task-agnostic neural architecture search towards
general-purpose multi-task learning.
In Proceedings of the IEEE/CVF Conference on Computer Vision and
Pattern Recognition, pages 11543–11552, 2020.

[16]
S. Gershman and N. Goodman.
Amortized inference in probabilistic reasoning.
In Proceedings of the annual meeting of the cognitive science
society, volume 36, 2014.

[17]
B. Gong, Y. Shi, F. Sha, and K. Grauman.
Geodesic flow kernel for unsupervised domain adaptation.
In 2012 IEEE Conference on Computer Vision and Pattern
Recognition, pages 2066–2073. IEEE, 2012.

[18]
I. J. Goodfellow, J. Shlens, and C. Szegedy.
Explaining and harnessing adversarial examples.
arXiv preprint arXiv:1412.6572, 2014.

[19]
J. Gordon, J. Bronskill, M. Bauer, S. Nowozin, and R. E. Turner.
Meta-learning probabilistic inference for prediction.
arXiv preprint arXiv:1805.09921, 2018.

[20]
G. Griffin, A. Holub, and P. Perona.
Caltech-256 object category dataset.

[21]
P. Guo, C.-Y. Lee, and D. Ulbricht.
Learning to branch for multi-task learning.
In International Conference on Machine Learning, pages
3854–3863. PMLR, 2020.

[22]
T. Heskes.
Empirical bayes for learning to learn.

[23]
A. Jalali, S. Sanghavi, C. Ruan, and P. K. Ravikumar.
A dirty model for multi-task learning.
In Advances in neural information processing systems, pages
964–972, 2010.

[24]
E. Jang, S. Gu, and B. Poole.
Categorical reparameterization with gumbel-softmax.
arXiv preprint arXiv:1611.01144, 2016.

[25]
P. K. Jawanpuria, M. Lapin, M. Hein, and B. Schiele.
Efficient output kernel learning for multiple tasks.
In Advances in neural information processing systems, pages
1189–1197, 2015.

[26]
Z. Kang, K. Grauman, and F. Sha.
Learning with whom to share in multi-task feature learning.
In ICML, volume 2, page 4, 2011.

[27]
A. Kendall, Y. Gal, and R. Cipolla.
Multi-task learning using uncertainty to weigh losses for scene
geometry and semantics.
In Proceedings of the IEEE conference on computer vision and
pattern recognition, pages 7482–7491, 2018.

[28]
H. Kim, A. Mnih, J. Schwarz, M. Garnelo, A. Eslami, D. Rosenbaum, O. Vinyals,
and Y. W. Teh.
Attentive neural processes.
arXiv preprint arXiv:1901.05761, 2019.

[29]
D. P. Kingma and J. Ba.
Adam: A method for stochastic optimization.
arXiv preprint arXiv:1412.6980, 2014.

[30]
D. P. Kingma, T. Salimans, and M. Welling.
Variational dropout and the local reparameterization trick.
In Advances in neural information processing systems, pages
2575–2583, 2015.

[31]
D. P. Kingma and M. Welling.
Auto-encoding variational bayes.
arXiv preprint arXiv:1312.6114, 2013.

[32]
Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner.
Gradient-based learning applied to document recognition.
Proceedings of the IEEE, 86(11):2278–2324, 1998.

[33]
H. Liu, M. Palatucci, and J. Zhang.
Blockwise coordinate descent procedures for the multi-task lasso,
with applications to neural semantic basis discovery.
In Proceedings of the 26th Annual International Conference on
Machine Learning, pages 649–656, 2009.

[34]
L. Liu, Y. Li, Z. Kuang, J.-H. Xue, Y. Chen, W. Yang, Q. Liao, and W. Zhang.
Towards impartial multi-task learning.
In International Conference on Learning Representations, 2021.

[35]
S. Liu, E. Johns, and A. J. Davison.
End-to-end multi-task learning with attention.
In Proceedings of the IEEE Conference on Computer Vision and
Pattern Recognition, pages 1871–1880, 2019.

[36]
M. Long, Z. Cao, J. Wang, and S. Y. Philip.
Learning multiple tasks with multilinear relationship networks.
In Advances in neural information processing systems, pages
1594–1603, 2017.

[37]
I. Misra, A. Shrivastava, A. Gupta, and M. Hebert.
Cross-stitch networks for multi-task learning.
In Proceedings of the IEEE Conference on Computer Vision and
Pattern Recognition, pages 3994–4003, 2016.

[38]
D. Molchanov, A. Ashukha, and D. Vetrov.
Variational dropout sparsifies deep neural networks.
arXiv preprint arXiv:1701.05369, 2017.

[39]
E. Nalisnick and P. Smyth.
Learning priors for invariance.
In International Conference on Artificial Intelligence and
Statistics, pages 366–375. PMLR, 2018.

[40]
X. Peng, Q. Bai, X. Xia, Z. Huang, K. Saenko, and B. Wang.
Moment matching for multi-source domain adaptation.
In Proceedings of the IEEE International Conference on Computer
Vision, pages 1406–1415, 2019.

[41]
T. K. Pong, P. Tseng, S. Ji, and J. Ye.
Trace norm regularization: Reformulations, algorithms, and multi-task
SIAM Journal on Optimization, 20(6):3465–3489, 2010.

[42]
W. Qian, B. Chen, and F. Gechter.
Multi-task variational information bottleneck.
arXiv preprint arXiv:2007.00339, 2020.

[43]
K. Saenko, B. Kulis, M. Fritz, and T. Darrell.
Adapting visual category models to new domains.
In European conference on computer vision, pages 213–226.
Springer, 2010.

[44]
Y. Shi, N. Siddharth, B. Paige, and P. H. Torr.
Variational mixture-of-experts autoencoders for multi-modal deep
generative models.
Advances in Neural Information Processing Systems, 2019.

[45]
K. Simonyan and A. Zisserman.
Very deep convolutional networks for large-scale image recognition.
arXiv preprint arXiv:1409.1556, 2014.

[46]
K. Sohn, H. Lee, and X. Yan.
Learning structured output representation using deep conditional
generative models.
In Advances in neural information processing systems, pages
3483–3491, 2015.

[47]
G. Strezoski, N. v. Noord, and M. Worring.
Many task learning with task routing.
In Proceedings of the IEEE International Conference on Computer
Vision, pages 1375–1384, 2019.

[48]
X. Sun, R. Panda, R. Feris, and K. Saenko.
Adashare: Learning what to share for efficient deep multi-task
arXiv preprint arXiv:1911.12423, 2019.

[49]
H. Takahashi, T. Iwata, Y. Yamanaka, M. Yamada, and S. Yagi.
Variational autoencoder with implicit optimal priors.
In Proceedings of the AAAI Conference on Artificial
Intelligence, pages 5066–5073, 2019.

[50]
M. K. Titsias and M. Lázaro-Gredilla.
Spike and slab variational inference for multi-task and multiple
kernel learning.
In Advances in neural information processing systems, pages
2339–2347, 2011.

[51]
J. Tomczak and M. Welling.
Vae with a vampprior.
In International Conference on Artificial Intelligence and
Statistics, pages 1214–1223, 2018.

[52]
H. Venkateswara, J. Eusebio, S. Chakraborty, and S. Panchanathan.
Deep hashing network for unsupervised domain adaptation.
In (IEEE) Conference on Computer Vision and Pattern
Recognition (CVPR), 2017.

[53]
Y. Xue, X. Liao, L. Carin, and B. Krishnapuram.
Multi-task learning for classification with dirichlet process priors.
Journal of Machine Learning Research, 8(Jan):35–63, 2007.

[54]
K. Yu, V. Tresp, and A. Schwaighofer.
Learning gaussian processes from multiple tasks.
In Proceedings of the 22nd international conference on Machine
learning, pages 1012–1019, 2005.

[55]
T. Yu, S. Kumar, A. Gupta, S. Levine, K. Hausman, and C. Finn.
Gradient surgery for multi-task learning.
arXiv preprint arXiv:2001.06782, 2020.

[56]
Y. Zhang and Q. Yang.
Learning sparse task relations in multi-task learning.
In Proceedings of the AAAI Conference on Artificial
Intelligence, 2017.

[57]
Y. Zhang and Q. Yang.
A survey on multi-task learning.
IEEE Transactions on Knowledge and Data Engineering, 2021.

[58]
Y. Zhang and D. Yeung.
Multi-task learning using generalized t process.
In Proceedings of the Thirteenth International Conference on
Artificial Intelligence and Statistics, pages 964–971, 2010.

[59]
Y. Zhang and D.-Y. Yeung.
A convex formulation for learning task relationships in multi-task
arXiv preprint arXiv:1203.3536, 2012.

[60]
Y. Zhang, Y. Zhang, and W. Wang.
Deep multi-task learning via generalized tensor trace norm.
arXiv preprint arXiv:2002.04799, 2020.

§ DERIVATION

§.§ Evidence Lower Bound for Multi-Task Learning

In this paper, we follow the multi-input multi-output data setting [36, 57] for multi-task learning, each task $t$ has its own training data $\mathcal{D}_t = \{\mathbf{x}_{t, n}, \mathbf{y}_{t, n}\}_{n=1}^{N_t}$. Note that we derive our methodology mainly using terminologies related to classification tasks, but it is also applicable to regression tasks.

Under the probabilistic formulation for multi-task learning, we start with the conditional log-likelihood for each task $t$:
$\log p(\mathbf{y}_{t, n}  |\mathbf{x}_{t, n}, \mathcal{D}_{1:T \backslash t})$, where $(\mathbf{x}_{t, n}, \mathbf{y}_{t, n})$ is a sample from the data of current task $t$ and $\mathcal{D}_{1:T \backslash t}$ is the data from all related tasks.

Here, we introduce the latent variables $\mathbf{z}_{t, n}$ and $\mathbf{w}_t$:

\begin{equation}
\begin{aligned}
& \log p(\mathbf{y}_{t, n}   |\mathbf{x}_{t, n}, \mathcal{D}_{1:T \backslash  t} ) = \log \int \int p(\mathbf{y}_{t, n}, \mathbf{z}_{t, n}, \mathbf{w}_t, |\mathbf{x}_{t, n}, \mathcal{D}_{1:T \backslash  t} ) d\mathbf{z}_{t, n} d\mathbf{w}_t,
\end{aligned}
\end{equation}

where $p(\mathbf{y}_{t, n}, \mathbf{z}_{t, n}, \mathbf{w}_t, |\mathbf{x}_{t, n}, \mathcal{D}_{1:T \backslash  t} )$ is the joint conditional predictive distribution over the classification label or regression target. Under the assumption that $\mathbf{w}_t$ and $\mathbf{z}_{t, n}$ are conditionally independent, we obtain

\begin{equation}
\begin{aligned}
&\log p(\mathbf{y}_{t, n} |\mathbf{x}_{t, n}, \mathcal{D}_{1:T \backslash  t} ) = \log \int \int p(\mathbf{y}_{t, n}|\mathbf{z}_{t, n}, \mathbf{w}_t) p( \mathbf{z}_{t, n}|\mathbf{x}_{t, n}, \mathcal{D}_{1:T \backslash t})  p(\mathbf{w}_t|\mathcal{D}_{1:T \backslash  t} ) d\mathbf{z}_{t, n}d\mathbf{w}_t. \\
\end{aligned}
\end{equation}

Next, we introduce the variational posteriors $q_{\phi}(\mathbf{z}_{t, n}|\mathbf{x}_{t, n})$ and $q_{\theta}(\mathbf{w}_t|\mathcal{D}_t)$ to approximate the true posteriors for latent representations and classifiers, respectively. By leveraging Jensen's inequality, we have the following steps as

\begin{equation}
\begin{aligned}
\log & p(\mathbf{y}_{t, n} |\mathbf{x}_{t, n}, \mathcal{D}_{1:T \backslash  t} ) \\
& = \log \int \int p(\mathbf{y}_{t, n}|\mathbf{z}_{t, n}, \mathbf{w}_t) p( \mathbf{z}_{t, n}|\mathbf{x}_{t, n}, \mathcal{D}_{1:T \backslash t}) d\mathbf{z}_{t, n} p(\mathbf{w}_t|\mathcal{D}_{1:T \backslash  t} ) \frac{q_{\theta}(\mathbf{w}_t|\mathcal{D}_t)}{q_{\theta}(\mathbf{w}_t|\mathcal{D}_t)} d\mathbf{w}_t  \\
& \ge \int  \log \Big[ \frac{\int p(\mathbf{y}_{t, n}|\mathbf{z}_{t, n}, \mathbf{w}_t) p( \mathbf{z}_{t, n}|\mathbf{x}_{t, n}, \mathcal{D}_{1:T \backslash t}) d\mathbf{z}_{t, n} p(\mathbf{w}_t|\mathcal{D}_{1:T \backslash  t} ) }{q_{\theta}(\mathbf{w}_t|\mathcal{D}_t)}\Big] q_{\theta}(\mathbf{w}_t|\mathcal{D}_t) d\mathbf{w}_t  \\
& =  \mathbb{E}_{q_{\theta}}\big[ \log \int p(\mathbf{y}_{t, n}|\mathbf{z}_{t, n}, \mathbf{w}_t) p( \mathbf{z}_{t, n}|\mathbf{x}_{t, n}, \mathcal{D}_{1:T \backslash t}) \frac{q_{\phi}(\mathbf{z}_{t, n}|\mathbf{x}_{t, n})}{q_{\phi}(\mathbf{z}_{t, n}|\mathbf{x}_{t, n})}   d\mathbf{z}_{t, n} \big] \\
& ~~~~ -\mathbb{KL}[q_{\theta}(\mathbf{w}_t|\mathcal{D}_t)||p(\mathbf{w}_t|\mathcal{D}_{1:T \backslash  t} )] \\
& \ge  \mathbb{E}_{q_{\theta}} \mathbb{E}_{ q_{\phi}}[\log p(\mathbf{y}_{t, n}|\mathbf{z}_{t, n}, \mathbf{w}_t)] - \mathbb{KL}[q_{\phi}(\mathbf{z}_{t, n}|\mathbf{x}_{t, n})||p( \mathbf{z}_{t, n}|\mathbf{x}_{t, n}, \mathcal{D}_{1:T \backslash t}) ]\\
& ~~~~ -\mathbb{KL}[q_{\theta}(\mathbf{w}_t|\mathcal{D}_t)||p(\mathbf{w}_t|\mathcal{D}_{1:T \backslash  t} )].
\end{aligned}
\end{equation}

Thus, we obtain the ELBO for multi-task learning with latent representations and classifiers as follows:

\begin{equation}
\begin{aligned}
& \frac{1}{T} \sum_{t=1}^{T} \log p(\mathcal{Y}_{t} |\mathcal{X}_{t}, \mathcal{D}_{1:T \backslash  t} )
\ge \frac{1}{T} \sum_{t=1}^{T} \bigg\{ \sum_{n=1}^{N_t} \Big\{ \mathbb{E}_{q_{\theta}} \mathbb{E}_{ q_{\phi}}[\log p(\mathbf{y}_{t, n}|\mathbf{z}_{t, n}, \mathbf{w}_t)] \\
& - \mathbb{KL}[q_{\phi}(\mathbf{z}_{t, n}|\mathbf{x}_{t, n})||p( \mathbf{z}_{t, n}|\mathbf{x}_{t, n}, \mathcal{D}_{1:T \backslash t}) ] \Big\} -\mathbb{KL}[q_{\theta}(\mathbf{w}_t|\mathcal{D}_t)||p(\mathbf{w}_t|\mathcal{D}_{1:T \backslash  t} )] \bigg \}.
\end{aligned}
\end{equation}

We integrate this ELBO with the proposed Gumbel-Softmax priors to obtain the empirical objective for variational multi-task learning. To verify the effectiveness of our proposed models, we define the basic variational Bayesian multi-task learning (VBMTL) as a baseline. VBMTL shares the inference network of latent representations among tasks but just applies the normal Gaussian as priors of the latent variables.

In this paper, we propose variational multi-task learning, a general probabilistic inference framework, in which we cast multi-task learning as a variational Bayesian inference problem. This general framework can be seamlessly combined with the advantages of other deterministic approaches in leveraging shared knowledge among tasks.
We can in fact take advantage of deterministic approaches to generalize even better in more settings, e.g., large amounts of training data. In this case, we can train a large convolutional neural network fully end-to-end to extract more representative features specifically for individual tasks.

§.§ Evidence Lower Bound for Single-Task Learning

Generally, the proposed Bayesian inference framework which infers the posteriors of presentations $\mathbf{z}$ and classifiers $\mathbf{w}$ jointly can be widely applied in other research fields. For example, based on the proposed Bayesian inference framework, we introduce a variational version of single-task learning (VSTL) and provide the derivation of its evidence lower bound. It is worth noting that single-task learning does not share knowledge among tasks, thus both inference networks of latent representations and classifiers are task-specific. And the log-likelihood for single-task learning is not allowed to be conditioned on the data from other tasks.

\begin{equation}
\begin{aligned}
% & \log p(\mathcal{Y}_{t} |\mathcal{X}_{t}) = \sum^{N_t}_{n=1} \log p(\mathbf{y}_{t, n} |\mathbf{x}_{t, n})  \\
\log & p(\mathbf{y}_{t, n} |\mathbf{x}_{t, n})  \\
& =   \log \int \int p(\mathbf{y}_{t, n}|\mathbf{z}_{t, n}, \mathbf{w}_t) p( \mathbf{z}_{t, n}|\mathbf{x}_{t,n})p(\mathbf{w}_t) d\mathbf{z}_{t, n} d\mathbf{w}_t \\
& =   \log \int \int p(\mathbf{y}_{t, n}|\mathbf{z}_{t, n}, \mathbf{w}_t) p( \mathbf{z}_{t, n}|\mathbf{x}_{t, n})d\mathbf{z}_{t, n} p(\mathbf{w}_t) \frac{q_{\theta}(\mathbf{w}_t)}{q_{\theta}(\mathbf{w}_t)}  d\mathbf{w}_t  \\
& \ge \int \log [\frac{\int p(\mathbf{y}_{t, n}|\mathbf{z}_{t, n}, \mathbf{w}_t) p( \mathbf{z}_{t, n}|\mathbf{x}_{t, n})d\mathbf{z}_{t, n} p(\mathbf{w}_t)}{q_{\theta}(\mathbf{w}_t)}]q_{\theta}(\mathbf{w}_t)d\mathbf{w}_t\\
& =  \mathbb{E}_{q_{\theta}} \big[\log \int p(\mathbf{y}_{t, n}|\mathbf{z}_{t, n}, \mathbf{w}_t) p( \mathbf{z}_{t, n}|\mathbf{x}_{t, n}) \frac{q_{\phi}(\mathbf{z}_{t, n}|\mathbf{x}_{t, n})}{q_{\phi}(\mathbf{z}_{t, n}|\mathbf{x}_{t, n})} d\mathbf{z}_{t, n} \big] -\mathbb{KL}[q_{\theta}(\mathbf{w}_t)||p(\mathbf{w}_t)] \\
& \ge \mathbb{E}_{q_{\theta}}\mathbb{E}_{ q_{\phi}}[\log p(\mathbf{y}_{t, n}|\mathbf{z}_{t, n}, \mathbf{w}_t)]
-\mathbb{KL}[q_{\phi}(\mathbf{z}_{t, n}|\mathbf{x}_{t, n})||p(\mathbf{z}_{t, n}|\mathbf{x}_{t, n})] -\mathbb{KL}[q_{\theta}(\mathbf{w}_t)||p(\mathbf{w}_t)].
\end{aligned}
\end{equation}

In this case, tasks are learned independently with no access to shared knowledge provided by other tasks, thus the priors $p(\mathbf{w}_{t})$ and $p(\mathbf{z}_{t, n}|\mathbf{x}_{t, n})$ are set to normal Gaussians as applied in [30, 38, 46].

§ MORE EXPERIMENTAL DETAILS

We train all models and parameters by the Adam optimizer [29] using an NVIDIA Tesla V100 GPU. The learning rate is initially set as $1e-4$ and decreases with a factor of $0.5$ every $3K$ iterations.
Details of iteration numbers and batch sizes for different benchmarks are provided in Table <ref>. In each batch, the number of training samples from each task and category is identical.
The network architectures of our methods for the four benchmarks are given.
The code will be available at https://github.com/autumn9999/VMTL.git.

The iteration numbers and batch sizes on different datasets, where $C$ and $T$ denotes the number of classes and tasks in the specific dataset, respectively.

Dataset     Iteration     Batch size

Office-Home     $15,000$     $4*C*T$

Office-Caltech     $15,000$     $4*C*T$

ImageCLEF     $15,000$     $4*C*T$

DomainNet      $30,000$     $2*C*T$

The inference network $\theta(\cdot)$ for amortized classifiers in VMTL-AC.

Output size     Layers

$4096$     Input feature

$4096$     Dropout (p=$0.7$)

$512$     Fully connected, ELU

$512$     Fully connected, ELU

$512$     Local reparameterization  to $\mu_w$, $\sigma^{2}_w$

The inference network $\phi(\cdot)$ for latent representations.

Output size     Layers

$4096, N*4096$     Input features

$4096$     Cross attention

$4096$     Dropout (p=$0.7$)

$512$     Fully connected, ELU

$512$     Fully connected, ELU

$512$     Local reparameterization to $\mu_z$, $\sigma^{2}_z$

§.§ Inference Networks

The architecture of the inference network for amortized classifiers in VMTL-AC is in Table <ref>. In VMTL, we directly learn the parameters of the distribution of variational posteriors, which has the same dimension as the latent representation. The architecture of the inference network for latent representations is in Table <ref>.  During inference, we apply the reparameterization trick to generate the samples for both latent variables [30].

§.§ Implementation of the Compared Previous Works

In this paper, we compare against four representative methods [4, 27, 36, 42], which are implemented by following the same experimental setup as our methods. In practice, we implement the method, Long et al. [36], by applying its open code repository (https://github.com/thuml/MTlearn) under the same experimental environments as ours.
For other compared methods, the models consist a shared feature extractor and task-specific classifiers. In particular, Bakker et al. [4] is a Bayesian method for multi-task learning optimized by an expectation-maximization algorithm, producing very competitive performance. Kendall et al. [27] propose to weigh multiple loss functions by considering the homoscedastic uncertainty of each task, which shows the benefit of modeling uncertainty. Qian et al. [42] integrate the variational information bottleneck [1] to the method based on [27], which shows the benefit of exploring shared information for latent representations.

§ MORE EXPERIMENTAL RESULTS

Performance under different proportions of training data on Office-Home.

max width=

Methods     5%     10%     20%      40%      60%

49.2$\pm$0.2	   58.3$\pm$0.1	   64.9$\pm$0.1	   70.3$\pm$0.2	   73.4$\pm$0.1

51.1$\pm$0.1    60.2$\pm$0.2	   65.8$\pm$0.2	   72.4$\pm$0.3	   73.8$\pm$0.2

50.4$\pm$0.1	   59.5$\pm$0.1	   65.6$\pm$0.1	   70.5$\pm$0.1	   69.5$\pm$0.2

51.3$\pm$0.1	   60.9$\pm$0.1	   67.0$\pm$0.2	   72.1$\pm$0.1	   74.0$\pm$0.1

56.3$\pm$0.1	   63.8$\pm$0.1	   68.3$\pm$0.1	   69.0$\pm$0.1	   73.7$\pm$0.2

58.3$\pm$0.1	   65.0$\pm$0.0	   69.2$\pm$0.2	   71.5$\pm$0.3	   74.2$\pm$0.1

Performance under different proportions of training data on Office-Caltech.

max width=

Methods     5%     10%     20%      40%      60%

88.6$\pm$0.3	   90.7$\pm$0.2	   92.4$\pm$0.3	   96.6$\pm$0.2	   97.2$\pm$0.2

89.0$\pm$0.2	   91.1$\pm$0.2	   93.4$\pm$0.3	   96.7$\pm$0.2	   97.1$\pm$0.3

89.5$\pm$0.3	   92.3$\pm$0.2	   93.1$\pm$0.1	   95.4$\pm$0.3	   97.0$\pm$0.2

90.8$\pm$0.6	   93.2$\pm$0.2	   93.5$\pm$0.1	   96.5$\pm$0.1	   97.1$\pm$0.4

93.9$\pm$0.1	   95.1$\pm$0.0	   95.2$\pm$0.1	   96.8$\pm$0.2	   97.2$\pm$0.2

93.8$\pm$0.1	   95.3$\pm$0.0	   95.2$\pm$0.1	   96.5$\pm$0.2	   97.3$\pm$0.1

Performance under different proportions of training data on ImageCLEF.

max width=

Methods     5%     10%     20%      40%      60%

62.6$\pm$0.2	   69.7$\pm$0.3	   76.2$\pm$0.3	   79.3$\pm$0.2	   80.1$\pm$0.1

64.9$\pm$0.3	   70.8$\pm$0.3	   77.2$\pm$0.2	   80.3$\pm$0.1	   80.8$\pm$0.1

65.7$\pm$0.4	   72.0$\pm$0.3	   76.8$\pm$0.3	   79.0$\pm$0.3	   80.5$\pm$0.2

67.1$\pm$0.3	   73.0$\pm$0.7	   78.0$\pm$0.2	   81.2$\pm$0.1	   81.0$\pm$0.2

75.7$\pm$0.3	   77.6$\pm$0.2	   80.0$\pm$0.1	   81.3$\pm$0.2	   82.3$\pm$0.3

76.2$\pm$0.3	   77.9$\pm$0.2	   80.2$\pm$0.1	   82.4$\pm$0.4	   82.3$\pm$0.2

Detailed results on performance of Bayesian approximation for representation z and classifier w on Office-Home.

max width=

2*z     2*w     5c|5%     5c|10%     5c20%

A     C     P     R     Avg.     A     C     P     R     Avg.     A     C     P     R     Avg.

$\times$     $\times$
37.6$\pm$0.4 	   31.5$\pm$0.3	   68.5$\pm$0.2 	   63.8$\pm$0.2 	   50.4$\pm$0.1 	   51.0$\pm$0.2 	   41.6$\pm$0.1 	   76.0$\pm$0.3 	   69.2$\pm$0.3 	   59.5$\pm$0.1 	   56.6$\pm$0.3 	   51.8$\pm$0.5 	   80.9$\pm$0.3 	   72.9$\pm$0.4 	   65.6$\pm$0.1

$\checkmark$     $\times$
52.0$\pm$0.4	   37.6$\pm$0.3	   71.8$\pm$0.3	   68.3$\pm$0.1	   57.4$\pm$0.0	   59.2$\pm$0.4	   47.1$\pm$0.2	   77.6$\pm$0.1	   73.7$\pm$0.4	   64.4$\pm$0.1	   63.3$\pm$0.4	   52.7$\pm$0.2	   82.1$\pm$0.1	   76.0$\pm$0.3	   68.5$\pm$0.1

$\times$     $\checkmark$
51.6$\pm$0.3     37.8$\pm$0.1     70.7$\pm$0.4     66.9$\pm$0.2     56.8$\pm$0.1     57.6$\pm$0.3     47.2$\pm$0.2     77.4$\pm$0.3     72.5$\pm$0.1     63.7$\pm$0.1     62.5$\pm$0.4     53.5$\pm$0.3     82.0$\pm$0.2     76.0$\pm$0.3     68.5$\pm$0.1

$\checkmark$     $\checkmark$
53.5$\pm$0.1	   39.2$\pm$0.2	   71.5$\pm$0.3	   69.0$\pm$0.1	   58.3$\pm$0.1	   60.2$\pm$0.2	   47.5$\pm$0.2	   78.2$\pm$0.3	   74.0$\pm$0.2	   65.0$\pm$0.0	   64.0$\pm$0.3	   53.5$\pm$0.4	   82.5$\pm$0.2	   76.8$\pm$0.1	   69.2$\pm$0.2

Detailed results on performance of Bayesian approximation for representation z and classifier w on Office-Caltech.

max width=

2*z     2*w     5c|5%     5c|10%     5c20%

A     W     D     C     Avg.     A     W     D     C     Avg.     A     W     D     C     Avg.

$\times$     $\times$
90.0$\pm$0.7     89.4$\pm$0.8     95.0$\pm$1.1     83.5$\pm$0.5     89.5$\pm$0.3
93.6$\pm$0.1     97.0$\pm$0.6     92.1$\pm$0.7     86.3$\pm$0.4     92.3$\pm$0.2
95.0$\pm$0.2     94.5$\pm$0.7     96.0$\pm$1.2     86.8$\pm$0.2     93.1$\pm$0.1

$\checkmark$     $\times$
93.3$\pm$0.4	   95.0$\pm$0.5	   96.1$\pm$0.3	   90.0$\pm$0.3	   93.6$\pm$0.2
95.3$\pm$0.1	   97.4$\pm$0.3	   97.9$\pm$0.0	   90.4$\pm$0.3	   95.2$\pm$0.0
95.6$\pm$0.1	   96.6$\pm$0.5	   98.4$\pm$0.4	   90.3$\pm$0.6	   95.2$\pm$0.2

$\times$     $\checkmark$
93.2$\pm$0.1     95.5$\pm$0.3     95.7$\pm$0.5     89.6$\pm$0.2     93.5$\pm$0.1
94.8$\pm$0.2     97.3$\pm$0.4     97.8$\pm$0.4     90.6$\pm$0.3     95.1$\pm$0.1
95.6$\pm$0.2     96.6$\pm$0.3     99.2$\pm$0.3     89.8$\pm$0.4     95.3$\pm$0.2

$\checkmark$     $\checkmark$
93.7$\pm$0.2	   95.2$\pm$0.3	   96.4$\pm$0.4	   89.7$\pm$0.4	   93.8$\pm$0.1
95.4$\pm$0.1	   97.6$\pm$0.1	   97.4$\pm$0.4	   90.9$\pm$0.2	   95.3$\pm$0.0
95.6$\pm$0.2	   95.6$\pm$0.4	   98.4$\pm$0.5	   91.1$\pm$0.3	   95.2$\pm$0.1

Detailed results on performance of Bayesian approximation for representation z and classifier w on ImageCLEF.

max width=

2*z     2*w     5c|5%     5c|10%     5c20%

C     I     P     B     Avg.     C     I     P     B     Avg.     C     I     P     B     Avg.

$\times$     $\times$
88.3$\pm$0.5     73.2$\pm$0.5     61.2$\pm$0.9     40.0$\pm$0.8     65.7$\pm$0.4
90.6$\pm$0.8     79.3$\pm$0.2     66.3$\pm$0.5     51.9$\pm$0.6     72.0$\pm$0.3
92.9$\pm$0.5     86.5$\pm$0.2     71.9$\pm$0.8     56.0$\pm$0.8     76.8$\pm$0.3

$\checkmark$     $\times$
90.4$\pm$0.2	   81.9$\pm$0.7	   70.9$\pm$0.5	   57.9$\pm$0.6	   75.3$\pm$0.4
93.7$\pm$0.2	   85.7$\pm$0.6	   71.7$\pm$0.2	   59.1$\pm$0.3	   77.5$\pm$0.0
93.5$\pm$0.2	   89.8$\pm$0.6	   77.3$\pm$0.5	   59.0$\pm$0.4	   79.9$\pm$0.1

$\times$     $\checkmark$
91.4$\pm$1.1     81.9$\pm$0.5     71.8$\pm$0.6      58.4$\pm$0.5
93.0$\pm$0.6     86.3$\pm$0.4     72.0$\pm$0.6      60.0$\pm$0.6
93.8$\pm$0.5     88.1$\pm$0.5     77.1$\pm$0.8      59.0$\pm$0.4

$\checkmark$     $\checkmark$
91.5$\pm$0.2	   83.5$\pm$0.6	   71.6$\pm$0.8	   58.2$\pm$0.7	   76.2$\pm$0.3
94.2$\pm$0.2	   86.0$\pm$0.5	   71.7$\pm$0.6	   59.8$\pm$0.4	   77.9$\pm$0.2
93.9$\pm$0.1	   89.4$\pm$0.2	   78.0$\pm$0.4	   59.5$\pm$0.4	   80.2$\pm$0.1

§.§ Effectiveness in Handling Limited Data

The results of average accuracy on the Office-Home, Office-Caltech, and ImageCLEF datasets are given in Tables <ref>,  <ref>, and  <ref>, respectively, which provide detailed information for Fig. $2$ of the paper.  Our proposed probabilistic models, i.e., VMTL and VMTL-AC outperform the deterministic baseline multi-task learning model (BMTL), which demonstrates the benefits of our proposed variational Bayesian framework. Given a limited amount of training data, our models also have a better performance than VBMTL, which demonstrates that the proposed Gumbel-Softmax priors are beneficial to fully leverage the shared knowledge among tasks. When training data is limited, STL and VSTL can not train a proper model for each task. As the training data decreases, our methods based on the variational Bayesian framework are able to better handle this challenging case by incorporating the shared knowledge into the prior of each task. The best and second-best results of average accuracy are respectively marked in bold and underlined.

§.§ Effectiveness of Variational Bayesian Approximation

Comparative results on performance of Bayesian approximation for representations z and classifiers w on the Office-Home, Office-Caltech and ImageCLEF datasets are shown in Tables <ref>, <ref> and <ref>, respectively. Both variational Bayesian representations and classifiers can benefit performance. Our method jointly infers the posteriors over feature representations and classifiers in a Bayesian framework and outperforms its variants on three benchmarks for most of train-test splits, which demonstrates the benefits of applying Bayesian inference to both classifiers and representations.

Detailed results on performance of VMTL with different priors on Office-Home.

max width=

[c]2*Priors     5c|5%     5c|10%     5c20%

A     C     P     R     Avg.     A     C     P     R     Avg.     A     C     P     R     Avg.

52.2$\pm$0.4	   38.0$\pm$0.3	   71.3$\pm$0.3	   68.3$\pm$0.1	   57.5$\pm$0.0
59.2$\pm$0.4	   47.1$\pm$0.2	   77.6$\pm$0.1	   73.7$\pm$0.4	   64.4$\pm$0.1
63.3$\pm$0.4	   52.7$\pm$0.2	   82.1$\pm$0.1	   76.0$\pm$0.3	   68.5$\pm$0.1

[c]Learnable weighted
51.8$\pm$0.5	   38.0$\pm$0.3	   70.9$\pm$0.5	   67.9$\pm$0.4	   57.2$\pm$0.2
59.2$\pm$0.6	   46.9$\pm$0.4	   77.6$\pm$0.3	   73.2$\pm$0.3	   64.2$\pm$0.2
63.9$\pm$0.5	   53.2$\pm$0.4	   82.1$\pm$0.4	   76.3$\pm$0.2	   68.9$\pm$0.2

53.5$\pm$0.1	   39.2$\pm$0.2	   71.5$\pm$0.3	   69.0$\pm$0.1	   58.3$\pm$0.1
60.2$\pm$0.2	   47.5$\pm$0.2	   78.2$\pm$0.3	   74.0$\pm$0.2	   65.0$\pm$0.0
64.0$\pm$0.3	   53.5$\pm$0.4	   82.5$\pm$0.2	   76.8$\pm$0.1	   69.2$\pm$0.2

Detailed results on performance of VMTL with different priors on Office-Caltech.

max width=

[c]2*Priors     5c|5%     5c|10%     5c20%

A     W     D     C     Avg.     A     W     D     C     Avg.     A     W     D     C     Avg.

93.3$\pm$0.4	   95.0$\pm$0.5	   96.1$\pm$0.3	   90.0$\pm$0.3	   93.6$\pm$0.2
95.1$\pm$0.1	   97.4$\pm$0.3	   97.9$\pm$0.0	   90.7$\pm$0.3	   95.3$\pm$0.0
95.6$\pm$0.1	   96.1$\pm$0.5	   98.7$\pm$0.4	   91.0$\pm$0.6	   95.4$\pm$0.2

[c]Learnable weighted
93.6$\pm$0.3	   95.0$\pm$0.2	   96.7$\pm$0.7	   89.4$\pm$0.7	   93.7$\pm$0.2
94.9$\pm$0.3	   97.3$\pm$0.4	   97.9$\pm$0.0	   90.4$\pm$0.3	   95.1$\pm$0.1
95.6$\pm$0.2	   95.9$\pm$0.3	   98.2$\pm$0.8	   90.9$\pm$0.6	   95.1$\pm$0.1

93.7$\pm$0.2	   95.2$\pm$0.3	   96.4$\pm$0.4	   89.7$\pm$0.4	   93.8$\pm$0.1
95.4$\pm$0.1	   97.6$\pm$0.1	   97.4$\pm$0.4	   90.9$\pm$0.2	   95.3$\pm$0.0
95.6$\pm$0.2	   95.6$\pm$0.4	   98.4$\pm$0.5	   91.1$\pm$0.3	   95.2$\pm$0.1

Detailed results on performance of VMTL with different priors on ImageCLEF.

max width=

[c]2*Priors     5c|5%     5c|10%     5c|20%

C     I     P     B     Avg.     C     I     P     B     Avg.     C     I     P     B     Avg.

90.4$\pm$0.2	   82.7$\pm$0.7	   71.$\pm$0.5	   57.8$\pm$0.6	   75.5$\pm$0.4
93.4$\pm$0.2	   86.4$\pm$0.6	   71.5$\pm$0.2	   59.1$\pm$0.3	   77.6$\pm$0.0
93.6$\pm$0.2	   89.7$\pm$0.6	   77.8$\pm$0.5	   59.4$\pm$0.4	   80.1$\pm$0.1

[c]Learnable weighted
90.1$\pm$0.4	   82.1$\pm$0.2	   71.2$\pm$1.0	   58.5$\pm$0.6	   75.5$\pm$0.4
93.4$\pm$0.3	   85.6$\pm$0.5	   71.5$\pm$0.5	   59.1$\pm$0.6	   77.4$\pm$0.2
93.5$\pm$0.3	   89.5$\pm$0.2	   77.9$\pm$0.7	   59.6$\pm$0.4	   80.1$\pm$0.2

91.5$\pm$0.2	   83.5$\pm$0.6	   71.6$\pm$0.8	   58.2$\pm$0.7	   76.2$\pm$0.3
94.2$\pm$0.2	   86.0$\pm$0.5	   71.7$\pm$0.6	   59.8$\pm$0.4	   77.9$\pm$0.2
93.9$\pm$0.1	   89.4$\pm$0.2	   78.0$\pm$0.4	   59.5$\pm$0.4	   80.2$\pm$0.1

Performance comparison of different methods on the large-scaled dataset DomainNet for multiple tasks: Clipart (C), Infograph (I), Painting (P), Quickdraw (Q), Real (R) and Sketch (S).

max width=

2*Methods     7c4%

C     I     P     Q     R     S     Avg.

23.0$\pm$0.2	    7.1$\pm$0.3	   30.4$\pm$0.1      5.2$\pm$0.2	   58.7$\pm$0.3	   16.3$\pm$0.3	   23.5$\pm$0.2

33.8$\pm$0.1	    12.3$\pm$0.2	   37.1$\pm$0.1	   23.7$\pm$0.3	   65.3$\pm$0.4	   23.2$\pm$0.2	   32.6$\pm$0.1

Bakker et al. [4]
28.3$\pm$0.4	   10.7$\pm$0.2	   35.4$\pm$0.1	   22.4$\pm$0.3	   59.9$\pm$0.3	   21.7$\pm$0.3	   29.7$\pm$0.3

Long et al. [36]
28.7$\pm$0.1	   13.2$\pm$0.3	   38.7$\pm$0.4	   7.5$\pm$0.3       62.9$\pm$0.2	   20.6$\pm$0.3	   28.6$\pm$0.2

Kendall et al. [27]
30.2$\pm$0.3	   11.6$\pm$0.4	   37.3$\pm$0.4	   29.7$\pm$0.2	   62.1$\pm$0.5	   22.2$\pm$0.3	   32.2$\pm$0.3

Qian et al. [42]
32.5$\pm$0.3	   12.6$\pm$0.2	   40.4$\pm$0.4	   25.8$\pm$0.5	   64.4$\pm$0.2	   25.4$\pm$0.3	   33.5$\pm$0.3

34.0$\pm$0.1	   11.9$\pm$0.3	   36.8$\pm$0.1	   24.7$\pm$0.2	   64.9$\pm$0.2	   23.1$\pm$0.3	   32.6$\pm$0.1

33.1$\pm$0.1 	   12.0$\pm$0.2	   37.0$\pm$0.2 	   19.7$\pm$0.1 	   64.5$\pm$0.1	   22.8$\pm$0.3 	   31.5$\pm$0.1

31.4$\pm$0.1	   11.1$\pm$0.1	   35.3$\pm$0.1	   15.8$\pm$0.1	   61.5$\pm$0.1	   21.8$\pm$0.2	   29.5$\pm$0.1

36.4$\pm$0.2	   14.8$\pm$0.2	   40.0$\pm$0.1	   19.0$\pm$0.1	   65.5$\pm$0.1	   26.1$\pm$0.1	   33.6$\pm$0.1

Impact of $L$ and $M$ on performance. Experiments are conducted on Office-Home with a 5% train-test split.

max width=

L (=M)     1        10       20       30       40       50       60       70       80       90       100

56.1    56.3     56.1     56.2     56.3     56.1     56.3     56.0     56.2     56.3     55.8

58.1    58.3     58.2     58.2     58.2     58.3     58.0     58.3     58.2     58.2     58.2

§.§ Effectiveness of Gumbel-Softmax Priors

The performance comparison of the proposed VMTL with different priors on the Office-Home, Office-Caltech and ImageCLEF datasets are shown in Tables <ref>, <ref> and <ref>, respectively.
These approximated priors are obtained by combining posteriors of related tasks.
“Mean" denotes that the prior of the current task is the mean of variational posteriors of other related tasks. “Learnable weighted" denotes that weights of mixing the variational posteriors of other related tasks are learnable. Our proposed prior by the Gumbel-Softmax technique to learn the mixing weights introduces uncertainty to the relationships among tasks to explore sufficient transferable information from other tasks. In the three datasets, our designed priors outperform other methods under most of the train-test splits.
In addition, the results of DomainNet under the $4$% train-test split are provided in Table <ref>.

We learn different weights for $\mathbf{w}$ and $\mathbf{z}$, motivated by the fact that latent variables are different in terms of capturing uncertainty: $\mathbf{w}$ is at the category level while $\mathbf{z}$ at the instance level.
To validate, we conduct experiments using the same Gumbel-Softmax weights for both variables. As shown in Table <ref>, using different weights are slightly better than using the same Gumbel-Softmax weights.

Performance of our priors using the same weights for $\mathbf{w}$ and $\mathbf{z}$ or not on $\textit{Office-Home}$.

Train-test split        5%             10%            20%

Same weights          58.2$\pm$0.1     64.8$\pm$0.1     68.7$\pm$0.3

Different weights     58.3$\pm$0.1     65.0$\pm$0.0     69.2$\pm$0.2

Illustration of training loss with iterations on Office-Home, Office-Caltech and ImageCLEF. VMTL-AC converges faster than VMTL under $5\%$, $10\%$ and $20\%$ train-test splits, which demonstrates the computational benefit of amortized learning.

The performance for each task under different noise levels on the Office-Home dataset.

§.§ Sensitivity of the Hyper-parameter $L$ and $M$

In this paper, $L$ and $M$ are the number of Monte Carlo samples for the variational
posteriors of latent representations and classifiers, respectively.
We ablate the sensitivity of $L$ and $M$ in Table <ref> on the Office-Home dataset. In practice, $L$ and $M$ are set to ten, which offer a good balance between accuracy and efficiency.

§.§ Fast Convergence of Amortized Classifiers

The computational advantage of amortized classifiers can be illustrated by the training loss as function of iteration on Office-Home, Office-Caltech and ImageCLEF. As shown in Fig. <ref>, VMTL-AC converges faster than VMTL under $5\%$, $10\%$ and $20\%$ train-test splits, which demonstrates the computational benefit of amortized learning.

§.§ Robustness of Our Methods

We conduct experiments on the Office-home dataset to show the robustness of our methods against adversarial attacks. In our experiments, the adversarial attack is implemented by the fast gradient sign method [18] where $\epsilon$ denotes the noise level. As shown in Fig. <ref>, under different noise levels, the proposed model VMTL outperforms BMTL. As the noise level increases, the proposed model VMTL-AC is more robust than other models.

§.§ A New Metric for Evaluating the Uncertainty Prediction

For Bayesian methods, it is necessary to quantify the model's ability of handling uncertainty. We looked into related references and didn't find such a measure for comparing the uncertainty prediction. Thus, we adopt a new metric for evaluating the uncertainty prediction, the ratio of the average entropy of failure cases and properly classified samples.  If the ratio is higher, the Bayesian methods predict failure cases with more uncertainty and predict successful cases with more confidence. As shown in Table <ref>, VMTL has higher entropy ratios, which demonstrates the effectiveness of our model to handle the uncertainty.

Entropy ratio (the higher the better) on $\textit{Office-Home}$.

Train-test split       5%             10%            20%

Bakker et al.[4]    2.469       2.625       3.031

VBMTL                4.111       4.430       5.460

VMTL        4.546       4.472       5.584

§.§ Runtime Impact of the Sampling Steps

To investigate the runtime impact of the additional sampling steps
we compare the actual training and inference time of the proposed method with that of deterministic approaches. As shown in Table <ref>, compared to the deterministic baseline (BMTL), the training and inference time of our method increases as the number of MC samples is set higher. In this paper, the number of MC samples is set to be 10, which is computationally efficient while yielding good performance (Table <ref>). In this case, our method does cost extra at training time but with 0.122s per iteration, this is still acceptable. When testing 1000 samples, our method only increases by an extra 10% test time of BMTL. Thus, our model doesn't cost much more time to surpass BMTL by 7.9% in terms of accuracy.

Runtime impact (seconds) of sampling step on Office-Home with 5% split.

Methods     BMTL      4cVMTL

MC samples     -     1        10       50       100

Training (per iteration)

Inference (per 1000 test samples)

[1]
A. A. Alemi, I. Fischer, J. V. Dillon, and K. Murphy.
Deep variational information bottleneck.
arXiv preprint arXiv:1612.00410, 2016.

[2]
C. Archambeau, S. Guo, and O. Zoeter.
Sparse bayesian multi-task learning.
In NIPS, volume 1, page 41, 2011.

[3]
A. Argyriou, T. Evgeniou, and M. Pontil.
Multi-task feature learning.
In Advances in neural information processing systems, pages
41–48, 2007.

[4]
B. Bakker and T. Heskes.
Task clustering and gating for bayesian multitask learning.
Journal of Machine Learning Research, 4(May):83–99, 2003.

[5]
J. Baxter.
A model of inductive bias learning.
Journal of artificial intelligence research, 12:149–198, 2000.

[6]
C. Blundell, J. Cornebise, K. Kavukcuoglu, and D. Wierstra.
Weight uncertainty in neural network.
In International Conference on Machine Learning, pages
1613–1622. PMLR, 2015.

[7]
S. R. Bowman, L. Vilnis, O. Vinyals, A. M. Dai, R. Jozefowicz, and S. Bengio.
Generating sentences from a continuous space.
arXiv preprint arXiv:1511.06349, 2015.

[8]
F. J. Bragman, R. Tanno, S. Ourselin, D. C. Alexander, and J. Cardoso.
Stochastic filter groups for multi-task cnns: Learning specialist and
generalist convolution kernels.
In Proceedings of the IEEE International Conference on Computer
Vision, pages 1385–1394, 2019.

[9]
R. Caruana.
Multitask learning.
Machine learning, 28(1):41–75, 1997.

[10]
Z. Chen, V. Badrinarayanan, C.-Y. Lee, and A. Rabinovich.
Gradnorm: Gradient normalization for adaptive loss balancing in deep
multitask networks.
In International Conference on Machine Learning, pages
794–803. PMLR, 2018.

[11]
C. Cremer, X. Li, and D. Duvenaud.
Inference suboptimality in variational autoencoders.
arXiv preprint arXiv:1801.03558, 2018.

[12]
H. Daumé III.
Bayesian multitask learning with latent hierarchies.
arXiv preprint arXiv:0907.0783, 2009.

[13]
C. Finn, P. Abbeel, and S. Levine.
Model-agnostic meta-learning for fast adaptation of deep networks.
arXiv preprint arXiv:1703.03400, 2017.

[14]
C. Finn, K. Xu, and S. Levine.
Probabilistic model-agnostic meta-learning.
In Proceedings of the 32nd International Conference on Neural
Information Processing Systems, pages 9537–9548, 2018.

[15]
Y. Gao, H. Bai, Z. Jie, J. Ma, K. Jia, and W. Liu.
Mtl-nas: Task-agnostic neural architecture search towards
general-purpose multi-task learning.
In Proceedings of the IEEE/CVF Conference on Computer Vision and
Pattern Recognition, pages 11543–11552, 2020.

[16]
S. Gershman and N. Goodman.
Amortized inference in probabilistic reasoning.
In Proceedings of the annual meeting of the cognitive science
society, volume 36, 2014.

[17]
B. Gong, Y. Shi, F. Sha, and K. Grauman.
Geodesic flow kernel for unsupervised domain adaptation.
In 2012 IEEE Conference on Computer Vision and Pattern
Recognition, pages 2066–2073. IEEE, 2012.

[18]
I. J. Goodfellow, J. Shlens, and C. Szegedy.
Explaining and harnessing adversarial examples.
arXiv preprint arXiv:1412.6572, 2014.

[19]
J. Gordon, J. Bronskill, M. Bauer, S. Nowozin, and R. E. Turner.
Meta-learning probabilistic inference for prediction.
arXiv preprint arXiv:1805.09921, 2018.

[20]
G. Griffin, A. Holub, and P. Perona.
Caltech-256 object category dataset.

[21]
P. Guo, C.-Y. Lee, and D. Ulbricht.
Learning to branch for multi-task learning.
In International Conference on Machine Learning, pages
3854–3863. PMLR, 2020.

[22]
T. Heskes.
Empirical bayes for learning to learn.

[23]
A. Jalali, S. Sanghavi, C. Ruan, and P. K. Ravikumar.
A dirty model for multi-task learning.
In Advances in neural information processing systems, pages
964–972, 2010.

[24]
E. Jang, S. Gu, and B. Poole.
Categorical reparameterization with gumbel-softmax.
arXiv preprint arXiv:1611.01144, 2016.

[25]
P. K. Jawanpuria, M. Lapin, M. Hein, and B. Schiele.
Efficient output kernel learning for multiple tasks.
In Advances in neural information processing systems, pages
1189–1197, 2015.

[26]
Z. Kang, K. Grauman, and F. Sha.
Learning with whom to share in multi-task feature learning.
In ICML, volume 2, page 4, 2011.

[27]
A. Kendall, Y. Gal, and R. Cipolla.
Multi-task learning using uncertainty to weigh losses for scene
geometry and semantics.
In Proceedings of the IEEE conference on computer vision and
pattern recognition, pages 7482–7491, 2018.

[28]
H. Kim, A. Mnih, J. Schwarz, M. Garnelo, A. Eslami, D. Rosenbaum, O. Vinyals,
and Y. W. Teh.
Attentive neural processes.
arXiv preprint arXiv:1901.05761, 2019.

[29]
D. P. Kingma and J. Ba.
Adam: A method for stochastic optimization.
arXiv preprint arXiv:1412.6980, 2014.

[30]
D. P. Kingma, T. Salimans, and M. Welling.
Variational dropout and the local reparameterization trick.
In Advances in neural information processing systems, pages
2575–2583, 2015.

[31]
D. P. Kingma and M. Welling.
Auto-encoding variational bayes.
arXiv preprint arXiv:1312.6114, 2013.

[32]
Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner.
Gradient-based learning applied to document recognition.
Proceedings of the IEEE, 86(11):2278–2324, 1998.

[33]
H. Liu, M. Palatucci, and J. Zhang.
Blockwise coordinate descent procedures for the multi-task lasso,
with applications to neural semantic basis discovery.
In Proceedings of the 26th Annual International Conference on
Machine Learning, pages 649–656, 2009.

[34]
L. Liu, Y. Li, Z. Kuang, J.-H. Xue, Y. Chen, W. Yang, Q. Liao, and W. Zhang.
Towards impartial multi-task learning.
In International Conference on Learning Representations, 2021.

[35]
S. Liu, E. Johns, and A. J. Davison.
End-to-end multi-task learning with attention.
In Proceedings of the IEEE Conference on Computer Vision and
Pattern Recognition, pages 1871–1880, 2019.

[36]
M. Long, Z. Cao, J. Wang, and S. Y. Philip.
Learning multiple tasks with multilinear relationship networks.
In Advances in neural information processing systems, pages
1594–1603, 2017.

[37]
I. Misra, A. Shrivastava, A. Gupta, and M. Hebert.
Cross-stitch networks for multi-task learning.
In Proceedings of the IEEE Conference on Computer Vision and
Pattern Recognition, pages 3994–4003, 2016.

[38]
D. Molchanov, A. Ashukha, and D. Vetrov.
Variational dropout sparsifies deep neural networks.
arXiv preprint arXiv:1701.05369, 2017.

[39]
E. Nalisnick and P. Smyth.
Learning priors for invariance.
In International Conference on Artificial Intelligence and
Statistics, pages 366–375. PMLR, 2018.

[40]
X. Peng, Q. Bai, X. Xia, Z. Huang, K. Saenko, and B. Wang.
Moment matching for multi-source domain adaptation.
In Proceedings of the IEEE International Conference on Computer
Vision, pages 1406–1415, 2019.

[41]
T. K. Pong, P. Tseng, S. Ji, and J. Ye.
Trace norm regularization: Reformulations, algorithms, and multi-task
SIAM Journal on Optimization, 20(6):3465–3489, 2010.

[42]
W. Qian, B. Chen, and F. Gechter.
Multi-task variational information bottleneck.
arXiv preprint arXiv:2007.00339, 2020.

[43]
K. Saenko, B. Kulis, M. Fritz, and T. Darrell.
Adapting visual category models to new domains.
In European conference on computer vision, pages 213–226.
Springer, 2010.

[44]
Y. Shi, N. Siddharth, B. Paige, and P. H. Torr.
Variational mixture-of-experts autoencoders for multi-modal deep
generative models.
Advances in Neural Information Processing Systems, 2019.

[45]
K. Simonyan and A. Zisserman.
Very deep convolutional networks for large-scale image recognition.
arXiv preprint arXiv:1409.1556, 2014.

[46]
K. Sohn, H. Lee, and X. Yan.
Learning structured output representation using deep conditional
generative models.
In Advances in neural information processing systems, pages
3483–3491, 2015.

[47]
G. Strezoski, N. v. Noord, and M. Worring.
Many task learning with task routing.
In Proceedings of the IEEE International Conference on Computer
Vision, pages 1375–1384, 2019.

[48]
X. Sun, R. Panda, R. Feris, and K. Saenko.
Adashare: Learning what to share for efficient deep multi-task
arXiv preprint arXiv:1911.12423, 2019.

[49]
H. Takahashi, T. Iwata, Y. Yamanaka, M. Yamada, and S. Yagi.
Variational autoencoder with implicit optimal priors.
In Proceedings of the AAAI Conference on Artificial
Intelligence, pages 5066–5073, 2019.

[50]
M. K. Titsias and M. Lázaro-Gredilla.
Spike and slab variational inference for multi-task and multiple
kernel learning.
In Advances in neural information processing systems, pages
2339–2347, 2011.

[51]
J. Tomczak and M. Welling.
Vae with a vampprior.
In International Conference on Artificial Intelligence and
Statistics, pages 1214–1223, 2018.

[52]
H. Venkateswara, J. Eusebio, S. Chakraborty, and S. Panchanathan.
Deep hashing network for unsupervised domain adaptation.
In (IEEE) Conference on Computer Vision and Pattern
Recognition (CVPR), 2017.

[53]
Y. Xue, X. Liao, L. Carin, and B. Krishnapuram.
Multi-task learning for classification with dirichlet process priors.
Journal of Machine Learning Research, 8(Jan):35–63, 2007.

[54]
K. Yu, V. Tresp, and A. Schwaighofer.
Learning gaussian processes from multiple tasks.
In Proceedings of the 22nd international conference on Machine
learning, pages 1012–1019, 2005.

[55]
T. Yu, S. Kumar, A. Gupta, S. Levine, K. Hausman, and C. Finn.
Gradient surgery for multi-task learning.
arXiv preprint arXiv:2001.06782, 2020.

[56]
Y. Zhang and Q. Yang.
Learning sparse task relations in multi-task learning.
In Proceedings of the AAAI Conference on Artificial
Intelligence, 2017.

[57]
Y. Zhang and Q. Yang.
A survey on multi-task learning.
IEEE Transactions on Knowledge and Data Engineering, 2021.

[58]
Y. Zhang and D. Yeung.
Multi-task learning using generalized t process.
In Proceedings of the Thirteenth International Conference on
Artificial Intelligence and Statistics, pages 964–971, 2010.

[59]
Y. Zhang and D.-Y. Yeung.
A convex formulation for learning task relationships in multi-task
arXiv preprint arXiv:1203.3536, 2012.

[60]
Y. Zhang, Y. Zhang, and W. Wang.
Deep multi-task learning via generalized tensor trace norm.
arXiv preprint arXiv:2002.04799, 2020.