Training Language Models with Memory Augmentation
Paper · 2022 · Zexuan Zhong, Tao Lei and Danqi Chen
Summary
When a document returns to an unusual name introduced several paragraphs earlier, the earlier occurrence can help predict how the name will be used again. The difficulty is giving the predictor access to that occurrence and teaching it to recognize when it matters. A language model can be given a cache of recent text or a searchable store of examples from a corpus. Earlier approaches often attached those stores after training, or used an encoder trained separately to represent their contents. TRIME changes the training objective so that looking up an example and using it to predict the next word are skills the system can learn together.
The authors use examples already being processed in the same training batch as a temporary memory. Each entry pairs a representation of a context with the token that actually followed it. To predict the next token, TRIME scores the usual vocabulary entries and compares the current context with eligible memory entries. Entries that point to the same token contribute to its probability together. Because the stored representations are computed in the current batch, a prediction error can change how the system represents both the query and the examples it consults. At test time the memory can contain earlier positions in the current segment, earlier segments of the same document, or examples from a separate corpus. The authors prepare for the latter settings by putting consecutive segments or segments with substantial word overlap in the same training batch.
On WikiText-103, local memory alone brings the test perplexity of a 247M-parameter Transformer from 18.70 to 17.76. Perplexity measures how much probability the predictor assigns to the observed text, with lower values indicating better predictions. The long-memory variant uses 15,000 tokens from earlier segments on WikiText-103 and a memory of size 24,576 on the character-level Enwik8 benchmark. With a datastore built from the WikiText-103 training corpus, the paper headlines a test perplexity of 15.37. In its direct comparison with kNN-LM, which adds corpus retrieval at test time, the reported test perplexities are 15.41 for TRIME and 16.23 for kNN-LM.
The prediction mechanism also improves German-to-English machine translation on IWSLT'14 De-En, beating kNN-MT, and the authors demonstrate the long-memory extension on SRU++, an architecture that combines recurrence and attention. The base network can be kept in place because the memory supplies scores at the final prediction step. Computing those scores from a training batch adds little overhead in the authors’ setup. Querying a large external store at inference is a separate cost, and the authors report a slowdown of 10× when they use one. They released the TRIME code and pretrained systems.
Deep dive: Training Language Models with Memory Augmentation
TRIME trains language models to use memories of earlier text and shows how local, document-wide, and external retrieval improve prediction. · about 36 minutes to read
The problem and its context
Giving a predictor access to specific examples
A next-token predictor turns the text it has read into a vector and uses that vector to score possible continuations. The weights learned during training give it a way to generalize across contexts. It can also benefit from a record of particular cases. If a piece of text has already used a name or spelling in a similar context, that occurrence is evidence for a later prediction. A record of the earlier case preserves the link between the context and the exact token that followed it.
The paper calls this kind of store non-parametric memory. Its entries are individual examples. A system can increase the number of examples it can consult without allocating a new learned parameter to each one. The vectors representing those examples can still come from a trained neural network. The distinction concerns where the evidence resides. A vocabulary score comes from the parameters applied to the current context, while a memory score depends on which earlier or external examples are available and what tokens they carry.
The continuous cache is one predecessor. It records contexts the system has already processed and the tokens that followed them. An upcoming prediction gives more weight to records whose vectors look like the current context. An ordinary attention layer already receives the recent text, so the case for adding a separate local cache to a Transformer had been questioned. The paper treats access through attention and access through the cache as distinct operations. Attention helps construct a representation of the current prefix. The cache also exposes the observed continuation of an earlier prefix as a candidate for the current prediction. Each operation can use the same stretch of text for a different purpose.
The other close predecessor is kNN-LM, where kNN stands for nearest neighbors. Its store can hold context and continuation pairs from a training corpus. The query is a vector for the current prefix. A search returns nearby vectors together with their following tokens, and the occurrences in the search result can increase the probability of those tokens. This provides direct access to examples from text outside the input being read. The paper identifies a training gap in this setup. The system that supplies the vectors has already been trained by the time the datastore is attached. A representation that works well for scoring a vocabulary item may organize examples poorly for finding other prefixes that share the same continuation.
This gap is easier to see by considering what counts as a useful match. Two prefixes can share their subject or many of their words while calling for different next tokens. Another prefix with little surface resemblance could have the continuation the current prediction needs. The ordinary loss rewards a high score for the observed token. It gives no direct instruction to draw together the vectors of prefixes with the same observed continuation. Once the system will rely on vector search, the arrangement of the vectors is part of the prediction problem.
Reaching beyond the current segment
Long documents pose a related problem even when all the relevant text belongs to the same document. Full self-attention becomes more expensive as the input grows because positions can interact with one another. Splitting a document into segments keeps each pass manageable. When the encoder only processes the current segment, the split also places older text beyond the attention available to that prediction. The paper uses long-term memory specifically for this earlier material in the same document.
The authors discuss several ways prior work made such material accessible. Transformer-XL and related recurrent designs pass representations from earlier segments to attention in later ones. Other designs compress earlier history or change which information survives. Work such as Longformer changes the attention pattern itself, and the paper also describes work pursuing attention with lower growth in computational cost. These approaches address which positions can interact while the current representation is being formed. TRIME offers another route for an earlier occurrence to affect the answer. The occurrence can supply a score after the current representation has been formed.
Long-term and external memory have different reasons for containing relevant material. Earlier passages of a document share its developing subject matter and can contain the names and expressions it will reuse. An external corpus gives access to examples the current document never contained. The latter store is much larger, so the problem includes finding a small set of plausible candidates efficiently. The former also has a temporal restriction. Earlier segments can inform the current prediction, while subsequent segments would expose text that has yet to be read.
Learning the representation used for lookup
Earlier work already combined sources of memory and considered a range of retrieval units. The paper describes an adaptive system that learns how to combine memory sources while using a previously trained ordinary predictor for its external representations. It also discusses Improving language models by retrieving from trillions of tokens, which retrieves text chunks from a large store built with off-the-shelf BERT representations. Other systems cited by the authors retrieve material for question answering, dialogue, and knowledge-intensive tasks, using such units as passages, entity mentions, or question and answer pairs. The size of the unit affects what the retrieved item can contribute. In TRIME a record has a very specific role. It offers the token observed immediately after its stored context.
The paper borrows a training intuition from Dense Passage Retrieval. Examples already computed within a batch can supply useful comparisons for one another. In TRIME the prediction target supplies the criterion for those comparisons. An entry is useful to a specific prediction when it carries the observed continuation, and it competes with entries carrying other tokens. This makes it possible to train representations for lookup without searching the entire training corpus on every update.
The design therefore hinges on what the batch contains. A batch constructed for ordinary next-token prediction only needs to deliver examples for the next update. Once those examples also serve as memory, their relationships matter. A batch of consecutive segments creates opportunities to retrieve from earlier parts of a document. A batch of passages with overlapping vocabulary creates opportunities to distinguish useful continuations from competing ones in related text. TRIME uses the same scoring rule in both cases and changes which examples the rule is allowed to compare.
The method, step by step
Start with a prefix and its observed continuation
The basic training example is a prefix with its next token. The prefix ends just before the position being predicted. During training the observed token at that position is available for computing the loss. The predictor must use the prefix to assign probabilities to possible continuations before that loss is evaluated.
cₜ = (x₁, …, xₜ₋₁)
Here cₜ is the context used to predict at position t. Each x is a token in the sequence and its subscript gives its position. The ellipsis stands for the intervening tokens. The final subscript t − 1 is the position immediately preceding the prediction.
An ordinary predictor encodes that context and compares its representation with a vector for each output token. The starting point in the paper is the following proportionality.
P(w ∣ cₜ) ∝ exp(E(w)ᵀ fθ(cₜ))
P(w ∣ cₜ) is the probability of candidate token w conditioned on context cₜ. E(w) is the output embedding, or learned output vector, for w. The superscript ᵀ denotes a transpose so that multiplying the vectors gives their dot product. The function fθ is the encoder output used for the vocabulary prediction, and θ denotes the trainable network parameters. The exponential function exp turns the score into a positive weight. The proportionality sign ∝ indicates that those weights still have to be divided by their total over the vocabulary.
During ordinary training, predictions are judged by the negative log-likelihood of the observed next token. Assigning that token a higher probability lowers the loss. The rest of the vocabulary matters because it shares the probability mass. TRIME keeps the same target and changes the probability calculation that precedes the loss. It gives a token an additional weight when an eligible stored context had that token as its continuation.
Let a stored example contribute a score
A memory entry consists of a context and the token observed immediately after it. The context vector acts as the key used for comparison. The observed token acts as the value returned by a match. At a given position, the current prefix provides the query. A stored key that resembles the query contributes evidence for its value. If several keys carry the same value, each can contribute and their weights are added.
Imagine a section of a document returning to an earlier term. The vocabulary calculation can already assign the term some probability based on the current prefix. An eligible occurrence in memory can add weight to the same token. How much it adds depends on the similarity between the prefix of that occurrence and the current prefix. A different occurrence that resembles the query but carries a different continuation increases the weight of a competing token. Retrieval can help or hurt under the same rule, which gives training a reason to shape which examples receive high scores.
How TRIME learns from a training batch
The steps in order.
The vector used for the comparison can come from a different point in the network from the vector used for vocabulary prediction. The authors denote the lookup representation by gθ. They considered using the final output for both jobs. For the Transformer, they found it preferable to take the input to the last feed-forward layer as the lookup representation. The final output still supplies the vocabulary score. This choice provides different representations for the two uses within a shared network.
The authors score a query and a memory key with a scaled dot product.
sim(q, k) = (q · k) / √d
The function sim returns the similarity score. The vector q is the query and k is a memory key. The middle dot denotes their dot product. The variable d is the dimension of the vectors, and √d is the square root of that dimension. The authors chose this form after preliminary experiments in which it gave more stable training and better performance. The same form of scaling appears in Attention Is All You Need.
The training distribution then takes the following form.
P(w ∣ c) ∝ exp(E(w)ᵀ fθ(c)) + ∑[(cⱼ,xⱼ) ∈ Mtrain : xⱼ = w] exp(sim(gθ(c), gθ(cⱼ)))
P(w ∣ c) is the next-token probability for vocabulary item w given the current context c. The term with E(w) and fθ(c) is the exponentiated vocabulary score, and ᵀ denotes the transpose in its dot product. Mtrain is the training memory open to the current query. The expression beneath the sum, written in brackets, selects entries whose stored target xⱼ equals w. In each selected pair, cⱼ is the stored context and j indexes its entry. The function gθ encodes the query or stored context for lookup using network parameters θ. The functions sim and exp give the similarity and its positive weight. The proportionality sign again calls for normalization over all candidate tokens after the two sources of weight have been added.
The normalization explains how examples carrying the wrong continuation enter the training signal. They add weight to other tokens, so they increase the total against which the correct token is judged. A correct continuation absent from memory still receives weight from its output embedding. If memory is populated with other continuations, their scores still affect normalization. The fallback concerns where the correct token gets its own weight. An absent target can still be learned through the vocabulary term.
This is the basis for the paper’s connection to contrastive learning. In a successful prediction, weight assigned to the observed token prevails over competing weight. The loss can reward the query for matching stored contexts with that continuation, and it can change how the stored contexts themselves are represented. The mechanism needs no separate annotation indicating which contexts are similar. The observed next token provides the relevant comparison for this objective.
The authors distinguish this joint scoring from the linear interpolation commonly used to add a cache or nearest-neighbor store to an ordinary predictor.
P(w ∣ c) = (1 − λ) Pₗₘ(w ∣ c) + λ Pₖₙₙ(w ∣ c)
P is the combined probability for candidate w given context c. Pₗₘ is the probability assigned by the ordinary vocabulary predictor and Pₖₙₙ is the probability assigned by the retrieval component. The coefficient λ is the weight given to retrieval, and 1 − λ is the complementary weight on the ordinary prediction. Both components in this example are already probability distributions. TRIME’s training rule adds the positive weights first and normalizes them together. A global normalization variant had appeared in earlier cache work for local contexts at test time. The authors also report trying a learned gate during training and finding it less effective than their chosen objective.
Decide which entries the predictor can consult
For local memory, each prediction can access the observed tokens before it in the same segment, paired with their contexts.
Mlocal(cₜ) = {(cⱼ, xⱼ) : 1 ≤ j ≤ t − 1}
Mlocal(cₜ) is the local memory for the context at position t. Each cⱼ is a context ending immediately before the observed token xⱼ. The index j begins at the first position and ends before t. The braces denote the collection of eligible pairs, and the condition after the colon gives the allowed range.
The local variant uses this rule during both training and testing. The segment itself has already been encoded, so its earlier positions provide the necessary keys. Batches can be drawn in the ordinary way. The change is in the calculation of the next-token probabilities and loss. The final predictor can use earlier positions directly even though the attention layers also see those positions when they form the query.
For long-term memory, the paper divides a document into an ordered sequence of segments. A segment has L contexts. The segment containing the current query is indexed by i, and an earlier segment is indexed by k.
Mlong(cₜ⁽ⁱ⁾) = {(cⱼ⁽ᵏ⁾, xⱼ⁽ᵏ⁾) : 1 ≤ k < i, 1 ≤ j ≤ L}
Mlong(cₜ⁽ⁱ⁾) is the long-term memory for the context at position t of segment i. The superscript in parentheses identifies a segment. Each earlier segment k contributes context cⱼ⁽ᵏ⁾ and observed continuation xⱼ⁽ᵏ⁾ at every position j up to the segment length L. The restriction k < i rules out later segments and the current segment. Local memory supplies the eligible positions within the current segment separately.
The authors put consecutive segments of the same document in a batch to create this memory during training. Their notation relates the number of contributing documents to the number of segments in a batch.
b ≈ B / m
The variable b is the approximate number of different documents in a batch. B is the total number of segments in that batch and m is the number of consecutive segments taken from each contributing document. The approximate equality sign represents the paper’s batch accounting. L, the length of a segment, is a separate setting. The long-memory variant takes more than one consecutive segment from a document so that some predictions can consult a preceding segment.
Each segment is encoded with the base architecture. A query can then use the keys from eligible earlier segments at the scoring stage, and those keys are still connected to the computation that produced them. Back-propagation, the process of tracing prediction errors through that computation, can change the representations on both sides of the match. At test time, the authors vary the number of preceding segments in memory and choose the setting on the development set. This permits an evaluation history longer than the collection of segments processed together during training.
External memory supplies examples from a corpus.
Mext = {(cⱼ, xⱼ) ∈ D}
Mext is the external datastore. D is the corpus from which its context and continuation pairs are obtained. Each entry contains a context cⱼ and the token xⱼ that follows it, with j indexing the recorded examples. The corpus can be the one on which the predictor was trained or a collection from the domain in which it will be evaluated.
A full corpus store is too large to reproduce inside a training batch. The authors approximate the kinds of comparisons it will present by arranging batches of segments with substantial lexical overlap. They use BM25, a text-ranking method from information retrieval, to identify such segments. Their procedure begins with a segment and repeatedly adds high-scoring segments to the batch. The search in their packing procedure requests the top 20 segments from the BM25 index. The resulting group supplies a pool of texts with related wording. Once a group is formed, the prediction objective compares context vectors, so overlapping words serve to bring examples together for training instead of supplying the final similarity score.
For this variant the authors use m = 1 in their batch scheme. Segments from a document can have sufficient word overlap to enter the batch through BM25. Each query can consult tokens from the other segments and, when enabled, the earlier positions of its own segment. Other segments are treated as examples in a corpus. The temporal restriction on the current segment protects its unseen continuation, while examples from other segments provide targets that can be compared regardless of their position in the batch.
The authors found that the external variant tended to rely on local evidence when it was always present. They therefore sometimes remove the current segment’s cache from the training memory. The probability of removal, denoted p, is 90% in the main external-memory setup. The encoder can still read the local prefix. What disappears is the direct score from earlier entries in that prefix. With this route frequently unavailable, examples from the other segments have more opportunity to affect the loss.
Train in batches and retrieve at inference
Training begins with ordinary next-token prediction for the first 5% of updates. The authors observed instability when they enabled the memory objective immediately and suggest that the estimated distributions varied too much at that stage. After the warmup, they use the memory rule appropriate to the variant. Keys in the batch are computed with the current network. This avoids reliance on a corpus index that would have to reflect the changing representation throughout training.
At inference the same scoring idea is applied to a different collection of entries. The external variant searches a corpus store for nearby keys and combines them with accessible document history. The local variant consults the current segment alone. The authors specify the combinations as follows.
Mtest = {
Mlocal for TRIME LM
Mlocal ∪ Mlong for TRIME LM long
Mlocal ∪ Mlong ∪ kNN(Mext, gθ(c)) for TRIME LM ext
}
Mtest is the set of eligible entries for the current prediction. Mlocal contains earlier positions of the current segment, Mlong contains previous segments of the same document, and Mext is the external corpus store. The union sign ∪ combines the named sources. The function kNN returns the top K nearby entries in Mext for the query vector gθ(c). K is the requested number of neighbors, c is the current context, and θ represents the trained encoder parameters.
The corpus lookup uses FAISS for approximate nearest-neighbor search, drawing on Billion-scale similarity search with GPUs. The approximate index avoids comparing the query exhaustively with all stored entries at each prediction. With external memory in the language modeling experiments, the authors retrieve 1,024 pairs per query. Within the resulting test memory, similarities enter the probability calculation with a temperature.
P(w ∣ c) ∝ exp(E(w)ᵀ fθ(c)) + ∑[(cⱼ,xⱼ) ∈ Mtest : xⱼ = w] exp(sim(gθ(c), gθ(cⱼ)) / τ)
P(w ∣ c) is the joint prediction for candidate w given current context c. E(w) and fθ(c) give the vocabulary dot product, with ᵀ denoting the transpose. The sum selects entries in the test memory Mtest whose observed target xⱼ is w. Their stored contexts are cⱼ, and gθ encodes those contexts and the query for comparison. The function sim gives the similarity, exp converts scores to positive weights, and the proportionality sign indicates vocabulary-wide normalization. The temperature τ rescales memory similarities before exponentiation. The vocabulary score does not receive this temperature. The authors tune τ on development data.
The external setup adds a second probability calculation. It takes the memory weights on their own and normalizes them without the vocabulary scores.
P′(w ∣ c) ∝ ∑[(cⱼ,xⱼ) ∈ Mtest : xⱼ = w] exp(sim(gθ(c), gθ(cⱼ)) / τ′)
P′(w ∣ c) is the memory-only probability for w given c. The sum uses the entries of Mtest whose stored next token xⱼ equals w. The context cⱼ supplies the key, gθ produces the lookup vectors for it and the current context, and sim compares those vectors. The exponential converts the rescaled similarity into weight. The separate temperature τ′ controls that rescaling, and ∝ indicates normalization, here over the weights supplied by memory.
Pfinal(w ∣ c) = (1 − λ) P(w ∣ c) + λ P′(w ∣ c)
Pfinal(w ∣ c) is the final probability of candidate w given c. P(w ∣ c) is TRIME’s joint vocabulary and memory distribution, and P′(w ∣ c) is the separately normalized memory distribution. The coefficient λ weights the latter, while 1 − λ weights the former. The authors choose the interpolation coefficient and temperatures on the development set. They propose that the range of retrieval scores can shift when inference searches a large corpus even if the ordering of the candidates is still useful. The separate distribution gives those candidates a way to contribute at a weight set independently of the joint normalization.
Change the context for translation
To adapt the method to translation, the authors keep the idea of a context with an observed continuation. The context now includes the source sentence and the target-language prefix emitted so far. The continuation is the next token of the target sentence. A completed training translation therefore supplies entries at its target positions. At inference the translation system can query those entries using its current source sentence and partial translation.
((x, y₍<t₎), yₜ)
Here x is the source sentence. The expression y₍<t₎ denotes the target prefix at positions before t, and yₜ is the observed target token at position t. The inner pair is the translation context and the outer pair associates that context with its continuation.
The translation architecture is a Transformer encoder-decoder. Its decoder output supplies the vocabulary representation, and the input to its final feed-forward layer supplies the lookup representation. In training, the BM25 batching heuristic uses the wording of the target sentences to group examples. In inference, the query uses the current translation context and searches a datastore built from the training pairs. The task consists of separate sentences, and the authors expect few useful repetitions within each one. They use external memory alone for this variant.
Experiments and results
How to read the comparisons
The experiments ask different questions about the same prediction rule. WikiText-103 and Enwik8 test whether the rule helps assign probability to observed sequences. BooksCorpus tests what happens when a system trained on one collection is evaluated on another and can be given memories from either. IWSLT'14 De-En tests whether a source-conditioned decoder can use the same approach when the quality measure is translation performance.
The authors use fairseq for their implementation. The language modeling setup trains on fixed-length segments. At evaluation it scores tokens at the end of a segment, and evaluation segments can overlap to make prior text available. A segment length specifies what the base predictor processes together. A separately reported memory length specifies what earlier examples can be looked up at the output. These lengths affect different parts of the computation and are especially important when comparing the long-memory configurations.
WikiText-103 is a word-level benchmark with 103M training tokens. The authors use adaptive token embeddings and adaptive softmax. They evaluate a 247M-parameter Transformer with segments of 3,072 tokens and a 150M-parameter Transformer with segments of 150 tokens. The configurations allow comparison with prior work that used different lengths and architectures. The metric is word-level perplexity, so a lower value indicates that the observed words received greater probability overall. The larger and smaller configurations have their own baselines.
Enwik8 contains 100M characters and is evaluated at the character level. The baseline used for the central comparison is a Transformer with 12 layers, hidden dimension 512, and segments of 512 characters. The metric is bits per character, the average prediction cost measured in bits for each observed character. Here too lower is better. The numerical scale belongs to character prediction and should be read within that benchmark.
Local memory improves the output even with attention
The large WikiText-103 setup gives a comparison among an ordinary Transformer, the same type of predictor with a cache added for inference, and the local TRIME variant. The ordinary Transformer has a test perplexity of 18.70. Attaching a continuous cache at test time brings it to 18.26. Training and testing with TRIME’s local objective brings it to 17.76. All three setups work with segments of 3,072 tokens. The comparison puts the output mechanism under the same broad context constraint and separates the result of adding cache access at test time from the result of using the local-memory training procedure as well.
Local-memory methods on WikiText-103 test perplexity for the 247M Transformer
Training with local memory gives the lowest perplexity among these settings.
The numbers
| System or setting | perplexity |
|---|---|
| Vanilla Transformer | 18.70 |
| Transformer with continuous cache | 18.26 |
| TRIME LM (this paper) | 17.76 |
The result matters because recent words already influence the Transformer’s hidden state. Giving a previously seen continuation an explicit route to the output makes it possible to raise that token’s probability based on a match between contexts. The improvement over the test-time cache shows the value of the trained local configuration as a whole. The authors’ speed comparison finds no appreciable overhead for the local variant relative to the ordinary predictor. Its memory comes from vectors that the current segment already supplied.
With segments of 150 tokens in the 150M WikiText-103 setup, the reported benchmark perplexities for the ordinary Transformer and local TRIME are 25.87 and 25.60. On Enwik8 the corresponding test results are 1.16 and 1.12 bits per character. The local-memory advantage there comes from character continuations rather than words. The authors associate the more modest local gains in the short-segment setups with the smaller amount of material available in each segment. These comparisons supply evidence across different segment lengths and prediction units, with the larger WikiText-103 configuration providing the clearest local comparison against a test-time cache.
Older segments provide useful evidence
In the 150M WikiText-103 setup, the long-memory variant reaches a test perplexity of 22.66, compared with 25.87 for the ordinary Transformer. The reported best evaluation uses 15,000 tokens of long-term memory even though the base encoder works with segments of 150 tokens. Earlier occurrences outside the current segment can thus affect the score of the next word. They enter as stored contexts and continuations, with the current segment still supplying the query representation.
On Enwik8 the equivalent test comparison goes from 1.16 bits per character for the ordinary Transformer to 1.05 for the long-memory variant. The best reported memory size is 24,576, with training segments of length 512. The local-only result of 1.12 bits per character also helps locate the effect. Giving the output a direct route to recent continuations already helps, and the trained access to earlier segments improves the result further.
Local and long-term memory on Enwik8 test bits per character
Access to earlier segments gives the strongest result in this comparison.
The numbers
| System or setting | bits per character |
|---|---|
| Vanilla Transformer | 1.16 |
| TRIME LM | 1.12 |
| TRIME LM long (this paper) | 1.05 |
The authors also extend the continuous cache to preceding segments and find that it underperforms the jointly trained variant. This is a closer baseline for the effect of giving earlier text a route to the output. Both systems have access to earlier contexts as cached vectors, while the TRIME configuration is trained to exploit that kind of evidence. The paper also compares with architectures that carry hidden representations across segments, including Transformer-XL. It reports performance at least competitive with those approaches in the evaluated settings. The practical difference is which part of the system needs access to the past. TRIME reads representations from the final layer for the output calculation. Architectures with recurrence in attention can bring earlier states into the formation of the current representation itself.
The SRU++ experiment tests whether the output-side rule can be used on an architecture that already carries information forward. SRU++ combines recurrent units and attention and uses previous-segment representations in attention layers. The authors retain its required batching procedure. Their added prediction memory uses the current segment and the previous segment. The previous-segment vectors in this adaptation were computed earlier, so the gradient does not pass back through those vectors. The reported Enwik8 comparisons still favor the TRIME extension over ordinary SRU++ at the evaluated sizes. This experiment demonstrates compatibility with recurrence and shows a case where the new output rule can operate with some stored keys held fixed during an update.
A corpus datastore improves WikiText-103 retrieval
The external-memory comparison uses the large WikiText-103 configuration. The reported direct comparison gives kNN-LM a test perplexity of 16.23 and TRIME’s external variant 15.41. Both approaches consult a large corpus store. The distinctive parts of the TRIME system are that it trains the representation for the combined prediction objective, builds batches with related segments, and uses the external-memory calibration at inference.
The accompanying comparison removes earlier-document memory from the external TRIME system. Its WikiText-103 test perplexity is 15.55, compared with 15.41 for the configuration that includes earlier segments. The authors include the reduced configuration to make comparison with kNN-LM equipped with a continuous cache fairer. Within the evaluated TRIME setup, adding long-term memory makes a relatively small contribution once the corpus lookup is available. The passage reporting these figures gives 15.41 for the direct kNN-LM comparison. The paper’s headline WikiText-103 result with a datastore from the training corpus is 15.37, against the ordinary Transformer’s 18.70. The speed table’s caption distinguishes runs using exact distance calculations from runs using approximate distances from the index, with exact distances requiring substantial SSD storage. The two reported TRIME perplexities should be kept with the claims in which the authors present them.
External-memory configurations on WikiText-103 test perplexity
The trained external-memory system improves on kNN-LM even when earlier document segments are omitted.
The numbers
| System or setting | perplexity |
|---|---|
| kNN-LM | 16.23 |
| TRIME LM ext without long-term memory | 15.55 |
| TRIME LM ext (this paper) | 15.41 |
The authors measure inference throughput in tokens per second, with the predictor running on an NVIDIA RTX 3090 GPU and the FAISS indexer using 32 CPUs. Lightweight training and inexpensive local retrieval coexist with a substantial cost for external search. The report of a 10× slowdown for external memory concerns inference with that extra search. The cost is relevant to the benchmark improvement because the lower perplexity is achieved by consulting the store for each evaluated prediction.
Changing the datastore for BooksCorpus
The BooksCorpus experiment evaluates word prediction on text from books using systems trained on WikiText-103. The authors construct a BooksCorpus training split of 100M tokens and development and test splits of 250K tokens each. In this experiment the training split of BooksCorpus is a source of external entries. The predictor keeps its WikiText-103 vocabulary and receives no parameter updates on the books. The base configuration has 247M parameters and uses segments of 3,072 tokens.
The ordinary Transformer performs poorly in the new domain, and the local and long-memory TRIME variants improve word-level perplexity. These variants use evidence from the text currently being evaluated. For the long-memory comparison, the authors use a memory of size 49,152 with TRIME LM long, TRIME LM ext, and the continuous cache. This setup lets repeated expressions in the new domain influence predictions as they appear in a document.
The external experiment compares datastores built from WikiText-103 and from BooksCorpus. Both kNN-LM and the external TRIME system perform substantially better than the ordinary Transformer when they can query the BooksCorpus store, and TRIME outperforms kNN-LM in this domain-adaptation comparison. The result shows that representations learned on WikiText-103 can support useful retrieval from this collection of books. The intervention is a change in available examples, evaluated with the same learned predictor and vocabulary.
German-to-English translation
IWSLT'14 De-En contains 170K translation pairs. The authors use the default fairseq configuration for the encoder-decoder and build an external memory from its parallel training examples. At test time, beam search maintains multiple candidate translations as they are generated. The evaluation uses a beam size of 4. The authors use sacrebleu to calculate the BLEU score, which compares a generated translation with reference text. Candidate neighbor counts considered for translation are 1, 2, 4, 8, 16, 32, and 64.
The external TRIME variant improves on the ordinary Transformer by 1.15 BLEU on the IWSLT'14 De-En test set and also scores higher than kNN-MT. The kNN-MT baseline makes the retrieval comparison informative because it already uses examples from a translation datastore. The observed improvement concerns sentence translation with a next-token objective conditioned on the source sentence. The experiment therefore extends the evidence beyond word and character prediction in monolingual text while retaining the same basic unit of memory, a stored context paired with its observed continuation.
What the ablations show
Batching matters when the test memory changes
The authors first cross different training strategies with different sets of inference memories. They do this on the WikiText-103 development set using the 247M Transformer with segments of 3,072 tokens. This comparison asks whether benefits depend on the relationship between the examples seen in training and the examples offered later. A generic improvement in vocabulary prediction alone would give little reason to expect that consecutive training segments would particularly help with document history or that grouping by lexical overlap would particularly help with a corpus index.
The comparison favors matching training construction to the intended memory. Consecutive segments improve the use of long-range history. BM25 groups improve the use of the external store. During long-memory training, a later segment can learn to use eligible occurrences in its actual document history. During external-memory training, relevant-looking examples from different segments form the comparison set. The result concerns the particular training and inference configurations evaluated, and it supports treating the choice of in-batch examples as part of the objective’s design.
A further WikiText-103 development experiment uses a smaller 7M Transformer to vary parts of the external training procedure. Random batching in place of BM25 produces a perplexity of 45.71. The authors report an increase of +4.21 for that replacement. Random batches still offer other segments as memory, so the difference gives evidence about which comparisons those segments create. Lexical grouping presents the objective with examples likely to overlap in wording, creating occasions to favor a useful continuation among plausible competitors. The experiment shows that this grouping gives a practical advantage over random selection in the tested setup. It leaves open which other methods of grouping examples could produce the same or a better result.
Gradients into the memory keys improve training
The authors also stop back-propagation into the representations used as memory keys and report substantially worse development perplexity. The predictor can still form queries and score the available memories in this comparison. The change concerns which computations the loss can update. With the memory-side gradient enabled, a representation can be adjusted in response to the predictions it helps make elsewhere in the batch, as well as the training signal at its own position.
The two ablations address distinct aspects of learning to retrieve. BM25 affects which candidate contexts are available for comparison. Back-propagation affects what the scoring errors can teach the network about those candidates. The authors also mention a preliminary attempt to draw on cached states from earlier training batches, which did not produce an improvement. The SRU++ result puts this observation in context. A useful extension can still operate when a recurrent architecture requires some older keys to be held fixed. The controlled comparison for the external Transformer establishes that the ability to update available memory keys matters in that configuration.
Local memory can dominate training
The external variant introduces the probability p of disabling the local cache because the authors observe that it can dominate when it is always present. They vary p on WikiText-103 development data using the 7M configuration. With p = 0, the model performs poorly when evaluated with external memory. Increasing p mitigates the problem. The main experiments use p = 0.9.
Local entries are frequently pertinent simply because they come from the same passage. When they are always available, the training loss can benefit from those entries without doing much with the less reliable cross-segment candidates. Removing direct local scores in a share of batches changes where the loss can obtain useful evidence. This intervention leaves the normal prefix input in place. The observed effect therefore concerns reliance on the cache route, and it helps explain why placing related segments in a batch was insufficient on its own for the authors’ chosen external setup.
The local variant is also evaluated across different segment lengths on WikiText-103 development data. It improves over the baselines at the tested lengths. This supports using explicit local scores even when the attention window changes. The evidence for local memory concerns the ability to use it when local access is the goal. In the external ablation the question is how to preserve learning opportunities for another source when easy local evidence is available alongside it.
More history and better neighbors
The authors vary long-term memory size on the WikiText-103 and Enwik8 development sets and compare the trained long-memory variant with an extended continuous cache. The WikiText-103 analysis uses the smaller 7M system and includes different segment lengths. TRIME uses histories beyond 10k tokens effectively, and its advantage over the cache grows as more history is made available in the reported analysis. This comparison asks whether earlier examples remain useful as the memory accumulates more candidates. The result suggests that the trained representation helps preserve the value of older evidence as the number of potentially competing examples grows.
The external retrieval analysis examines the search result before final probability calibration. On WikiText-103 development data, the authors compare the 7M TRIME system with kNN-LM using top-K retrieval accuracy at K values of 1, 8, 64, and 1024. The comparison concerns finding contexts whose stored continuation is the observed target. TRIME achieves better retrieval results. This supplies evidence for a change in the quality of the retrieved examples, alongside the improved perplexity of the final prediction. Having a suitable continuation in the retrieved set and assigning it useful probability are separate questions. The retrieval analysis addresses the former, while the language modeling experiments measure the resulting distribution.
Which tokens benefit
The authors divide WikiText-103 development tokens into 5 frequency buckets and report average perplexity by bucket for the 247M systems. The local and long-memory variants improve on the ordinary Transformer for rare words, which the authors characterize by frequency at or below 1k. For frequent words they find results that are similar or slightly worse. The external variant improves perplexity across the frequency buckets.
A cache can provide several chances to predict a word that is uncommon in the corpus but recurs within a passage. This is one interpretation of the rare-word result. The paper also finds that kNN-LM with a continuous cache does not perform substantially better than the local and long-memory TRIME variants in the frequency analysis, even though those TRIME variants use no external corpus. Taken with the retrieval comparison, the frequency analysis shows how aggregate perplexity can conceal where an improvement occurs. The local and long-memory gains concentrate among rarer words, while the external setting distributes improvements more broadly in this experiment.
Limitations
Limits identified by the authors
External lookup has a substantial runtime cost. The authors report that a system incorporating external memory can run 10× slower at inference. With each prediction requiring a query, even a search over a small returned set depends on the infrastructure used to find that set in the full datastore. The authors suggest coarser entries, such as blocks of text, or compression of the store and its vectors as possible ways to reduce the cost. Those proposals are directions for addressing the bottleneck. The measured performance is for the token-associated entries and search setup used in the experiments.
The largest model the authors train has 247M parameters, and some controlled experiments use a 7M Transformer because of the computation budget. The authors flag scaling to far larger autoregressive systems as future work. The architecture comparison is also limited. The main experiments use Transformers and an adaptation to SRU++. Transformer-XL and Compressive Transformer are mentioned as possible hosts for the output-side memory rule. The benchmark comparisons against those systems are evidence about relative performance in the chosen settings, while the SRU++ experiment supplies the actual test of combining TRIME with another architecture.
Translation is represented by a single small benchmark. The authors report 4M tokens in its external memory and leave larger translation datasets for future work. They also distinguish generation from natural language understanding. A memory entry with a next-token label fits word prediction and the translation decoder directly. The paper leaves open how to adapt the objective to a task such as text classification, where the target and useful unit of retrieval could differ.
The authors raise a privacy concern about external corpora. Retrieval exposes the prediction process to specific examples from the datastore, and generated output can leak information drawn from those examples. They suggest using public material and urge caution in privacy-sensitive settings. The benchmark evaluations concern predictive performance. They supply no measurement of leakage or of how it changes with the corpus or retrieval configuration.
Limits that follow from the experimental setup
The long-history results measure access through token prediction. The method allows a distant occurrence to increase or decrease the probability of a continuation, and the experiments show that this access improves held-out scores. Tasks requiring a reader to combine several dispersed pieces of evidence would test a different capability. TRIME consults earlier segments after it has formed the current query, so those segments cannot interact with the query at every attention layer through this memory mechanism. The memory sizes therefore describe how far the output can look for examples. They do not specify an equivalent attention window.
The headline external result belongs to a combined system. That system includes the trained representations, BM25 batching, suppression of local memory during training, approximate retrieval, and calibration on a development set. The ablations help attribute the effect to particular choices, but several of the controlled tests use the smaller Transformer. The larger benchmark result establishes the performance of the combined configuration. The paper offers less evidence about the magnitude of each contribution at that size or about whether the same tuning settings would transfer to another corpus.
The BooksCorpus comparison tests a specific change of domain with access to a collection from the target domain. It shows that the existing encoder can build useful keys from the new corpus and use them without parameter updates. Generalization to other domains depends on what useful examples can be put in a datastore, how they are represented, and which tokens the existing vocabulary supports. In particular, the BooksCorpus experiment retains the WikiText-103 vocabulary. Its reported gain concerns prediction within that vocabulary with better evidence available.
The benchmark metrics also delimit what can be concluded about generated text. Perplexity and bits per character measure probability assigned to observed continuations. BLEU evaluates correspondence with reference translations in the tested sentence translation task. None of these measurements directly tests whether a retrieved continuation is factually sound, whether retrieval resolves disagreement between sources, or whether a system can trace an answer back to a particular stored passage. The demonstrated benefit is in the measured predictions and translations under the stated memory conditions.
What came after
Retrieval inside the context or at the output
Later papers that cite TRIME address a range of decisions about where retrieved information should enter generation. The distinction is concrete in TRIME. Its datastore returns examples whose continuations contribute to the output probabilities. Work on in-context retrieval addresses the neighboring question of using retrieved material in the input context. A useful comparison is whether an example supplies intermediate evidence the system can read while forming a representation or a candidate continuation the system can score at the end. The titles of the later work identify the problems they take up. A citation alone establishes the connection to TRIME without establishing reuse of its objective or batching procedure.
In-Context Retrieval-Augmented Language Models takes up retrieval as part of the context presented to the predictor. The relationship to TRIME is the use of examples outside the immediate prefix. The two framings place the retrieved information at different stages of the prediction problem. TRIME’s entries contribute weights attached to observed next tokens, while the in-context framing makes the arrangement of retrieved information within the input itself relevant.
In-context Pretraining addresses prediction across document boundaries during pretraining. That scope connects directly to TRIME’s concern that ordinary training may give a system too little practice using related text from other documents. TRIME groups related segments so their positions can act as memory for each other at the output. The later title locates the cross-document problem in pretraining context. Both framings make the selection of related documents consequential during learning.
REPLUG examines retrieval augmentation for a black-box predictor. That access constraint makes a useful comparison with TRIME’s use of internal vectors and memory-side gradients. TRIME can change the representations that determine which examples match. A black-box framing asks what retrieval can do when the base predictor is available through its inputs and outputs. The difference concerns which part of the system can be adapted to improve the use of retrieved information.
Long inputs and different kinds of evidence
Unlimiformer addresses long-range Transformers and the length of the input they can handle. It belongs alongside TRIME’s long-document experiment because both concern the usefulness of information beyond a short segment. The relevant question for comparing them is what access means. TRIME measures useful access to older context and continuation pairs at the final prediction step. Unlimiformer’s stated subject is the input-length problem for the Transformer itself.
Adapting Language Models to Compress Contexts addresses another way of retaining information from longer text. Instead of counting available history only as input positions or records in a store, the title poses the question of what can survive in a compressed representation of context. Compression also appears among the directions TRIME’s authors discuss for reducing the cost of large memory. The comparison separates two questions about capacity, how much material can be kept and what information the representation preserves for a future prediction.
LeanDojo applies the retrieval-augmented framing to theorem proving. This setting illustrates how the task determines the usefulness of a retrieved item. In TRIME, the retrieval diagnostic asks whether a returned context carries the observed next token. In the theorem-proving setting identified by LeanDojo, the relevant question is how retrieved material helps with a proof. TRIME’s next-token result supplies a way to think about learning to select evidence, while the evaluation target depends on the task the evidence serves.
From obtaining evidence to relying on it
Chain-of-Note takes robustness in retrieval-augmented generation as its subject. In TRIME, a close match can supply weight to an unhelpful continuation, and the loss penalizes that outcome through the competition among tokens. Robustness in retrieval-augmented generation puts the broader question of what to do with unreliable retrieved information at the center. The connection is the need to learn how much influence retrieval deserves, even when a search has found plausible-looking candidates.
Enabling Large Language Models to Generate Text with Citations addresses attribution in the generated output. TRIME’s results show that a stored example can improve the probability of the next token. A citation task additionally requires the output to identify evidence for what it says. The later work’s stated goal places the relationship between generated text and its supporting material within the task itself, beyond the internal comparison between the query and stored examples that TRIME measures.
Augmented Language Models: a Survey and A Survey on RAG Meeting LLMs place the citation in broader discussions of augmentation and retrieval. Across these later settings, TRIME contributes a specific experimental result about how to train for memory access. Examples from the current batch can teach a predictor which past contexts to use, and that skill can transfer to a larger memory at inference. The later titles extend the set of questions around that result to input construction, restricted access to the predictor, long-context representation, and the standards that retrieved evidence has to meet for a particular task.
Cite
Cite as Zexuan Zhong, Tao Lei and Danqi Chen. 2022. Training Language Models with Memory Augmentation. Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing.
@inproceedings{zhong2022training,
title = {{Training Language Models with Memory Augmentation}},
author = {Zexuan Zhong, Tao Lei and Danqi Chen},
booktitle = {Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing},
year = {2022},
doi = {10.18653/v1/2022.emnlp-main.382},
eprint = {2205.12674},
archivePrefix = {arXiv},
url = {https://doi.org/10.18653/v1/2022.emnlp-main.382}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/zhong-2022-training-language-models-memory-augmentation/
References
- Rami Al-Rfou, Dokook Choe, Noah Constant, Mandy Guo, and Llion Jones. 2019. Character-level language modeling with deeper self-attention. In Conference on Artificial Intelligence (AAAI), volume 33, pages 3159–3166. our card
- Alexei Baevski and Michael Auli. 2019. Adaptive input representations for neural language modeling. In International Conference on Learning Representations (ICLR). our card
- Iz Beltagy, Matthew E Peters, and Arman Cohan. 2020. Longformer: The long-document Transformer. arXiv preprint arXiv:2004.05150. our card
- Sebastian Borgeaud, Arthur Mensch, Jordan Hoffmann, Trevor Cai, Eliza Rutherford, Katie Millican, George van den Driessche, Jean-Baptiste Lespiau, Bogdan Damoc, Aidan Clark, et al. 2021. Improving language models by retrieving from trillions of tokens. arXiv preprint arXiv:2112.04426. our card
- Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in Neural Information Processing Systems (NeurIPS), 33:1877–1901. our card
- Wenhu Chen, Pat Verga, Michiel de Jong, John Wieting, and William Cohen. 2022. Augmenting pre-trained language models with qa-memory for open-domain question answering. arXiv preprint arXiv:2204.04581. our card
- Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. 2019. Generating long sequences with sparse Transformers. arXiv preprint arXiv:1904.10509. our card
- Krzysztof Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song, Andreea Gane, Tamas Sarlos, Peter Hawkins, Jared Davis, Afroz Mohiuddin, Lukasz Kaiser, et al. 2020. Rethinking attention with Performers. arXiv preprint arXiv:2009.14794. our card
- Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, et al. 2022. PaLM: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311. our card
- Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. 2019. Transformer-XL: Attentive language models beyond a fixed-length context. In Association for Computational Linguistics (ACL). OpenAlex ↗ · Scholar ↗
- Michiel de Jong, Yury Zemlyanskiy, Nicholas FitzGerald, Fei Sha, and William Cohen. 2022. Mention memory: incorporating textual knowledge into transformers through entity mention attention. In International Conference on Learning Representations (ICLR). OpenAlex ↗ · Scholar ↗
- Cyprien de Masson D'Autume, Sebastian Ruder, Lingpeng Kong, and Dani Yogatama. 2019. Episodic memory in lifelong language learning. Advances in Neural Information Processing Systems (NeurIPS), 32. OpenAlex ↗ · Scholar ↗
- Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of deep bidirectional Transformers for language understanding. In North American Chapter of the Association for Computational Linguistics (NAACL). our card
- Angela Fan, Claire Gardent, Chloé Braud, and Antoine Bordes. 2021. Augmenting Transformers with knn-based composite memory for dialog. Transactions of the Association of Computational Linguistics (TACL), 9:82–99. our card
- Edouard Grave, Moustapha M Cisse, and Armand Joulin. 2017a. Unbounded cache model for online language modeling with open vocabulary. Advances in Neural Information Processing Systems (NIPS), 30. OpenAlex ↗ · Scholar ↗
- Edouard Grave, Armand Joulin, and Nicolas Usunier. 2017b. Improving neural language models with a continuous cache. In International Conference on Learning Representations (ICLR). our card
- Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Ming-Wei Chang. 2020. REALM: Retrieval-augmented language model pre-training. In International Conference on Machine Learning (ICML). our card
- Raia Hadsell, Sumit Chopra, and Yann LeCun. 2006. Dimensionality reduction by learning an invariant mapping. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), volume 2, pages 1735–1742. OpenAlex ↗ · Scholar ↗
- Junxian He, Graham Neubig, and Taylor Berg-Kirkpatrick. 2021. Efficient nearest neighbor language models. In Empirical Methods in Natural Language Processing (EMNLP). our card
- Gautier Izacard and Edouard Grave. 2021. Leveraging passage retrieval with generative models for open domain question answering. In European Chapter of the Association for Computational Linguistics (EACL). our card
- Haozhe Ji, Rongsheng Zhang, Zhenyu Yang, Zhipeng Hu, and Minlie Huang. 2022. LaMemo: Language modeling with look-ahead memory. In North American Chapter of the Association for Computational Linguistics (NAACL). OpenAlex ↗ · Scholar ↗
- Jeff Johnson, Matthijs Douze, and Hervé Jégou. 2019. Billion-scale similarity search with GPUs. IEEE Transactions on Big Data, 7(3):535–547. our card
- Vladimir Karpukhin, Barlas Oğuz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, and Wen-tau Yih. 2020. Dense passage retrieval for open-domain question answering. In Empirical Methods in Natural Language Processing (EMNLP). our card
- Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and François Fleuret. 2020. Transformers are RNNs: Fast autoregressive Transformers with linear attention. In International Conference on Machine Learning (ICML), pages 5156–5165. OpenAlex ↗ · Scholar ↗
- Urvashi Khandelwal, Angela Fan, Dan Jurafsky, Luke Zettlemoyer, and Mike Lewis. 2021. Nearest neighbor machine translation. In International Conference on Learning Representations (ICLR). OpenAlex ↗ · Scholar ↗
- Urvashi Khandelwal, Omer Levy, Dan Jurafsky, Luke Zettlemoyer, and Mike Lewis. 2020. Generalization through memorization: Nearest neighbor language models. In International Conference on Learning Representations (ICLR). our card
- Ankit Kumar, Ozan Irsoy, Peter Ondruska, Mohit Iyyer, James Bradbury, Ishaan Gulrajani, Victor Zhong, Romain Paulus, and Richard Socher. 2016. Ask me anything: Dynamic memory networks for natural language processing. In International Conference on Machine Learning (ICML), pages 1378–1387. our card
- Tao Lei. 2021. When attention meets fast recurrence: Training language models with reduced compute. In Empirical Methods in Natural Language Processing (EMNLP). OpenAlex ↗ · Scholar ↗
- Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, et al. 2020. Retrieval-augmented generation for knowledge-intensive NLP tasks. Advances in Neural Information Processing Systems (NeurIPS), 33:9459–9474. our card
- Peter J Liu, Mohammad Saleh, Etienne Pot, Ben Goodrich, Ryan Sepassi, Lukasz Kaiser, and Noam Shazeer. 2018. Generating Wikipedia by summarizing long sequences. In International Conference on Learning Representations (ICLR). our card
- Matt Mahoney. 2009. Large text compression benchmark. OpenAlex ↗ · Scholar ↗
- Pedro Henrique Martins, Zita Marinho, and André FT Martins. 2022. $\infty$-former: Infinite memory Transformer. In Association for Computational Linguistics (ACL). OpenAlex ↗ · Scholar ↗
- Yuxian Meng, Shi Zong, Xiaoya Li, Xiaofei Sun, Tianwei Zhang, Fei Wu, and Jiwei Li. 2022. Gnn-lm: Language modeling based on global contexts via gnn. In International Conference on Learning Representations (ICLR). OpenAlex ↗ · Scholar ↗
- Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. 2017. Pointer sentinel mixture models. In International Conference on Learning Representations (ICLR). our card
- Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. 2019. fairseq: A fast, extensible toolkit for sequence modeling. In Proceedings of NAACL-HLT 2019: Demonstrations. our card
- Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002. BLEU: a method for automatic evaluation of machine translation. In Association for Computational Linguistics (ACL), pages 311–318. our card
- Hao Peng, Nikolaos Pappas, Dani Yogatama, Roy Schwartz, Noah A Smith, and Lingpeng Kong. 2021. Random feature attention. In International Conference on Learning Representations (ICLR). OpenAlex ↗ · Scholar ↗
- Fabio Petroni, Aleksandra Piktus, Angela Fan, Patrick Lewis, Majid Yazdani, Nicola De Cao, James Thorne, Yacine Jernite, Vladimir Karpukhin, Jean Maillard, et al. 2021. KILT: a benchmark for knowledge intensive language tasks. In North American Chapter of the Association for Computational Linguistics (NAACL), pages 2523–2544. our card
- Matt Post. 2018. A call for clarity in reporting BLEU scores. In Proceedings of the Third Conference on Machine Translation: Research Papers, pages 186–191, Belgium, Brussels. Association for Computational Linguistics. our card
- Jack W Rae, Anna Potapenko, Siddhant M Jayakumar, and Timothy P Lillicrap. 2020. Compressive Transformers for long-range sequence modelling. In International Conference on Learning Representations (ICLR). our card
- Stephen Robertson and Hugo Zaragoza. 2009. The probabilistic relevance framework: BM25 and beyond. Now Publishers Inc. OpenAlex ↗ · Scholar ↗
- Abigail See, Peter J Liu, and Christopher D Manning. 2017. Get to the point: Summarization with pointer-generator networks. In Association for Computational Linguistics (ACL), pages 1073–1083. OpenAlex ↗ · Scholar ↗
- Devendra Singh, Siva Reddy, Will Hamilton, Chris Dyer, and Dani Yogatama. 2021. End-to-end training of multi-document reader and retriever for open-domain question answering. Advances in Neural Information Processing Systems (NIPS). our card
- Sainbayar Sukhbaatar, Édouard Grave, Piotr Bojanowski, and Armand Joulin. 2019. Adaptive attention span in Transformers. In Association for Computational Linguistics (ACL), pages 331–335. our card
- Sainbayar Sukhbaatar, Da Ju, Spencer Poff, Stephen Roller, Arthur Szlam, Jason Weston, and Angela Fan. 2021. Not all memories are created equal: Learning to forget by expiring. In International Conference on Machine Learning (ICML), pages 9902–9912. PMLR. OpenAlex ↗ · Scholar ↗
- Yi Tay, Mostafa Dehghani, Dara Bahri, and Donald Metzler. 2020. Efficient Transformers: A survey. arXiv preprint arXiv:2009.06732. our card
- Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. Advances in Neural Information Processing Systems (NIPS), 30. our card
- Sinong Wang, Belinda Z Li, Madian Khabsa, Han Fang, and Hao Ma. 2020. Linformer: Self-attention with linear complexity. arXiv preprint arXiv:2006.04768. OpenAlex ↗ · Scholar ↗
- Yuhuai Wu, Markus N Rabe, DeLesley Hutchins, and Christian Szegedy. 2022. Memorizing Transformers. In International Conference on Learning Representations (ICLR). OpenAlex ↗ · Scholar ↗
- Dani Yogatama, Cyprien de Masson d’Autume, and Lingpeng Kong. 2021. Adaptive semiparametric language models. Transactions of the Association of Computational Linguistics (TACL), 9:362–373. OpenAlex ↗ · Scholar ↗
- Manzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, et al. 2020. Big Bird: Transformers for longer sequences. In Advances in Neural Information Processing Systems (NeurIPS), volume 33, pages 17283–17297. our card
- Yury Zemlyanskiy, Joshua Ainslie, Michiel de Jong, Philip Pham, Ilya Eckstein, and Fei Sha. 2021. Readtwice: Reading very large documents with memories. In North American Chapter of the Association for Computational Linguistics (NAACL). OpenAlex ↗ · Scholar ↗
- Susan Zhang, Stephen Roller, Naman Goyal, Mikel Artetxe, Moya Chen, Shuohui Chen, Christopher Dewan, Mona Diab, Xian Li, Xi Victoria Lin, et al. 2022. OPT: Open pre-trained Transformer language models. arXiv preprint arXiv:2205.01068. our card
- Xin Zheng, Zhirui Zhang, Junliang Guo, Shujian Huang, Boxing Chen, Weihua Luo, and Jiajun Chen. 2021. Adaptive nearest neighbor machine translation. In Association for Computational Linguistics (ACL), pages 368–374. our card
- Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. 2015. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In International Conference on Computer Vision (ICCV), pages 19–27. our card