Abstract
Measuring the relationship between visual tasks is a fundamental challenge in transfer learning. Traditional approaches often rely on human intuition or computationally intensive cross-validation, which are either inaccurate or unscalable. This paper introduces Learnable Parameter Similarity (LPS), a novel framework that quantifies task relations by comparing the weights of models trained on those tasks. By treating high-dimensional model parameters as "metadata" and utilizing a specialized hierarchical neural network for alignment and comparison, LPS provides a scalable way to predict task transferability. Our experiments on the new ModelSet500 benchmark demonstrate that LPS effectively identifies task origins and correlates strongly with actual transfer performance.
Introduction
In transfer learning, the goal is to leverage knowledge from a source task to improve performance on a target task. A critical prerequisite is understanding the relationship between these tasks to avoid "negative transfer," where a source task actually degrades target performance. Historically, researchers have used data-level similarity or brute-force joint training (e.g., the Taskonomy project) to estimate these relations. However, data-level similarity often fails to capture the underlying learning dynamics, and brute-force methods are computationally prohibitive as the number of tasks grows.
This work proposes that the "second-order semantics" embedded within the weights of a trained model offer a more effective representation of task identity. We introduce the concept of Learnable Parameter Similarity (LPS) to measure these relations efficiently by comparing model parameters directly.
The Alignment Challenge
A primary obstacle in comparing neural network weights is the arbitrary ordering of filters and channels. Due to random initialization and the nature of convolution, two models trained on the identical task may have functionally similar filters in different positions. For example, a "vertical edge detector" might be the first filter in Model A but the fiftieth in Model B. This permutation invariance makes direct weight subtraction or simple distance metrics ineffective.
Methods: The LPS Framework
To address the alignment issue, we developed a hierarchical second-order network designed to align and then embed model parameters into a common space.
Hierarchical Alignment
The LPS framework operates layer-by-layer through a specialized alignment process:
- Frobenius Inner Product: For each layer, the network computes similarity scores between all pairs of filters and channels from the two models being compared.
- Max Matching & Sorting: A "max matching" strategy identifies the optimal correspondence between filters. The filters are then sorted into a canonical order, ensuring alignment before comparison.
- The Order Chain Rule: We formalize the dependency between layers: shuffling filters in layer $L$ necessitates a corresponding shuffling of channels in layer $L+1$. Our hierarchical approach accounts for this "chain" to maintain consistency across the network.
Metric Learning
Once aligned, the parameters are projected into a lower-dimensional embedding space. We use standard metric learning losses, such as triplet loss or cross-entropy, to train the second-order network to minimize intra-task distance and maximize inter-task distance.
Experimental Setup
We evaluated LPS using a new benchmark, ModelSet500. We split the CIFAR-100 dataset into 50 distinct tasks (2 classes each) and trained 10 models per task with different random seeds. This resulted in a meta-dataset of 500 trained models, providing a robust testbed for parameter-based task identification and retrieval.
Key Results
Our evaluation focused on task classification, retrieval, and the correlation between LPS scores and actual transferability.
Task Identification and Retrieval
LPS achieved a 79.8% top-1 accuracy in identifying the source task of an unseen model. In a retrieval scenario—finding models trained on similar tasks—it reached 80.7% rank-1 accuracy. In contrast, baseline methods that omitted the alignment step performed poorly, typically achieving less than 6% accuracy. This highlights the absolute necessity of the proposed alignment strategy.
Correlation with Transferability
A key finding is that the parameter similarity measured by LPS is proportional to actual transfer learning performance, as measured by the Adjusted Rand Index (ARI). As shown in Figure 3(a), higher parameter similarity generally corresponds to better transferability, suggesting that LPS can serve as a reliable proxy for expensive cross-validation.
Layer-wise Insights
Our analysis revealed that shallow layers contain the most discriminative information for task identification (Figure 3(b)). As we move deeper into the network, alignment becomes more challenging due to the accumulation of errors along the "order chain," leading to a decrease in individual layer accuracy. This suggests that the fundamental features learned early in training are the strongest indicators of task identity.
Conclusion and Future Work
Learnable Parameter Similarity (LPS) represents a significant step toward efficient task relation modeling. By treating model weights as first-class data and solving the fundamental alignment problem, we enable scalable task analysis. While currently limited to homogeneous architectures, future work will explore cross-architecture similarity and improved fusion techniques for deep-layer semantics.
Summary updated