Abstract
Multi-task learning (MTL) aims to improve a primary task's performance by leveraging auxiliary tasks. However, selecting compatible tasks is challenging due to the risk of negative transfer and the high computational cost of exhaustive search. We present GradTS (Gradient-based Task Selection), an automated method that utilizes the internal attention head importance of Transformer models to identify beneficial auxiliary tasks. By using gradients as a proxy for task similarity, GradTS achieves state-of-the-art performance on the GLUE benchmark with significantly reduced computational overhead compared to existing black-box search methods like AUTOSEM.
Introduction: The Challenge of Task Selection in MTL
Multi-task learning (MTL) has become a cornerstone of modern Natural Language Processing, allowing models to share inductive biases across related objectives. Despite its potential, MTL is often a "double-edged sword." While related tasks can provide helpful signals, unrelated or conflicting tasks can lead to negative transfer, where the model's performance on the primary task actually degrades.
The fundamental challenge lies in selection: how do we determine which auxiliary tasks will help and which will hinder? Traditional approaches often rely on human intuition or computationally expensive trial-and-error. Automated methods like AUTOSEM have attempted to solve this but often treat the underlying model as a black box, requiring numerous full-scale MTL experiments to explore the task space. This lack of efficiency becomes a major bottleneck as the number of candidate tasks grows.
Methodology: Leveraging Internal Model Mechanics
GradTS introduces a "white-box" approach that leverages the internal mechanics of Transformer networks. The core hypothesis is that a good auxiliary task shares key linguistic features with the primary task. Since specific attention heads in Transformers are known to specialize in different linguistic patterns—such as syntax, coreference, or semantic roles—tasks that rely on the same set of heads are likely to be compatible.
The GradTS Workflow
The selection process follows a three-step pipeline:
- Attention Head Ranking: The model is first fine-tuned on a single task. The "importance" of each attention head is quantified by summing the absolute gradients accumulated at that head during the final training epoch. These scores are then normalized to create a task-specific importance profile.
- Task Correlation Analysis: To compare two tasks, the method employs Kendall’s $\tau$ to measure the correlation between their respective head importance rankings. A high correlation coefficient suggests that the tasks utilize the model's internal representations in a similar manner.
- Automated Selection: Based on these correlations, tasks are selected using one of two modules:
- GradTS-trial (Task-level): This module greedily adds tasks to the auxiliary set based on their correlation scores, stopping when performance on a validation set no longer improves.
- GradTS-fg (Fine-grained): This more advanced version subsamples specific instances from auxiliary tasks that exhibit high gradient similarity to the primary task, effectively filtering out noisy or irrelevant data points.
Because these rankings are derived from single-task experiments, the gradient profiles can be computed once and reused indefinitely. This makes GradTS highly scalable for large-scale "task zoos" where new primary tasks may need to be matched against a fixed set of auxiliary candidates.
Experimental Evaluation
The authors evaluated GradTS across a diverse range of NLP challenges to ensure robustness:
- GLUE Benchmark: The primary evaluation used 8 classification tasks (CoLA, MRPC, MNLI, QNLI, QQP, RTE, SST-2, WNLI).
- Mixed Objectives: To test the method's ability to handle diverse task types, they included regression (STSB) and sequence labeling tasks (POS tagging, NER, and Syntactic Chunking).
- Difficult Textual Tasks: Multimodal emotion recognition datasets (MELD and Dyadic-MELD) were used to test performance on "hard" cases where base models like BERT typically struggle.
Key Results and Insights
GradTS demonstrated significant improvements over existing state-of-the-art methods in both performance and efficiency.
Superior Performance and Robustness
GradTS-fg consistently outperformed the strong AUTOSEM baseline across all 8 GLUE tasks. The most dramatic improvement was seen on the WNLI task, where it achieved a 17.93% performance boost over the baseline. Furthermore, GradTS successfully identified helpful auxiliary tasks even when they utilized different training objectives (e.g., using POS tagging to assist a classification task), a scenario where traditional baselines often failed.
Computational Efficiency
One of the most significant advantages of GradTS is its speed. On average, GradTS-fg was 21.32% faster than AUTOSEM while maintaining comparable GPU memory usage. The simpler GradTS-trial variant was even more efficient, requiring approximately 6.7% less time than standard MTL baselines. This efficiency stems from the "compute once, reuse many" nature of the gradient-based rankings.
Quality over Quantity
The results highlighted a crucial insight: linguistic compatibility is more important than dataset size. GradTS frequently selected smaller, more linguistically relevant auxiliary tasks over massive datasets like MNLI. This proves that the quality of the relationship between tasks is the primary driver of successful multi-task learning.
Conclusion and Future Directions
GradTS offers a scalable, efficient, and interpretable solution to the task selection problem in MTL. By looking "under the hood" of Transformer models, it avoids the pitfalls of black-box search methods. While the authors noted that extremely difficult tasks can produce noisier gradients, the overall robustness of the method is clear. Future work may extend this gradient-based approach to help curate higher-quality training data by selecting the best individual datasets or even specific data slices for a given primary task.
Summary updated