Introduction
Achieving state-of-the-art performance in Natural Language Understanding (NLU) typically relies on the "Pretrain-Finetune" (PT-FT) paradigm. While effective, this approach requires maintaining a separate copy of a massive model for every target task, leading to significant storage and maintenance overhead in production. Multi-Task Learning (MTL) offers a parameter-efficient alternative by training a single model on multiple tasks simultaneously. However, MTL often suffers from "catastrophic forgetting" and task interference, where competing task dynamics prevent the model from reaching the performance levels of dedicated single-task models.
This paper introduces HyperGrid, a novel hypernetwork-based approach designed to bridge the performance gap between MTL and PT-FT. HyperGrid dynamically specializes regions of a Transformer's weight matrices for different tasks using grid-wise decomposable projections, enabling a single unified model to match the performance of multiple task-specific models.
Methodology
HyperGrid innovates on standard hypernetworks by introducing a structured, efficient way to modulate Transformer weights. Instead of simple row-wise scaling, HyperGrid employs Grid-wise Projections, segmenting the weight matrix into a structural grid of blocks. This allows for more granular, yet computationally efficient, control over specific weight regions.
The core of the architecture is the Decomposable Hyper Projector. To generate the grid parameters efficiently, the authors factorize the projection into two components:
- Local Vector: Conditioned on the specific input instance or task prefix.
- Global Vector: A task-agnostic trainable embedding representing the model's general state.
The outer product of these two vectors creates a rich, compositional gating matrix. This matrix is then expanded and multiplied element-wise with the Transformer's weight matrix, specifically targeting the second positional Feed-Forward Network (FFN) layer.
To inform the hypernetwork of the current task, the system pools the "task prefix" token (e.g., "translate:") from the input sequence, ensuring the weight modulation is task-aware.
Experimental Setup
The HyperGrid approach was evaluated using the T5 model architecture across 16 distinct NLU tasks from two major benchmarks:
- GLUE (General Language Understanding Evaluation): 8 standard tasks.
- SuperGLUE: 8 more challenging NLU tasks. The model was co-trained on a proportionate mixture of all 16 tasks, aiming to match the performance of 16 individually fine-tuned T5 models.
Results and Discussion
Experimental results demonstrate that HyperGrid effectively mitigates task interference in MTL settings.
Performance Gains
On base-sized models, HyperGrid achieved a score of 85.2 on GLUE, significantly outperforming the standard MTL baseline (85.0) and nearing the PT-FT performance of 85.7. The gains were even more pronounced on the harder SuperGLUE benchmark, where HyperGrid improved the MTL score from 73.6 to 74.5, nearly matching the 74.8 achieved by 16 separate fine-tuned models.
Key Insights
- Weight Gating Efficiency: Gating the actual weights of the FFN layer proved more effective than gating output representations, a common practice in Mixture-of-Experts (MoE) models.
- Local-Global Synergy: The factorization into local and global components provides high expressivity without a massive increase in parameter count.
- Optimal Granularity: Ablation studies indicated that coarse-grained control over larger weight blocks (smaller fan-in/fan-out dimensions) often performs better than fine-grained micromanagement of individual weights.
- Scalability: The method scales effectively to massive models. An 11B parameter HyperGrid model achieved 89.4 on GLUE and 87.7 on SuperGLUE, coming within 1.2% of state-of-the-art results while using 16x fewer total parameters than ensembled task-specific baselines.
Conclusion
HyperGrid presents a highly efficient path toward unified multi-task models that do not sacrifice performance. By dynamically adapting weights through decomposable projections, it offers the benefits of task-specific specialization with the parameter efficiency of a single model. While training such large-scale multi-task models remains computationally intensive, the reduction in inference-time overhead and maintenance makes HyperGrid a compelling solution for large-scale NLP production environments.
Summary updated