H YPER G RID T RANSFORMERS : T OWARDS A S INGLE M ODEL FOR M ULTIPLE T ASKS
Anonymous authors
Paper under double-blind review
A BSTRACT
Achieving state-of-the-art performance on natural language understanding tasks typically relies on ﬁne-tuning a fresh model for every task.
Consequently, this approach leads to a higher overall parameter cost, along with higher technical maintenance for serving multiple models.
Learning a single multi-task model that is able to do well for all the tasks has been a challenging and yet attractive proposition.
In this paper, we propose HyperGrid Transformers, a new Transformer architecture that leverages task-conditioned hyper networks for controlling its feed-forward layers.
Speciﬁcally, we propose a decomposable hypernetwork that learns grid-wise projections that help to specialize regions in weight matrices for different tasks.
In order to construct the proposed hypernetwork, our method learns the interactions and composition between a global (task-agnostic) state and a local task-speciﬁc state.
We conduct an extensive set of experiments on GLUE/SuperGLUE.
On the SuperGLUE test set, we match the performance of the state-of-the-art while being 16 times more parameter efﬁcient.
Our method helps bridge the gap between ﬁne-tuning and multi-task learning approaches.
I NTRODUCTION
Learning a single multi-task model that performs well across multiple targeted tasks is an attractive proposition for many reasons (Kaiser et al., 2017; Ruder, 2017; Clark et al., 2019b).
Although extremely challenging, this paradigm enables a substantial savings in overall parameter costs, along with eliminating the need for maintaining multiple models in production (Stickland and Murray, 2019).
However, achieving state-of-the-art performance on natural language understanding benchmarks today (Wang et al., 2018; 2019) still relies on ﬁne-tuning a new model for every single task.
This methodology is infeasible in many situations.
Moreover, certain tasks rely on an extensive ensemble of models and/or task-speciﬁc ﬁne-tuning tricks (Liu et al., 2019b; Devlin et al., 2018; Clark et al., 2020).
The single-task ﬁne-tuning paradigm is well-established to be the dominant approach (Raffel et al., 2019), as training multiple tasks using a single set of parameters can be problematic in many ways, such as catastrophic forgetting (French and Chater, 2002; McCloskey and Cohen, 1989;
McClelland et al., 1995; Kirkpatrick et al., 2017) or the inherent difﬁculty of ﬁnding a consistently good model for all tasks (Clark et al., 2019b; Wu et al., 2020).
Inevitable task conﬂicts and difﬁculty in ﬁtting all models within a set of hard parameters is also a challenging problem for multi-task co-training.
In this paper, we propose a new Transformer architecture, the HyperGrid Transformer for efﬁcient modeling of multiple tasks within a single set of model parameters.
HyperGrid Transformers rely on a hypernetwork-based (Ha et al., 2016) module that performs gridwise decomposable hyper projections .
This module is task conditioned and dynamically learns to generate weights of the feedforward layers of the Transformer model.
Overall, our eventual goal is to dispense with task speciﬁc ﬁne-tuning tricks altogether.
While neural networks typically maintain the same consistent set of parameters for all input instances, the proposed HyperGrid Transformers introduces instance-speciﬁc parameters by conditioning on the current input.
This setup enables our model to learn task-speciﬁc reparameterization for each input instance, which mitigates several challenges of multi-task co-training.
Our proposed HyperGrid module belongs to a family of hypernetworks (Ha et al., 2016), in which a side network is responsible for weight generation for the main network.
In our case, task-conditioned hypernetworks provide greater ﬂexibility and expressiveness for capturing the dynamics of multiple tasks within a single set of parameters.
Speciﬁcally, we introduce two novel algorithmic improvements over the existing methods.
First, we introduce the notion of grid-wise projections in which we assume a structural layout in vanilla projection layers.
For each input sample, our projections dynamically control the parameters in a grid-wise, region-speciﬁc manner.
The structural segmentation of feed-forward layers is similar in spirit to mixture-of-experts gating (Shazeer et al., 2017), albeit at a lower-level.
Conversely, standard hypernetworks only consider row-wise re-weighting of weight matrices.
Second, we introduce decomposable hyper-projections.
The key idea is to learn rich compositional and pairwise interactions between dual hypernetworks.
A dual setup is adopted, where we explore different hypernetwork composition variants.
We introduce a novel local-global setup, which composes a local instance-speciﬁc and task-speciﬁc hyper-projection with a task agnostic global state embedding.
This is intuitive since this setup is not only highly expressive and ﬂexible but also serves as a factorization of local and global components.
To the best of our knowledge, our work is the ﬁrst to explore this setup with respect to learning conditional parameters.
Finally, we conduct extensive experiments on GLUE/SuperGLUE.
Our proposed model is able to match the performance of individually ﬁne-tuned state-of-the-art Text-to-Text Transformers (T5)
(Raffel et al., 2019) models with a single model that is learned to ﬁt all GLUE and SuperGLUE tasks at once.
Moreover, our single model also outperforms strong baselines that employ ensembling and other task-speciﬁc tricks (Liu et al., 2019b; Clark et al., 2020).
Our Contributions
The contributions of this paper can be summarized as follows:
• We propose HyperGrid Transformers, a form of hypernetwork-based Transformer that learns task-conditioned dynamic weights for its feed-forward layers.
• The key novelty behind HyperGrid Transformers is the factorization of local and global components for weight generation.
Our weight generation is grid-wise and imbues the model with a structural layout.
• We conduct extensive experiments on natural language understanding benchmarks (GLUE/SuperGLUE).
With a single model, we match the state-of-the-art T5 model that is ﬁnetuned in a per-task fashion (multiple models), resulting in 16x parameter savings.
H YPER G RID T RANSFORMERS
This section outlines the key idea of the proposed algorithm.
2. H YPER G RID M ODULE
HyperGrid operates on weight matrices (linear transformations), i.e., Y = W X
+ b .
In a hypernetwork formulation, instead of letting W be free weights, we generate W using a parameterized side network H ( . ) .
[Equation]
where W ∈ R d m × d f .
In the case where X is a single vector ∈ R d m , we may parameterize H ( . ) with a simple feed-forward layer.
[Equation]
where 1 is a column vector of ones, σ is the sigmoid activation function and U ∈ R d m × d f .
The key idea is that the hypernetwork generates a vector, i.e.,
U X ∈ R
d f that is broadcast (multiplied by 1 ) and multiplied by W , acting as a row-wise scaling of W .
We are also able to reduce U ∈ R d m × n where d f mod n = 0 and repeat the vector d f n times to form the original dimension of d f .
These methods only consider scaling one dimension of W (e.g., row-wise).
We now consider methods beyond simple row-wise weight scaling.
2.1. D ECOMPOSABLE G RIDWISE P ROJECTIONS
In our method, we propose grid-wise projections that segments W into a grid, i.e., blocks of d m d r × d f d c .
We generate blocks by the outer product of
L r ∈ R d r and L c ∈ R d c .
Note that d r and d c are user-speciﬁed hyperparameters that control the grid-size for the fan-in and fan-out of the output matrix.
For simplicity, we consider divisible blocks where d r < d m , d m mod d r = 0 , and d c < d f , d f mod d c = 0 .
In this case:
[Equation]
where ( L r X )
( L c X )
(cid:62) ∈ R
d r × d c , ψ ( . ) is a repeat vector function that repeats its input d m d r times on the row axis and d f d c times on the column axis.
We name this approach the L 2 variant, short for
Local-Local Gridwise Projection.
[Figure]
Composition between Local and Global Factors The decomposable grid-wise projections learn
L r and L c from X , which makes it conditioned on local, instance-wise information.
Here, we postulate that it may be beneﬁcial for either L r or L c to be a global embedding.
By keeping L c as a global, trainable embedding, this can be formulated as:
[Equation]
where G c ∈ R d f .
In this case, L r is conditioned from X , the speciﬁc input sample.
On the other hand, G c remains consistent across all input samples.
Hence, the outer product is essentially a rich dyadic composition between local and global factors.
Local-Global and Global-Local
It is easy to see that there are two ways of composing L and G .
The above method considers the Local-Global approach where the fan-in uses a local hypernetwork and the global part uses a trainable embedding.
An alternative that ﬂips this around to use a GlobalLocal composition is evaluated in our experiments.
Namely, this can be expressed as:
[Equation]
2. D YNAMIC W EIGHT G ENERATION WITH H YPER G RID
This section describes how we use task-conditioned hypernetworks to inﬂuence and generate the parameters for HyperGrid Transformers.
[Figure]
Task Conditioning
The local network part of HyperGrid L is learned via a task embedding T ∈ R d m , which provides a task identiﬁer and information to the hypernetwork.
In HyperGrid Transformers, we ﬁrst apply self-attention of the task embedding by concatenating it with the input sequence.
This is described as:
[Equation]
where [; ] is a concatenation on the length dimension and MHSA(.) is the multi-head self-attention function.
The input sequence X interacts with the task embedding to generate T (cid:48) which is used in our hypernetwork module.
Weight Gating
The HyperGrid module is added at the position-wise feed-forward layers of the
Transformer models.
More speciﬁcally, we equip the second positional FFN after the ReLU activations with HyperGrid.
There are several reasons for doing so.
In most Transformer implementations, the fan out of this layer is typically scaled up to very large values (Raffel et al., 2019).
Hence, the inﬂuence on this layer has the greatest potential to beneﬁt the Transformer model.
Second, early experiments on both of the positional feed-forward layers yielded no substantial improvements.
Hence, we opt to only modify the second positional FFN of the Transformer model.
Initialization In our experiments, we take advantage of existing pretrained model (Raffel et al., 2019) and add additional HyperGrid parameters that are ﬁne-tuned along with the rest of the network.
The overall formulation of the HyperGrid-enhanced Transformer can be written as:
[Equation]
where i denotes the layer i .
We construct a new HyperGrid (with non-shared parameters) for each layer.
Since W has been pretrained, we also add a residual connection of the original W i
( X i − 1 ) computation to the mixture.
Parameter Costs We note that the parameter counts added by HyperGrid are relatively negligible since d r and d c are small.
In the LG setting, the model adds d m d r + d c parameters at each layer.
On the GL setting, the parameter cost added is d r + d f d c .
The most expensive option is L 2 where the added cost is d m d r + d f d c .
These added parameter costs are often negligible for large Transformer models.
E XPERIMENTAL R ESULTS
We conduct experiments on GLUE (Wang et al., 2018) and SuperGLUE (Wang et al., 2019) which are consolidated benchmarks of multiple challenging NLP and NLU tasks.
While most of the work in this area has been focused on achieving good task-speciﬁc performance, our work focuses on trying to get good performance with a single model on all GLUE and SuperGLUE tasks.
Therefore, most of our experiments are conducted on a mixture of all GLUE and SuperGLUE tasks.
3. E XPERIMENTAL R ESULTS
In this section, we discuss the empirical results of our experiments.
Further details about the experimental setup can be found in the appendix.
Pertaining to parameter counts (reported as θ in our experiments), this is the total parameter cost for serving the entire suite of tasks.
If a single model (ﬁnetuned on a single task) is X parameters, then the costs of serving N tasks in a multi-model setup would be NX .
3.1. S INGLE M ODEL VERSUS M ULTIPLE M ODELS
These experiments investigate different model settings, namely using (1) multiple models (MM) or a single model (SM) for all tasks.
The MM model trains a fresh model on every single task and retains the best checkpoint for all tasks.
Meanwhile, the SM model is trained on all tasks at once.
We compare them against HGT, our single model HyperGrid Transformer approach.
Details about Baselines For the Single Model Baseline, this is the identical T5 model without our HyperGrid layers which serves as a fair comparison to our model. This enables us to observe the effect of HyperGrid directly. As for the multi-model method, this is done by ﬁnetuning T directly on each task and reporting results from the best checkpoint (of each task). This is a very strong baseline because the model is also allowed to choose speciﬁc best checkpoints for each task which the single model approach is prohibited against.
As for the sampling strategy in the singlemodel approach (baseline and our approaches), we use a proportionate mix of tasks according to the number of samples in the each task/dataset.
[Table] [Table]
Our Single-Model Approaches
[Table]
Results Table 2 reports results of our experiments on the GLUE and SuperGLUE benchmark.
The ﬁrst key observation is that the single model (SM) approach is outperformed by multi model (MM).
This is a well known phenomena and therefore multi-model is generally adopted when the absolute best score is desired on every single task.
The interesting result is that we are able to come rather close to the performance of single model with our approach.
As a result, the multi-model has 16x more parameters.
To ﬁt both GLUE and SuperGLUE, this would require 16x the parameters.
Given that our goal is to bridge the performance of a single model versus multiple models for multiple tasks, we ﬁnd that this result is considerably successful.
Moreover, we observe that our singlemodel approach outperforms the multi-model baseline by +0.6% on average across 8 tasks.
We observe similar trends as on the GLUE benchmark.
Naturally, the best model is the multi-model model which involves ﬁnetuning a specialized model for each task.
The gap between multi-model and single-model is at 74 . 8 versus 73 .
Our approach bridges this gap, improving the single-model score to 74 . 5 , competitive with the multi-model approach.
[Table] ACROSS M ODEL S IZES
We investigate the gains of the proposed HyperGrid over the base model on various sizes of the T model.
For models larger than Base, we train with 64 TPU V3 chips for 200 K steps and select the best checkpoint for all tasks based on the benchmark score
[Table]
Findings Table 3 reports results of
GLUE and SuperGLUE scores (and their macro-average).
We ﬁnd that performance gains on SuperGLUE averages is reasonably good ( +1 . 9% on Large).
The model still outperforms the vanilla model on GLUE with marginal performance gains.
Overall, on a macro-average oftasks, we ﬁnd an overall +1 .
0% improvement across three sizes.
These results show that performance gains scale with model size.
3.1. E FFECT OF M ODELING C HOICES
To ascertain the effectiveness of our approach [Table] we test different architectural variants of HyperGrid
Transformers, along with other architectural variants considered during model development.
Setup We evaluate all four model variants of HyperGrid Transformers ( L , L 2 , GL and LG ).
For the other architectural variants, we were mainly interested to know if a hypernetwork setup (weight gating) is better than gating on the output representations (details can be found in the supplementary material).
For the base setting [Table] we ran the baseline T5 model (single-model) four times and reported the mean and standard deviation of the runs.
When comparing the performance gain of our method, we compare against the max run of the baseline runs.
We report relative performance gains/loss against this max baseline score. We conduct ablation studies on the four composition types on the large models 1 . [Table] Large
[Table]
Findings of HyperGrid Variants
Table 4 reports our key ablation results.
Pertaining to results of the base models, our overall ﬁnding is that HyperGrid generally improves performance over the max baseline.
Gains are mainly on SuperGLUE while maintaining good performance on GLUE.
The overall average gain is about +1% .
Amongst the different variants of
HyperGrid, the best performing model on this setup is the L 2 setup.
On the large setting, we ﬁnd that the LG model performs the best while the L and L 2 variants perform similar to the baseline.
Is Output Gating Better?
The other architectural variants (OutGate) do not perform well and generally perform with a net loss in performance as compared to the baseline.
As such, we ascertain that gating on weights is more effective than gating on the output representations.
This veriﬁes that our hypernetwork-based approach is indeed effective as opposed to simple task-conditioned output gating.
3.1. E FFECT OF G RID S IZE ON P ERFORMANCE
We investigate the effect of Grid size (fan-in and fan-out) of our proposed HyperGrid method.
The purpose of this experiment is to discover how ﬁne-grained or coarse-grained the hypernetwork should be.
Notably, smaller values of d r , d c signify a more coarse-grained control of the Transformer weights.
Setup We searched d r (fan-in) and
d c (fan-out) in the ranges of { 4 , 8 , 16 , 32 , 128 , 256 } and { 8 , 16 , 32 , 128 , 256 } respectively and report the results on GLUE + SuperGLUE (macro-average) by varying a single value.
When varying d r , we took the average of all d c runs and plot the max, mean and min.
Likewise, when varying d c , we took the average of all d r runs and plot max, mean and average.
We report scores across the L 2 , LG , and GL variants of HyperGrid.
Findings pertaining to Grid Size Figures 3 to Figures 8 illustrates performance across varied grid sizes.
We observe that a clear trend exists.
For most settings, a small fan-out ( d c ) works well (e.g., 32 ) as noted by many spikes around this region.
For fan-in ( d r ) a smaller value also works well.
However, performance gets better at higher fan-out d c values again (e.g., > 128 ).
Trends are quite consistent across all three variations that we considered.
These results suggest that a more coarse grid may be more effective, as the regions within the grid become larger. [Figure] G L U E [Figure]
S u p e r G L U E S c o r [Figure] [Figure]
[Figure]
[Figure]
u p e r G L U E S c
o r e
[Figure]
[Figure]
[Figure]
3.1. P ERFORMANCE ON T EST S ET
For our ﬁnal runs, we submit our model predictions to the GLUE and SuperGLUE test servers. Model | θ | Avg CoLA
SST
[Table] [Table]
Setup We run experiments with a 3B and 11B HyperGrid Transformer model in multi-task 2 setup (GLUE + SuperGLUE).
We initialize with the T5 pre-trained checkpoints.
Since this is a relatively expensive run, we only train the single model HyperGrid once using a 32 × 128 grid with the LG (local-global) setting.
For GLUE, we compare against baselines reported in (Clark et al., 2020) which includes models such as BERT (Devlin et al., 2018), ALBERT Lan et al.
(2019), RoBERTa (Liu et al., 2019b), and XLNet (Yang et al., 2019).
Note that all these models are ensembles and heavily rely on task-speciﬁc ﬁne-tunining strategies.
More details can be found in the supplementary material.
Results on Test Set
We ﬁnd that our single model approach can achieve highly competitive results on both GLUE and SuperGLUE.
Our model achieves a strong performance of 88 .
9 on SuperGLUE, matching the reported T5 results while having 16 times fewer total parameters.
On GLUE, the performance gap is also small, almost matching the T5 model at 89 .
4 versus 89 .
The gap on the base model remains similar at 88 .
2 versus 88 .
On SuperGLUE, our 3B model achieves 84 .
7 , a respectable score that matches the performance of RoBERTa ensembles ﬁne-tuned individually with task speciﬁc tricks (Liu et al., 2019b).
R ELATED W ORK
Multi-task learning (MTL) (Caruana, 1997) is a long standing research problem.
Learning a single uniﬁed model that does well on multiple tasks is an uphill battle given well-known problems such as catastrophic forgetting (Kirkpatrick et al., 2017).
As such, learning a large number of tasks with a single set of model parameters is an extremely challenging endeavour.
Moreover, the disproportionate amount of data per task is also potentially problematic (Lee et al., 2017; Pfeiffer et al., 2020), which results in models overﬁtting on high resource tasks but underﬁtting on low resource tasks.
Early work in multi-task NLP typically considered a hierarchical taxonomy of tasks (Hashimoto et al., 2016) where a clear hierarchy of tasks exist, such as POS → Chunking → entailment.
The
Joint Many-Task (JMT) model explores an incremental and hierarchical paradigm for building multitask NLP models.
Similarly, (Sanh et al., 2019) proposed a hierarchical multi-task model based on the intuition of low-level and high-level tasks.
Another line of recent work explores casting all tasks into a form of question answering problem (McCann et al., 2018) and using an interpolated pointer-generator (See et al., 2017) mechanism for generating ‘answers’.
Exploiting task relatedness as a means for improved model quality has been frequently explored.
In relatively recent work, (Liu et al., 2019a) proposed MTDNN, a multi-task deep neural network that shares parameters between several NLP tasks.
The model achieves strong performance on the GLUE benchmark.
However, MTDNN simply leverages MTL as a form of pretraining and uses task-speciﬁc models for ﬁnal evaluation.
The recent T5 (Text-to-Text Transfer Transformers) model (Raffel et al., 2019) frames all NLP problems as a Seq2Seq (Sutskever et al., 2014) problem.
However, the best results are again obtained by task-speciﬁc ﬁne-tuning.
Orthogonal to other research efforts, (Clark et al., 2019b) proposed
Born Again Neural Networks (BAM), a clever way to obtain a single multi-task network by knowledge distillation.
(Stickland and
Murray, 2019) proposed Projected Attention Layers for task-speciﬁc ﬁne-tuning of BERT (Devlin et al., 2018).
(Zaremoodi et al., 2018) proposed Adaptive Knowledge Sharing 3 for low-resource neural machine translation.
Our work is related to the literature surrounding hypernetworks (Ha et al., 2016) which have been found to useful in areas such as continual learning (von Oswald et al., 2019).
Learning task-adaptive parameters to avoid catastrophic forgetting has also been a go-to strategy for continual learning (Yoon et al., 2019).
Outside of the NLP domain, ﬂexible parameter sharing approaches are also dominant strategies for learning multi-task models (Ma et al., 2018; 2019).
C ONCLUSION
We proposed Hypergrid Transformers, a new Transformer architecture that leverages Grid-wise Decomposable Hyper Projections (HyperGrid), a hypernetwork-based projection layer for task conditioned weight generation.
We learn and ﬁt all GLUE and SuperGLUE tasks within the same set of model parameters and achieve competitive results to the same state-of-the-art model that is specially and individually ﬁne-tuned on each and every task.
On GLUE/SuperGLUE, this efﬁcient single-model method results in 16x fewer parameters
S UPPLEMENTARY M ATERIAL 6. D ATASETS 6.1. GLUE
The datasets in GLUE are CoLA (Corpus of Linguistic Acceptability)
(Warstadt et al., 2018),
Sentiment Treebank SST-2 Socher et al.
(2013), Microsoft Research Paraphrase Corpus (MRPC) (Dolan and Brockett, 2005), QQP (Quora Question Pairs)
(Iyer et al., 2017), Semantic Textual
Similarity Benchmark (STSB) (Cer et al., 2017), MNLI (Multi-Genre Natural Language Inference)
Williams et al.
, QNLI (Rajpurkar et al., 2016), RTE (Dagan et al., 2005), Winograd Schema Challenge WNLI (Levesque et al., 2012).
More details can be found at https: //github.com/tensorflow/datasets/blob/master/docs/catalog/glue.md .
6.1. S UPER GLUE
The datasets in SuperGLUE (Wang et al., 2019) are BoolQ (Boolean Questions)
(Clark et al., 2019a),
CB (Commitment Bank) (De Marneff et al., 2019), CoPA (Roemmele et al., 2011)
(Choice of Plausible Alternatives), MultiRC (Multi-Sentence Reading Comprehension Dataset) (Khashabi et al., 2018), Record (Reading Comprehension with Commonsense Reasoning)
(Zhang et al., 2018), RTE (Recognizing Textual Entailment) (Dagan et al., 2005; Bar-Haim et al., 2006; Giampiccolo et al., 2007; Bentivogli et al., 2009), Word-in-Context (WiC) (Pilehvar and os’e
Camacho-Collados, 2018), and WSC (Winograd Schema Challenge)
(Levesque et al., 2012).
We use Tensorﬂow datasets for loading and preprocessing these datasets.
More details can be found at https://github.com/ tensorflow/datasets/blob/master/docs/catalog/super_glue.md .
6. E XPERIMENT S ETTINGS
This section describes most of the hyperparameter settings for our experiments.
6. D ATASETS AND E XPERIMENTAL S ETUP
Our experiments are built upon the existing state-of-the-art model, T5.
We run most of our experiments using the base T5 setting, which is comprised of 220 M parameters.
We ﬁne-tune for a maximum of 100 K steps.
We initialize our models with the released pretrained checkpoints 4 .
Our implementation is in Mesh Tensorﬂow (Shazeer et al., 2018).
We consider the following setups for the baseline T5 model.
First, we compare with the T5 results reported in the original 5 paper (Raffel et al., 2019).
These results are denoted with T5 † .
Second, we compare with T5 (PTFT), which stands for pretrain-ﬁnetune.
In this setup, we ﬁne-tune a T5 model for each task individually following common practice.
Finally, we compare with T5 (MTL) which is a fair comparison of T5 without
HyperGrid.
In this setting, T5 is co-trained and results are reported from a single model checkpoint selected from the best overall GLUE dev score.
Note that in the MTL setting, we co-train GLUE and SuperGLUE within the same model.
Experiments for Base Models For all experiments with base models, we train models for 100 K steps with a batch size of 128 .
We use the en mix mixture which samples each task proportionately to the number of examples in the dataset.
Learning rate is a constant 0 .
001 with Adafactor (Shazeer and Stern, 2018).
All results for baselines are reported with scores at the last checkpoint.
During ﬁne-tuning, the embeddings are not ﬁne-tuned.
Experiments are run with 16 TPU V3 chips and are typically completed in about 8 to 10 hours.
Experiments with Large Models We increased the search for large models to 200 K steps pick the best checkpoint for all models based on the best GLUE score.
Experiment and hyperparameter settings remain identical although we use 64 TPU V3 chips for ﬁnetuning which typically take about 12 hours to complete.
Experiments with 3B and 11B Models For the large models, we only use 1 − 2 HyperGrid conﬁgurations 32x128 or 32x256 in LG mode for ﬁnetuning the model.
We submit each model only once to the leaderboard 6 .
Finetuning hyperparameters remain identical.
We pick a single checkpoint based on the best GLUE score.
Finetuning for the 3 B model is using 64 TPU V3 chips and the 11 B model is ﬁne-tuned with 128 TPU V3 chips.
6. C OMPARING WITH O UTPUT G ATING
One of the model architecture variants we compared with is Output Gating.
It can be formulated as:
[Equation]
Comparing to the HyperGrid, which gates the weights in the Relu layer, output gating directly gates the Relu layer outputs.
We can apply either the basic projection method (Equation (2)), or the grid-wise projection method with block-wise projection on layer outputs.
There are two key differences: (1) Output Gating applies sigmoid gating on Relu layer outputs, while HyperGrid applies sigmoid gating on weights before the Relu function.
Output gating is similar to the Mixture-of-Expert architecture while concatenating the expert outputs.
(2) Based on this formulation, the full grid-based projection cannot be applied to output gating.
6. F URTHER A RCHITECTURAL A BLATIONS
We include more architectural ablations to supplement the results and ﬁndings of the paper.
Ablation Architectures
We run experiments for 6 different ablations.
The ﬁrst (1) - (4) is concerning with where to apply HyperGrid.
(1) applies on the entire network (all QKV + both FFNs), (2) applies it to both positional FFNs, (3) applies it on the 1st FFN only and (4) applies it on the 2nd
FFN only.
For (5) and (6), we evaluate on different weighting schemes for HyperGrid.
(5) projects
HyperGrid to a scalar value by pooling (in essense, instead of upsampling the grid, we downsample the grid into a scalar value).
As fo (6), this is the setting where the the row and column size of the
HyperGrid is essentially the same as the FFN.
[Table]
Results
Our ablation studies show that the best place to place the FFN is only at the 2nd FFN.
Using HyperGrid on all the layers, apart from slowing down the network, would also degrade performance.
This can be observed because the difference between (1) and (2) is the addition of QKV
HyperGrids to the model.
In (5) and (6), we also note that Scalar HyperGrid performs poorly and worse than the Baseline model.
Finally, the Max-Grid HyperGrid performs reasonably well.
However, this incurs a huge cost because the hyper network is now larger (as composed to learning small grids and upsampling).