Abstract
In modern Natural Language Processing (NLP), intermediate-task transfer—fine-tuning on a source task before a target task—is a standard practice to enhance performance. However, identifying the optimal source task typically requires exhaustive experimentation, which is computationally prohibitive. We propose COPATE (Connectivity Patterns as Task Embedding), a novel method that utilizes the sparse structural masks of a neural network as task embeddings. By identifying which attention heads and neurons are critical for a specific task, COPATE generates compact binary vectors that effectively predict task transferability. Our results demonstrate that COPATE outperforms existing heavy-weight baselines in both prediction accuracy and efficiency, requiring only 4.6 KB of storage per task and offering up to 44x speedup in embedding generation.
Introduction
The challenge of "negative transfer"—where an ill-suited source task degrades target performance—necessitates robust task embedding methods. Traditional approaches often rely on full model weights, gradients, or complex matrix calculations, leading to high computational and storage overhead. COPATE addresses these limitations by focusing on the "connectivity patterns" of a model, inspired by the specialized neural pathways found in biological brains. This approach treats the sparse sub-network architecture as a unique "fingerprint" for each task.
Methods
The COPATE framework identifies task-specific sub-networks within a Transformer architecture (e.g., BERT). The process involves three key stages:
- Masking and Sparsity: Scalar masks are attached to every attention head and intermediate neuron in the Feed-Forward Networks (FFN). The model undergoes brief training with an $L_1$ penalty to induce sparsity, forcing the selection of essential sub-structures.
- Early-Bird Extraction: Connectivity patterns stabilize early in the training process. COPATE extracts these patterns before full convergence, significantly reducing computation time.
- Binarization and Similarity: The final embedding is a binary vector (1 for active, 0 for pruned). Task similarity is calculated using Hamming Similarity between these binary masks.
Results
We evaluated COPATE across 19 NLP tasks, encompassing classification, regression, and question answering (342 total transfer combinations).
- Predictive Power: COPATE consistently identifies high-transfer source tasks. As shown in the correlation analysis, there is a strong positive relationship between task embedding similarity and actual relative transfer gain across various target tasks like STS-B, SQuAD2, and DROP.
- Efficiency: For a BERT-base model, a COPATE embedding occupies just 4.6 KB, a fraction of the size required by methods like Task2Vec. Furthermore, the "Early-MB" version is approximately 44x faster to generate than LoRA-based alternatives.
- Structural Signal: Analysis reveals that the binary architecture of task-specific sub-networks contains more transferable information than the underlying floating-point weights, particularly in data-limited scenarios.
Conclusion
COPATE demonstrates that the sparse connectivity patterns of neural networks serve as highly effective and efficient task embeddings. This "connectivity-as-identity" approach provides a scalable solution for task selection in large-scale transfer learning and opens new avenues for understanding model specialization through structural analysis.
Summary updated