논문 해설
InstructRetro: Instruction Tuning post Retrieval-Augmented Pretraining
InstructRetro: 검색 증강 pre-training 이후의 지시 튜닝
- 연구 문제 대규모 검색 증강 LLM에서 명령어 튜닝 후 제로샷 일반화가 좋아지는지가 연구 질문입니다.
- 연구 방법 사전학습된 GPT 43B에서 Retro 48B를 계속 사전학습하고 명령어 튜닝하여 InstructRetro를 만듭니다.
- 주요 결과 InstructRetro 43B는 기준 모델 대비 단답형 QA, 장문형 QA, 요약에서 향상을 보였습니다.
연구 문제와 기존 한계
검색 증강 언어 모델은 perplexity와 사실성 측면에서 장점이 보고되었지만, 기존 Retro는 7.5B 파라미터 수준에 머물러 있었습니다. 이 규모에서는 명령어 튜닝과 제로샷 일반화의 효과가 충분히 드러나기 어렵습니다. 이 논문은 검색 증강 pre-training을 대규모 디코더 중심 LLM으로 확장할 때 명령어 튜닝 후 제로샷 성능이 좋아지는지를 묻습니다. 원문은 Retro 계열이 대규모로 명령어 튜닝된 사례가 없었다고 설명하며, 이 논문은 그 공백을 메우는 것을 목표로 합니다.
핵심 변경점은 새로 처음부터 학습하지 않고, 사전학습된 43B GPT 모델을 출발점으로 삼아 1.2조 토큰 검색 데이터베이스를 사용해 100B 토큰을 추가로 검색 증강 사전학습하는 것입니다. 이렇게 얻은 Retro 48B를 명령어 튜닝한 InstructRetro가 본문의 주된 비교 대상이 됩니다.

Figure 1 . Training pipeline for InstructRetro 48B and InstructRetro 43B.
원문 · CC BY 4.0 · Boxin Wang, Wei Ping, Lawrence McAfee, Peng Xu, Bo Li, Mohammad Shoeybi, Bryan Catanzaro · InstructRetro: Instruction Tuning post Retrieval-Augmented Pretraining · 원문 그림 인용 · 원본 PDF 3쪽에서 그림 영역을 추출했습니다.Retro 구조와 검색 데이터베이스
Retro는 GPT 계열 디코더 백본에 검색 이웃을 인코딩하는 얕은 양방향 트랜스포머 인코더와 청크 단위 교차 어텐션을 추가한 자기회귀 모델입니다. 이 논문에서 인코더는 2층이며 디코더와 같은 은닉 차원을 사용합니다.
입력 시퀀스는 청크로 나뉩니다. 이전 청크로 k개의 최근접 이웃을 검색하고, 그 정보를 교차 어텐션으로 다음 청크 생성에 융합합니다. 인과성을 지키기 위해 i번째 청크의 생성은 현재 청크가 아니라 이전 청크의 이웃만 사용합니다. 이 논문은 청크 크기를 64, k를 2로 설정합니다.
검색 데이터베이스는 pre-training 코퍼스 전체를 사용하며 1%는 검증용으로 보류됩니다. 데이터베이스는 BERT 임베딩을 키로, 청크 토큰을 값으로 가지고 19B개 청크로 구성됩니다. 이 설계는 Retro와 GPT가 같은 양의 pre-training 정보를 보도록 맞추는 역할을 합니다.
Retro-fitting과 디코더 비동결
이 논문은 Retro를 처음부터 학습하지 않고 Retro-fitting으로 만듭니다. 사전학습된 GPT 파라미터로 Retro 디코더를 초기화하고, 인코더와 교차 어텐션은 무작위로 초기화한 뒤 검색 증강 pre-training을 계속합니다. Retro 디코더가 백본 디코더를 공유하며 추가 파라미터가 약 10% 수준이라는 점이 이 방식을 가능하게 합니다.
Borgeaud 등의 Retro는 사전학습된 디코더를 동결하지만, 이 논문은 디코더 파라미터를 동결하지 않고 전체 모델을 계속 학습합니다. 원문의 823M 모델 실험에서는 디코더를 풀어 학습한 경우 동일 학습 일정에서 검증 perplexity가 더 빠르게 낮아지고 최종적으로 더 좋은 값을 보였습니다. 이 비교는 823M 모델과 100B 토큰 조건에 한정됩니다.

Figure 3 . Validation perplexity of Retro-fitting (823M) when we freeze or unfreeze Retro decoder during continued pretraining on 100B tokens.
원문 · CC BY 4.0 · Boxin Wang, Wei Ping, Lawrence McAfee, Peng Xu, Bo Li, Mohammad Shoeybi, Bryan Catanzaro · InstructRetro: Instruction Tuning post Retrieval-Augmented Pretraining · 원문 그림 인용 · 원본 PDF 5쪽에서 그림 영역을 추출했습니다.계속 pre-training은 추가 100B 토큰으로 수행되며, 이는 GPT pre-training 데이터의 9%에 해당합니다. 공정 비교를 위해 같은 100B 토큰으로 GPT를 계속 학습한 GPT-fitting 모델도 함께 둡니다.
pre-training perplexity 비교
검증 perplexity는 pre-training 코퍼스에서 보류한 1% 샘플로 측정됩니다. 이 샘플은 pre-training, 계속 pre-training, 검색 데이터베이스 어디에도 쓰이지 않아 누출을 막습니다.
결과에서 GPT-fitting은 원래 pre-training GPT보다 약간 개선되는 반면, Retro는 모든 파라미터 규모에서 GPT와 GPT-fitting을 크게 앞섭니다. 원문에 따르면 Retro는 4배 큰 GPT 모델과 비슷한 perplexity에 도달하며, 격차는 8B에서 48B까지 줄지 않습니다. 이 결과는 pre-training perplexity에 대한 것이며 명령어 튜닝 후 성능과 직접 같은 지표가 아닙니다.

Figure 2 . Perplexity evaluation of pretrained GPT models, GPT-fitting, and Retro-fitting models across various parameter sizes on the held-out validation set. In contrast to Borgeaud et al. (2022), we unfreeze all parameters for Retro-fitting. Retro significantly outperforms GPT models, achieving the perplexity comparable to GPT models with 4× larger parameter sizes.
원문 · CC BY 4.0 · Boxin Wang, Wei Ping, Lawrence McAfee, Peng Xu, Bo Li, Mohammad Shoeybi, Bryan Catanzaro · InstructRetro: Instruction Tuning post Retrieval-Augmented Pretraining · 원문 그림 인용 · 원본 PDF 5쪽에서 그림 영역을 추출했습니다.명령어 튜닝 데이터와 학습 방식
명령어 튜닝은 대화 형식으로 통일된 데이터를 사용하며, SODA, ELI5, Self-Instruct, Unnatural Instructions, FLAN, Chain-of-thought, OpenAssistant, Dolly 등과 pre-training 코퍼스 일부를 혼합합니다. 전체 128K개 샘플이며 system, user, assistant 역할로 구성됩니다.
학습에서는 여러 턴의 대화를 문맥으로 보고 마지막 assistant 응답에만 손실을 적용합니다. 표준 언어 모델링 손실과 teacher forcing을 사용하며, 배치 크기 128, 학습률 5e-6, 1000 스텝, weight decay 0.01 설정이 원문에 기록됩니다. 이 설정은 InstructRetro와 InstructGPTRAG 43B 비교에서 사용된 조건입니다.

Table 9 . A sample conversation from our instruction tuning dataset. The black part serves as the context, while the black part is masked as the answer mask, on which the LM loss is computed.
원문 · CC BY 4.0 · Boxin Wang, Wei Ping, Lawrence McAfee, Peng Xu, Bo Li, Mohammad Shoeybi, Bryan Catanzaro · InstructRetro: Instruction Tuning post Retrieval-Augmented Pretraining · 원문 그림 인용 · 원본 PDF 16쪽에서 그림 영역을 추출했습니다.Retro 명령어 튜닝의 핵심은 인코더 처리입니다. 명령어 데이터에는 검색 이웃이 없으므로 교차 어텐션을 게이트로 우회합니다. 게이트가 0이면 인코더와 교차 어텐션은 갱신되지 않고 디코더 백본만 갱신됩니다. 이 설계는 추론 때도 인코더를 끈 GPT 디코더로 평가하는 근거가 됩니다.

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.
원문 · CC BY 4.0 · Boxin Wang, Wei Ping, Lawrence McAfee, Peng Xu, Bo Li, Mohammad Shoeybi, Bryan Catanzaro · InstructRetro: Instruction Tuning post Retrieval-Augmented Pretraining · 원문 그림 인용 · 원본 PDF 6쪽에서 그림 영역을 추출했습니다.QA와 요약 평가 결과
제로샷 평가는 주로 단답형 QA와 독해, 장문형 QA, 요약 과제에서 수행됩니다. 기준 모델은 같은 디코더 구조와 학습 데이터를 가진 InstructGPTRAG 43B입니다.
단답형 QA에서 InstructRetro 43B는 InstructGPTRAG 43B보다 여러 데이터셋에서 일관되게 높았고, 평균 상대 향상은 약 7%입니다. 장문형 QA 네 개 데이터셋에서는 평균 약 10% 향상이 보고됩니다. 요약 과제 세 개에서는 GovReport, SummFD, QMSum의 ROUGE1/2/L 기하평균을 사용하며, 평균 상대 향상은 약 16%입니다. 원문은 GovReport의 향상폭이 가장 크다고 보고합니다.

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.
원문 · CC BY 4.0 · Boxin Wang, Wei Ping, Lawrence McAfee, Peng Xu, Bo Li, Mohammad Shoeybi, Bryan Catanzaro · InstructRetro: Instruction Tuning post Retrieval-Augmented Pretraining · 원문 그림 인용 · 원본 PDF 8쪽에서 그림 영역을 추출했습니다.
Table 3 . Zero-shot evaluation on three summarization datasets. We use the standard ROUGE scores as the evaluation metrics. The
원문 · CC BY 4.0 · Boxin Wang, Wei Ping, Lawrence McAfee, Peng Xu, Bo Li, Mohammad Shoeybi, Bryan Catanzaro · InstructRetro: Instruction Tuning post Retrieval-Augmented Pretraining · 원문 그림 인용 · 원본 PDF 8쪽에서 그림 영역을 추출했습니다.이 수치들은 특정 모델과 데이터셋, 인코더를 끈 43B 디코더 조건에서 얻은 결과입니다. 48B 모델과 인코더 활성화 조건의 결과는 서로 비슷하게 보고되었으며, 이 비교는 같은 조건 안에서만 해석해야 합니다.
절제 실험과 규모별 해석
Natural Questions에서 명령어 튜닝 전후 GPT와 Retro의 EM 정확도를 비교한 결과, 명령어 튜닝 전에는 2.25B 규모에서 Retro가 GPT보다 제로샷 정확도가 높았습니다. 그러나 규모가 커지면 두 모델 모두 정확도가 포화되는 경향이 보고됩니다. 저자들은 이 포화가 pre-training 모델의 명령어 따르기 능력 부족 때문이라고 해석합니다.
명령어 튜닝 후에는 Retro 48B와 GPT 43B 모두 정확도가 크게 오르고, Retro 쪽의 이점이 더 뚜렷해졌습니다. 이 결과는 검색 증강 사전학〮과 명령어 튜닝이 함께 필요하다는 저자의 해석을 뒷받침하지만, 이것은 같은 Natural Questions 실험 안의 관찰입니다.
적용 범위와 한계
이 연구의 명령어 튜닝 실험은 검색 이웃이 없는 데이터에서 Retro 인코더를 끈 상태로 수행되었습니다. 따라서 인코더를 활성화한 명령어 튜닝이 같은 효과를 낼지는 이 논문에서 검증되지 않았으며, 저자들도 이를 향후 과제로 제시합니다.
또한 MT-Bench에서는 Tulu-v2 데이터로 튜닝한 InstructRetro와 InstructGPT를 비교했는데, Retro는 코딩과 역할극에서 상대적으로 낮았습니다. 저자들은 이를 기반 pre-training 데이터에 해당 도메인이 충분히 포함되지 않았기 때문으로 해석합니다. 검색 데이터베이스는 민감하거나 개인적인 정보를 포함할 수 있다는 점도 원문에서 언급됩니다.

Table 11 . Performance comparison of MT-Bench models
원문 · CC BY 4.0 · Boxin Wang, Wei Ping, Lawrence McAfee, Peng Xu, Bo Li, Mohammad Shoeybi, Bryan Catanzaro · InstructRetro: Instruction Tuning post Retrieval-Augmented Pretraining · 원문 그림 인용 · 원본 PDF 18쪽에서 그림 영역을 추출했습니다.논문 정보
- 저자
- Boxin Wang, Wei Ping, Lawrence McAfee, Peng Xu, Bo Li, Mohammad Shoeybi, Bryan Catanzaro
- 학회·저널
- arXiv · 프리프린트
- 최초 공개일
- 2023년 10월 11일
- 등록일
- 2026년 11월 5일
- 수정일
- 2024년 5월 29일
- 버전
- v3
- arXiv
- 2310.07713
- 분류
- cs.CL · cs.AI · cs.IR · cs.LG
- 원문 이용 조건
- CC BY 4.0
- 제공 범위
- 논문 정보, 해설, 허용된 원문 그림
AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.
초록
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.
원문 인용
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}
}