Abstract
Adapting pre-trained models with broad capabilities has become standard practice for learning a wide range of downstream tasks. The typical approach of fine-tuning different models for each task is performant, but incurs a substantial memory cost. To efficiently learn multiple downstream tasks we introduce Task Adaptive Parameter Sharing (TAPS), a general method for tuning a base model to a new task by adaptively modifying a small, task-specific subset of layers. This enables multi-task learning while minimizing resources used and competition between tasks. TAPS solves a joint optimization problem which determines which layers to share with the base model and the value of the task-specific weights. Further, a sparsity penalty on the number of active layers encourages weight sharing with the base model. Compared to other methods, TAPS retains high accuracy on downstream tasks while introducing few task-specific parameters. Moreover, TAPS is agnostic to the model architecture and requires only minor changes to the training scheme. We evaluate our method on a suite of fine-tuning tasks and architectures (ResNet, DenseNet, ViT) and show that it achieves state-of-the-art performance while being simple to implement.
Introduction
When adapting a pre-trained model (e.g., ResNet or Vision Transformer) to multiple downstream tasks, practitioners typically face a trade-off between performance and efficiency. Full fine-tuning involves creating a complete copy of the model for every task, which yields high accuracy but becomes prohibitively expensive in terms of memory and storage as the number of tasks increases. Conversely, fixed feature extraction or using fixed adapters freezes most of the model, which is efficient but often fails to reach peak performance, particularly when the target domain differs significantly from the pre-training data.
The ideal solution is to modify only the layers that are essential for the new task. However, identifying these layers manually is a complex combinatorial problem. Task Adaptive Parameter Sharing (TAPS) addresses this by automating the layer selection process directly within the standard training loop, avoiding the need for expensive secondary policy networks or heuristic-based choices.
Methodology
The core of TAPS is a differentiable layer selection mechanism. The weights of each layer $w_i$ are re-parametrized as a combination of frozen base weights $\bar{w}_i$ and a learnable task-specific "delta" $\delta w_i$: $$w_i = \bar{w}_i + I_\tau(s_i)\delta w_i$$ where $s_i$ represents a learnable "score" for the layer, and $I_\tau$ is an indicator function that activates task-specific weights only if the score exceeds a threshold.
To optimize this non-differentiable indicator function using standard gradient descent, TAPS employs a Straight-Through Estimator (STE). This allows gradients to flow back to the scores $s_i$. By incorporating an $L_1$ sparsity penalty on these scores, the optimization process naturally minimizes the number of active task-specific layers, specializing only where it significantly reduces task loss.
Evaluation and Results
TAPS was evaluated across diverse computer vision benchmarks, including ImageNet-to-Sketch (Flowers, Stanford Cars, Sketch, CUB, WikiArt), the Visual Decathlon (10 diverse datasets like Omniglot and GTSRB), and DomainNet.
Efficiency vs. Accuracy
A key finding is that TAPS can match the accuracy of full fine-tuning while using significantly fewer task-specific parameters. As shown in the performance analysis on the Stanford Cars dataset, the method (labeled DWS in the figure) achieves a Top-1 error comparable to fine-tuning as the percentage of task-specific layers increases, while consistently outperforming the feature extractor baseline.
Insights into Model Specialization
The adaptive nature of TAPS reveals that different architectures and tasks require different sharing strategies:
- Architecture-Specific Patterns: For ResNets, TAPS tends to specialize later layers. For Vision Transformers (ViT), it adapts attention and projection layers throughout the network while keeping MLP layers shared.
- Task Complexity: Simpler tasks, such as traffic sign recognition, require fewer specialized layers (sometimes only batch-norm parameters), whereas fine-grained classification tasks like CUB (birds) drive more extensive specialization.
TAPS achieved the second-highest "S-score" on the Visual Decathlon while using nearly half the parameters of the top-performing method, Spot-Tune. Furthermore, in multi-task settings on DomainNet, TAPS outperformed AdaShare in both accuracy and parameter efficiency.
Conclusion
TAPS provides a simple yet powerful framework for multi-task learning that balances accuracy and resource efficiency. By making layer selection differentiable, it removes the need for complex policy networks or manual tuning. While current implementations focus on sharing with a base model, future work could explore cross-task sharing of specialized weights to further enhance learning across related domains.
Summary updated