Improving Gradient Trade-offs between Tasks in Multi-task Text Classification (2023)

Abstract: Multi-task learning (MTL) has emerged as a promising approach for sharing inductive bias across multiple tasks to enable more efficient learning in text classification. However, training all tasks simultaneously often yields degraded performance of each task than learning them independently, since different tasks might conflict with each other. Existing MTL methods for alleviating this issue is to leverage heuristics or gradient-based algorithm to achieve an arbitrary Pareto optimal trade-off among different tasks. In this paper, we present a novel gradient trade-off approach to mitigate the task conflict problem, dubbed GetMTL, which can achieve a specific trade-off among different tasks nearby the main objective of multi-task text classification (MTC), so as to improve the performance of each task simultaneously. The results of extensive experiments on two benchmark datasets back up our theoretical analysis and validate the superiority of our proposed GetMTL.

## introduction multi-task learning (mtl), which aims to learn a single model that can tackle multiple correlated but different tasks simultaneously, makes multiple tasks benefit from each other and obtain superior performance over learning each task independently @xcite @xcite . by discovering shared information/structure across the tasks, it has gained attention in many areas of research and industrial communities, such as computer vision @xcite @xcite ) and text classification @xcite @xcite . however, it is observed in multi-task text classification (mtc) scenarios that some tasks could conflict with each other, which may be reflected via conflicting gradients or dominating gradients @xcite task 1 error task 2 error pareto front pareto solutions et al., 2020; @xcite , leading to the degraded performance of mtl due to poor training. how to make a proper trade-off among jointing different tasks in mtc is a difficult problem. recently, several methods have been proposed to mitigate gradient conflicts issue via both loss balance (linear weighted scalarization) such as homoscedastic uncertainty @xcite and task variance regularization @xcite , and gradient balance like pareto optimality @xcite . existing methods devote to finding an arbitrary pareto optimality solution in the pareto set, which achieve a single arbitrary trade-off among all tasks. however, they can only satisfy the improved performance on part of tasks, not all tasks simultaneously. this means that these methods can not converge to a minimum average loss of all objectives. to illustrate our idea, we give a two-task learning example shown in figure 1 . as shown in @xcite , it is observed that pareto optimality-based methods can generate a set of pareto solutions for a given two-task learning problem. however, some of pareto solutions can increase the task 1 error while decreasing task 2 error, leading to unsatisfactory overall performance for mtl model. this im-plies that not all pareto solutions always satisfy the goal of mitigating the tasks conflicts in mtl, and thus failing to achieve a better trade-off between tasks. therefore, it is necessary to find a specific trade-off between tasks that is beyond what only using pareto optimality can achieve. to address this issue, inspired by multi-objective optimization @xcite , we argue that a more efficient way to mitigate task conflicts is to find a gradient trade-off between tasks in the neighborhood of the average loss rather than exhaustively searching for a proper solution from the set of pareto solutions. as shown in figure 1b , the pareto solutions nearby the average loss can achieve a better trade-off between task 1 and task 2, leading to better performance on both tasks at the same time. based on it, in this paper, we propose a novel gradient trade-off multi-task learning approach, named getmtl, to mitigate task conflicts in multi-task text classification. specifically, the gradients of each task are utilized to derive an update vector that can minimize the conflicts among task gradients in the neighborhood of the average gradient, so as to achieve a better trade-off performance among joint training tasks. in summary, the main contributions of our work are as follows: ## related works multi-task learning methods jointly minimize all task losses based on either loss balance methods @xcite @xcite or gradient balance methods @xcite . the loss balance methods adaptively adjust the tasks weights during training based on various heuristic approaches, such as task uncertainty quan-tification @xcite , gradient normalization @xcite , task difficulty prioritization @xcite , dynamic weight average @xcite , random loss weighting @xcite , task variance regularization @xcite , and meta learning-based approach @xcite . these methods are mostly heuristic and can have unstable performance while ignoring the task conflicts among all tasks, leading to the bad generalization performance of mtl models. recently, some gradient balance based methods have been proposed to mitigate task conflicts for improving task performance. for example, @xcite leverages multiple-gradient descent algorithm (mgda) to optimize multiple objectives. due to the guarantee of convergence to pareto stationary point, this is an appealing approach. sener and koltun (2018) cast the multi-objective problem as a multi-task problem and devote to finding an arbitrary pareto optimal solution. @xcite propose a novel mtl method based tchebycheff procedure for achieving pareto optimal without any convex assumption. however, these methods only consider achieving an arbitrary pareto optimal solution while it is not the main objective. unlike these methods, we propose an mtl approach based on multi-objective optimization and seek to find a set of solutions that are pareto optimality and nearby the main mtc objective l 0 . ## preliminaries consider a multi-task learning problem with t 1 tasks over an input space x and a collection of task spaces {y t } @xmath0, where each task contains a set of i.i.d. training samples d @xmath1, y t i } @xmath2, t is the number of tasks, and n t is the number of training samples of task t. the goal of mtl is to find parameters {θ sh , θ 1 , ..., θ t } of a model f that can achieve high average performance across all training tasks over x , defined as f(x , θ sh , • • • , θ t ) : @xmath3, where θ sh denotes the parameters shared between tasks and θ t denotes the task-specific parameters of task t. in particular, we further consider a parametric taskspecific map as f t (•, θ sh , θ t ) : @xmath4. we also consider task-specific loss functions ℓ t (•, •) : y t × y @xmath5. we also denote the multi-task loss as l(θ) = t i ℓ i (θ), and the gradients of each task as g @xmath6. in this paper, we choose the average loss as main objective of mtc problem, defined as l 0 (θ) = 1 t t i ℓ i (θ). ## gradient trade-offs for multi-task text classification following most mtl methods, as shown in figure 2, we employ the hard parameter sharing mtl architecture, which includes f sh parameterized by heavy-weight task-shared parameters θ sh and f t parameterized by light-weight task-specific parameters θ t . all tasks take the same shared intermediate feature @xmath7; θ sh ) as input, and the t-th taskspecific network outputs the prediction as f t (z; θ t ). since task-shared parameters θ sh are shared by all tasks, the different tasks may conflict with each other, leading to the degraded performance of mtl model. in this paper, we hypothesize that one of the main reasons for task conflicts arises from gradients from different tasks competing with each other in a way that is detrimental to making progress. we propose a novel gradient-based moo optimization to find a gradient trade-off among tasks in the neighborhood of the average loss, so as to mitigate task conflicts. note that, we omit the subscript sh of task-shared parameters θ sh for the ease of notation. ## conclusion in this paper, we propose a novel gradient tradeoff multi-task learning approach to mitigate the task conflict problem, which can achieve a specific trade-off among different tasks nearby the main objective of multi-task text classification problem. moreover, we present a series of theoretical proofs to illustrate the effectiveness and superiority of our getmtl. experimental results on two benchmark datasets show that our getmtl achieves state-ofthe-art performance in multi-task text classification problem.