Introduction
The rapid advancement of large-scale pretrained Transformer models, such as T5 and BERT, has revolutionized natural language processing. However, the standard practice of fine-tuning these models for each individual downstream task is increasingly impractical due to the massive computational and storage requirements. While adapters—small, trainable modules inserted into frozen pretrained layers—offer a parameter-efficient alternative, they typically operate in a single-task setting, failing to leverage shared knowledge across related tasks. Conversely, traditional Multi-Task Learning (MTL) approaches often suffer from "task interference," where updates for one task negatively impact others.
This paper introduces HYPERFORMER, a framework that bridges the gap between parameter efficiency and effective multi-task knowledge sharing. By utilizing a shared hypernetwork to generate task-specific adapter weights, HYPERFORMER enables efficient multi-task fine-tuning with minimal additional parameters.
Methods: The HYPERFORMER Framework
The core innovation of HYPERFORMER lies in the use of hypernetworks—auxiliary networks designed to generate the weights for another "target" network. In this case, the target networks are adapter modules integrated into a frozen Transformer backbone.
Task-Conditional Adapters
Instead of learning static weights for each task's adapters, HYPERFORMER learns a compact task embedding for every task. This embedding serves as input to a hypernetwork, which dynamically generates the weights for the adapter modules (down-projection and up-projection layers) and the parameters for Layer Normalization. This allows the model to adapt its internal representations to the specific requirements of each task while maintaining a shared underlying structure.
HYPERFORMER++: Scaling with Efficiency
To further enhance efficiency, the authors propose HYPERFORMER++, which employs a single hypernetwork shared across all layers of the Transformer. To distinguish between layers, the hypernetwork receives additional "layer ID" and "position" embeddings. This design ensures that the total number of parameters remains extremely low—adding as few as 0.29% additional parameters per task—regardless of the model's depth.
Experimental Results
The HYPERFORMER framework was evaluated on the GLUE benchmark and several few-shot domain transfer tasks.
Performance on GLUE
On the GLUE benchmark, HYPERFORMER++ (based on T5-Base) achieved an average score of 86.48, surpassing both full model fine-tuning (85.47) and standard multi-task adapters (85.83). The performance gains were particularly pronounced in low-resource scenarios. For instance, on the CoLA dataset, HYPERFORMER++ outperformed full fine-tuning by nearly 9 points (63.73 vs 54.88).
Few-Shot Generalization
A key strength of the hypernetwork approach is its ability to generalize to new tasks with limited data. By learning a general "recipe" for building adapters across multiple tasks, the hypernetwork facilitates effective transfer learning.
As shown in the figure above, HYPERFORMER++ consistently outperforms the T5 baseline across various sample sizes, with the most significant margin observed when data is scarce (e.g., < 1000 samples per task).
Key Insights
- Functional Taxonomy: Visualization of learned task embeddings revealed that the model naturally clusters similar tasks (e.g., sentiment analysis tasks) together, indicating it learns a meaningful functional relationship between NLP tasks.
- Parameter Efficiency: By sharing a single hypernetwork across layers, HYPERFORMER++ achieves state-of-the-art performance with a fraction of the parameters required by traditional methods.
- Mitigating Interference: The task-conditional nature of the generated adapters helps reduce negative transfer between unrelated tasks while promoting positive transfer between similar ones.
Conclusion and Future Work
HYPERFORMER provides a powerful and efficient solution for multi-task learning in large-scale Transformers. By combining the parameter efficiency of adapters with the generative power of hypernetworks, it achieves superior performance, especially in low-resource and few-shot settings. Future research may explore more sophisticated task-sampling strategies to further minimize task interference and investigate the scalability of this approach to hundreds or thousands of tasks.
Summary updated