Retrieval-Pretrained Transformer: Long-range Language Modeling with Self-retrieval
On the map: Retrieval-augmented generation → Generation and context integration
Abstract (arXiv)
Retrieval-augmented language models (LMs) have received much attention recently. However, typically the retriever is not trained jointly as a native component of the LM, but added post-hoc to an already-pretrained LM, which limits the ability of the LM and the retriever to adapt to one another. In this work, we propose the Retrieval-Pretrained Transformer (RPT), an architecture and training procedure for jointly training a retrieval-augmented LM from scratch and apply it to the task of modeling long texts. Given a recently generated text chunk in a long document, the LM computes query representations, which are then used to retrieve earlier chunks in the document, located potentially tens of thousands of tokens before. Information from retrieved chunks is fused into the LM representations to predict the next target chunk. We train the retriever component with a semantic objective, where the goal is to retrieve chunks that increase the probability of the next chunk, according to a reference LM. We evaluate RPT on four long-range language modeling tasks, spanning books, code, and mathematical writing, and demonstrate that RPT improves retrieval quality and subsequently perplexity across the board compared to strong baselines.
Key facts. Cited by 20 papers in the map (data through 7 Oct 2026). Placed in Generation and context integration, one of 15 directions in Retrieval-augmented generation. Builds on 56 of its 66 references that are in the map. First posted on arXiv 23 Jun 2023.
Builds on
56 of 66 references.
Closest ancestors · 7
Same direction, newest first
- 2023Surface-Based Retrieval Reduces Perplexity of Retrieval-Augmented Language Models25 May
- 2023Shall We Pretrain Autoregressive Language Models with Retrieval? A Comprehensive Study13 Apr
- 2023In-Context Retrieval-Augmented Language Models31 Jan
- 2023REPLUG: Retrieval-Augmented Black-Box Language Models30 Jan
- 2022Atlas: Few-shot Learning with Retrieval Augmented Language Models5 Aug
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks22 May
- 2020REALM: Retrieval-Augmented Language Model Pre-Training10 Feb
Other references · 49
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
- 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,779
- 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,464
- 2020Longformer: The Long-Document Transformercited by 3,362
- 2021Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsitycited by 3,014
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
- 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,734
37 more
- 2020Big Bird: Transformers for Longer Sequencescited by 1,673
- 2020Reformer: The Efficient Transformercited by 1,658
- 2021Improving language models by retrieving from trillions of tokenscited by 1,278
- 2020Leveraging Passage Retrieval with Generative Models for Open Domain Question Answeringcited by 1,203
- 2021Unsupervised Dense Information Retrieval with Contrastive Learningcited by 1,203
- 2019Generalization through Memorization: Nearest Neighbor Language Modelscited by 788
- 2015Scheduled Sampling for Sequence Prediction with Recurrent Neural Networkscited by 779
- 2022GPT-NeoX-20B: An Open-Source Autoregressive Language Modelcited by 711
- 2019Compressive Transformers for Long-Range Sequence Modellingcited by 699
- 2019Latent Retrieval for Weakly Supervised Open Domain Question Answeringcited by 691
- 2021Learning To Retrieve Prompts for In-Context Learningcited by 641
- 2022Hungry Hungry Hippos: Towards Language Modeling with State Space Modelscited by 495
- 2020Efficient Content-Based Sparse Attention with Routing Transformerscited by 469
- 2023Resurrecting Recurrent Neural Networks for Long Sequencescited by 397
- 2020AdaBelief Optimizer: Adapting Stepsizes by the Belief in Observed Gradientscited by 282
- 2016Using the Output Embedding to Improve Language Modelscited by 266
- 2022Long Range Language Modeling via Gated State Spacescited by 265
- 2020Distilling Knowledge from Reader to Retriever for Question Answeringcited by 226
- 2022Memorizing Transformerscited by 219
- 2021Unsupervised Corpus Aware Language Model Pre-training for Dense Passage Retrievalcited by 203
- 2022Improving Passage Retrieval with Zero-Shot Question Generationcited by 164
- 2021Simple Entity-Centric Questions Challenge Dense Retrieverscited by 140
- 2021End-to-End Training of Multi-Document Reader and Retriever for Open-Domain Question Answeringcited by 133
- 2023Unlimiformer: Long-Range Transformers with Unlimited Length Inputcited by 127
- 2022Training Language Models with Memory Augmentationcited by 112
- 2022Block-Recurrent Transformerscited by 107
- 2021Do Long-Range Language Models Actually Use Long-Range Context?cited by 92
- 2021Adaptive Semiparametric Language Modelscited by 83
- 2020Shortformer: Better Language Modeling using Shorter Inputscited by 76
- 2022Efficient Long-Text Understanding with Short-Text Modelscited by 71
- 2021Learning to Retrieve Passages without Supervisioncited by 46
- 2022Retrieval as Attention: End-to-end Learning of Retrieval and Reading within a Single Transformercited by 45
- 2022QAMPARI: An Open-domain Question Answering Benchmark for Questions with Many Answers from Multiple Paragraphscited by 42
- 2021Not All Memories are Created Equal: Learning to Forget by Expiringcited by 32
- 2020Do Transformers Need Deep Long-Range Memorycited by 24
- 2022Simplifying and Understanding State Space Models with Diagonal Linear RNNscited by 23
- 2023kNN-Adapter: Efficient Domain Adaptation for Black-Box Language Modelscited by 13
Built on by
Citing papers per year: 2023: 7; 2024: 10; 2025: 3.
20 papers.
Sort:
By area:
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
- 2023A Comprehensive Overview of Large Language Modelscited by 639
- 2023Making Retrieval-Augmented Language Models Robust to Irrelevant Contextcited by 364
- 2024BABILong: Testing the Limits of LLMs with Long Context Reasoning-in-a-Haystackcited by 211
- 2023CacheGen: KV Cache Compression and Streaming for Fast Large Language Model Servingcited by 199
- 2023Attention Sorting Combats Recency Bias In Long Context Language Modelscited by 89
- 2024Reliable, Adaptable, and Attributable Language Models with Retrievalcited by 73
- 2023Recursively Summarizing Enables Long-Term Dialogue Memory in Large Language Modelscited by 62
- 2023KCTS: Knowledge-Constrained Tree Search Decoding with Token-Level Hallucination Detectioncited by 43
- 2024UniMS-RAG: A Unified Multi-source Retrieval-Augmented Generation for Personalized Dialogue Systemscited by 38
- 2024In Search of Needles in a 11M Haystack: Recurrent Memory Finds What LLMs Misscited by 36
- 2024Accelerating Retrieval-Augmented Language Model Serving with Speculationcited by 20
8 more
- 2024Associative Recurrent Memory Transformercited by 15
- 2024Analyzing and Adapting Large Language Models for Few-Shot Multilingual NLU: Are We There Yet?cited by 11
- 2024Efficient Length-Generalizable Attention via Causal Retrieval for Long-Context Language Modelingcited by 8
- 2025Hardware-aligned Hierarchical Sparse Attention for Efficient Long-term Memory Accesscited by 7
- 2025CoCoLex: Confidence-guided Copy-based Decoding for Grounded Legal Text Generationcited by 6
- 2024Intermediate Distillation: Data-Efficient Distillation from Black-Box LLMs for Information Retrievalcited by 3
- 2025Every Token Counts: Generalizing 16M Ultra-Long Context in Large Language Modelscited by 3
- 2024Retrieval Augmented Spelling Correction for E-Commerce Applicationscited by 1
- 2025Every Token Counts: Generalizing 16M Ultra-Long Context in Large Language Models28 Nov 2025
- 2025CoCoLex: Confidence-guided Copy-based Decoding for Grounded Legal Text Generation7 Aug 2025
- 2025Hardware-aligned Hierarchical Sparse Attention for Efficient Long-term Memory Access23 Apr 2025
- 2024Retrieval Augmented Spelling Correction for E-Commerce Applications15 Oct 2024
- 2024Efficient Length-Generalizable Attention via Causal Retrieval for Long-Context Language Modeling2 Oct 2024
- 2024Associative Recurrent Memory Transformer5 Jul 2024
- 2024Intermediate Distillation: Data-Efficient Distillation from Black-Box LLMs for Information Retrieval18 Jun 2024
- 2024BABILong: Testing the Limits of LLMs with Long Context Reasoning-in-a-Haystack14 Jun 2024
- 2024Reliable, Adaptable, and Attributable Language Models with Retrieval5 Mar 2024
- 2024Analyzing and Adapting Large Language Models for Few-Shot Multilingual NLU: Are We There Yet?4 Mar 2024
- 2024In Search of Needles in a 11M Haystack: Recurrent Memory Finds What LLMs Miss16 Feb 2024
- 2024Accelerating Retrieval-Augmented Language Model Serving with Speculation25 Jan 2024
8 more
- 2024UniMS-RAG: A Unified Multi-source Retrieval-Augmented Generation for Personalized Dialogue Systems24 Jan 2024
- 2023KCTS: Knowledge-Constrained Tree Search Decoding with Token-Level Hallucination Detection13 Oct 2023
- 2023CacheGen: KV Cache Compression and Streaming for Fast Large Language Model Serving11 Oct 2023
- 2023Making Retrieval-Augmented Language Models Robust to Irrelevant Context2 Oct 2023
- 2023Attention Sorting Combats Recency Bias In Long Context Language Models28 Sep 2023
- 2023Recursively Summarizing Enables Long-Term Dialogue Memory in Large Language Models29 Aug 2023
- 2023A Comprehensive Overview of Large Language Models12 Jul 2023
- 2023Lost in the Middle: How Language Models Use Long Contexts6 Jul 2023
- 2023Making Retrieval-Augmented Language Models Robust to Irrelevant Contextcited by 364
- 2024Reliable, Adaptable, and Attributable Language Models with Retrievalcited by 73
- 2024UniMS-RAG: A Unified Multi-source Retrieval-Augmented Generation for Personalized Dialogue Systemscited by 38
- 2024Accelerating Retrieval-Augmented Language Model Serving with Speculationcited by 20
- 2024Intermediate Distillation: Data-Efficient Distillation from Black-Box LLMs for Information Retrievalcited by 3
- 2024Retrieval Augmented Spelling Correction for E-Commerce Applicationscited by 1
- 2024Retrieval Augmented Spelling Correction for E-Commerce Applications15 Oct 2024
- 2024Intermediate Distillation: Data-Efficient Distillation from Black-Box LLMs for Information Retrieval18 Jun 2024
- 2024Reliable, Adaptable, and Attributable Language Models with Retrieval5 Mar 2024
- 2024Accelerating Retrieval-Augmented Language Model Serving with Speculation25 Jan 2024
- 2024UniMS-RAG: A Unified Multi-source Retrieval-Augmented Generation for Personalized Dialogue Systems24 Jan 2024
- 2023Making Retrieval-Augmented Language Models Robust to Irrelevant Context2 Oct 2023
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
- 2023A Comprehensive Overview of Large Language Modelscited by 639
- 2023Attention Sorting Combats Recency Bias In Long Context Language Modelscited by 89
- 2023Recursively Summarizing Enables Long-Term Dialogue Memory in Large Language Modelscited by 62
- 2023KCTS: Knowledge-Constrained Tree Search Decoding with Token-Level Hallucination Detectioncited by 43
- 2024In Search of Needles in a 11M Haystack: Recurrent Memory Finds What LLMs Misscited by 36
- 2024Associative Recurrent Memory Transformercited by 15
- 2024Analyzing and Adapting Large Language Models for Few-Shot Multilingual NLU: Are We There Yet?cited by 11
- 2024Efficient Length-Generalizable Attention via Causal Retrieval for Long-Context Language Modelingcited by 8
- 2025Hardware-aligned Hierarchical Sparse Attention for Efficient Long-term Memory Accesscited by 7
- 2025CoCoLex: Confidence-guided Copy-based Decoding for Grounded Legal Text Generationcited by 6
- 2025Every Token Counts: Generalizing 16M Ultra-Long Context in Large Language Modelscited by 3
- 2025Every Token Counts: Generalizing 16M Ultra-Long Context in Large Language Models28 Nov 2025
- 2025CoCoLex: Confidence-guided Copy-based Decoding for Grounded Legal Text Generation7 Aug 2025
- 2025Hardware-aligned Hierarchical Sparse Attention for Efficient Long-term Memory Access23 Apr 2025
- 2024Efficient Length-Generalizable Attention via Causal Retrieval for Long-Context Language Modeling2 Oct 2024
- 2024Associative Recurrent Memory Transformer5 Jul 2024
- 2024Analyzing and Adapting Large Language Models for Few-Shot Multilingual NLU: Are We There Yet?4 Mar 2024
- 2024In Search of Needles in a 11M Haystack: Recurrent Memory Finds What LLMs Miss16 Feb 2024
- 2023KCTS: Knowledge-Constrained Tree Search Decoding with Token-Level Hallucination Detection13 Oct 2023
- 2023Attention Sorting Combats Recency Bias In Long Context Language Models28 Sep 2023
- 2023Recursively Summarizing Enables Long-Term Dialogue Memory in Large Language Models29 Aug 2023
- 2023A Comprehensive Overview of Large Language Models12 Jul 2023
- 2023Lost in the Middle: How Language Models Use Long Contexts6 Jul 2023
Similar, not cited
Close in wording, no citation either way
- 2024RAG and RAU: A Survey on Retrieval-Augmented Language Model in Natural Language Processing
- 2023BRENT: Bidirectional Retrieval Enhanced Norwegian Transformer
- 2026To Memorize or to Retrieve: Scaling the Interaction Between Pretraining and Retrieval
- 2026Latent Abstraction for Retrieval-Augmented Generation
- 2024ACER: Automatic Language Model Context Extension via Retrieval
- 2025Direct Retrieval-augmented Optimization: Synergizing Knowledge Selection and Language Models
- 2024Unraveling and Mitigating Retriever Inconsistencies in Retrieval-Augmented Large Language Models
- 2024MemLong: Memory-Augmented Retrieval for Long Text Modeling