Dense Passage Retrieval for Open-Domain Question Answering
EMNLP 2020
本文提出只需要用少量的 question 和 passage pair 就能訓練 dense representation model 的方法,來解決
- TF-IDF 或是 BM25 受限於字詞上的比對,無法使用語意搜索
- 學習 dense-representation 需要大量資料來訓練
方法
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Dual-Encoder 架構
獨立的 question encoder 和 passage encoder 來幫 query 和 passage 產生 embedding,最佳化相關 question 和 passage 的 dot-product 相似度
Inference 階段
FAISS 搜索 和 之間的 dot-product 相似度
Encoders
BERT_base model,使用 CLS token
loss function
拉近 和 Positive 的距離,拉遠 Negative 距離
- Question
- Positive passages
- Negative passages
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
訓練重點在於如何選出難度高的 Negative passages,本文提出三種方式
- Random
- BM25: bm25 高相似度但不是答案
- Gold: positive passages paired with other questions
- In-batch negatives 方法可以減少運算,又帶來一定的效能
In-batch negatives
假設 batch 內有 questions,每個 question 都有和其相關的一個passages,D 為 question 和 passage embedding 的維度
我們可以得到相似矩陣 ,代表 queries 和 passages 的相似度
我們能重複利用計算好的 embedding,輸入 B 個 query 和其 passages 就能有 B-1 個 negative passages
實驗
資料集
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
由於 TREC, WebQuestions and TriviaQA 資料集內只提供 question 和 answer,沒有 passages,所以用 BM25 找出最高相似度且包含答案的 passage 當作 positive passage,如果 top-100 都不符合條件則捨去該 question。
QuAD and Natural Questions 已經提供 passages,將 passages 和 candidate pool 配對作為 positive passage
candidate pool: English Wikipedia dump from Dec. 20, 2018
分數
DPR 除了 SQUAD 都比 BM25 厲害
- Training 欄位表示 encoder 對於每個資料獨立 (single) 或是共用 (multi)
- 實驗設置為 negative 為 127 (in-batch) + 128 (BM25)
- 因為 TREC 資料集很小,透過 multi 的上升最多,
- TriviaQA 和 NQ 沒什麼提升甚至下降
- SQUAD 分數比 BM25 糟糕,推測是因為 SQUAD 是讓人類從 passage 中圈出答案,BM25 是字詞比對方式很適合在這資料集上
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Negative 選擇
額外為每個 query 選出 1~2個 BM 25最高分結果作為 negative
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Sample efficiency
DPR 在使用 1K 筆資料後的表現就比 BM25 好
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →