L EARNING TO T RANSFER VIA M ODELLING M ULTILEVEL T ASK D EPENDENCY
Anonymous authors
Paper under double-blind review
A BSTRACT
Multi-task learning has been successful in leveraging the dependency among different tasks to improve general performance.
However, when applying to ‘discrete’ data (graph/text), most of the existing frameworks only leverage the general task dependency with the assumption that the task dependency remains the same for (1) different data samples; and (2) different sub-structures (node/word) in one data sample (graph/text). Yet, this assumption may not be true for real-world ‘discrete’ datasets.
Thus, we propose a novel multi-task learning frameworkLearning To Transfer
Via Modelling Multi-level Task Dependency, which leverages both general task dependency and data-speciﬁc task dependency to guide the knowledge transfer among tasks.
We also propose a decomposition method to reduce the space complexity needed by transfer functions from quadratic to linear.
To show the effectiveness of our framework and the importance of modelling multi-level task dependency, we conduct experiments on several public graph/text datasets, on which we obtain signiﬁcant improvements over current frameworks.
I NTRODUCTION
Multi-task learning (Caruana, 1997) aims to train a single model on multiple related tasks jointly, so that useful knowledge learned from one task can be transferred to enhance the generalization performance of other tasks.
Over the last few years, different types of multi-task learning mechanisms (Sener & Koltun, 2018; Guo & Farooq, 2018; Ish, 2016; Lon, 2015) have been proposed and proved better than single-task learning methods from natural language processing (Palmer et al., 2017) and computer vision (Cortes et al., 2015) to chemical study (Ramsundar et al., 2015).
Despite the success of multi-task learning, when applying to ‘discrete’ data (graph/text), most of the current multi-task learning frameworks (Zamir et al., 2018; Ish, 2016) only leverage the general task dependency with the assumption that the task dependency remains the same for (1) different data samples; and (2) different sub-structures (node/word) in one data sample (graph/text).
However, this assumption is not always true in many real-world problems.
(1) Different data samples may have different task dependency.
For example, when we want to predict the chemical properties of a particular toxic molecule, despite the general task dependency, its representations learned from toxicity prediction tasks should be more signiﬁcant than the other tasks.
(2) Even for the same data sample, different sub-structures may have different task dependency.
Take sentence classiﬁcation as an example. Words like ‘good’ or ‘bad’ may transfer more knowledge from sentiment analysis tasks, while words like ‘because’ or ‘so’ may transfer more from discourse relation identiﬁcation tasks.
In this work, to accurately learn the task dependency in both general level and data-speciﬁc level, we propose a novel framework, ‘Learning to Transfer via ModellIng mulTi-level Task dEpeNdency’ (L2T-MITTEN).
The general task dependency is learned as a parameterized weighted dependency graph.
And the data-speciﬁc task dependency is learned with the position-wise mutual attention mechanism. The two-level task dependency can be used by our framework to improve the performance on multiple tasks. And the objective function of multi-task learning can further enhance the quality of the learned task dependency.
By iteratively mutual enhancement, our framework can not only perform better on multiple tasks, but also can extract high-quality dependency structures at different levels, which can reveal some hidden knowledge of the datasets.
Another problem is that to transfer task-speciﬁc representations between every task pair, the number of transfer functions will grow quadratically as the number of tasks increases, which is unaffordable. To solve this, we develop a universal representation space where all task-speciﬁc representations get mapped to and all target tasks can be inferred from. This decomposition method reduces the space complexity from quadratic to linear.
We validate our multi-task learning framework extensively on different tasks, including graph classication, node classiﬁcation, and text classiﬁcation.
Our framework outperforms all the other state-ofthe-art (SOTA) multi-task methods.
Besides, we show that L2T-MITTEN can be used as an analytic tool to extract interpretable task dependency structures at different levels on real-world datasets.
Our contributions in this work are threefold:
• We propose a novel multi-task learning framework to learn to both general task dependency and data-speciﬁc task dependency.
The learned task dependency structures can be mutually enhanced with the objective function of multi-task learning.
• We develop a decomposition method to reduce the space complexity needed by transfer functions from quadratic to linear.
• We conduct extensive experiments on different real-world datasets to show the effectiveness of our framework and the importance of modelling multi-level task dependency.
R ELATED W ORK
According to a recent survey (Ruder, 2017), existing multi-task learning methods can be categorized by whether they share the parameters hardly or softly
. 2. H ARD P ARAMETER S HARING
For hard parameter sharing, a bottom network will be shared among all the tasks, and each individual task will have its own task-speciﬁc output network.
The parameter sharing of the bottom network reduces the parameter needed to be learned and thus can avoid over-ﬁtting to a speciﬁc task.
However, when the tasks are not relevant enough (Sha, 2002; Baxter, 2011), the shared-bottom layers will suffer from optimization conﬂicts caused by mutually contradicted tasks.
If the bottom model is not capable enough to encode all the necessary knowledge from different tasks, this method will fail to correctly capture all the tasks.
Besides, Dy & Krause (2018) points out that the gradients of some dominant task will be relatively larger than gradients of other tasks.
This dominant phenomenon will be more obvious when the proportions of labeled data between tasks are uneven, in which case the model will be majorly optimized on data-rich tasks.
To alleviate this problem, some recent works (Sener & Koltun, 2018; Dy & Krause, 2018) try to dynamically adjust the task weight during the training stage.
Sener & Koltun (2018) casts the multi-task learning to a multi-objective optimization problem, and they use a gradient-based optimization method to ﬁnd a Pareto optimal solution.
Dy & Krause (2018) proposes a new normalization method on gradients, which attempts to balance the inﬂuences of different tasks.
Recently, Guo & Farooq (2018) proposes to apply Mixture-of-Experts on multi-task learning, which linearly combines different experts (bottoms) by learnable gates.
Because different experts can capture different knowledge among tasks, this model can, to some extent, model the dependency relationship among tasks.
2. S OFT P ARAMETER S HARING
Methods using soft parameter sharing (Lon, 2015; Ish, 2016; Dai et al., 2015; Yan, 2017) do not keep the shared bottom layers.
Instead, for soft-parameter models, most of the model parameters are task-speciﬁc.
Lon (2015) focuses on reducing the annotation effort of the dependency parser tree.
By combining two networks with a L2 normalization mechanism, knowledge from a different source language can be used to reduce the requirement of the amount of annotation.
Further, in some existing works, the shallow layers of the model will be separated from other layers, and be used as the feature encoders to extract task-speciﬁc representations.
For example, Ish (2016) proposes a
Cross-Stitch model which is a typical separate bottom model.
Cross-Stitch model will be trained on different tasks separately to encode the task-speciﬁc representations from different bottom layers.
Then, a cross-stitch unit is used a as a gate to combine those separately trained layers.
Yan (2017) introduces the tensor factorization model to allow common knowledge to be shared at each layer in the network.
By the strategy proposed in their work, parameters are softly shared across the corresponding layers of the deep learning network and the parameter sharing ratio will be determined by the model itself.
We also note that some recent works (Zamir et al., 2018; Lan et al., 2017; Liu et al., 2018) can learn to capture task dependency.
Zamir et al. (2018) computes an afﬁnity matrix among tasks based on whether the solution for one task can be sufﬁciently easily read out of the representation trained for another task. However, it can only capture the general task dependency.
Lan et al. (2017) uses a sigmoid gated interaction module between two tasks to model their relation.
But it will suffer from quadratic growth in space as the number of tasks increases.
Liu et al. (2018) utilizes a shared network to share features across different tasks and uses the attention mechanism to automatically determine the importance of the shared features for the respective task.
However, there is no knowledge transferred or interaction between tasks.
A PPROACH
In this section, we propose our framework L2T-MITTEN, which can end-to-end learn the task dependency in both general and data-speciﬁc level, and help to assemble multi-task representations from different task-speciﬁc encoders
. 3. P ROBLEM F ORMULATION
To formulate our framework, we ﬁrst start by brieﬂy introducing a general setting of multi-task learning.
For each task t ∈ { 1 , ..., T } , we have a corresponding dataset { ( X ( t ) k , y ( t ) k ) } N ( t ) k
=1 with N ( t ) data samples, where X ( t ) k represent the feature vector of k -th data sample and y ( t ) k is its label.
We would like to train T models for these tasks, and each model has its own parameter W ( t ) .
Note that for different multi-task learning frameworks, these parameters can be shared hardly or softly.
The goal of multi-task learning is to improve general performance by sharing information among related tasks. The total loss of multi-task learning is calculated as:
[Equation]
3. A RCHITECTURE O VERVIEW
As is shown in Figure 1, our framework consists of three components: Task-specific
Encoders , Transfer Block , and Readout Block .
The Task-specific Encoders consists of T separate feature encoders, which can be any type of feed-forward networks based on speciﬁc data.
Unlike hard parameter sharing methods that tie the bottom encoders’ parameters together, we keep each feature encoder separate to efﬁciently extract task-speciﬁc knowledge.
In this way, for a given data sample X k , we can use these encoders to get task-speciﬁc representations { E t ( X k ) } Tt =1 , where E t ( X k ) is the representation of X k for task t .
To conduct multi-task learning, one can simply use the representation of each task alone to predict labels without sharing any parameters.
However, this model will suffer for tasks without sufﬁcient labeled data.
Therefore, we would like to (1) transfer the knowledge among these T tasks and (2) assemble the transferred representations, which is what we do in the Transfer Block .
The Readout Block also consists of T separate readout modules depending on the speciﬁc data.
The detailed architecture for different tasks can be found in Appendix B. 3. T RANSFER B LOCK 3.3. T ASK - SPECIFIC R EPRESENTATIONS T RANSFER In the Transfer Block , the ﬁrst step is to transfer the task-speciﬁc representations from source to target tasks. A naive way is to use a transfer function F i → j ( · ) to transfer the task-speciﬁc representation from the space of task i to task j for every task pair:
[Equation]
where W i → j ∈ R d × d , and d is the dimension of the task-speciﬁc representation.
However, this will result in a total number of T 2 transfer functions.
Thus, to prevent the quadratic growth, we develop a universal representation space where all task-speciﬁc representations get mapped to and all target tasks can be inferred from.
More speciﬁcally, we decompose each transfer function F i → j ( · ) to F Tj ◦ F Si ( · ) .
Assume that we are trying to transfer the task-speciﬁc representation E i ( X k ) from task i to task j , where i, j ∈ { 1 , 2 , ..., T } .
We can decompose the transfer matrix W i
→ j to S i and T j . In this way, we only need 2 T transfer functions in total for F Si ( · ) and F Tj ( · ) .
The space complexity is reduced from O ( T 2 ) to O ( T ) .
Here we denote the transferred representation from task i to task j as:
[Equation]
where S i , T j ∈ R d × d (cid:48) and d (cid:48) is a hyper-parameter. 3.3. R EPRESENTATIONS A SSEMBLY VIA M ULTI - LEVEL T ASK D EPENDENCY
With the transferred representations, the next step of the Transfer Block is to assemble the transferred representations with respect to the multi-level task dependency.
Here, the multi-level task dependency consists of two parts: (1) the general task dependency and (2) the data-speciﬁc task dependency .
The multi-level task dependency is modelled by the position-wise mutual attention mechanism as shown in Figure 2.
To model the general task dependency , we represent it by a parameterized weighted dependency graph D ∈ R T × T .
The learnable weight of this parameterized dependency graph represents the transferable weight between any task pair.
Note that the dependency graph is asymmetrical.
In this way, the negative inﬂuence of irrelevant tasks can be reduced as much as possible.
Further, even for the same task pair, the transferable weight (dependency) may be different for (1) different data samples; (2) different sub-structure (node/word) in one data sample (graph/text).
Therefore, we study the data-speciﬁc task dependency in depth.
To efﬁciently model the dataspeciﬁc task dependency, we consider the mutual attention between representations of the same data sample under source and target tasks.
Given H i
→ j , the transferred representation from the task i to task j , and E j ( X k ) , the original representation from the target task, we get the position-wise mutual attention by:
[Equation]
where W Qi , W Kj ∈ R d × d (cid:48)(cid:48) are the query and key projection matrices, d (cid:48)(cid:48) is a hyper-parameter, ⊗ is the Hadamard product, and SUM is used to eliminate the last dimension ( d (cid:48)(cid:48) ).
We use Hadamard product instead of matrix multiplication because we only want the sub-structure in a given data sample to interact with its counterpart under other tasks. Take graph data as an example, a certain node of one graph will only give attention to the same node of that graph under other tasks.
Then, for a target task j , we obtain (1) a set of general task dependency D j = { D i → j } Ti =1 ; and (2) a set of data-speciﬁc task dependency A j = { A i → j } Ti =1 .
To integrate them, we ﬁrst scale data-speciﬁc task dependency
A j by the general task dependency D j .
And then, we calculate the weighted sum of the transferred representations according to the multi-level task dependency. The ﬁnal assembled representation ˆ X jk (for data sample k and task j ) is as follow:
[Equation]
where ˜ D is the normalized version of D , W V i ∈ R d × d (cid:48)(cid:48) is the value projection matrix, W Oj ∈ R d × d (cid:48)(cid:48) is the output projection matrix.
Note that η here is a scalar parameter used to prevent the vanish gradient problem of two normalization operations.
E XPERIMENT
In this section, we evaluate the performance of our proposed L2T-MITTEN approach against several classical and SOTA approaches on two application domains: graph and text.
In graph domain, we train a multitask Graph Convolutional Network (GCN) for both graph-level and node-level classiﬁcation.
And in text domain, we train a multitask Recurrent Neural Network (RNN) for text classiﬁcation.
Further, we provide visualization and analysis on the learned hidden dependency structure.
Codes and datasets will be released.
4. D ATASETS
For graph-level classiﬁcation, we use Tox21 (Wu et al., 2017) and SIDER (Kuhn et al., 2010).
Tox21: Toxicology in the 21st Century (Tox21) is a database measuring the toxicity of chemical compounds.
This dataset contains qualitative toxicity assays for 8014 organic molecules ondifferent targets including nuclear receptors and stress response pathways.
In our experiment, we treat each molecule as a graph and each toxicity assay as a binary graph-level classiﬁcation task (for 12 tasks in total).
SIDER: The Side Effect Resource (SIDER) is a database of marketed drugs and adverse drug reactions.
This dataset contains qualitative drug side-effects measurements for 1427 drugs onside-effects.
In our experiment, we treat each drug (organic molecule) as a graph and the problem of predicting whether a given drug induces a side effect as a individual graph-level classiﬁcation tasks (for 27 tasks in total).
For node-level classiﬁcation, we use DBLP (Tang et al., 2008) and BlogCatalog (IV et al., 2009).
DBLP:
In the dataset, authors are represented by nodes and its feature is generated by titles of their papers.
Two authors are linked together if they have co-authored at least two papers in 2014-2019.
We use 18 representative conferences as labels.
An author is assigned to multiple labels if he/she has published papers in some conferences.
The processed DBLP dataset is also published in our repository.
BlogCatalog: The BlogCatalog is a collection of bloggers.
In the dataset, bloggers are represented as nodes, and there is a link between two bloggers if they are friends.
The interests of each blogger can be tagged according to the categories that he/she published blogs in.
This dataset usescategories as labels.
Each blogger is assigned to multiple labels if he/she published a blog in some categories.
For text classiﬁcation, we use TMDb 1 dataset.
TMDb: The Movie Database (TMDb) dataset is a collection of information for 4803 movies.
For each movie, the dataset includes information ranging from the production company, production country, release date to plot, genre, popularity, etc.
In our experiment, we select plots as the input with genres as the label.
We treat the problem of predicting whether a given plot belongs to a genre as an individual text-level classiﬁcation tasks (for 20 tasks in total).
A summary of the ﬁve datasets is provided in Appendix A.
4. B ASELINE M ETHODS
We compare our L2T-MITTEN approach with both classical and SOTA approaches.
The details are given as follows:
Single-task method: Single-Task: Simply train a network consists of encoder block and readout block for each task separately.
Classical multi-task method: Shared-Bottom (Caruana, 1997):
This is a widely adopted multi-task learning framework which consists of a shared-bottom network (encoder block in our case) shared by all tasks, and a separate tower network (readout block in our case) for each speciﬁc task.
The input is fed into the sharedbottom network, and the tower networks are built upon the output of the shared-bottom.
Each tower will then produce the task-speciﬁc outputs.
SOTA multi-task methods:
Cross-Stitch (Ish, 2016):
This method uses a ”cross-stitch” unit to learn the combination of shared and task-speciﬁc representation.
The ”cross-stitch” unit is a k × k trainable matrix ( k is the number of tasks) which will transfer and fuse the representation among tasks by the following equation:
[Equation]
 where x i is the output of the lower level layer for task i , α ij is the transfer weight from task j to task i , and
˜ x
i is the input of the higher level layer for task i .
MMoE (Guo & Farooq, 2018):
This method adopts the Multi-gate Mixture-of-Expert structure.
This structure consists of multiple bottom networks (experts), and multiple gating networks which take the input features and output softmax gates assembling the experts with different weights.
The assembled features are then passed into the task-speciﬁc tower networks.
All the baseline models use the same encoder and readout block for each task.
The architecture details are provided in Appendix B.
4. E XPERIMENTAL S ET - UP
We partition the datasets into 80:20 training/testing sets (i [Table] e. each data sample can either appear in the training or testing set) and evaluate our approach under multiple settings 2 : (1) Sufﬁcient setting: all tasks have sufﬁcient labeled training data; (2) Imbalanced setting: some tasks have more labeled training data than others; (3) Deﬁcient setting: all tasks have deﬁcient labeled training data.
Models are trained for 100 epochs using the ADAM optimizer. [Table] [Table]
4. R ESULT
We report the performance of our approach and baselines on graph classiﬁcation, node classiﬁcation and text classiﬁcation tasks in terms of AUC-ROC score in Table 1 and 2 respectively.
From the above result, ﬁrst of all, we can see that the multi-task methods outperform the single-task method in most cases which shows the effectiveness of knowledge transfer and multi-task learning.
Further, we can see that our proposed L2T-MITTEN approach outperforms both classical and SOTA in most tasks.
Finally, our approach shows signiﬁcant improvement under deﬁcient labeled training data setting, since our approach leverages the structure of the data sample itself to guide the transfer among tasks.
Secondly, we found that in the real-world dataset, like DBLP dataset, our model can outperform other SOTA methods signiﬁcantly, which demonstrate the importance of taking multi-level dependency into consideration.
Note that the Single-Task can achieve the second-best result.
This fact indicates that in the real-world dataset, tasks may be irrelevant to each other.
Our multi-level task dependency can be more effective to prevent the inﬂuence of other irrelevant tasks.
Furthermore, we conduct experiments on the text classiﬁcation dataset, TMDb.
The Cross-Stitch model achieves the best result when the label ratio for every task is 80%.
However, our task can achieve the best result for partially labeled setting (partially 10%) and few labeled setting (all 10%).
[Table] This fact demonstrates that our directed task dependency graph can effectively prevent the negative knowledge be transferred among different tasks when the training label is few.
4. V ISUALIZATION AND A NALYSIS
For visualization and analysis of the learned multi-level task dependency structure, we will take DBLP as an example here due to its simplicity in interpreting and understanding.
[Figure] First, in Figure 3a, where we directly visualize the learned general task dependency matrix, we can see our approach indeed captures the task dependency structure in general, i.e. conferences from the same domain are more likely to be in the same sub-tree.
Moreover, in Figure 3b we plot the authors (nodes) according to the learned data-speciﬁc task dependency matrix and we can see that there are some clusters formed by authors.
Further, we visualize the mean value of the data-speciﬁc task dependency for each cluster, as shown in Figure 3c.
We can see that different cluster does have different task dependency. This is desirable since when predicting if an author has published papers in some conferences, authors from different domains should have different transfer weight among conferences (tasks).
As a summary, it is demonstrated that our approach can capture the task dependency at multiple levels according to speciﬁc data.
C ONCLUSION
We propose L2T-MITTEN, a novel multi-task learning framework that (1) employs the positionwise mutual attention mechanism to learn the multi-level task dependency; (2) transfers the taskspeciﬁc representations between tasks with linear space-efﬁciency; and (3) uses the learned multilevel task dependency to guide the inference.
We design three experimental settings where training data is sufﬁcient, imbalanced or deﬁcient, with multiple graph/text datasets.
Experimental results demonstrate the superiority of our method against both classical and SOTA baselines.
We also show that our framework can be used as an analytical tool to extract the task dependency structures at different levels, which can reveal some hidden knowledge of tasks and of datasets
A D ATASET S UMMARY
[Table]
[Table]
B A RCHITECTURE D ETAILS B. A RCHITECTURE D ETAILS FOR G RAPH M ODEL
As shown in Figure
[Table] in the Encoder Block [Table] we use several layers of graph convolutional layers (Kipf & Welling, 2016) followed by the layer normalization (Ba et al., 2016).
In the Readout
Block, for graph-level task [Table] we use set-to-set (Vinyals et al., 2015) as the global pooling operator to extract the graph-level representation which is later fed to a classiﬁer; while for node-level task, we simply eliminate the global pooling layer and feed the node-level representation directly to the classiﬁer.
B. A RCHITECTURE D ETAILS FOR T EXT M ODEL
The text model uses long short-term memory (LSTM) architecture in their Encoder Block, and the dot-product attention in the Readout Block, as shown in Figure 5.
The dot-product attention used to get the text-level representation is as follows:
[Equation]
where O ∈ R n × d is the output of the LSTM, H n ∈ R 1 × d is the hidden state for the last word, α ∈ R n × 1 is attention weight for each word, and ˆ O ∈ R 1 × d is the text-level representation ( n is the number of words, d is the feature dimension for each word).