Skip to main content
QUICK REVIEW

[논문 리뷰] In-context Pretraining: Language Modeling Beyond Document Boundaries

Weijia Shi, Sewon Min|arXiv (Cornell University)|2023. 10. 16.
Topic ModelingComputer Science인용 수 3
한 줄 요약

이 논문은 문맥 내 미리 훈련(In-Context Pretraining)을 소개한다. 이는 의미적으로 관련된 문서들을 함께 묶어 pretraining 데이터를 재정렬함으로써 언어 모델이 문서 간 경계를 초월해 추론할 수 있도록 하는 확장 가능한 방법이다. 근사 최근접 이웃 검색과 그래프 기반 정렬을 활용함으로써, 기존의 pretraining 파이pline을 수정하지 않고도 in-context learning(+8%), 독해력(+15%), 신뢰성(+16%)에서 성능 향상을 이룬다.

ABSTRACT

Large language models (LMs) are currently trained to predict tokens given document prefixes, enabling them to directly perform long-form generation and prompting-style tasks which can be reduced to document completion. Existing pretraining pipelines train LMs by concatenating random sets of short documents to create input contexts but the prior documents provide no signal for predicting the next document. We instead present In-Context Pretraining, a new approach where language models are pretrained on a sequence of related documents, thereby explicitly encouraging them to read and reason across document boundaries. We can do In-Context Pretraining by simply changing the document ordering so that each context contains related documents, and directly applying existing pretraining pipelines. However, this document sorting problem is challenging. There are billions of documents and we would like the sort to maximize contextual similarity for every document without repeating any data. To do this, we introduce approximate algorithms for finding related documents with efficient nearest neighbor search and constructing coherent input contexts with a graph traversal algorithm. Our experiments show In-Context Pretraining offers a simple and scalable approach to significantly enhance LMs'performance: we see notable improvements in tasks that require more complex contextual reasoning, including in-context learning (+8%), reading comprehension (+15%), faithfulness to previous contexts (+16%), long-context reasoning (+5%), and retrieval augmentation (+9%).

연구 동기 및 목표

  • 표준 미리 훈련 방식에서 무작위로 연결된 문서들이 문서 간 신호를 제공하지 못하는 한계를 해결하기 위해, 의미적으로 유사한 문서들을 묶어 훈련 데이터를 재정렬한다.
  • 기존의 pretraining 파이pline을 수정하지 않고도, 단순하고 확장 가능한 훈련 데이터 재정렬을 통해 언어 모델이 개별 문서 경계를 초월해 문맥 기반 추론을 학습할 수 있도록 한다.
  • 데이터 반복을 방지하면서도 대규모 문서 검색과 일관된 문맥 구성에 효율적인 근사 알고리즘을 개발한다.
  • 의미적으로 일관된 다중 문서 문맥에서 훈련하면 복잡한 추론이 필요한 최종 작업에서 성능 향상이 이루어지는지 평가한다.
  • 이 방법이 기존의 pretraining 파이pline을 수정하지 않고도 언어 모델의 언어 이해 및 추론 능력을 향상시킬 수 있음을 입증한다.

제안 방법

  • 임베딩 공간에서의 근사 최근접 이웃 검색과 함께, 검색 모델을 활용해 의미적으로 유사한 문서들을 묶어 pretraining 데이터를 재정렬한다.
  • 문서 정렬을 여행하는 상인 문제(TSP)로 간주하고, 유사도를 극대화하고 반복을 방지하기 위해 그래프 탐색 알고리즘을 사용해 일관된 입력 문맥을 구성한다.
  • 기존의 pretraining 파이pline을 그대로 유지하면서 데이터 전처리 단계에서만 문서 순서를 변경함으로써, 모든 다른 훈련 구성 요소를 그대로 유지한다.
  • 임베딩 유사도 기반으로 근접한 문서를 식별하기 위해 의미 기반 검색 모델을 사용하여, 스케일링 가능한 관련 문서 시퀀스 구축을 가능하게 한다.
  • 재정렬된 일관된 입력에 대해 동일한 pretraining 목표(마스크된 언어 모델링)를 적용하여, 모델이 문서 간 추론을 학습하도록 한다.
  • 효율성과 일관성을 유지하기 위해 최적화된 색인과 근사 검색을 활용해 수십억 개의 문서에 대해 이 방법을 스케일링한다.
Figure 1: Overview of In-Context Pretraining . Different from the standard pretraining strategy that place randomly shuffled documents in the input context, In-Context Pretraining places related documents in the same context, making models learn to reason across prior documents. For example, when pr
Figure 1: Overview of In-Context Pretraining . Different from the standard pretraining strategy that place randomly shuffled documents in the input context, In-Context Pretraining places related documents in the same context, making models learn to reason across prior documents. For example, when pr

실험 결과

연구 질문

  • RQ1의미적으로 관련된 문서의 시퀀스에서 훈련된 언어 모델이 문서 경계를 초월해 추론 능력을 향상시킬 수 있는가?
  • RQ2의미적 유사도를 극대화하고 데이터 반복을 방지하면서도, 수십억 개의 문서에 대해 효율적으로 문서 재정렬을 수행할 수 있는가?
  • RQ3In-Context Pretraining이 복잡한 문맥 이해가 필요한 최종 작업에서 측정 가능한 성능 향상을 이끌어내는가?
  • RQ4In-Context Pretraining의 성능은 in-context learning 및 독해력 테스크에서 표준 미리 훈련 방식과 비교해 어떻게 다른가?
  • RQ5이 방법은 아키텍처 변경 없이 기존의 pretraining 파이pline에 통합될 수 있는가?

주요 결과

  • In-Context Pretraining은 8개의 벤치마크 데이터셋 평균으로 in-context learning 성능을 8% 향상시켰다.
  • 8개의 최종 독해력 작업 평균으로 독해력 정확도가 15% 향상되었다.
  • 모델 출력의 신뢰성이 평균 16% 향상되어 환상적이고 일관성 없는 출력이 감소했다.
  • 장문의 문맥 추론 작업에서는 성능이 5% 향상되어 확장된 문맥 창의 더 효과적으로 활용됨을 시사했다.
  • 위키피디아 외부 지식을 활용한 검색 증강 생성 테스크에서는 9%의 성능 향상이 이루어졌다.
  • 이러한 성과는 pretraining 목표나 아키텍처를 수정하지 않고, 오직 훈련 데이터의 순서만 재정렬함으로써 달성되었다.
Figure 2: Illustration of In-Context Pretraining . In-Context Pretraining first finds related documents at scale to create a document graph (§ 2.1 ) and then builds pretraining input contexts by traversing the document graph (§ 2.2 ). Along the path, documents are concatenated into a sequence and su
Figure 2: Illustration of In-Context Pretraining . In-Context Pretraining first finds related documents at scale to create a document graph (§ 2.1 ) and then builds pretraining input contexts by traversing the document graph (§ 2.2 ). Along the path, documents are concatenated into a sequence and su

더 나은 연구,지금 바로 시작하세요

논문 읽기부터 검토까지, 연구 시간을 획기적으로 줄여보세요.

카드 등록 없음 · 무료 플랜 제공

이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.