Skip to main content
QUICK REVIEW

[논문 리뷰] Retrieval-Pretrained Transformer: Long-range Language Modeling with Self-retrieval

Ohad Rubin, Jonathan Berant|arXiv (Cornell University)|2023. 06. 23.
Topic ModelingComputer Science인용 수 3
한 줄 요약

Retro-Pretrained Transformer(RPT)는 자체 검색을 통해 장기적 맥락 생성을 위한 의미적으로 관련된 과거 청크를 검색하는 공동 최적화된 검색기와 함께, 완전히 새로 학습된 검색 보강 언어 모델이다. RPT는 참조 언어 모델을 사용하여 다음 토큰 예측의 가능성도 최대화하는 의미적 목표를 통해 검색기를 학습함으로써, 책, 코드, 수학적 글쓰기 등 네 가지 장기형 작업에서 최신 기준을 달성한 퍼플렉서티를 달성한다. 이는 강력한 베이스라인을 능가하면서도 검색 품질도 향상시킨다.

ABSTRACT

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.

연구 동기 및 목표

  • 기존의 검색 보강 언어 모델(RALM)이 검색기를 외부 또는 고정된 구성요소로 간주하여 언어 모델과 함께 공동으로 학습하지 않는 한계를 해결하기 위해.
  • 언어 모델과 검색기를 완전히 새로 학습하면서 상호 적응을 가능하게 하여 장기 맥락 모델링을 향상시키기 위해.
  • 모델의 자체 은닉 상태에서 파생된 쿼리 표현을 사용하여 의미적으로 관련된 과거 텍스트 청크를 검색함으로써 장거리 언어 모델링을 향상시키기 위해.
  • 참조 스코링 언어 모델을 지도로 사용하여, 검색된 컨텍스트를 바탕으로 다음 타겟 청크의 확률을 높이는 것을 유도하는 의미적 목표를 통해 검색기를 학습하기 위해.
  • 의미 기반 검색을 통한 엔드 투 엔드 학습이 어휘적 또는 고정된 검색기 베이스라인보다 더 나은 성능과 더 높은 품질의 검색을 이끌 수 있음을 입증하기 위해.

제안 방법

  • RPT는 자체 검색을 사용한다: 검색을 위한 쿼리 표현은 최근에 생성된 텍스트 청크의 디코더 은닉 상태에서 직접 유도된다.
  • 검색기는 밀도 벡터 유사도 기반 메커니즘을 사용하여, 수천, 수만 토큰 전의 문서에서 의미적으로 관련된 과거 청크를 검색한다.
  • 검색된 표현은 청크 단위의 셸프 크로스 어텐션을 통해 디코더에 융합되어 장거리 정보의 맥락화된 통합을 가능하게 한다.
  • 검색기는 보조 손실을 통해 학습되며, 이는 참조 언어 모델을 스코링 함수로 사용하여 검색된 컨텍스트와 현재 컨텍스트를 바탕으로 다음 타겟 청크의 확률을 최대화하는 데 목적이 있다.
  • 학습 목표는 표준 언어 모델링 손실과 검색 전용 손실을 조합하여, 검색이 최종 생성 성능과 일치하도록 한다.
  • 전체 아키텍처는 외부 데이터에 대한 사전 학습 없이 완전히 새로 학습되며, 검색기 인덱스는 순방향 전파를 통해 계산되어 테스트 시기 인덱스 업데이트가 필요 없다.
Figure 1: Retrieval-Pretrained Transformer (RPT) is a language model for long texts (e.g., books) trained from scratch with a native retrieval ability. RPT takes a chunk of text as input, retrieves semantically-relevant chunks from the past to better predict the next chunk, and fuses these retrieved
Figure 1: Retrieval-Pretrained Transformer (RPT) is a language model for long texts (e.g., books) trained from scratch with a native retrieval ability. RPT takes a chunk of text as input, retrieves semantically-relevant chunks from the past to better predict the next chunk, and fuses these retrieved

실험 결과

연구 질문

  • RQ1언어 모델과 함께 완전히 새로 학습된 검색기를 사용할 경우, 사전 학습 후 추가되는 방식의 검색기와 비교해 장기 맥락 성능이 향상되는가?
  • RQ2모델의 자체 표현을 사용해 과거 컨텐츠를 쿼리하는 자체 검색(Self-retrieval)이 장기형 텍스트에서 검색 품질과 생성 성능을 향상시키는가?
  • RQ3다음 토큰 예측 가능성을 최대화하는 의미 기반 검색 목표가 어휘적 또는 고정된 검색기 베이스라인을 능가하는가?
  • RQ4CCA, TRIME, RETRO와 같은 강력한 베이스라인과 비교했을 때, RPT는 다양한 장기형 작업에서 퍼플렉서티와 검색 품질 측면에서 어떻게 성능을 내는가?
  • RQ5어휘 기반 검색 방법인 BM25와 비교했을 때, 사전 학습 없이 의미 목표를 통해 학습된 검색기가 성능을 뛰어넘을 수 있는가?

주요 결과

  • RPT는 책, 코드, 수학적 글쓰기, 대화 등 네 가지 장거리 언어 모델링 작업에서 최신 기준 퍼플렉서티를 달성하였으며, CCA 및 TRIME와 같은 강력한 베이스라인을 능가한다.
  • BM25와 같은 어휘 기반 베이스라인과 비교했을 때, RPT의 검색기는 더 높은 품질의 의미적으로 관련된 청크를 검색한다. 이는 다음 토큰 예측 가능성 향상으로 입증된다.
  • 완전히 새로 학습한 공동 학습은 검색기와 언어 모델 간의 상호 적응을 가능하게 하여, 고정되거나 별도로 사전 학습된 검색기를 사용하는 모델보다 더 뛰어난 성능을 이끈다.
  • 참조 언어 모델을 통해 다음 토큰 가능성 확률을 최대화하는 의미 기반 검색 목표는 어휘적 또는 히وري스틱 지도보다 더 효과적인 검색을 이끈다.
  • RPT는 엔드 투 엔드 학습을 통해 자체 검색과 의미 지도를 통합함으로써, 사전 학습된 검색기나 테스트 시기 전용 검색에 의존하는 모델을 능가할 수 있음을 보여준다.
  • 다양한 도메인에서 일관된 퍼플렉서티 향상과 검색 품질 향상을 보이며, 이는 장기형 생성 작업에 광범위하게 적용 가능함을 시사한다.
Figure 2: The architecture of the Retrieval-Pretrained Transformer , where an input of 45 tokens is shown, consisting of 9 chunks, and causal self-attention is applied over 15 tokens. The left side shows the decoder stack, where the bottom $\frac{n_{\text{layers}}}{2}$ are standard Transformer decod
Figure 2: The architecture of the Retrieval-Pretrained Transformer , where an input of 45 tokens is shown, consisting of 9 chunks, and causal self-attention is applied over 15 tokens. The left side shows the decoder stack, where the bottom $\frac{n_{\text{layers}}}{2}$ are standard Transformer decod

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.