Exploring Task Affinities through NTK Alignment and Early Training Dynamics in Multi-Task Learning

Yoann Morello, Emilie Gregoire, Sam VerbovenM3L @ NeurIPS 2024

TL;DR

This paper proposes a more efficient way to identify task relationships in multi-task learning (MTL) by analyzing early training dynamics and leveraging the Neural Tangent Kernel (NTK). By focusing on the alignment between NTK and gradient-based deviation matrices early in training and averaging across initializations, they can predict task affinities, potentially mitigating negative transfer and improving model performance.

What Problem Does This Paper Address?

Multi-task learning (MTL) aims to improve model generalization and training efficiency by learning multiple tasks simultaneously using a shared representation. However, a major hurdle is "negative transfer," where learning one task can actually hurt the performance on another. This often happens when tasks are poorly grouped. The challenge is to effectively group tasks to maximize positive transfer and minimize negative transfer. Existing methods for measuring "task affinity" (how related tasks are) are often computationally expensive, requiring full training of an MTL model and periodic calculations. This paper tackles this computational bottleneck by proposing a method to estimate task affinities much earlier in the training process.

Methods

The core of this work lies in connecting existing gradient-based task affinity measures (like those from Fifty et al. and Wang et al.) to the Neural Tangent Kernel (NTK). The authors show that these measures can be expressed in terms of the alignment between the NTK and a "deviation tensor" (G).

They then propose two key strategies for simplification:

  1. Linearization: They explore linearizing the network's behavior in either the input space or the weight space. Linearization in the input space leads to architecture-dependent formulas but is limited to capturing linear relationships. Linearization in the weight space, however, reveals a deeper connection between existing measures and highlights the importance of the alignment between the off-diagonal blocks of the NTK and the deviation tensor.
  2. Early Training Averaging: Recognizing that task affinities might be predictable from early training dynamics, they propose averaging the NTK and deviation matrices over multiple random initializations during the initial epochs. This approach aims to reduce the stochasticity inherent in early training and capture non-linear relationships more effectively.

Datasets

The paper uses a synthetic dataset specifically designed to test their methods. This dataset features four tasks:

  • Tasks 1, 2, and 3: Constructed to have identical linear correlations, making them indistinguishable by linear similarity measures. These tasks have distinct geometric structures (cylindrical, conical, spherical shells) designed to reveal non-linear relationships.
  • Task 4: Designed to be unrelated to the other three, serving as a baseline.

The authors also mention applying their method to CIFAR-10 for a simple model, but the primary experimental evaluation is on their synthetic dataset.

Key Insights and Ideas

  • NTK as a unifying theory: The Neural Tangent Kernel provides a theoretical bridge connecting different gradient-based task affinity measures, revealing their underlying similarities.
  • Off-diagonal alignment is key: The alignment between the off-diagonal blocks of the NTK and the deviation tensor (G) is crucial for measuring task affinity, particularly for capturing non-linear relationships.
  • Early training predicts affinity: Task affinities can be reliably estimated from the very early stages of training, especially when averaged across multiple initializations. This significantly reduces computational cost compared to methods requiring full training.
  • Averaging mitigates stochasticity: Averaging NTK and G matrices over several initializations helps to reduce the noise and stochasticity present in early training, leading to more stable and informative affinity estimates.
  • Linearization limitations: While input-space linearization offers architecture-dependence, it's inherently limited to linear relationships and cannot capture the nuances of modern neural networks.

Key Results

  • The proposed method, which averages NTK and G alignment over early training epochs and multiple initializations, successfully identifies non-linear task similarities on their synthetic dataset after approximately 50 epochs.
  • On the synthetic dataset, the method correctly groups tasks 1, 2, and 3 together, demonstrating its ability to capture relationships beyond simple linear correlations.
  • The paper shows that the alignment of off-diagonal blocks of K and G is more chaotic initially but stabilizes over time, and averaging helps to smooth this out.
  • For a simple 2-layer network on CIFAR-10, their derived linear affinity measure showed "perfect semantic clustering."

Limitations and Future Work

  • Computational Cost of NTK: While the proposed method is more efficient than existing ones, computing the full NTK can still be computationally intensive, especially for large networks and datasets.
  • Non-linear Feature Blindness (for linear approximations): The input-space linearization approach is limited to linear relationships and cannot capture non-linear feature interactions.
  • Applicability to Complex Datasets: The current experimental validation is primarily on synthetic data. Further investigation is needed to assess the method's effectiveness on more complex, real-world datasets.
  • Future Directions: The authors suggest exploring the impact of data subset sizes on NTK computation, the speed of alignment across different architectures, and the regularity of NTK norm evolution. They also propose investigating whether this approach can lead to more efficient computations of task-affinity measures in practice.

Summary updated

BibTeX
@inproceedings{morello2024exploring,
  author = {Yoann Morello and Emilie Gregoire and Sam Verboven},
  title = {{Exploring Task Affinities through NTK Alignment and Early Training Dynamics in Multi-Task Learning}},
  booktitle = {M3L @ NeurIPS},
  year = {2024},
  url = {https://openreview.net/forum?id=HxT9EuHdXW},
}
Figure