CS

[논문 리뷰] End-to-End Training of Neural Retrievers forOpen-Domain Question Answering(2021), RAG(4)

yoooon1009 2025. 5. 13. 09:20

Background

소속: Mila - Quebec AI Institute, NVIDIA

출판: ACL-IJCNLP 2021

인용: 104회

Abstract & 1 Introduction

open-domain question answering 문제를 해결하기 위해 supervised와 unsupervised 방법들이 활용되었다. 하지만 neural retriever를 위해 이 방법들을 가장 효과적으로 사용하는 방법에 대해서는 불분명하다. 본 논문에서는 retriever pre-training을 체계적으로 연구한다.

  1. unsupervised pre-training을 수행하고 supervised fine-tuning을 수행하는 방법을 제안
  2. reader와 retriever의 end-to-end training을 위한 두 가지 방식에 대해 탐구
    • Individual Top-k: 하나의 상위 문서로부터 최종 문장이 생성될 확률들을 예측하고 모든 문서들에 대한 예측들에 대해 합산함
    • Joint Top-k: 모든 상위 문서들을 고려했을 때 최종 문장이 생성될 확률을 예측함

2 Neural Retriever

2.1 Background

question $q$와 evidence $\mathcal{Z} = \{z_1, ..., z_m\}$이 주어지면, retriever는 question에 따라 evidence document의 순위를 매기고 상위 순위의 document를 출력한다. retriever은 dual-encoder model로 두 개의 모듈 question encoder와 context encoder로 구성된다. dual-encoder model의 학습 방법은 다음과 같다.

$$ s(q, z_i; \phi) = f_Q (q)^\top f_Z (z_i) $$

$$ p(z_i \mid q, \mathcal{Z} ; \phi) = \frac{\exp(s(q, z_i; \phi))/ \tau}{\sum_{j=1}^{|\mathcal{Z}|}\exp(s(q, z_j; \phi)/ \tau)}$$

  • $ s(q, z_i; \phi) = f_Q (q)^\top f_Z (z_i) $: dot-product를 수행해 question과 context사이의 relevance score를 계산
  • $ p(z_i \mid q, \mathcal{Z} ; \phi)$: $q$에 대해서 $\mathcal{Z}$를 기반으로 $z_i$가 예측될 확률($z_i$에 대한 softmax). $\tau$는 스케일러

2.2 Training

In this section, we discuss different approaches to train the retriever. In all the approaches, we initialize the parameters of both the question and context encoders using BERT weights

2.2.1 Supervised Training

In the supervised setting, human-annotated questions, answers, and sometimes context are provided.

2.2.2 Unsupervised Training

  • Inverse Cloze Task (ICT): a randomly sampled sentence from a paragraph is considered as the query while other sentences as the context.
  • Masked salient spans training
더보기

OpenQA에서 unsupervised learning

  • Inverse Cloze Task (ICT): 주어진 문서에서 빠진 문장을 맞히는 훈련을 하는 self-supervised 학습 기법. 정답 레이블이 없어도 자동으로 생성할 수 있어서 대규모 학습에 적합하고 문장 간 의미 관계를 잘 파악할 수 있음
  • masked salient span: 문장에서 정보적으로 중요한 구간(예: ‘Barack Obama’, ‘2008’, ‘climate change’ 등) 선택해 가리고, 그것을 예측하도록 훈련. QA처럼 문서 내에서 중요한 정보를 예측해야 하는 task에 유리

2.3 Proposed Approach: Unsupervised Pre-training and Supervised Finetuning

we first pre-train the retriever weights with ICT training or masked salient spans training (Sec. 2.2.2). After pre-training, we finetune the retriever with supervised training (Sec. 2.2.1).

 

3 End-to-End Retriever and Reader Training

Background and notation

$$ \mathcal{K} = \underset{z_i \in \mathcal{Z}}{\arg\!\operatorname{sort}} \, s(q, z_i; \phi)[:k] $$

  • relevance score를 기준으로 상위 k개의 context documents $\mathcal{K}$를 추출함

$$ p(a \mid q, z_i ; \theta) = \prod_{j=1}^N p(a_j \mid a_{1:j-1}, q, z_i ; \theta)$$

  • 앞서 생성된 토큰 $ a_{1:j-1}$, 쿼리 $q$, 관련 문서 $z_i$가 주어졌을 때 다음 토큰$a_j$이 생성될 확률. 그 확률들을 모든 토큰에 대해서 곱하여 최종적인 문장$a$이 생성될 확률.

3.1 Approach 1: Individual Top-k

하나의 상위 문서로부터 최종 문장이 생성될 확률들을 예측하고 모든 문서들에 대한 예측들에 대해 합산함

$$ p(a \mid q; \theta, \phi) = \sum_{z_i \in \mathcal{K}} p(a \mid q, z_i ; \theta) p(z_i \mid q, \mathcal{Z}; \phi)  $$

  • $ p(z_i \mid q, \mathcal{Z}; \phi) $: 질문 $q$로부터 $z_i$를 검색
  • $ p(a \mid q, z_i ; \theta) $: 질문 $q$와 검색된 하나의 문서 $z_i$로부터 $a$를 생성할 확률
  • $ \sum_{z_i \in \mathcal{K}} $: 문서들에 대한 예측들을 합산

3.2 Approach 2: Joint Top-k

모든 상위 문서들을 고려했을 때 최종 문장이 생성될 확률을 예측함

$$ p(a \mid q; \theta, \phi) = p(a \mid q, z_{1:k}, p(z \mid q, \mathcal{Z}; \phi); \theta) $$

  • $ p(z \mid q, \mathcal{Z}; \phi) $: 질문과 연관된 문서를 검색함
  • $\theta$의 encoder: 각 검색된 문서를 question과 연결해서 encoder에 입력하고 hidden representation을 출력함.
  • $\theta$의 decoder: 출력된 모든 hidden representations을 쌓아서(하나의 긴 시퀀스로 만들어서) decoder에 입력함.

$$ \operatorname{attn}(q, a, z_{1:k}) \propto Q(a)^\top K(z_{1:k}, q) + \lambda p (z \mid q; \phi) $$

  • $ Q(a)^\top K(z_{1:k}, q) $: attention 수행할 때 유사성 점수랑 문서가 선택될 확률이 반영됨.

4 Experimental Setup

In this section, we describe the datasets and model settings.

5 Results: Retriever Training

5.1 Effect of Relevance Score Scaling, Longer Training, and Hard Negatives

  • DPR을 BERT로 초기화, 40 epoch까지 학습, [CLS] 토큰을 활용
  • relevance score scaling 적용하고 80 epoch까지 학습
  • relevance score scaling 적용하고 80 epoch까지 학습+hard-negative 예제를 하나 포함 
  • 제안된 방법을 모두 적용했을 때 가장 성능이 우수함

5.2 Effect of Retriever Initialization

  • BERT(zero-shot)보다 ICT(zero-shot)가 우수하고, masked salient spans 훈련으로 더 성능이 향상됨. 이런 pre-trainined weights를 사용하는 것이 효과적임
  • ICT와 masked salient spans으로 pre-training 한 후에 supervised로 fine-tuning하면 성능이 더 개선

5.4 Effect of End-to-End Training

  • Individual Top-k 방식으로 최적화할 때 가장 성능이 우수

6 Results: Answer Extraction

6.1 Individual Top-k Approach

  • Our improved results are because of a more accurate initial retriever, stronger reader, and updating both the query and context encoders during training
  • 제안한 방법이 가장 우수함
  • document 수가 늘어난다고해서 성능이 비례해서 향상되지는 않

6.2 Joint Top-k Approach

  • 제안한 방법이 가장 우수함
  • document 수가 늘어날 수록 성능이 향상됨

8 Conclusion

We first perform a systematic investigation of the importance of pre-training with ICT and masked salient spans tasks for supervised training of the retriever.

the reader considers each retrieved document individually while in the other approach where the reader considers all the retrieved documents jointly.

반응형