# InstructRetro: Instruction Tuning post Retrieval-Augmented Pretraining

Continued retrieval pretraining before instruction tuning lifts a 48B model's zero-shot QA

Boxin Wang, Wei Ping, Lawrence McAfee, Peng Xu, Bo Li, Mohammad Shoeybi and 1 more · arXiv · 2023-10-11

- **Problem** Retrieval models stayed near 10B parameters, limiting zero-shot gains after instruction tuning.
- **Method** InstructRetro continues pretraining a 43B GPT with retrieval on 100B more tokens, instead of training a retrieval model from scratch. It then instruction tunes the model with the encoder bypassed.
- **Results** InstructRetro 43B gains about 7% over InstructGPTRAG 43B on short-form QA.

## Why retrieval models stayed small

Retrieval-augmented pretraining reduces perplexity and improves factual accuracy, which makes it a promising way to ground a language model. Those decoder-only models then received instruction tuning and RLHF, which the retrieval models never had. The authors point to the Retro model at 7.5B parameters, trained on 600B tokens, as a typical example of how small retrieval models stayed.

The authors argue that this lack of scale could limit the effectiveness of instruction tuning.

Retrieval-augmented LLMs of around 10B parameters therefore largely limit zero-shot generalization after instruction tuning. Retrieval-augmented pretraining has been studied in retrieval at inference, fine-tuning, and pretraining settings. Pretraining with retrieval was the setting that reduced perplexity and enhanced factuality, so the authors focused on it.

Instruction tuning itself aims to teach LLMs to follow natural language instructions. A concurrent work, RA-DIT, focuses on retrieval-augmented instruction tuning instead of retrieval-augmented pretraining.

No earlier retrieval model had been instruction tuned or RLHF-tuned, so the question stayed open. The authors ask whether scaling retrieval pretraining to 48B and then instruction tuning gives a better zero-shot model than GPT with RAG. They scale Retro up to 48B parameters on 1.2T tokens in total. Their model starts from a 43B GPT trained on 1.1T tokens and adds 100B tokens of retrieval-augmented pretraining.

## Continued retrieval pretraining from a 43B GPT

The method starts from a pretrained 43B GPT and keeps training it with retrieval on 100B more tokens, instead of building a retrieval model from scratch. That reuse keeps the extra compute small, because the GPT backbone has already seen 1.1T tokens before retrieval is added. Retro adds a two-layer bidirectional encoder and chunk-wise cross-attention to the GPT decoder, so retrieved neighbors can reach the decoder.

The encoder uses the same hidden dimension as the decoder, and the authors' preliminary runs showed that deeper encoders gave no better validation perplexity.

Retro-fitting loads the decoder weights from GPT and randomly initializes the encoder and cross-attention. Borgeaud et al. froze the decoder at this step, but the authors unfreeze all decoder parameters and train the whole model. In an 823M ablation, unfreezing the decoder converged faster and reached better validation perplexity than freezing it.

GPT-fitting continues training GPT on the same 100B tokens without retrieval, so the comparison isolates the effect of retrieval. The 100B tokens equal 9% of the data used to pretrain the GPT models.

The retrieval database holds 19B chunks of 64 tokens, built from the 1.2 trillion token corpus with BERT embeddings as keys. Retro retrieves top-k = 2 neighbors using the previous chunk, which keeps generation causal. A Faiss index with 222 centroids, HNSW graphs and product quantization returns neighbors in 4ms per query.

Retro 48B reaches lower perplexity than GPT 43B, and the extra cost is 2.58% additional GPU hours. Retro matches GPT models with 4× larger parameter sizes, and the gap holds from 8B to 48B. Retrieval adds around 35% computational overhead over GPT continued pretraining, so the 2.58% figure is the overall cost to compare.

## Instruction tuning with the encoder gated off

InstructRetro's instruction tuning uses 128K conversational samples with system, user and assistant roles. The loss is taken only on the final assistant response, so earlier turns act as context. The authors use a batch size of 128, a learning rate of 5e-6 and 1000 steps, with a weight decay of 0.01. Applying this recipe gives two models, InstructGPTRAG 43B and InstructRetro 48B.

Retrieved neighbors aren't available for the instruction data, so the encoder has nothing to read. Neighbors pulled from the pretraining corpus would be noisy for such high-quality data, and they wouldn't help the model follow instructions. A 0/1 gate between the cross-attention output and the residual connection is set to zero, which skips the cross-attention.

During pretraining the gate stays at 1, so the Retro encoder is active.

![Figure 4: Simplified architecture diagram of InstructRetro. We omit the layer norm, softmax, and embedding layers for simplicity. We add additional 0/1 gates b…](https://refivu.com/papers/dd0abb30-a6bc-4a8d-9d46-a2308c9cb88b/figures/figure-3b59299f3ce18b964133eeacb4141d62.png?thumb=512)

**Figure 4** . Simplified architecture diagram of InstructRetro. We omit the layer norm, softmax, and embedding layers for simplicity. We add additional 0/1 gates between cross-attention output and the residual connection from self-attention output. During pretraining, we keep the Retro encoder gate ON with gate-value 1. During instruction tuning and inference, we bypass the Retro encoder by turning the Retro encoder gate OFF with gate-value 0 to solely serve as a GPT decoder.

[Original paper](https://arxiv.org/abs/2310.07713v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Boxin Wang, Wei Ping, Lawrence McAfee, Peng Xu, Bo Li, Mohammad Shoeybi, Bryan Catanzaro · InstructRetro: Instruction Tuning post Retrieval-Augmented Pretraining · Original paper figure · Extracted the figure area from page 6 of the original PDF.

With the gate at zero, the cross-attention module and the Retro encoder are skipped, so their parameters stay effectively frozen. The authors argue that this design simplifies instruction tuning and inference. It also lets Retro learn to infer with and without retrieval, which may improve the generalization of the Retro decoder. InstructRetro 43B is the same model with the gate off, so it runs as a decoder-only GPT at evaluation.

They didn't test instruction tuning with the Retro encoder enabled in this setup.

## Short-form QA against the GPT with RAG baseline

On the eight short-form QA and reading comprehension tasks, InstructRetro 43B beats InstructGPTRAG 43B on most datasets. Table 1 places retrieved context in the prompt for each zero-shot task, so both models get the same retrieval setup. On Natural Questions, InstructRetro 43B scored 38.9 EM, compared to 37.0 for InstructGPTRAG 43B. The TriviaQA gap is narrower, with 78.3 compared to 78.1.

Averaged over these tasks, the authors report a relative gain of about 7%.

The authors credit this gain to continued retrieval pretraining before instruction tuning. Both models used identical datasets, hyperparameters and evaluation prompts, so the training recipe is the only difference they point to. They argue that retrieval pretraining teaches the model to use information in the context, from both the encoder and the decoder.

Instruction tuning then amplifies that ability on knowledge-intensive tasks.

Keeping the encoder changes little on these tasks. InstructRetro 48B with the encoder averages +6%, while InstructRetro 43B without it averages +7%. InstructRetro 43B, with no encoder, comes close to FLAN-LaMDA 137B, which is three times its size. When the encoder is active, the authors feed the top-2 neighbors to it, which matches the pretraining setup.

The authors also say that bypassing the encoder during evaluation aligns better with the instruction tuning protocol.

## Long-form QA and summarization gains from retrieval-augmented pretraining

On four long-form QA sets, the average relative gain of InstructRetro 43B over InstructGPTRAG 43B is 10%. The authors read this as larger than the short-form gain, since long-form QA is generally more challenging. On doc2dial, F1 moved from 32.87 for InstructGPTRAG 43B to 35.74 for InstructRetro 43B. The Car #1 gap is larger, with 58.18 for InstructGPTRAG 43B compared to 63.52 for InstructRetro 43B.

Car #2 moved from 50.88 to 57.49, and IT Doc from 31.40 to 34.08 under the same comparison. InstructRetro 48B, with the encoder enabled, reaches an average of +10% as well, so the encoder choice changes little here.

![Table 2: Zero-shot evaluation on four long-form QA datasets. We use F1 as the evaluation metric. Car #1 and #2 are short for two annotated car manual datasets.…](https://refivu.com/papers/dd0abb30-a6bc-4a8d-9d46-a2308c9cb88b/figures/figure-1862217a1838d96470f5081b68a66532.png?thumb=512)

**Table 2** . Zero-shot evaluation on four long-form QA datasets. We use F1 as the evaluation metric. Car #1 and #2 are short for two annotated car manual datasets. The average relative improvement of InstructRetro 43B across the long-form QA tasks is 10% over InstructGPTRAG 43B.

[Original paper](https://arxiv.org/abs/2310.07713v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

On the summarization sets, the ROUGE geometric mean rose on GovReport from 12.59 to 17.46 for InstructRetro 43B. The average gain across the three summarization sets is 16%, with GovReport showing the largest relative change. The paper reports a 4.87 ROUGE point improvement on GovReport, and SummFD and QMSum rose as well. InstructRetro 43B scores above Llama 2 RAG 70B on all three summarization datasets.

The metric is the geometric mean of ROUGE-1, ROUGE-2 and ROUGE-L, so it combines three overlap scores into one number.

The authors trace these gains to the retrieval-augmented pretraining stage, which they connect to the instruction-tuned decoder. Because the encoder is bypassed at evaluation, the 43B decoder-only model is the one compared against InstructGPTRAG 43B. They didn't test retrieval-augmented instruction tuning with the Retro encoder enabled. The ablation in Figure 5 uses Natural Question accuracy, where instruction tuning lifts both GPT and Retro.

## General chat results on MT-Bench

The authors test whether the recipe carries over to general chat by tuning both GPT and Retro on the Tulu-v2 alignment dataset. They score both models on the MT-Bench chat benchmark, which lets the comparison cover more than the QA and summarization tasks. InstructRetro-Tulu-v2-43B averages 6.70, compared to 6.44 for InstructGPT-Tulu-v2-43B.

Turn 1 scores 6.89 compared to 6.67, and Turn 2 scores 6.51 compared to 6.21. The authors summarize this as InstructRetro outperforming InstructGPT on average across the different turns.

The category breakdown shows gains on Writing, Reasoning, Math and Humanities for InstructRetro. Writing reaches 8.85 compared to 8.15, Reasoning 5.40 compared to 4.75, and Math 3.15 compared to 2.35. Retro trails GPT in role play and coding, with Roleplay at 7.75 compared to 7.80 and coding at 3.40 compared to 4.10. The authors attribute this gap to missing coding and role-playing data in the GPT pretraining mix, so retrieval adds little there.

They didn't test whether adding coding or role-play data to the retrieval database would close the gap.

## Limits of the evidence

The headline comparisons are all zero-shot, covering the listed QA, reading comprehension and summarization tasks. The instruction-tuned comparisons stop at the 43B and 48B scale, so nothing shows how the recipe behaves at other sizes. The MT-Bench run uses only the Tulu-v2 dataset, so it doesn't test the broader instruction mix used for the main models.

Retro trails GPT on role play and coding, and the authors attribute this to missing coding and role-play data in pretraining.

The authors leave open whether retrieval-augmented instruction tuning, with the encoder active, would help. They didn't apply RA-DIT retrieval-augmented instruction data to InstructRetro. InstructRetro 43B beats RA-DIT 65B only on certain benchmarks, so that comparison is narrow.

## Paper info

- **Authors**: Boxin Wang, Wei Ping, Lawrence McAfee, Peng Xu, Bo Li, Mohammad Shoeybi, Bryan Catanzaro
- **Venue**: arXiv · Preprint
- **First published**: 2023-10-11
- **Added**: 2026-11-5
- **Updated**: 2024-5-29
- **Version**: v3
- **arXiv**: 2310.07713
- **Category**: cs.CL · cs.AI · cs.IR · cs.LG
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info, commentary and permitted figures from the original paper

[Original paper ↗](https://arxiv.org/abs/2310.07713v3) · [PDF ↗](https://arxiv.org/pdf/2310.07713v3)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Abstract

Pretraining auto-regressive large language models~(LLMs) with retrieval demonstrates better perplexity and factual accuracy by leveraging external databases. However, the size of existing pretrained retrieval-augmented LLM is still limited (e.g., Retro has 7.5B parameters), which limits the effectiveness of instruction tuning and zero-shot generalization. In this work, we introduce Retro 48B, the largest LLM pretrained with retrieval. Specifically, we continue to pretrain a 43B GPT model on additional 100 billion tokens using the Retro augmentation method by retrieving from 1.2 trillion tokens. Notably, the obtained foundation model, Retro 48B, largely outperforms the counterpart GPT 43B trained on 1.2T tokens in terms of perplexity with only 2.58% additional GPU hours, demonstrating the significant scaling potential of the method. After instruction tuning on Retro, InstructRetro demonstrates significant improvement over the instruction tuned GPT on a wide range of zero-shot tasks. Specifically, the average improvement of InstructRetro is 7% over its GPT counterpart across 8 short-form QA and reading comprehension tasks, 10% over GPT across 4 challenging long-form QA tasks, and 16% over GPT across 3 summarization tasks. Surprisingly, we find that one can ablate the encoder from InstructRetro architecture and directly use its decoder backbone, while achieving comparable results. Our results highlight the promising direction to obtain a better GPT decoder through continued pretraining with retrieval before instruction tuning. Our code and checkpoints are publicly available at: https://huggingface.co/nvidia/retro-48b-instruct-4k.

## Quote from the paper

Boxin Wang, Wei Ping, Lawrence McAfee, Peng Xu, Bo Li, Mohammad Shoeybi, Bryan Catanzaro (2023). InstructRetro: Instruction Tuning post Retrieval-Augmented Pretraining. arXiv:2310.07713v3. https://arxiv.org/abs/2310.07713v3

**BibTeX**

```
@misc{wang2023instructretro,
  title = {{InstructRetro: Instruction Tuning post Retrieval-Augmented Pretraining}},
  author = {Boxin Wang and Wei Ping and Lawrence McAfee and Peng Xu and Bo Li and Mohammad Shoeybi and Bryan Catanzaro},
  year = {2023},
  eprint = {2310.07713},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.07713v3}
}
```

## Other paper commentary

- [xRAG: Extreme Context Compression for Retrieval-augmented Generation with One Token](https://refivu.com/en/papers/8c00b36b-02ff-4ebf-9551-f33a03272544-xrag-extreme-context-compression-for-retrieval-augmented.md)
- [Scaling Laws For Data-Constrained Dense Retrieval](https://refivu.com/en/papers/9afdcf21-003a-43d4-967e-2743eca7bae1-scaling-laws-for-data-constrained-dense-retrieval.md)
- [Dense Passage Retrieval for Open-Domain Question Answering](https://refivu.com/en/papers/c44c51e1-e59a-4cb6-8e94-20a4b572abc0-dense-passage-retrieval-for-open-domain-question-answering.md)
- [Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks](https://refivu.com/en/papers/569bb9ab-8345-4766-a539-e7ffb7b1754e-retrieval-augmented-generation-for-knowledge-intensive-nlp.md)
- [EchoSpec: Training Search Agents to Weigh Evidence Above Echoes](https://refivu.com/en/papers/22f39cf0-d41a-4695-8d6b-0d26df622012-echospec-training-search-agents-to-weigh-evidence-above.md)
- [UniGraph: A Unified Graph-based Index for Dynamic Hybrid Dense-Sparse Vector Retrieval](https://refivu.com/en/papers/a5ee1bb8-7883-49ee-91f4-322d407f8039-unigraph-a-unified-graph-based-index-for-dynamic.md)
- [InstructBLIP: Towards General-purpose Vision-Language Models with Instruction Tuning](https://refivu.com/en/papers/a16f8bfe-f6f1-4e2b-a409-c76d2ed97fc3-instructblip-towards-general-purpose-vision-language-models.md)
- [Benchmarking Large Language Models for News Summarization](https://refivu.com/en/papers/403ef5da-5a1a-4165-8e2b-85961d56009c-benchmarking-large-language-models-for-news-summarization.md)
- [Statistical Uncertainty in Word Embeddings: GloVe-V](https://refivu.com/en/papers/7123c4fb-4192-4228-80d1-bb907af44980-statistical-uncertainty-in-word-embeddings-glove-v.md)
- [CLUE: A Chinese Language Understanding Evaluation Benchmark](https://refivu.com/en/papers/b4bc9096-0098-4c87-8ac2-865871c6cfda-clue-a-chinese-language-understanding-evaluation-benchmark.md)
- [ELEVATER: A Benchmark and Toolkit for Evaluating Language-Augmented Visual Models](https://refivu.com/en/papers/d3be8dc0-aaa4-4e80-84d7-1f3c5a5c7c5b-elevater-a-benchmark-and-toolkit-for-evaluating-language.md)
- [SEAHORSE: A Multilingual, Multifaceted Dataset for Summarization Evaluation](https://refivu.com/en/papers/01a68808-9d3a-4a53-a65f-3ebd9270c5dc-seahorse-a-multilingual-multifaceted-dataset-for.md)

## Terms in this paper

- [exact match](https://refivu.com/en/terms/f6e0295e5c92-exact-match)
- [retrieval-augmented generation](https://refivu.com/en/terms/86077612addb-retrieval-augmented-generation)
- [ROUGE](https://refivu.com/en/terms/b50ceb784ddd-rouge)
- [summarization](https://refivu.com/en/terms/1e45700d5a1c-summarization)
- [instruction tuning](https://refivu.com/en/terms/0a2a2d11f238-instruction-tuning)
- [GovReport](https://refivu.com/en/terms/19fddba27d40-govreport)
- [QMSum](https://refivu.com/en/terms/8aa84c764cd0-qmsum)
- [SQuAD 1.1](https://refivu.com/en/terms/d3a3fd11ed33-squad-1-1)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/dd0abb30-a6bc-4a8d-9d46-a2308c9cb88b-instructretro-instruction-tuning-post-retrieval-augmented)
