TL;DR
This paper introduces Factorized Tensor Networks (FTN), a novel parameter-efficient method for multi-task and multi-domain learning. FTN achieves comparable accuracy to full fine-tuning while drastically reducing the number of trainable parameters by incorporating low-rank tensor factors into a frozen pre-trained network. This approach offers a flexible and efficient way to adapt models to new tasks and domains without catastrophic forgetting.
What Problem Does This Paper Address?
Training separate models for each task or domain is computationally expensive and leads to massive storage requirements. While multi-task learning (MTL) and multi-domain learning (MDL) aim to address this by leveraging shared information in a single unified network, existing methods often struggle to balance performance, parameter efficiency, and the risk of catastrophic forgetting. Some methods achieve efficiency by using task-specific heads but sacrifice performance, while others require a significant number of additional parameters to adapt effectively. The challenge is to find a method that can efficiently adapt a single model to multiple tasks/domains with minimal parameter overhead, maintaining high accuracy and avoiding forgetting previously learned tasks.
Methods
The core of the proposed method, Factorized Tensor Networks (FTN), lies in adapting a pre-trained, frozen backbone network by introducing task- or domain-specific low-rank tensor factors. Instead of fine-tuning the entire network or adding large task-specific modules, FTN injects these low-rank tensors into specific layers.
- Factorized Tensor Networks (FTN): The approach models the weight update for a layer as a sum of low-rank tensors. Specifically, for a convolutional layer with weights $W$, the update $\Delta W$ is decomposed into a sum of $R$ rank-1 tensors: $\Delta W = \sum_{r=1}^{R} w_{1,r} \otimes w_{2,r} \otimes w_{3,r}$. This factorization significantly reduces the number of trainable parameters compared to directly learning a full update matrix.
- Task/Domain-Specific Adaptation: These low-rank tensor factors are learned for each specific task or domain, allowing for tailored adaptation without altering the original pre-trained weights.
- Batch Normalization Adaptation: In addition to weight updates, FTN also adapts Batch Normalization (BN) layers with task/domain-specific parameters ($\Gamma$ and $\beta$). This is found to significantly improve performance.
- Architecture Agnosticism: The method is designed to be architecture-agnostic, applicable to both convolutional neural networks (CNNs) and transformer-based architectures. For transformers, FTN is applied to the query and value projection weights within the Multi-Head Self-Attention (MHSA) blocks, or to the output projection weights.
- Initialization: To ensure a stable start, the low-rank factors are initialized using a strategy that minimizes modifications to the frozen backbone weights, such as Xavier uniform initialization for convolutional layers and Gaussian sampling for transformer layers.
Datasets
The authors evaluated their FTN method on several widely used datasets for multi-domain classification and multi-task dense prediction:
- ImageNet-to-Sketch: A multi-domain classification dataset comprising five domains: Flowers, Cars, Sketch, Caltech-UCSD Birds (CUBs), and WikiArt.
- DomainNet: Another multi-domain classification dataset with six domains: Clipart, Sketch, Painting, Quickdraw, Inforgraph, and Real.
- NYUD: A multi-task dataset for dense prediction, including tasks like edge detection, semantic segmentation, surface normals estimation, and depth estimation.
- Visual Decathlon Challenge dataset: Used for evaluating FTN on a broader set of tasks.
- Transient Attributes dataset: Used for multi-domain image generation experiments.
Key Insights and Ideas
- Tensor Factorization for Efficiency: The core idea of using tensor factorization to represent weight updates is highly effective in reducing parameter count while retaining expressive power. This is a significant departure from traditional matrix-based adaptation methods.
- Flexibility in Rank Selection: FTN allows for varying the rank ($R$) of the low-rank tensors. This flexibility enables users to balance performance and parameter efficiency based on the complexity of the task or domain, unlike methods that use fixed adaptation modules.
- Batch Normalization's Importance: Adapting Batch Normalization layers alongside the low-rank tensor factors is crucial for achieving competitive performance, highlighting the interplay between normalization and feature adaptation.
- Transformer and CNN Compatibility: Demonstrating FTN's effectiveness on both convolutional and transformer architectures broadens its applicability and potential impact across various deep learning domains.
- Avoiding Catastrophic Forgetting: By keeping the backbone frozen and only adding task-specific low-rank factors, FTN inherently avoids catastrophic forgetting, a common issue in sequential multi-task learning.
Key Results
- Parameter Efficiency: FTN consistently requires a fraction of the additional parameters compared to methods like Fine-Tuning, while achieving comparable or superior accuracy. For instance, on ImageNet-to-Sketch, FTN with rank 50 uses only 1.53x the parameters of the Feature-Extractor, achieving a mean top-1% accuracy of 85.76%, close to Fine-Tuning's 85.98%.
- Competitive Accuracy: FTN achieves accuracy comparable to or better than single-task/domain methods and other state-of-the-art adaptation techniques across various benchmarks. On DomainNet, FTN with rank 40 achieved better top-1% accuracy on Infograph and Real domains.
- Transformer Performance: For transformer-based adaptation, FTN (Query and Value) surpassed LoRA in average performance while requiring fewer additional parameters.
- Image Generation: FTN enabled successful adaptation of a generative model to new domains for image generation, producing visually plausible results.
Limitations and Future Work
- Rank Selection: While the flexibility in rank selection is a strength, determining the optimal rank for each task/domain might require empirical tuning. The paper suggests that some domains do not require high ranks, indicating potential for further optimization.
- Layer-wise Rank: The current FTN approach uses a fixed rank for all layers. The authors suggest future work could explore adaptively selecting ranks for different layers to further reduce parameters.
- Task Interference: While FTN mitigates catastrophic forgetting, addressing task interference or negative transfer learning when conflicting tasks are trained together remains an area for future research.
- Sequential Adaptation: The current FTN method requires a separate forward pass for each task. Future work could explore more efficient ways to handle multiple tasks, potentially reducing computational overhead.
Summary updated