Elamur Research

MEGABYTE: Predicting Million-byte Sequences with Multiscale Transformers

Paper · 2023 · Lili Yu, Dániel Simig, Colin Flaherty et al.

Summary

A book, a high-resolution image, and a long recording can each be represented as a sequence of bytes. Predicting those bytes directly gives a system access to the original data, but it makes the sequence very long. In a conventional Transformer, attention compares positions with one another, and a large feedforward network does additional work at every position. MEGABYTE reduces both costs by giving the expensive part of the computation fewer positions to process. It groups consecutive bytes into fixed-size patches, uses a large global Transformer to carry information from earlier patches, and uses a smaller local Transformer to predict each byte in the current patch.

The two Transformers have different jobs. The global Transformer sees each completed patch as a single vector assembled from its byte embeddings. Its output gives the local Transformer information about the preceding sequence. The local Transformer then predicts the bytes in order, using both that information and the bytes already known within the patch. Shifting the inputs at both scales keeps each prediction causal. The large feedforward layers run at patch frequency, and the attention calculation is divided between a shorter global sequence and many short local sequences. With patch size chosen as a function of sequence length, the paper derives an attention cost of O(T⁴⁄³), where T is the number of bytes. The smaller Transformer still makes each byte prediction during generation, but the larger one needs to run only once per patch.

The authors compare MEGABYTE with a standard byte-level Transformer and PerceiverAR under matched training budgets. MEGABYTE assigns higher likelihood to the observed bytes across the text and image datasets in those comparisons. On PG19, it is also competitive with published sub-word systems, whose training budgets and tuning differ. On ImageNet 64x64, it matches the reported state of the art in density estimation, with the authors estimating that their run took less than half the GPU hours needed to reproduce the strongest published PerceiverAR run. At the highest image resolution, MEGABYTE processes up to 1.2M byte positions in one forward pass. It also predicts bytes directly from raw audio, reaching 3.477 bits per byte in the audio comparison. In a separate PG19 timing experiment, it generates 8192 bytes 40% faster than the standard Transformer used for that test.

Removing either Transformer worsens prediction across the text, audio, and image datasets used for the component tests. The allocation experiments favor spending more of the available capacity on the global Transformer, while the PG19 test shows that predictions improve across an 8192-byte context. A separate run with a longer context finds no further improvement. The findings establish that autoregressive prediction without tokenization can be practical at the sequence lengths and training budgets tested. Whether it can replace sub-word prediction at the scale of the largest language systems remains open.

Deep dive: MEGABYTE: Predicting Million-byte Sequences with Multiscale Transformers

MEGABYTE uses a global Transformer for groups of bytes and a local one for individual predictions, making million-byte sequences practical. · about 37 minutes to read

The problem and its context

A byte is a simple prediction unit with an expensive sequence length

An autoregressive system assigns a probability to the next element of a sequence using the elements that precede it. At training time the sequence is already available, so the system can calculate many of these predictions in parallel, provided each prediction is prevented from seeing its own target or any later input. During generation, a sampled byte becomes part of the input for subsequent predictions. Both uses require the system to represent the prefix, the portion of the sequence that comes before the position it is predicting. The longer the prefix it can use, the more opportunity it has to draw on information that occurs far away.

Using bytes makes the prediction unit simple and shared across kinds of data. A passage of text, the color values of an image, and the samples in an audio file can all be presented as ordered byte values. A sequence of bytes can also run to millions of positions before it describes a complete document or recording. The paper points out that the large Transformer decoders it discusses typically use context windows of several thousand tokens. This discrepancy is important even when the immediate next element is straightforward. A local texture in an image may continue predictably, while the part of the image being depicted depends on structure established much earlier in the scan. Long input creates a computational problem and an information problem at the same time.

The standard decoder incurs two distinct costs. Self-attention lets each position draw information from other positions in the available prefix. With dense attention, increasing sequence length increases both the number of positions seeking information and the number of positions they may look at. The causal mask restricts access to the past, but the amount of attention work still grows quadratically in sequence length. The feedforward layers have a different cost. They transform the hidden representation at every position separately, and wider layers perform more work at each of those positions. The paper singles out these layers because they account for most of the arithmetic in the large decoders used to motivate MEGABYTE.

This matters when comparing ways to extend context. Making attention cheaper addresses the cost of relating positions. A wide feedforward network that still runs once for every byte remains expensive. Conversely, the standard Transformer can reduce the number of positions at which it runs both kinds of computation by working with larger discrete units. That approach changes the units on which the system makes its predictions. MEGABYTE asks whether the expensive computation can operate at a lower frequency while the probability distribution remains defined over bytes.

How earlier work reduced the burden

The paper groups efficient decoders by where they change the flow of information. Some divide a sequence into blocks and carry information forward through a recurrent state, a representation updated as the computation proceeds. Others use cross-attention, in which one set of representations queries another. PerceiverAR, the main long-context comparison in the experiments, can read a longer input through one cross-attention layer and use a shorter set of internal representations, called latents, for its subsequent processing. This gives it a way to use a large prefix while keeping the sequence presented to much of the decoder shorter.

Other work changes the attention computation itself. The paper discusses linear alternatives that use forms of recurrence, as well as state-space approaches. Sparse methods retain selected attention connections in place of the full set, with different designs determining which positions can communicate directly. Among the examples in the paper are Generating Long Sequences with Sparse Transformers, Reformer, and Longformer. The authors observe that large decoders still often use dense attention, citing LLaMA and PaLM as examples.

The authors also draw on work that shortens sequences before applying a Transformer. Vision Transformers group image pixels into patches, and some text encoders reduce the number of positions at intermediate stages. A decoder faces an additional constraint. If a representation combines all the bytes of a patch and the decoder uses it to predict an early byte of that same patch, the representation can contain the very answer the decoder is meant to predict. Grouping inputs therefore requires a rule about when the group becomes visible. Vision Transformer supplies a precedent for representing a patch as one position. MEGABYTE’s local decoder and input shifts make the idea usable for causal prediction.

What a tokenizer would otherwise do

In the paper’s account, a tokenizer shortens text by turning strings of bytes into discrete vocabulary entries. A vocabulary entry might stand for a familiar piece of a word, allowing the decoder to handle that piece at one position. Methods in subword tokenization can preserve the original text. The authors’ concern is that the choice of segmentation still shapes the interface. Language-specific rules can affect preprocessing, and a change as small as whether a prompt ends with whitespace can change its tokenization. The paper also cites evidence that vocabulary and segmentation choices matter when transferring to another domain, and it discusses SentencePiece as an example of lossless text tokenization.

Image and audio pipelines pose a different problem when the goal is to shorten their sequences substantially. The paper discusses systems that first learn a discrete representation of the input, using a discrete autoencoder for images or clustering for speech. These schemes can discard some of the information in the source. The point of the comparison is about the representations those pipelines choose. An autoregressive system that reads the original bytes can learn which details matter to prediction without a separate stage deciding which details to retain. One earlier approach the authors cite for speech representations is HuBERT.

A fixed patch also groups bytes, but it does so by position. Its contents do not have to appear in a vocabulary of recurring strings. When a word begins close to the end of a patch, its remaining bytes simply appear in the next patch. This leaves the decoder with a predictable computational layout and with the task of learning what patterns mean across that layout. The authors’ motivation for giving the local Transformer less capacity is that many individual byte predictions draw heavily on immediate context. Completing a partly observed word is their example. The larger Transformer can spend its layers representing the broader context, while the smaller one uses it to resolve details at byte resolution.

The method, step by step

Follow a prediction through the two scales

Start with a sequence of bytes in the order in which they will be predicted. MEGABYTE divides it into consecutive patches, all of the same size for a given configuration. The patch embedder looks up a vector for each byte and adds information about its position. It then joins all the vectors in a patch end to end. Joining them keeps a separate part of the resulting vector for each byte position. The operation requires neither a dictionary of complete patches nor a learned choice of where to place each boundary.

When the system predicts a patch, the global Transformer receives representations of patches that are already complete. It reads them in order with causal attention. Its output at the position assigned to the current target patch has room for a distinct vector for each byte slot. MEGABYTE splits that output into those slots and projects each vector to the width of the local Transformer. The resulting vectors can carry different information to different positions, even though the global Transformer produced them together.

The local Transformer receives those vectors and a shifted copy of the current patch’s bytes. At the beginning of the patch it receives a learned start vector. At each later position it receives the embedding of the preceding byte. Causal attention within the patch also lets it use the earlier slots. The output at each slot provides scores for the possible byte values, converted into a probability distribution. During generation, the chosen byte is fed back into this local process. Once the patch is complete, its embedding can be supplied to the global Transformer for the next patch.

How MEGABYTE predicts bytes at two scales

The steps in order.

How MEGABYTE predicts bytes at two scalesStep 1: Embed bytes and add position information1. Embed bytes and add position informationStep 2: Concatenate consecutive byte embeddings into patches2. Concatenate consecutive byte embeddings into patchesStep 3: Shift completed patches into global input3. Shift completed patches into global inputStep 4: Contextualize patches with causal global attention4. Contextualize patches with causal global attentionStep 5: Split and project global output by byte5. Split and project global output by byteStep 6: Add shifted local byte embeddings6. Add shifted local byte embeddingsStep 7: Apply causal local attention within each patch7. Apply causal local attention within each patchStep 8: Predict the next byte from vocabulary probabilities8. Predict the next byte from vocabulary probabilities

The shifts govern what information is available at each step. A causal mask allows a Transformer position to use the input at that position. The input therefore has to be aligned with the target so that even this permitted connection uses only known data. On the global side, the first input is a learned padding patch and each later input comes from the preceding patch. On the local side, the padding and shift are applied afresh in each patch. The first local slot can use the global output for its patch along with the local start vector. The very next slot can additionally use the patch’s first byte. The same rule continues through the last slot.

Consider the point just before a new patch begins. The global computation can use the entire patch that has just ended, including its last byte. For the patch about to be generated, none of its own bytes have appeared yet. The system can nevertheless compute all of its global conditioning vectors together. As the local decoder fills the slots, the global contribution is already available at every slot. Once the last byte has been predicted, the next global step has a new complete patch to read. This cycle explains why there is still a serial dependency from one byte to the next, even though the expensive global computation is no longer part of every byte step.

Shapes and probability calculations

The architecture description assumes a sequence that can be reshaped into whole patches. The relationship between the dimensions is

K = T / P

Here T is the length of the byte sequence, P is the number of bytes per patch, and K is the resulting number of patches. The slash denotes division. Patch positions use zero-based indices, as do the byte positions inside each patch.

embedₜ = Eᵍˡᵒᵇᵃˡ⁻ᵉᵐᵇᵉᵈ[xₜ] + Eᵖᵒˢ[t]

Here t is a byte position and xₜ is the byte value at that position. The symbol Eᵍˡᵒᵇᵃˡ⁻ᵉᵐᵇᵉᵈ identifies the global lookup table, and the brackets select the row for xₜ. The table has V rows and D_G columns, where V is the byte vocabulary size and D_G is the width of each global byte embedding. Eᵖᵒˢ[t] is the positional embedding for t. Adding the two vectors element by element gives embedₜ, the representation of that byte at its particular position.

global-inₖ = { Eᵍˡᵒᵇᵃˡ⁻ᵖᵃᵈ                 if k = 0
             { concat(embed[(k−1)·P : k·P])  if 1 ≤ k < K

The symbol k indexes the target patch, and global-inₖ is the global input aligned with that target. The braces give the starting case and the ordinary case. Eᵍˡᵒᵇᵃˡ⁻ᵖᵃᵈ is the trainable initial padding, with the same number of elements as P byte embeddings of width D_G. The slice after concat includes its starting position and excludes its ending position. The dot denotes multiplication. Concatenation flattens those byte vectors into one vector of width P·D_G. With this shift, the input for the last target patch contains the preceding patch. The last patch itself supplies targets but is outside the global input for that training sequence.

global-out[0:K] = Transformer_global(global-in[0:K])

The names global-in and global-out refer to the ordered sequences of patch vectors before and after the global Transformer. The slice [0:K] takes all K positions, starting at 0 and stopping before K. Transformer_global denotes the decoder that uses causal self-attention over this sequence. It returns one vector of width P·D_G at each patch position. Its mask allows a position to use its own shifted input and earlier ones, so the representation aligned with a target patch can use the completed patches leading up to it.

At the local stage, p denotes the position within a patch. It starts at 0 and runs up to, but excludes, P. The index in the original sequence is

t = k·P + p

Here k is the patch index, P is its size, and p is the slot within that patch. The product k·P counts the byte positions before the patch begins. Adding p gives the target byte position t.

local-inₖ,ₚ = global-out[k, p·D_G : (p+1)·D_G] · Wᴳᴸ + shifted-byteₖ,ₚ

Here local-inₖ,ₚ is the input at local slot p in patch k. Inside the brackets, global-out selects the row for patch k and the slice corresponding to slot p. The slice starts at p·D_G and excludes its endpoint at (p+1)·D_G. Wᴳᴸ is the learned projection from the global byte width D_G to the local width D_L. The equation uses row vectors, so the dot before Wᴳᴸ denotes multiplication by a matrix with D_G rows and D_L columns. The term shifted-byteₖ,ₚ has width D_L and is added element by element after projection.

shifted-byteₖ,ₚ = { Eˡᵒᶜᵃˡ⁻ᵖᵃᵈ                if p = 0
                 { Eˡᵒᶜᵃˡ⁻ᵉᵐᵇᵉᵈ[xₖ·ₚᵃₜcₕ]   if 1 ≤ p < P

Here shifted-byteₖ,ₚ is the local embedding just added to the projected global output. Eˡᵒᶜᵃˡ⁻ᵖᵃᵈ is the learned start vector for the first slot, and Eˡᵒᶜᵃˡ⁻ᵉᵐᵇᵉᵈ is the local byte lookup table. The byte labeled xₖ·ₚᵃₜcₕ in this expression is the preceding byte in the current patch, at sequence position k·P + p − 1. The conditions select the padding for p = 0 and that byte’s embedding for all subsequent slots before P.

local-out[k, 0:P] = Transformer_local(local-in[k, 0:P])

The symbol local-in is the collection of inputs formed by adding the global contribution and the shifted local embedding. The symbol local-out is the collection of hidden representations returned by the smaller decoder. Transformer_local denotes that decoder, applied to the slice [0:P] of patch k, which includes all P slots. The base architecture applies it independently to each patch with the same parameters. Accordingly, given the available training bytes and the global outputs, these applications can run in parallel.

Pr(xₜ | x[0:t]) = softmax(Eˡᵒᶜᵃˡ⁻ᵉᵐᵇᵉᵈ · hₖ,ₚ)[xₜ]

Pr is the conditional probability, with the vertical bar separating the target byte value xₜ from the earlier bytes x[0:t]. The slice ends just before t. The vector hₖ,ₚ is the local output for patch k and slot p, written as a column of width D_L. Multiplying the local embedding table by that column produces one score per vocabulary value. Softmax turns the scores into probabilities that sum to one. The final brackets select the probability of xₜ. The table thus serves both to embed known bytes and to score possible next bytes.

The formal architecture allows the global slice and the local embedding to have different widths. The appendix pseudocode expresses the same shifts and reshaping in a simplified form, adding the two inputs directly after reshaping the global output. The projection in the architecture description supplies the general version of that addition. The overall procedure computes a probability for every observed byte. Training can adjust the byte embeddings, the two Transformers, and the projection together through those predictions. The patch boundaries are fixed by the configured patch size.

Why the local decoder predicts in order

The global Transformer outputs a representation for the upcoming patch, but issuing a distinct score for every possible patch would require an output vocabulary whose size grows exponentially with patch length.

patch output space = 256ᴾ

The quantity on the left counts the possible ordered byte strings of a patch. The base 256 is the number of possible byte values and the superscript P is the number of positions. Longer patches are attractive for the global computation, yet the set of strings they can represent soon becomes too large to score as a single categorical output.

An alternative would give each slot its own prediction from the global representation and treat the slots as conditionally independent. The authors illustrate the loss of expressive power with the words “cat” and “dog.” Suppose a patch should be one of those words with equal probability. Separate distributions for the letters would need to give probability to the individual letters in both words. When combined independently, they would also give probability to mixed strings such as “cag.” A local autoregressive decoder can let the first letter determine which later letters are probable. It expresses a joint distribution by composing a series of byte predictions, each conditioned on the prefix already chosen.

The example also explains the division of labor. The global representation can leave several continuations open. The local Transformer can use a byte that is already observed or generated to narrow those possibilities for the remaining slots. When the first distinction between continuations depends heavily on earlier patches, the global Transformer still supplies the context for that distinction. The model needs both access to the earlier sequence and a way to express relationships among the bytes of the output patch.

Where the computation is saved

To analyze attention, the authors count its growth with sequence length. They compare a dense Transformer over every byte with one dense global attention computation over patch positions and many small dense attention computations, each over the byte positions of a patch.

MEGABYTE attention cost ∈ O(T²/P² + T·P)

Here T is sequence length in bytes and P is patch length in bytes. The symbol ∈ means the cost is in the growth class described by O, which suppresses constant factors. The first term, T²/P², comes from dense global attention over T/P patch positions. Each local attention calculation is quadratic in P, and there are T/P such patches, giving the second term T·P. For the standard decoder, the corresponding dependence on sequence length is O(T²), since the positions entering dense attention are the bytes themselves.

P = T¹⁄³

Here the fractional exponent means the cube root of sequence length T. In the authors’ analysis this is the choice of patch length P that balances the two attention terms as the target sequence length grows. Under that choice, the resulting growth class is

MEGABYTE attention cost ∈ O(T⁴⁄³)

Here O denotes the asymptotic growth class and T⁴⁄³ denotes sequence length raised to the power four thirds. The bound concerns attention under the stated choice of patch size. The experiments choose fixed patch sizes for particular configurations and examine their effect on prediction. The authors also consider the choice P = T¹⁄⁵, where the exponent one fifth makes patches shorter as a function of T. It gives O(T⁸⁄⁵) attention cost, where eight fifths is the corresponding growth exponent. The reason is that with shorter patches, the global sequence remains longer.

The arithmetic for the larger weight matrices depends on how frequently they are used. The paper uses a forward-pass approximation for a large standard Transformer.

standard forward FLOPS ≈ 2·m·T

FLOPS here denotes the estimated number of floating-point operations in the pass. The symbol ≈ indicates an approximation, m is the number of non-embedding parameters, and T is the length of the input sequence. The factor 2 is part of the paper’s accounting convention. Multiplying by T reflects the use of the parameterized layers at every position.

MEGABYTE forward FLOPS ≈ 2·T·(m_g/P + m_l)

Here m_g counts the global Transformer’s parameters in the approximation and m_l counts the local Transformer’s parameters. The global cost is divided by P because the global layers process one position per patch. The local cost remains proportional to the full byte count T, since each byte has a local position. The parentheses combine those contributions before multiplication by 2·T. When the local term is small relative to the global term after division by P, the dominant contribution is roughly 2·T·m_g/P. The paper uses this approximation to explain how the global Transformer can have substantially more parameters within a given compute budget.

The authors give a concrete motivation for treating this expense separately from attention. For the GPT3 architecture, they report that the quadratic attention computation represents only 1.4% of FLOPS. They also estimate the combined operation count for standard Transformers, Linear Transformers, and MEGABYTE. With patch size P = 8, the estimates favor MEGABYTE across the sizes and sequence lengths shown, which span 660M to 173B parameters and extend to 1M token positions. For linear attention the calculation uses an estimate of 9D FLOPS per token, where D is the embedding dimension and 9 is the coefficient assumed in the paper. The authors caution that this operation count may understate the time used by a recurrent decoder on hardware where the recurrence is harder to parallelize.

Generation involves a second accounting, this time of layers that have to run in sequence. The paper treats each layer as having constant cost for this analysis. Its motivation is that running a layer for a single position may leave some GPU parallelism unused.

MEGABYTE serial work per patch ∈ O(L_G + P·L_L)

Here L_G is the number of layers in the global Transformer and L_L is the number in the local Transformer. O describes how the serial work grows with these quantities and patch size P. The L_G term is incurred once to prepare a patch. The P·L_L term counts the local layers applied at every byte step.

standard serial work per patch ∈ O(P·L_G + P·L_L)

Here the comparison Transformer has L_G + L_L layers in total and P byte positions to generate. Both groups of layers now run at every position. When the global layers dominate the serial work even after counting the repeated local steps, the paper’s estimate permits a reduction approaching a factor of P. This calculation explains the direction of the speed difference. The actual timing experiment measures how much of the advantage is realized for a particular configuration.

Extensions and training

The authors test ways of making patch boundaries less consequential. One puts causal convolutions before the patch grouping, with filter sizes of 3, 5, and 7. A convolution applies the same learned filter at successive positions. Reusing the filter lets it respond to a pattern wherever the pattern occurs in the stream. The causal form restricts the filter to bytes already available at its position. Applying it before grouping gives the patch representation some local context that can travel across a boundary.

Another extension gives each layer of the local Transformer access to a short tail of the previous patch. The paper uses r for the number of preceding positions made available. In the base architecture, earlier patches reach a local prediction through the global output. The extension adds a direct route to nearby positions so that the global output can focus on context farther away. Rotary position embeddings encode relative placement in this attention computation, drawing on RoFormer. The authors note a resemblance to TransformerXL and describe their cross-patch approach as fully differentiable.

Strided inference changes the positions at which an already trained decoder evaluates a sequence. It runs the decoder on differently aligned copies of the same input. The offset between runs is

offset = P / 2

Here P is the patch length and 2 is the divisor that places the second alignment half a patch away from the first. For each byte, the method takes the prediction from the run where that byte falls in the first half of a patch. The two sets of retained positions cover the sequence. The paper motivates this procedure by observing that predictions tend to become worse as a local decoder proceeds through a patch. An extra pass lets the evaluation use positions closer to the point at which global context was introduced.

The training runs use MetaSeq, with sharding of the parameters and optimizer state through FairScale and mixed precision to reduce training cost. The framework is PyTorch. The optimizer is Adam with first and second decay coefficients of 0.9 and 0.98. The appendix reports clipping the gradient norm to a maximum of 1.0. The learning rate uses polynomial decay following 500 warmup updates, with its final value set to 0. The Transformer blocks apply normalization before the main operations and use ReLU activations. Dropout is set to 0.1 outside the embeddings, and weight decay is also 0.1. For initialization the authors use a normal distribution centered at zero with a standard deviation of 0.006, truncated to within two standard deviations. They report that the initialization improved training stability and performance.

Experiments and results

What the comparisons hold fixed

The main experiments ask which architecture gives the best predictions for a shared training budget. The authors tune architectural settings, especially the number of layers, to get comparable forward-pass time per byte, then train on the same number of bytes within a comparison. The appendix describes matching the time of a training update and the number of updates. The image resolution experiment expresses the shared budget in GPU hours and data. Matching budgets allows the architectures to use different parameter counts and context lengths. Those differences are part of what each design can afford.

The authors implement the standard decoder and PerceiverAR in their own framework and share similar loading, preprocessing, and training machinery with MEGABYTE. Their PerceiverAR adds a cross-attention layer to compute latents and samples random spans from the texts during training. It uses the standard implementation’s attention dropout and omits chunked attention. For its reproduction of the published standard-ordering ImageNet experiment at 64 pixels, the paper reports 3.53 bits per byte, compared with 3.54 in the original PerceiverAR publication. These values are a reproduction check for that configuration. The paper treats the comparisons with published results separately from the experiments that match the authors’ own training budgets.

The primary metric is bits per byte, abbreviated bpb. It measures the average surprise assigned to the observed bytes, with surprise expressed in bits. If the decoder assigns more probability to the observed continuation, the score falls. Measuring per byte gives the experiments a unit shared by the text, image, and audio tasks, although the values should be interpreted within each dataset. For one PG19 comparison the authors convert byte-level scores to word-level perplexity. That representation of predictive uncertainty makes the PG19 results comparable to work reporting scores per word, including approaches that make their underlying predictions over sub-words.

The evaluation procedure also depends on the comparison. In the main controlled results the authors avoid extra evaluation passes that would change the inference budget. They reserve windowing and striding for comparisons with prior published work and examine their effects separately. The PerceiverAR appendix describes a sliding window whose stride is half the number of latents, used when following the original work’s protocol unless the experiment specifies otherwise. The high-resolution ImageNet comparison explicitly uses no sliding window evaluation.

Text, from books to source code

The text experiments cover collections with different kinds of structure. PG-19 contains English-language Project Gutenberg books written before 1919. Books is a separate English-language collection. Stories draws on CommonCrawl and was assembled with Winograd schemas in mind, while arXiv comprises technical publications written in LaTeX. The Code dataset is a collection of public open-source files under Apache, BSD, or MIT licenses. Taken together, the datasets test whether the same architecture is useful across prose, technical markup, and source code.

In the first text comparison, each architecture trains for 80 billion bytes on each dataset. The standard Transformer has 320M parameters and a context length of 1024 bytes. PerceiverAR has 248M parameters, an 8192-byte context, and a latent sequence of size 1024. MEGABYTE uses 758M global parameters and 262M local parameters, with a context length of 8192 bytes and a patch size of 8. The authors use the same architecture settings on all the text datasets. They report that MEGABYTE achieves lower bits per byte than both baselines across the full set.

These configurations illustrate what gets traded within a shared budget. The standard Transformer uses fewer positions of context. PerceiverAR reads the same context length as MEGABYTE through its cross-attention layer. MEGABYTE devotes much more parameter capacity to its global Transformer because it uses that capacity at patch frequency. A win in this setting therefore tests the combination of capacity, context, and how computation is distributed over the sequence. The later component studies investigate parts of that combination more directly.

In the PG-19 scaling experiment the authors keep the settings from the controlled runs and increase the training exposure to 400B bytes for the compute-matched byte systems. They report that MEGABYTE again outperforms the byte-level Transformer and PerceiverAR. They also compare with previously published PG19 scores. The numbers below are the test perplexities the paper gives for its own result and two smaller-scale prior byte experiments, after expression in word-level units.

PG19 test word-level perplexity for byte-level systems

MEGABYTE has lower test perplexity than the previously published byte-level systems shown.

PG19 test word-level perplexity for byte-level systemsMemorizing Transformers: 49.5Memorizing Transformers49.5BlockRecurrent Transformer: 46.5BlockRecurrent Transformer46.5MEGABYTE (this paper): 36.4MEGABYTE (this paper)36.4
The numbers
System or settingword-level perplexity
Memorizing Transformers49.5
BlockRecurrent Transformer46.5
MEGABYTE (this paper)36.4

The chart is a comparison with published values. The paper describes the prior byte-level experiments there as smaller in scale. Its comparison with published sub-word systems also allows differences in training compute and tuning. The word-level conversion addresses how predictive quality is counted, while the matched experiments address differences in resources. Together they establish that MEGABYTE can compete with other approaches to long-form language prediction under more than one way of making a comparison.

Images and the cost of an entire sequence

An image must be turned into an ordered sequence before the decoder can predict it. Each pixel has 3 bytes, corresponding to its color channels. Standard raster order visits pixels row by row. The paper generally instead uses a patch scan, which visits square regions in raster order and then visits pixels within each region in raster order as well. This keeps the bytes of a small image region together. The way the image is ordered changes which bytes a prediction can see nearby in the sequence.

p = √(P / 3)

Here p is the side length in pixels of a square region for the patch scan, P is the patch length in bytes, and 3 is the number of color bytes per pixel. The square-root sign gives the side length from the number of pixels in the region. The lower-case p in this formula describes image geometry. In the earlier decoder equations it indexed a position inside a patch.

The first ImageNet comparison asks whether the system can match the best published likelihood at 64x64. The authors train a configuration with 2.7B global parameters and 350M local parameters for 1.4T tokens. They report performance matching the published PerceiverAR result in bits per byte. They estimate that the run consumed less than half the GPU hours that reproducing the strongest published PerceiverAR configuration would have required. The estimate compares their training run with a projected reproduction cost. The separate 3.53 versus 3.54 check concerns the implementation of a particular PerceiverAR experiment and serves a different purpose.

The resolution experiment asks which architectures can make effective use of very long image sequences within comparable GPU-hour and data budgets. It uses Image64, Image256, and Image640. MEGABYTE uses a patch size of 12 bytes for Image64 and 192 bytes for Image256 and Image640. The system can evaluate sequences up to 1.2M byte positions in a forward pass. The authors found the alternative designs impractical for whole sequences of that size at reasonable parameter counts. They split the inputs for the standard Transformer into segments of 1024 positions and those for PerceiverAR into segments of 12,000 positions.

MEGABYTE obtains lower bits per byte than both alternatives at each image resolution in this comparison. At the highest resolution, the segmentation choices determine what information the baselines can use across the image. An architecture that handles the entire input in one pass can condition local predictions on a wider prefix, subject to what its global vectors retain. A shorter segment confines the predictions to information available within that segment. The measured likelihood improvement establishes the advantage of the tested configuration under the shared budget. The fact that the complete scan fits in a forward pass establishes the separate point that the architecture can operate at million-byte sequence length.

The ImageNet metric is density estimation. Each system assigns probabilities to the observed image bytes in the chosen order, and the experiment evaluates those probabilities. Local details and broad structure can both influence this score. An early region may tell the decoder what object is present, and a neighboring pixel may tell it how a texture continues. The reported likelihood measures the combined benefit of available information at the scale of individual predictions.

Audio directly from stored bytes

The audio experiment changes both the source of the data and the meaning of a local pattern. A raw waveform can store a sample as a 16-bit integer. Scoring every possible sample value with one softmax would require 65,536 outputs per step. The paper discusses ways earlier audio work made this problem more manageable. WaveNet uses a companding transformation followed by quantization into 256 possible values. Other work represents the sample distribution with a discretized mixture or separates the sample into coarse and fine parts. MEGABYTE reads the bytes directly and predicts a distribution over 256 values at each byte position.

The data consists of 2 terabytes of audio, which the paper describes as roughly 18,000 hours. The recordings use 16 kHz, 16-bit audio, amounting to 32k bytes for a one-second clip. The reported MEGABYTE training configuration uses sequences of 524,288 bytes, patches of 32 bytes, and a batch size of 32. The patch size determines how frequently the global Transformer processes the data, while the byte output preserves the resolution of the values being predicted. The local decoder can condition later components of a sample on preceding bytes in the stream.

Raw audio prediction in bits per byte on the paper’s audio dataset

MEGABYTE assigns the observed audio bytes higher likelihood than either comparison system.

Raw audio prediction in bits per byte on the paper’s audio datasetStandard Transformer: 3.567Standard Transformer3.567PerceiverAR: 3.543PerceiverAR3.543MEGABYTE (this paper): 3.477MEGABYTE (this paper)3.477
The numbers
System or settingbits per byte
Standard Transformer3.567
PerceiverAR3.543
MEGABYTE (this paper)3.477

The audio result tests whether the same hierarchical decoder works for a dense stream of numeric data. The long sequence gives the global Transformer an opportunity to represent regularities over a larger part of the waveform. The local predictions account for detailed dependencies in the stored data. The score reports how effectively the system predicts observed bytes in this setup. The separate component comparisons use Librilight-L to investigate what happens when the architecture is changed.

Generating a long continuation

For the text timing experiment, the authors compare a 350M-parameter standard Transformer with a MEGABYTE configuration using 1.3B global parameters and 218M local parameters. The systems are trained on PG19 with equal compute. The baseline has a context length of 1024, and MEGABYTE has a context length of 8192 with patches of 8 bytes. The task measured in the timing comparison is generation of a sequence of 8192 bytes.

MEGABYTE generates the sequence 40% faster in this test and gives better predictive scores. Its large global Transformer runs once for every 8 bytes. The smaller local Transformer carries out the intervening byte predictions. The timing demonstrates that a system with a larger parameter count can still generate faster when most of its parameters are applied less frequently. It also gives an empirical counterpart to the serial-layer calculation, which predicts an advantage but does not determine the actual runtime of the tested implementation.

What the ablations show

Both scales contribute to prediction

The authors remove components in compute- and data-matched comparisons on arXiv, Librilight-L, and ImageNet256. Removing the local Transformer causes a substantial increase in bits per byte on all three datasets. Removing the global Transformer also causes a substantial increase throughout. These interventions test the roles of the two processing scales in text, audio, and images. Global context helps predict a patch, and within-patch conditioning helps predict its individual bytes.

The local ablation is especially informative because the global Transformer has the larger share of parameters. Giving the global stage access to earlier patches still leaves a need to coordinate the probabilities of bytes in the patch being predicted. The ablation shows that the complete architecture uses its smaller stage for consequential work. Conversely, local attention has access to nearby bytes under the base masking scheme, but its restricted window makes it depend on the global contribution for what came before. The global ablation shows a cost to losing that contribution even though some nearby patterns remain accessible.

The extensions have smaller effects in these comparisons. The version without cross-patch local attention remains competitive, so the extra access to the previous patch is optional for obtaining strong scores in the tested settings. The convolutional encoder gives slight improvements on Librilight-L and ImageNet256. These outcomes distinguish the recurring benefit of keeping both Transformers from the more task-dependent gains of altering what enters a patch or expanding the local attention window.

Where to spend a shared budget

The patch-size comparison on Image256 varies the number of bytes handled together while holding GPU hours and data fixed. The authors report a wide range of settings with similar predictive quality. They observe comparable robustness across modalities, with the particular optimum varying. The result gives a practical reading of the complexity analysis. Arithmetic favors fewer global positions and shorter local sequences, two goals that place different demands on patch length. Likelihood also depends on which dependencies the decoder has to learn within each patch and which ones the global Transformer relays.

The authors separately change the allocation of parameters between the global and local Transformers on PG19. Under matched compute and data, the allocations favor the global stage having more parameters. The paper reports that this trend holds across the modalities and patch sizes it studied. A global parameter participates in the computation for each patch, while a local parameter participates at byte frequency. This difference gives the architecture room to increase global capacity at a lower cost per byte. The component removals and the allocation experiments answer complementary questions. A relatively small local Transformer is valuable, and the larger share of parameters is most useful in the global stage in the tested budget range.

Performance across a window and within a patch

The authors examine the average log probability of the observed next byte at successive positions within the context window on the PG19 test set. Their MEGABYTE configuration has a context length of 8192 bytes. The comparison includes a standard Transformer trained with the same compute. MEGABYTE gives the observed bytes higher likelihood as positions advance through its window. The authors take this as evidence that predictions benefit from context extending to about 8k bytes, because later positions have more preceding material available to the decoder.

A different pattern appears when the authors average over positions within a patch. Bytes near the end of the patch are predicted less well on average than bytes near its beginning. The authors interpret this pattern as an effect of relying more heavily on the smaller local Transformer as the patch progresses. The diagnostic profiles are about different scales. More preceding text is associated with better predictions over the whole context. The position within the current patch is associated with an additional variation in how well the decoder uses its conditioning.

Strided inference exploits that local pattern. On the PG19 test set, the authors take predictions from the first halves of patches under two alignments of their strongest system. The evaluation improves, and the paper reports that the gain combines with the benefit of a standard sliding window. The inference procedure doubles the cost of the full forward evaluation. The comparison shows that patch alignment affects likelihood for the trained system and that a reader should account for the extra evaluation cost when comparing the resulting numbers with single-pass scores.

The appendix also evaluates a longer PG19 context in the scaling experiment. Both configurations in that comparison use a 1.3b global Transformer, a 350m local Transformer, and patches of 8 bytes. Increasing context length in this experiment yields no further improvement. The authors suggest that further growth in capacity and data could make the extra context more valuable. This result can coexist with the rising likelihood over the original window. The within-window analysis concerns what the system does with the context it already gets, while the longer-context run tests whether additional context improves the aggregate score under that training setup.

Ordering the image before prediction

A separate ImageNet256 comparison uses the same image task with raster scan and patch scan. The paper reports that patch scan improves both MEGABYTE and PerceiverAR. When bytes in a small region are placed close together in the sequence, more of their dependencies fall within a short range. Since this ordering helps the baseline as well, part of the benefit comes from how the image is serialized. The result also explains why the scan order matters when interpreting the headline image experiments. The principal ImageNet setup uses the structure of the input grid to choose a sequence order before the decoder learns any probabilities.

Limitations

Limits the authors identify

The authors emphasize that their experiments use much less training scale than the leading language systems they discuss. The PG19 results support the feasibility of byte-level training, including competitive likelihood against published sub-word systems. They leave open whether the same advantages hold when parameter counts and datasets increase to the scale the authors identify as the next test. The largest image context demonstrates that the architecture can process a sequence of that length. Scaling the amount of language data and the size of the system presents a separate question.

The paper also qualifies its comparisons with published sub-word results. Different systems may have had different amounts of compute or different degrees of tuning. Conversion to word-level perplexity aligns the metric and still leaves those training differences in place. The comparable ImageNet result against the published state of the art has a related qualification. The GPU hours needed for a reproduction of the strongest PerceiverAR run are estimated. The controlled ImageNet experiments, which train the implementations within the same framework, supply a more direct comparison under a shared budget.

The authors identify fixed patch boundaries as a representational limitation. An identical substring may have a different arrangement inside its patch embedding depending on where it begins. A word can fall completely within a patch in one occurrence and be divided between two patches in another. The causal convolutions and cross-patch attention address aspects of this issue. The average loss pattern within a patch shows that position continues to matter in practice. Strided inference can improve the score, with the added cost stated by the authors. The training procedure still uses fixed boundaries for the chosen configuration.

Limits of the experimental setup

The central evaluation is next-byte likelihood. A low score shows that the system assigns more probability to the observed data under its prediction order. The text experiments do not measure instruction following or performance on downstream tasks. The audio results do not establish how listeners would rate generated speech or recordings. The images are evaluated as density estimation, so the reported scores do not directly measure visual quality in a sample comparison. The paper uses a metric closely aligned with the architecture’s objective, and claims about other capabilities would need their own evidence.

The matched comparisons allow context lengths and parameter counts to vary so each architecture can use the shared training budget. This is appropriate for comparing complete systems. In the high-resolution image experiment, it means the standard Transformer and PerceiverAR see shorter segments while MEGABYTE sees the full scan. Longer available context is part of the result, and the likelihood difference cannot quantify its contribution independently of other architectural choices. The single-pass result also measures feasibility for the tested image setup. It provides no basis for assuming that language or audio predictions would make effective use of a prefix of identical length.

The PG19 analysis of likelihood against position provides aggregate evidence about context. Positions later in the window have longer prefixes, and the observed trend supports the authors’ interpretation that additional context helps. It does not trace specific predictions to particular bytes at the far end of the window or measure how accurately the system could recover a distant fact on demand. The longer-context run gives another reason for care. An increase in the number of bytes a decoder can accept and an increase in the context that improves its predictions are distinct experimental outcomes.

The complexity results likewise describe particular costs. The subquadratic bound concerns attention with a patch size chosen as a function of sequence length. The feedforward estimate has a regime in which the local contribution is sufficiently small for the global scaling argument to apply. The generation argument treats layers as constant-cost serial operations, whereas measured runtime also reflects how the implementation uses the hardware. The PG19 generation result is evidence for the tested systems and output length. The mathematical estimate explains why a speedup can occur and leaves the size of that speedup to measurement.

Finally, byte inputs provide a common interface across the demonstrated modalities. The experiments train and evaluate the architecture on individual datasets, and the best settings are chosen separately for different kinds of data. The paper does not evaluate joint training on text, image, and audio, or transfer among them. Nor do the text datasets establish how the tokenizer-free approach would perform across languages whose byte sequences have different properties. The evidence supports a decoder design that can be applied to several modalities. Its generality in combined systems is an open empirical question.

What came after

Patches and alternatives for byte prediction

The later citation record includes work that treats patch formation as a research question in its own right. Byte Latent Transformer compares the scaling of patches and tokens. That question follows directly from the distinction MEGABYTE makes between the units used in the expensive part of the computation and the units whose probabilities are predicted. MEGABYTE’s tests vary a fixed patch size within a controlled budget. The later work’s stated focus is how patches scale as a representation. Its citation connects the two papers at that level.

MambaByte pursues token-free prediction with a selective state-space architecture. This picks up MEGABYTE’s question about how to handle the length of a raw byte stream while using a different sequence mechanism. MEGABYTE’s two causal Transformers shorten the sequences that enter attention. MambaByte’s stated design places the token-free question in the setting of state-space computation. The common research problem is how to make byte granularity affordable in the underlying architecture.

Byte-level prediction also motivates work on the representation of languages before an architecture processes them. MYTE proposes a morphology-driven byte encoding for multilingual language prediction. Morphology concerns how pieces of words carry meaning or grammatical functions. The direction named by MYTE puts the choice of byte representation under study. MEGABYTE’s text experiments establish results for their particular datasets and fixed grouping rule. MYTE addresses the adjacent question of what byte encoding can do for multilingual quality and fairness.

Separating the input representation from the output probabilities

Some citing papers study choices made by systems that still use a tokenizer. Tokenizer Choice For LLM Training examines the importance of a tokenizer choice for training. MEGABYTE makes that choice avoidable in its own byte-level setup. The later work’s topic is relevant to assessing how much the discrete representation matters when a system retains one. Tokenization Counts narrows the issue to arithmetic performance. Its stated scope connects the representation decision to a task-level question that MEGABYTE’s likelihood experiments do not cover.

Exact Byte-Level Probabilities from Tokenized Language Models studies how to obtain byte probabilities from systems that make predictions over tokens, with applications to fill-in-the-middle tasks and ensembles. MEGABYTE defines the probability of the next byte directly through its local decoder. The later paper’s problem begins with an already tokenized predictor and seeks exact probabilities at byte resolution. The connection is the unit in which predictions can be compared or combined. The two tasks arise at different stages of a system’s design.

Retrofitting Large Language Models with Dynamic Tokenization considers changing how larger units are formed in existing systems. Its stated focus on dynamic tokenization gives another setting for the question of where to group a stream. In MEGABYTE, fixed lengths make the global and local schedules predictable, and the ablations show that boundary placement affects prediction. Work on dynamic tokenization investigates grouping as a choice that can be altered after the original system has been built.

Long context and continuous data

The citation from In-Context Learning with Long-Context Models connects MEGABYTE to the study of what a system does with a long prompt. MEGABYTE tests that issue by tracking PG19 likelihood as more of a context window becomes available. In-context learning asks about the use of information supplied in context to carry out a task. These are different ways to evaluate a long window, and the later work’s stated subject enlarges the question beyond next-byte likelihood.

The audio application has a parallel in the citation from Moshi, which concerns speech and text for real-time dialogue. The shared setting is sequential audio. MEGABYTE tests raw-byte prediction and measures the likelihood of an observed waveform. A real-time speech-text system studies an application in which timing and interaction matter as well. The citation places MEGABYTE in that area of work. It does not establish that Moshi uses the fixed-patch decoder.

The titles and citation relationships establish these research connections. They do not specify which later systems reproduce the global and local architecture, import an evaluation procedure, or cite MEGABYTE as an example. The clearest continuation is the question the later titles share with the paper. Once predictions can be made over bytes, the representation used for the bulk of the computation becomes a choice that can be studied independently of the prediction unit.

Cite

Cite as Lili Yu, Dániel Simig, Colin Flaherty, Armen Aghajanyan, Luke Zettlemoyer and Mike Lewis. 2023. MEGABYTE: Predicting Million-byte Sequences with Multiscale Transformers. arXiv:2305.07185.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.2305.07185 · arXiv 2305.07185

@misc{yu2023megabyte,
  title = {{MEGABYTE: Predicting Million-byte Sequences with Multiscale Transformers}},
  author = {Lili Yu, Dániel Simig, Colin Flaherty, Armen Aghajanyan, Luke Zettlemoyer and Mike Lewis},
  year = {2023},
  doi = {10.48550/arxiv.2305.07185},
  eprint = {2305.07185},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2305.07185}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/yu-2023-megabyte-predicting-million-byte-sequences/

References

49 references, from the paper's own bibliography.

  1. Baines, M., Bhosale, S., Caggiano, V., Goyal, N., Goyal, S., Ott, M., Lefaudeux, B., Liptchinsky, V., Rabbat, M., Sheiffer, S., Sridhar, A., and Xu, M. FairScale: A general purpose modular PyTorch library for high performance and large scale training. https://github.com/facebookresearch/fairscale, 2021. OpenAlex ↗ · Scholar ↗
  2. Beltagy, I., Peters, M. E., and Cohan, A. Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150, 2020. our card
  3. Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J. D., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al. Language models are few-shot learners. Advances in neural information processing systems, 33:0 1877–1901, 2020. our card
  4. Child, R., Gray, S., Radford, A., and Sutskever, I. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019. our card
  5. Choromanski, K., Likhosherstov, V., Dohan, D., Song, X., Gane, A., Sarlos, T., Hawkins, P., Davis, J., Mohiuddin, A., Kaiser, L., et al. Rethinking attention with performers. arXiv preprint arXiv:2009.14794, 2020. our card
  6. Chowdhery, A., Narang, S., Devlin, J., Bosma, M., Mishra, G., Roberts, A., Barham, P., Chung, H. W., Sutton, C., Gehrmann, S., et al. Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311, 2022. our card
  7. Clark, J. H., Garrette, D., Turc, I., and Wieting, J. Canine: Pre-training an efficient tokenization-free encoder for language representation. Transactions of the Association for Computational Linguistics, 10:0 73–91, 2022. our card
  8. Dai, Z., Yang, Z., Yang, Y., Carbonell, J., Le, Q. V., and Salakhutdinov, R. Transformer-xl: Attentive language models beyond a fixed-length context, 2019. URL https://arxiv.org/abs/1901.02860. OpenAlex ↗ · Scholar ↗
  9. Didolkar, A., Gupta, K., Goyal, A., Gundavarapu, N. B., Lamb, A., Ke, N. R., and Bengio, Y. Temporal latent bottleneck: Synthesis of fast and slow processing mechanisms in sequence learning, 2022. OpenAlex ↗ · Scholar ↗
  10. Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020. our card
  11. Edman, L., Toral, A., and van Noord, G. Subword-delimited downsampling for better character-level translation, 2022. OpenAlex ↗ · Scholar ↗
  12. Gao, L., Biderman, S., Black, S., Golding, L., Hoppe, T., Foster, C., Phang, J., He, H., Thite, A., Nabeshima, N., Presser, S., and Leahy, C. The pile: An 800gb dataset of diverse text for language modeling, 2020. our card
  13. Gu, A., Goel, K., and Ré, C. Efficiently modeling long sequences with structured state spaces. arXiv preprint arXiv:2111.00396, 2021. OpenAlex ↗ · Scholar ↗
  14. Hawthorne, C., Jaegle, A., Cangea, C., Borgeaud, S., Nash, C., Malinowski, M., Dieleman, S., Vinyals, O., Botvinick, M., Simon, I., et al. General-purpose, long-context autoregressive modeling with perceiver ar. In International Conference on Machine Learning, pp. 8535–8558. PMLR, 2022. OpenAlex ↗ · Scholar ↗
  15. Hoffmann, J., Borgeaud, S., Mensch, A., Buchatskaya, E., Cai, T., Rutherford, E., Casas, D. d. L., Hendricks, L. A., Welbl, J., Clark, A., et al. Training compute-optimal large language models. arXiv preprint arXiv:2203.15556, 2022. our card
  16. Hsu, W.-N., Bolte, B., Tsai, Y.-H. H., Lakhotia, K., Salakhutdinov, R., and Mohamed, A. Hubert: Self-supervised speech representation learning by masked prediction of hidden units. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 29:0 3451–3460, 2021. our card
  17. Hutchins, D., Schlag, I., Wu, Y., Dyer, E., and Neyshabur, B. Block-recurrent transformers. arXiv preprint arXiv:2203.07852, 2022. OpenAlex ↗ · Scholar ↗
  18. Jaegle, A., Gimeno, F., Brock, A., Vinyals, O., Zisserman, A., and Carreira, J. Perceiver: General perception with iterative attention. In International conference on machine learning, pp. 4651–4664. PMLR, 2021. our card
  19. Kalchbrenner, N., Elsen, E., Simonyan, K., Noury, S., Casagrande, N., Lockhart, E., Stimberg, F., van den Oord, A., Dieleman, S., and Kavukcuoglu, K. Efficient neural audio synthesis. CoRR, abs/1802.08435, 2018. URL http://arxiv.org/abs/1802.08435. OpenAlex ↗ · Scholar ↗
  20. Kaplan, J., McCandlish, S., Henighan, T., Brown, T. B., Chess, B., Child, R., Gray, S., Radford, A., Wu, J., and Amodei, D. Scaling laws for neural language models. arXiv preprint arXiv:2001.08361, 2020. our card
  21. Katharopoulos, A., Vyas, A., Pappas, N., and Fleuret, F. Transformers are rnns: Fast autoregressive transformers with linear attention. In International Conference on Machine Learning, pp. 5156–5165. PMLR, 2020. OpenAlex ↗ · Scholar ↗
  22. Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. In ICLR, 2015. our card
  23. Kitaev, N., Kaiser, Ł., and Levskaya, A. Reformer: The efficient transformer. arXiv preprint arXiv:2001.04451, 2020. our card
  24. Kudo, T. and Richardson, J. Sentencepiece: A simple and language independent subword tokenizer and detokenizer for neural text processing. arXiv preprint arXiv:1808.06226, 2018. our card
  25. Ma, X., Zhou, C., Kong, X., He, J., Gui, L., Neubig, G., May, J., and Zettlemoyer, L. Mega: moving average equipped gated attention. arXiv preprint arXiv:2209.10655, 2022. OpenAlex ↗ · Scholar ↗
  26. Micikevicius, P., Narang, S., Alben, J., Diamos, G., Elsen, E., Garcia, D., Ginsburg, B., Houston, M., Kuchaiev, O., Venkatesh, G., et al. Mixed precision training. arXiv preprint arXiv:1710.03740, 2017. OpenAlex ↗ · Scholar ↗
  27. Oord, A. v. d., Kalchbrenner, N., and Kavukcuoglu, K. Pixel Recurrent Neural Networks. ICML, 4:0 2611–2620, 1 2016. . URL https://arxiv.org/abs/1601.06759v3. OpenAlex ↗ · Scholar ↗
  28. Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., et al. PyTorch: An imperative style, high-performance deep learning library. In NeurIPS, 2019. our card
  29. Press, O., Smith, N. A., and Lewis, M. Shortformer: Better language modeling using shorter inputs. arXiv preprint arXiv:2012.15832, 2020. OpenAlex ↗ · Scholar ↗
  30. Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., and Sutskever, I. Language models are unsupervised multitask learners. 2019. OpenAlex ↗ · Scholar ↗
  31. Rae, J. W., Potapenko, A., Jayakumar, S. M., and Lillicrap, T. P. Compressive transformers for long-range sequence modelling. arXiv preprint arXiv:1911.05507, 2019a. our card
  32. Rae, J. W., Potapenko, A., Jayakumar, S. M., and Lillicrap, T. P. Compressive transformers for long-range sequence modelling. arXiv preprint arXiv:1911.05507, 2019b. our card
  33. Ramesh, A., Pavlov, M., Goh, G., Gray, S., Voss, C., Radford, A., Chen, M., and Sutskever, I. Zero-shot text-to-image generation. In International Conference on Machine Learning, pp. 8821–8831. PMLR, 2021. our card
  34. Ren, H., Dai, H., Dai, Z., Yang, M., Leskovec, J., Schuurmans, D., and Dai, B. Combiner: Full attention transformer with sparse computation cost, 2021. URL https://arxiv.org/abs/2107.05768. OpenAlex ↗ · Scholar ↗
  35. Roy, A., Saffar, M., Vaswani, A., and Grangier, D. Efficient content-based sparse attention with routing transformers, 2020. URL https://arxiv.org/abs/2003.05997. our card
  36. Salimans, T., Karpathy, A., Chen, X., and Kingma, D. P. Pixelcnn++: Improving the pixelcnn with discretized logistic mixture likelihood and other modifications. CoRR, abs/1701.05517, 2017. URL http://arxiv.org/abs/1701.05517. OpenAlex ↗ · Scholar ↗
  37. Schlag, I., Irie, K., and Schmidhuber, J. Linear transformers are secretly fast weight programmers. In Meila, M. and Zhang, T. (eds.), Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pp. 9355–9366. PMLR, 18–24 Jul 2021. URL https://proceedings.mlr.press/v139/schlag21a.html. our card
  38. Sennrich, R., Haddow, B., and Birch, A. Neural machine translation of rare words with subword units. arXiv preprint arXiv:1508.07909, 2015. our card
  39. Sharami, J., Shterionov, D., and Spronck, P. A systematic analysis of vocabulary and bpe settings for optimal fine-tuning of nmt: A case study of in-domain translation. arXiv preprint arXiv:2303.00722, 2023. OpenAlex ↗ · Scholar ↗
  40. Smith, J. T., Warrington, A., and Linderman, S. W. Simplified state space layers for sequence modeling. arXiv preprint arXiv:2208.04933, 2022. OpenAlex ↗ · Scholar ↗
  41. Su, J., Lu, Y., Pan, S., Murtadha, A., Wen, B., and Liu, Y. Roformer: Enhanced transformer with rotary position embedding. arXiv preprint arXiv:2104.09864, 2021. our card
  42. Sun, S., Krishna, K., Mattarella-Micke, A., and Iyyer, M. Do long-range language models actually use long-range context? arXiv preprint arXiv:2109.09115, 2021. our card
  43. Touvron, H., Lavril, T., Izacard, G., Martinet, X., Lachaux, M.-A., Lacroix, T., Rozière, B., Goyal, N., Hambro, E., Azhar, F., et al. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971, 2023. our card
  44. Trinh, T. H. and Le, Q. V. A simple method for commonsense reasoning. arXiv preprint arXiv:1806.02847, 2018. our card
  45. van den Oord, A., Dieleman, S., Zen, H., Simonyan, K., Vinyals, O., Graves, A., Kalchbrenner, N., Senior, A. W., and Kavukcuoglu, K. Wavenet: A generative model for raw audio. CoRR, abs/1609.03499, 2016. URL http://arxiv.org/abs/1609.03499. our card
  46. van den Oord, A., Li, Y., Babuschkin, I., Simonyan, K., Vinyals, O., Kavukcuoglu, K., van den Driessche, G., Lockhart, E., Cobo, L. C., Stimberg, F., Casagrande, N., Grewe, D., Noury, S., Dieleman, S., Elsen, E., Kalchbrenner, N., Zen, H., Graves, A., King, H., Walters, T., Belov, D., and Hassabis, D. Parallel wavenet: Fast high-fidelity speech synthesis. CoRR, abs/1711.10433, 2017. URL http://arxiv.org/abs/1711.10433. OpenAlex ↗ · Scholar ↗
  47. Wu, Y., Rabe, M. N., Hutchins, D., and Szegedy, C. Memorizing transformers. arXiv preprint arXiv:2203.08913, 2022. OpenAlex ↗ · Scholar ↗
  48. Zhang, S., Roller, S., Goyal, N., Artetxe, M., Chen, M., Chen, S., Dewan, C., Diab, M., Li, X., Lin, V., Mihaylov, T., Ott, M., Shleifer, S., Shuster, K., Simig, D., Koura, S., Sridhar, A., Wang, T., Zettlemoyer, L., and Ai, M. OPT: Open Pre-trained Transformer Language Models. 5 2022a. . URL https://arxiv.org/abs/2205.01068v4. our card
  49. Zhang, S., Roller, S., Goyal, N., Artetxe, M., Chen, M., Chen, S., Dewan, C., Diab, M., Li, X., Lin, X. V., et al. Opt: Open pre-trained transformer language models. arXiv preprint arXiv:2205.01068, 2022b. our card