Human language displays simultaneous organization at multiple scales and granularities: topics are maintained over long spans of text without controlling every single word, while grammatical correctness imposes strong local constraints without influencing word choice at a very long range. The choice of a word is thus constrained by both local and longer-range information. This multi-scale structure is reminiscent of well-studied hierarchies in many domains of natural perception. In vision, the resolution of receptive fields decreases as one moves either away from the center of the retina, or higher in the hierarchy of visual cortex areas (from V1 to V2 to V4). This gives rise to phenomena such as crowding (pelli2008uncrowded), where only some ensemble statistic of a set of elements can be perceived, and the existence of metamers, distinct visual stimuli that look the same when seen at the periphery (freeman2011metamers; wallis2019image). Incorporating both local and global organizational constraints and compressing representations with statistical pooling have been suggested to better explain empirical perceptual vision phenomena (wallis2019image). Multi-resolution pyramids such as Laplacian pyramids have been shown to produce more convincing image generation (denton2015deep) and efficient compression (burt1983laplacian). Combining representations at multiple scales has also been successful for speech and audio generation (mehri2016samplernn).
Language modeling efforts however, typically rely on modeling the multi-scale nature of language without strong architectural priors. Representations are learned only at the finest scale, usually that of words or subwords, and rely on the training objective of predicting the next word in the sequence to implicitly capture the need to maintain consistency and coherence across multiple scales. Some previous efforts have advocated for multi-scale sequence models (koutnik2014clockwork; chung2016hierarchical; mehri2016samplernn), but these haven’t seen widespread adoption in language modeling on current large-scale benchmarks. The potential of leveraging multiple scales of representation to reduce memory footprint (see Section 3.5) is especially appealing for language modeling because transformers (DBLP:journals/corr/VaswaniSPUJGKP17), which are currently the most popular architectures, suffer from quadratic memory usage scaling as context length increases.
We argue here that multi-scale transformer architectures can lead to better and more efficient generative models of text. We design three such architectures and present empirical evidence of their advantages, as well as analyses to better understand how transformer language models (LMs) use available context, following work by khandelwal2018sharp; sankar2019neural. Our work thus makes the following contributions: (1) We present three different multi-scale transformer architectures for language modeling. (2) We show that on some benchmarks, these models typically have smaller memory footprint for the same performance. For example, we show that it is possible to train a multi-scale variant with 30 layers that has 23% smaller memory footprint and better perplexity, compared to a vanilla transformer with less than half the number of layers. (3) We show that transformer LMs suffer only minor perplexity increases when only looking at the last 8 or 16 tokens instead of 512, and show that combining a short context of 8 tokens at the finest granularity with longer contexts at a coarser scale has perplexity similar to that of a model that looks at the entire longer context at the finest granularity.
2 Related Work
Transformer-based language models (DBLP:journals/corr/VaswaniSPUJGKP17; radford2018improving; al2019character) have become the model of choice for most large-scale language modeling benchmarks. kaplan2020scaling report power-law scaling of transformer language models with model capacity and data size. As models get bigger, the amount of computational resources, especially memory, grows quickly. In the next paragraph we review some recent efforts attempting to address this issue.
sukhbaatar2019adaptive present an adaptive attention mechanism that learns how far back into the past each head in a transformer should look, and if implemented efficiently with sparse matrix operations, can help save memory. liu2018generating; rae2019compressive
present approaches that compress the transformer’s memory with strided convolutions. Specifically,liu2018generating compress the keys and values in the multi-headed attention by a factor of 3 for long-text abstractive summarization. child2019generating present sparse transformers along with efficient CUDA kernels for sparse attention demonstrating the ability to generate very long sequences. rae2019compressive compress the recurrent memory for a transformer-XL (dai2019transformer), but find that the best performing variant is one that does not learn the compression function end-to-end. liu2019hierarchical proposes a hierarchical extension of the architecture proposed in liu2018generating that attends over very long sequences, with the aim to better model paragraph- and document-level contexts. kitaev2019reformer describe the different factors that contribute to large memory footprints in vanilla transformers. They use reversible layers to remove the need to store activations at every layer in the forward pass, LSH attention to decrease memory requirements from to where is the sequence length, and they split activations in the feedforward layers. bai2019deep present a way to train infinite-depth weight-tied feedforward nets via root-finding, yielding a memory footprint that is constant with the depth of the network, but incurs computational overhead, similar to reversible layers. Unfortunately, this computational overhead is typically at least 50% (gomez2017reversible).
for sequential data (schmidhuber1992learning; el1996hierarchical; koutnik2014clockwork) have attempted to exploit the multi-scale nature of data like language, speech, music and audio. Such models seek to build representations of the input signal at multiple resolutions to better control the generative process by keeping representations of the high-level structure in the signal (e.g., topic) invariant to fine-resolution local changes (e.g., precise word choice or grammar), while simultaneously allowing flexibility at finer resolutions to model these complex phenomena. They have seen success in modeling conversations (sordoni2015hierarchical), raw audio, speech and music (mehri2016samplernn), and language (chung2016hierarchical). sordoni2015hierarchical use the available hierarchical structure in conversations such as utterance level boundaries to define a shallow hierarchy. koutnik2014clockwork and mehri2016samplernn use fixed time scales, while chung2016hierarchical try to learn the clocking function using the task-specific training objective in an end-to-end manner, with an RNN-based architecture. garg2019multiresolution present multi-resolution transformers where resolution hierarchies are obtained from explicit boundaries in the data such as sentences or paragraphs. This however limits the model’s ability to capture hierarchies that aren’t explicit in the data, e.g. within a single sentence or across sentences within the same paragraph. To the best of our knowledge, more generic multi-scale architectures not relying on limited data-dependent boundaries haven’t been explored in conjunction with transformer language models.
We first briefly review language modeling and transformers (DBLP:journals/corr/VaswaniSPUJGKP17) which are the base for our architectures. We then describe the three different multi-scale architectures we explore for language modeling. See Figure 1
for a visual depiction of our proposed architectures and Listings 1, 2 and 3 in Appendix for a PyTorch-like implementation of the forward pass through the models.
3.1 Language Modeling & Transformer Preliminaries
The goal of language modeling is to estimate the joint probability of a sequence of words (or subwords, but we will refer to “words” for simplicity). The models we consider in this work factorize the joint probability over words into a product of conditional probabilities of each word given everything that precedes it. Conditional probabilities are typically parameterized as recurrent neural networks like LSTMs(graves2013generating; mikolov2010recurrent) or feedforward models like gated convnets (dauphin2017language), transformers (DBLP:journals/corr/VaswaniSPUJGKP17; radford2018improving)
, or estimated with non-parametric count-based statistics like in n-gram language models.
Transformers have become ubiquitous for large-scale language modeling (radford2018improving; baevski2018adaptive; radford2019language; dai2019transformer; kaplan2020scaling)
. They are self-attentive models that have stacks of residual blocks, each of which contains layers of multi-headed self-attention and feedforward modules. Multi-headed attention is a generalization of dot-product attention(bahdanau2014neural; luong2015effective) where a score is computed between a query and key for different learned projections of both. The scores are then normalized with a softmax and used as weights to compute a weighted average over values at each position in the sequence. In language models, we use self-attention where . The resulting representations are then summed with the input to the residual block and then normalized using LayerNorm (ba2016layer) followed by a feedforward layer, normalization, and residual summing again. All operations in the model have the advantage of being easily parallelizable on current hardware, and the attention mechanism allows the model to learn long-range dependencies.
In the rest of this section, we consider estimating the joint probability of words, factorized autoregressively. We use and to refer to the dimensionality of the intermediate hidden states and the convolutional feedforward layer in the model, respectively. Words are first represented as embeddings of dimension Let denote the scales of a multi-scale model, where is the finest scale that looks at every token, and scales incorporates information that has been down-sampled by a factor through a down-sampling operator (e.g., an average over windows of size or a strided convolution). For example, a model with scales would use three scales with each scale being 4 times coarser than the preceding scale. Let denote the representation that is fed as input to vanilla transformer blocks at scale (with possibly different numbers of layers at each scale), and the representation at scale . We now detail how are computed for each of the variants we propose.
3.2 Top-down Model
The Top-down model we propose (Fig. 0(a)) is largely inspired by SampleRNN (mehri2016samplernn), a multi-scale recurrent architecture for generating audio. We call this a “Top-down” model because it builds representations of the sequence progressively from coarser to finer scales, by running multiple transformer layers at a particular coarse scale followed by convolutional upsampling to the subsequent (finer) scale. Predictions are made at the finest scale.
The Top-down transformer uses downsampling operators
, that take as input a sequence of vectors and a factorby which to downsample them, to compute a representation of the input at scale of length of ; in our experiments, is average pooling with a kernel of size , or causal strided convolutions.
The input to the coarsest scale in the model , is simply the pooled token embeddings over windows of size . Inputs to the finer-scale transformers thereafter are obtained by combining the pooled token embeddings at the corresponding scale with the upsampled representation from the immediately coarser scale:
where denotes a function that concatenates its inputs (of equal dimension), followed by a learned linear projection to half the dimension of the concatenated vector; is an upsampling function such that indicates that representations are being upsampled by a factor . The model is trained to predict the next word in the sequence using representations . To make sure representations aren’t informed by the future at any position, we slice and shift the inputs to appropriately (see Listing 1 and Figure 0(a)).
The motivation behind such a model is to have early layers learn high-level or coarse outlines of what the model should be generating and have those representations be progressively upsampled to include finer and finer details. Vanilla transformer language models by contrast, entangle the learning and representation of coarse and fine details.
A benefit of this model over vanilla transformer LMs is that they are typically much faster at inference. This is because transformer layers at the coarser scales do not need to run at every time step, but only once every steps for a particular scale. A Top-down model with 26 layers is about 30% faster than a vanilla transformer with 14 layers (see Appendix Table 5).
3.3 Bottom-up Model
In contrast to the Top-down model, the Bottom-up model (Fig. 0(b)) builds representations progressively from fine to coarse scales. Instead of upsampling operators, the architecture uses an aggregation layer, denoted by , to incorporate information from coarser scales at the word level. This is a transformer layer where certain subsets of heads attend to representations from different scales. Specifically, inputs to the multi-headed attention module within the layer are the word embeddings themselves denoted by , and the keys and values are representations at different coarser scales denoted by ; we denote this operation via . This aggregation layer is given as input to the finest transformer blocks that make word-level predictions. The attention mask is constructed appropriately for each subset of heads to prevent looking at the future. To summarize:
where is the output from which word probabilities are predicted.
3.4 Retina Model
We also experiment with an architecture that combines progressively coarser representations for tokens further away in the past, in a way that is reminiscent of the progressively bigger receptive fields in the retina as one moves away from the center. The underlying intuition is that a lot of the fine-grained information at the word level might be necessary in a close range (e.g., for grammaticality), but not so much at larger distances (see also the shuffling results in Section 5.3). Unlike the Top-down and Bottom-up models, this Retina model does not have separate transformer layers at every scale. The Retina model looks at each token with a different granularity: tokens in the recent past are looked at with finer granularity and distant tokens at a coarser granularity. This is a simple modification to the multi-headed attention module of a transformer: namely, a different subset of heads look at representations from different scales. The queries to the multi-headed attention always come from the representations at the finest 1x () scale, while the keys and values are selected appropriately based on each input query position and the scale assigned to each head. This amounts to having local attention (parmar2018image) at the finest 1x () scale (for the first subset of heads), and memory compressed attention (schmidhuber1992learning; liu2018generating; rae2019compressive) with added sparsity for the remaining coarser scales. Note that context windows across the attention heads at different scales can have arbitrary boundaries for each scale (see Fig. 0(e)).
Formally, consider the same setting as in the Top-down model (see Sec. 3.2), with scales and token embeddings , predicting token at position Downsampled representations are obtained at various scales through average pooling or strided convolutions, and then used as keys and values in a transformer. Each scale uses its own context window. These context windows are obtained by slicing the full-length context into non-overlapping windows of sizes roughly proportional to the scales, with the coarser scales using larger, further away context windows. Denoting context window boundaries by and assuming a fixed scale ratio this means that roughly grows geometrically as and each scale takes up about the same space for representation, since the context size increase exactly compensates the higher downsampling ratio. Overall, the output representation is given by:
This basic description can easily be extended to arbitrary non-overlapping context window boundaries (see ablation in Section 5.3), while still maintaining the general design that the context windows of coarser scales are bigger and further away from
3.5 Space & Time Complexity for Transformer Layers
Transformer language models typically require large amounts of GPU memory to train. There are a few factors that contribute to this.
They require intermediate activations at every time step and layer to be stored in memory for fast backpropagation. Memory footprint therefore scales linearly with the number of layers and we’d often like to fit as big a model as we can into memory(kaplan2020scaling).
Inside a transformer layer, multi-headed attention with queries, keys and values requires computing a score for every pair of elements in the query and key (i.e.) the matrix is of size (assuming a batch size of 1) where is the number of elements in the sequence. Both memory and time complexities are therefore quadratic in the length of the sequence , computation however is typically less of a problem since it can be parallelized easily across . With short sequences, where the embedding dimension of the queries, keys, and values are greater than the sequence length, the matrix becomes expensive to store and compute. The overall complexity is , where is the embedding dimension.
Transformer layers also contain position-wise linear layers that are about 4 times as wide as the model embedding dimension and therefore require 4 times as much memory to store activations. In typical language modeling setups, where , these activations dominate memory footprint (see Appendix Table 8).
Our multi-scale architecture addresses 1 and 2 by reducing the number of positions over which transformer layers at coarser scales need to operate on. Figure 2 shows memory footprint in GB and time taken for a forward pass in milliseconds for a single transformer layer at different scales as a function of the input sequence length. Each transformer layer in this setting is identical to the ones used in our BookCorpus and Wikitext-103 experiments. Layers at the 4x, 16x and 64x scales are more efficient in terms of time and memory. Memory footprint was calculated analytically by accounting for the number of stored activations in the layer and time by implementing the layer in PyTorch.
By contrast, recurrent models have far fewer layers (typically an order of magnitude smaller) and are trained with BPTT, which only requires storing hidden state across all time steps for efficient backprop, making complexity .
4 Datasets & Experimental Setup
We consider three word/sub-word level language modeling benchmarks of different sizes. In order to make our results comparable to previous published research, we use standard datasets that have been used in prior language modeling efforts (baevski2018adaptive; radford2018improving; lample2019large) - Wikitext-103 (merity2016pointer), BookCorpus (zhu2015aligning) & CC-news (liu2019roberta). We use the standard train/validation/test splits for Wikitext-103 and use random splits for the Bookcorpus and CC-news. Dataset statistics are reported in Table 1. Following baevski2018adaptive, we BPE tokenize (sennrich2015neural) Wikitext-103 with 32k replacements, but report perplexities at the word level for comparison with previous work, by re-normalizing the average perplexity by the actual number of words in valid/test sets. We use 30k replacements for the Bookcorpus and CC-news datasets, and report the average sub-word level perplexities since all models being compared are trained with the same tokenization and BPE pre-processing.
|Dataset||Size (GB)||Train Tokens||Valid Tokens||Test Tokens||Vocab Size|
4.2 Experimental Details
Across all datasets, our primary point of comparison is with a vanilla transformer language model (radford2018improving). For the Wikitext-103 and Bookcorpus datasets, we use a model that has either 12, 14 or 16 layers, = 768, 12 attention heads, = 3,072, dropout of 0.1 everywhere including the attention scores and GeLU activations (hendrycks2016gaussian)
- a configuration similar to the smallest GPT-2 model(radford2019language). For the CC-News dataset, we increase to 1,024 and to 4,096. We use a batch size of 256 randomly sampled chunks of 512 tokens. For our CC-News models, we use gradient accumulation to simulate a batch size of 256. At inference, we consider the entire piece of text as one contiguous block and use a sliding window of size 512 tokens with a stride of 256 and make predictions only over the last 256 tokens in the window. This ensures that for every minibatch of examples, the model has some context to work with.
Our multi-scale architectures use the same configuration above for every transformer layer, with added upsampling and downsampling modules. Our best-performing models use average pooling for downsampling and we present an ablation study with strided convolutions in Table 4. We used a single transpose convolution layer with an appropriate kernel size and stride for upsampling. Each scale increases by a factor of 4 from the previous.
All models were trained with mixed precision arithmetic and optimized using Adam (kingma2014adam) with the learning rate increased linearly to over 40,000 warmup steps and then annealed to 0 over a million steps using a cosine schedule (radford2018improving). We tuned the dropout rates in our Wikitext-103 in the range of 0.1 to 0.5 with increments of 0.05, since we found that our models were able to overfit the data quite easily. For BookCorpus and CC-News, we only experimented with the number of transformer layers at each hierarchy and the number of hierarchies (see Table 4).
5 Results & Discussion
5.1 Perplexity vs Memory Footprint trade-off
As kaplan2020scaling note, transformer language model perplexities scale as a power-law with model capacity and dataset size. Given a big enough dataset, we would therefore like to fit as big a model as our hardware will allow. Our multi-scale architectures brings us closer to this goal - demonstrating better perplexities for the same model memory footprint, as Figure 3 shows. As expected, perplexity decreases with depth and memory usage, but the multi-scale transformer achieves lower perplexity for the same memory usage. Gains are particularly stark when comparing to vanilla transformer LMs with fewer than 8 layers.
While it is possible to manually estimate the amount of memory a model uses as shown in Appendix Table 8, here and in the remainder of the section we use PyTorch functions111torch.cuda.max_memory_allocated to report actual measurements.
|Model||Layers||Test PPL||Train Mem (GB)|
|Model||Layers||Test PPL||Mem (GB)|
|DEQ-Transformer (Adaptive) (bai2019deep)||-||23.2||-|
|Adaptive Inputs (baevski2018adaptive)||16||18.7||-|
|Top-down (4x, 1x)||6,12||25.6||25.15|
|Top-down (4x, 1x)||5,10||26.1||22.08|
|Bottom-up (4x, 1x)||5,10||26.8||21.83|
|Retina (16x, 4x, 1x)||16||26.6||29.92|
Tables 2 and 3 report perplexities of different models with their associated memory footprint. In all cases, multi-scale transformers achieve either the same perplexity as strong baselines, while using less memory; or for the same memory, they achieve lower perplexity. On Wikitext-103, multi-scale transformers overfit the data much faster than vanilla transformers, since they have a lot more capacity for the same memory footprint. In the future, we plan to investigate better regularization methods to further improve generalization. In Appendix Figures 5 and 6, we further analyze which tokens are responsible for the overall improved performance similarly to baevski2018adaptive, and we found that the multi-scale transformer outperforms the baseline by modeling rare tokens better.
Further, in Appendix Table 6, we report nearest neighbors in the wikitext-103 dataset using representations produced by the model at different scales, finding that retrieved chunks are often very similar in topic. In Appendix Table 7, we also report example completions from a model trained only at different coarse scales (see Appendix Section 6.2 for details).
5.2 Analyzing Transformer LM behavior to context perturbations
khandelwal2018sharp and sankar2019neural analyzed how LSTM language models and dialog systems use context, by perturbing it with different kinds of noise and observing changes in the likelihood assigned by the model to every subsequent (unperturbed) token in the sequence. Khandelwal-arxiv show that perturbations which destroy word order, like shuffling, affects the likelihood that the model assigns to words near the shuffled context, but not far away.
We observe similar patterns for transformer language models on the Wikitext-103 and Bookcorpus datasets, as shown in Figure 4. In particular, we consider a sequence of 512 tokens, shuffle the first 256 tokens and observe the likelihood that an already trained model (without perturbations) assigns to the subsequent 256 tokens. When the shuffled context is more than 50 tokens away, the change in likelihood, compared to when the model is presented with a completely unshuffled context is already minimal, indicating that the model may not be using word order beyond this distance. This observation might partly explain why our Retina model, which only looks at fine-grained context in a local way while using coarser representations for distant context, can perform similarly as a model that uses the entire context at a fine-grained scale (see results in Table 4).
In Table 4 we extensively investigate how the main design choices of multi-scale tranformers, such as the number of scales and number of layers at each scale, impact perplexity.
First, we observe that adding a coarser scale to the top-down multi-scale transformer helps when moving from (4,1) to (16,4,1), as these have the same memory footprint but the latter model has lower perplexity. However, we do not observe gains when adding an additional coarser scale with the (64,16,4,1) transformer.
Second, we find that the best layer allocation places more layers at the finer scales. Therefore, the designer of the architecture has to strike a trade-off between minimizing perplexity and limiting memory consumption since the finest scale is responsible for the bulk of memory usage.
Third, one may wonder whether improved perplexity reported by multi-scale models is merely due to the depth increase of the overall architecture. We thus trained skinnier but deeper vanilla transformers with set to 256 and 512 and set to 1024, 2048, and found that they perform worse. Therefore, the gains are not entirely due to depth increase.
Fourth, in the previous section we have already discussed how transformers are not so sensitive to the order of the tokens in their farther context, motivating the use of the Retina variant of the multi-scale architecture. Here we show a) that the performance of the baseline model only mildly deteriorates when reducing the size of the context below 64 tokens (in fact, only 3 points are lost when using a context size of 8 tokens), and b) that this property can be leveraged by the Retina version of our model.
In particular, the “attention context window” column shows the context size in the multi-headed attention of the retina model. For example, "0:512" indicates that a token at position and can look at tokens to and "0:8, 8:256, 256:512" indicates that the attention heads at the 1x scale can look at tokens to , to at the 4x scale, and to at the 16x scale. Using this configuration and for the same memory footprint, our Retina model is able to improve over a model that looks at all 512 words at the 1x scale.
Finally, we experimented with three different downsampling modules - average pooling, max-pooling and strided convolutions. We found average pooling to be better than convolutions and max-pooling to be quite unstable during training.
5.4 Sample based evaluation
A hallmark of the recent progress in language modeling has been improvements not only in perplexity, but sample quality as well. While evaluating generative models of text purely based on their samples is extremely difficult and an on ongoing effort (cifka2018eval; semeniuta2018accurate), we would like to ensure that we aren’t losing out on sample quality with respect to vanilla transformer LMs. Table 5 in the Appendix shows no significant difference in terms of generation quality between multiscale models and baseline transformers according to several common metrics; see Table 9 in Appendix for some qualitative comparisons.
|Model||Scales||Attention Context Window||Layers||Test PPL||Mem (GB)|
|Ablation for number of scales|
|Ablation for capacity at different scales|
|Ablation for downsampler|
|Ablation for deep & narrow networks|
|Ablation for attention context window|
We propose three multi-scale transformer architectures for language modeling and show that they achieve competitive or better perplexities compared to vanilla transformer language models for the same model memory footprint across three different language modeling benchmarks.
These models leverage the robustness of transformers to word ordering in distant context windows. In these architectures, the representation produced by coarser scales which operate on much shorter sequences, is combined with the representation of the finest scale, thereby reducing the overall computational and memory cost.
Future work will explore how to combine our multi-scale architectures with adaptive attention head spans and how different types of information (e.g., topic, grammatical correctness) are differently affected by architecture scale choices.
6.1 NLL vs Word Frequency
In tables 5 and 6, we break down the token-level perplexities based on their frequency of occurrence in the training set, similar to (baevski2018adaptive). We bin tokens into 5 or 10 equally sized bins, based on cumulative frequency and report the average NLL within each bin, with bins sorted from those that contain least to most frequent words. We find that the performance gap between models with smaller and larger context window sizes stems from modeling of low-frequency tokens.
6.2 Coarse-only Transformer LMs
We explore the possibility of training a model that makes predictions directly at a particular scale. For example, if we consider a scale of 4, we initially downsample the input by a factor of 4 by averaging the embeddings of every non-overlapping 4-gram chunk. We then run transformer layers on this input and use the final representations at each step to predict the next 4-gram
chunk. We train the model to make these predictions by minimizing the cross-entropy between the model’s output distribution and a uniform distribution over the subsequent 4-gram.
Table 7 presents qualitative results showing model predictions for the following. We experimented with adding this criterion of being able to predict the subsequent bag of words distribution in our top-down model at all scales, but didn’t observe any improvements. This experiment mostly served as a sanity check to ensure that the representations learned at different scales can be useful. To ensure that representations at different scales learn meaningful representations, we qualitatively analyze them by looking at nearest neighbors computed using them in Table 6. We found that nearest neighbors computed on Wikitext-103 typically returned segments within highly related topics.
6.3 Sample-Level Evaluation Metrics
A hallmark of the recent progress in language modeling has been improvements not only in perplexity, but sample quality as well. While evaluating generative models of text purely based on their samples is extremely difficult and an ongoing effort (cifka2018eval; semeniuta2018accurate), we would like to ensure that we aren’t losing out on sample quality with respect to vanilla transformer LMs.
We therefore borrow a few sample-level evaluation metrics typically used to evaluate GAN-based text generation methods to compare samples from our model with vanilla transformer LMs. In all sample-based evaluation setups, we provide models with 64 tokens of context and generate sequences of length 256 with topk sampling(fan2018hierarchical) and a temperature of 0.7.
N-gram and GPT-2 PPL
- We compute the likelihood of model generated samples under a pre-trained kneser-ney smoothed 4-gram language model (heafield2011kenlm) and a pre-trained GPT-2 345M parameter model (radford2019language).
- Given an a particular input context, we generate 3 distinct completions and use these as references to compute BLEU wrt the ground truth completion.
- Following welleck2019neural, we also estimate the fraction of 1,2,3 and 4-grams that the model repeats.
Quantitative results for different models are presented in Table 5, with qualitative samples in Table 9. We could not observe any significant difference in sample quality between the different models. We also report the time it takes for each model to generate a sequence of 256 tokens given a context of 64 tokens.
|Model||Layers||N-gram PPL||GPT-2 PPL||Ref BLEU||N-gram Repeat||Time (s/seq)|
|Reference Text :|
|good on Megadeth ’s claim to being the world ’s state @-@ of @-@ the @-@ art speed metal band " . Musicologist Glenn Pillsbury stated the guitar work on the album was a mixture of Mustaine ’s " controlled chaos " and the " technical brilliance " of Marty Friedman . Studio efforts released in the mid- and late 1990s featured songs with compact structures and less complicated riffing . Megadeth ’s lyrics often focus on death , war , politics , and religion . The lyricism centers on nihilistic themes , but occasionally deals with topics such as alienation and social problems . The earliest releases featured themes such as occultism , graphic violence|
|Nearest Neighbors at the 4x Scale|
|vocalist Jock Cheese and keyboardist / vocalist Eugene de la Hot Croix Bun , and enjoyed a large underground / independent following . Their third album , Machiavelli and the Four Seasons , reached the Australian national top 10 in 1995 . TISM were known for their hybrid of dance music and rock ’n’roll , high @-@ energy live shows and humorous lyrics . TISM ’s songs frequently satirised modern culture , celebrities and the entertainment industry , classic literature and art , current affairs , politics and sport . The titles of their songs were often wordplays created by juxtaposing pop culture references with more intellectual ones ( for|
|n ; 1950 ’s blues artists Guitar Slim , Johnny Watson , and B.B. King ; R & B and doo @-@ wop groups ( particularly local <unk> groups ) ; and modern jazz . His own heterogeneous ethnic background , and the diverse social and cultural mix in and around greater Los Angeles , were crucial in the formation of Zappa as a practitioner of underground music and of his later distrustful and openly critical attitude towards " mainstream " social , political and musical movements . He frequently lampooned musical fads like psychedelia , rock opera and disco . Television also exerted a strong influence , as demonstrated by quotations from show|
|magazine , " I am a young adult now , and I think this album shows my growth vocally . " Aaliyah was mastered by Bernie Grundman at his studio in Los Angeles . = = Music and lyrics = = An R & B and neo soul album , Aaliyah featured midtempo funk songs , hip hop @-@ textured uptempo tracks , and slow jams that draw on older soul influences . Along with contemporary urban sounds , its music incorporated Middle @-@ Eastern influences , muted alternative rock , and , particularly on Timbaland ’s songs for the album , Latin timbres . " Never No More " mixed both older soul and modern hip hop sounds with|
|Nearest Neighbors at the 16x Scale|
|well received by both critics and fans , and was responsible for bringing Slayer to the attention of a mainstream metal audience . Kerrang ! magazine described the record as " the heaviest album of all " . Alongside Anthrax ’s Among the Living , Megadeth ’s Peace Sells … but Who ’s Buying ? and Metallica ’s Master of Puppets , Reign in Blood helped define the sound of the emerging US thrash metal scene in the mid @-@ 1980s , and has remained influential subsequently . Reign in Blood ’s release was delayed because of concerns regarding its graphic artwork and lyrical subject matter . The opening track , " Angel of Death " , which refers to Josef|
|music industry in 1992 , through his vocal contributions on Dr. Dre ’s The Chronic . That album is considered to have " transformed the entire sound of West Coast rap " by its development of what later became known as the " G @-@ funk " sound . The Chronic expanded gangsta rap with profanity , anti @-@ authoritarian lyrics and multi @-@ layered samples taken from 1970 ’s P @-@ Funk records . Snoop Dogg contributed vocals to Dre ’s solo single , " Deep Cover " , which led to a high degree of anticipation among hip hop for the release of his own solo album . Doggystyle and The Chronic are associated with|
|the most innovative popular musicians in America if not the world " but also " the most politically ambitious . Not even in the heyday of [ the ] Clash has any group come so close to the elusive and perhaps ridiculous ’ 60s rock ideal of raising political consciousness with music . " Their music on the album inspired leftist and Afrocentric ideals among rap listeners who were previously exposed to more materialist themes in the music . Reeves said it introduced black consciousness to the " hip @-@ hop youth " of the " post @-@ black power generation " , " as leather African medallions made popular by rappers like P.E. replaced thick gold chains as|
|Neighbors at the 64x Scale|
|an album that established the concept for Metallica ’s following two records . Colin Larkin , writing in the Encyclopedia of Popular Music , singled out " For Whom the Bell Tolls " as an example of Metallica ’s growing music potential . Popoff regards Ride the Lightning as an album where " extreme metal became art " . Megaforce initially printed 75 @,@ 000 copies of the album for the US market , while Music for Nations took care of the European market . By the autumn of 1984 , Ride the Lightning had moved 85 @,@ 000 copies in Europe , resulting in Metallica ’s first cover story for British rock magazine Kerrang ! in its December issue|
|best record of derisive punk rock since Exile on Main St. ( 1972 ) by the Rolling Stones . In The New Yorker , Ellen Willis wrote that she learned to appreciate Too Much Too Soon more than New York Dolls after seeing the band perform songs from the former album in concert , particularly " Human Being " and " Puss ’ n ’ Boots " , while Ron Ross from Phonograph Record magazine said the group ’s " easy going ironic sensibility " was expressed " far more amusingly and accessibly " here than on their debut album . Some reviewers were critical of Too Much Too Soon for what they felt was a poorly recorded and overproduced|
= Riot Act features a diverse sound , including folk @-@ based and experimental songs . Stephen Thomas Erlewine of AllMusic said " Riot Act is the album that Pearl Jam has been wanting to make since Vitalogy - a muscular art rock record , one that still hits hard but that ’s filled with ragged edges and odd detours . " Gossard said " Riot Act really seems to showcase all of our thing . There ’s the simple rock songs we could have written in the earlier era , but it covers all the different times and dynamics we ’ve had and still holds together . " The musical experiments also lead several songs on the album to use alternate
|Prisoner of Azkaban was the third film in the series . Radcliffe ’s performance was panned by New York Times journalist A. O. Scott , who wrote that Watson had to carry him with her performance . Next was Harry Potter and the Goblet of Fire in 2005 . The film was the second @-@ highest grossing Harry Potter|
|2x Completions - | film | , ||
|4x Completions - | film | the | , | and ||
|8x Completions - | the | film | of | , | . | in | and | series ||
|16x Completions - | grossing | the | , | worldwide | and | $ | in | . | million | of | @-@ | highest | grossed | film | Part | @.@ ||
|64x Completions - | . | Harry | the | , | and | of | in | a | " | film | was | to | ’s | @-@ | The | that | Watson | Gob@@ | Potter | for | rint | Rowling | her | as | Prison@@ | performance | with | Columbus | an | on | by | she | it | Stone | had | Times | Phoenix | at | Best | Radcliffe | Half | In | from | book | series | first | grossing | his | one | role | instal@@ | Philosop@@ | but | be | $ | which | ) | he | ( | ab@@ | is | novel | character ||
|set fire to the ship to prevent her from falling into enemy hands . Patriots in small boats sailed out to the burning ship , fired some of its cannons at the British ships , took what stores and loot they could , and retreated shortly before the ship ’s powder magazine exploded . = = Aftermath = = The British did not|
|2x Completions - | the | have ||
|4x Completions - | the | their | to | fire ||
|8x Completions - | the | , | to | and | any | of | not | until ||
|16x Completions - | the | , | . | of | and | to | British | a | was | in | were | that | The | ’s | as | on ||
|64x Completions - | . | the | , | and | of | to | British | ships | a | in | was | on | had | that | The | were | ’s | for | with | by | ship | at | from | wounded | as | fleet | sailed | American | his | her | which | they | but | HMS | not | been | an | @-@ | two | after | men | returned | York | battle | harbor | be | fire | = | she | their | killed | Boston | French | it | damage | off | captured | one | guns | In | crew | into | he | schooner ||
|Scale||Layers||Emb||,, Proj||FC||LN, Drop Residual||Output + Grad||Hierarchical Representations||Total (GB)|
|Memory footprint breakdown for a single transformer LM layer at different scales|
|Memory footprint breakdown for a 12 layer vanilla transformer|
|Memory footprint breakdown for a 30 layer top-down transformer|
|Memory footprint breakdown for a 23 layer Bottom-up transformer|
|one has the bluegrass and which one has blue grass? "Zane barely resisted the impulse to shake him again. It wouldn’t help, but it might help him feel better." I’m not asking where Burns told you you were. "Ty nodded, refusing to comment on that. Zane shook his head and then|
reached into his pocket to pull out his phone. He turned it on and pressed the buttons for the Miami Police Department. He had a feeling that Burns had told him about the specific questions he’d asked, and he looked over at Ty. "You ever been to Texas?" he asked. Ty shook his head and looked away, giving Zane the privacy he needed. He glanced at Ty. "I ’ll be in touch," he promised, and then turned to walk away. "What?" Zane asked, surprised. "You ’re pretty sure of yourself. "Zane grinned and nodded." Not even in the Marines? "Ty shook his head." Never. "Zane stared at him a moment longer, then walked over to the bar and poured himself a beer. He leaned against the wall and watched Ty walk away. He couldn’t help but smile. "You don’t have to go." Ty stopped and turned, looking back at
|I told Dominic silently, I just wigged out. Dominic’s gaze met mine, his dark eyes glowing, his hair falling around his cheeks. You told him to get off. He didn’t. The prick hasn’t even apologized. I don ’t think he’s going to, I replied calmly, I don|
|’t know what to say . Dominic’s voice was stern. "I will not tolerate that kind of behavior from you." I knew I had to look at him, because he was glaring at me . He wasn’t being a very nice guy, but I knew he was right. He deserved to be treated like a human being. I’d never seen him so angry. "Dominic," I said softly, trying to soothe him. "I ’m sorry. I didn’t mean to make you angry." I tried to make him look at me, but he looked away. "I just don’t understand why you do it. You have to know that you’re not normal." He sighed and looked back at me. "I know. I ’m sorry. I just don’t want to be like that." I sighed, knowing he was right. I didn’t want to be like that either. "Well, I ’m going to go check|
|Anna’s lips twisted. "Over the past few days I’ve discovered that there are very few things that are impossible." "He’s dead, "Morgana said, as much to convince herself as the annoying pest standing before her. "I watched him die." "You betrayed him. "Morgana’s|
|eyes narrowed. "The king is dead, and the rest of the clan has been murdered."Anna’s jaw hardened with a fierce fury."What do you want?" "I want you out of my office. Now. "Anna stiffened , but before she could react, Levet was at her side, his wings flapping furiously in panic. "Sacrebleu, I beg of you. I cannot leave my sister. "Anna glared at the tiny demon. "I know." "I can ’t take you with me, "Anna snapped. Levet’s wings flapped in panic. "I’m not leaving without Morgana." "You can’t be leaving her." "No, I can’t." "Then don’t leave me alone." "I can ’t do it." "You can." "No." Levet’s words were swallowed by a sudden roar of anger|
|door wide and I gasped as I stepped inside. It was more like a studio apartment than a guest bedroom; it was about three times the size of our room back in Seattle. The walls were painted a surprisingly warm shade of gray, with furniture in a deep, contrasting dark cherry. The bedspread was black with intricate|
|patterns in shades of red, gold, and green. The floors were of polished wood and a thick layer of brown dust covered the walls. The ceiling was vaulted, giving the room a more natural light. There was a huge bay window and an easel in the corner. A large bed and a large, flat-screen TV surrounded it. The only other thing that was obvious was the bathroom. There were two stalls off to the side, the toilet and sink. There was a bathroom to the left of the bedroom, opposite a large, white, marble bathroom. There were two sinks, both full of toilet paper. I walked over to the bed and looked out the window. The door was slightly ajar, and a couple of windows had a view of the lake.|