Skip to main content
QUICK REVIEW

[Paper Review] DC-BERT: Decoupling Question and Document for Efficient Contextual Encoding

Yuyu Zhang, Ping Nie|arXiv (Cornell University)|Feb 28, 2020
Topic ModelingComputer Science23 references10 citations
TL;DR

DC-BERT proposes a decoupled BERT framework that separately encodes questions and documents using dedicated online and offline BERT models, caching document encodings for fast retrieval. By replacing question-document concatenation with learnable global embeddings and Transformer-based interactions, it achieves over 10x speedup in document retrieval while retaining 98% of the QA performance of standard BERT-based rerankers.

ABSTRACT

Recent studies on open-domain question answering have achieved prominent performance improvement using pre-trained language models such as BERT. State-of-the-art approaches typically follow the "retrieve and read" pipeline and employ BERT-based reranker to filter retrieved documents before feeding them into the reader module. The BERT retriever takes as input the concatenation of question and each retrieved document. Despite the success of these approaches in terms of QA accuracy, due to the concatenation, they can barely handle high-throughput of incoming questions each with a large collection of retrieved documents. To address the efficiency problem, we propose DC-BERT, a decoupled contextual encoding framework that has dual BERT models: an online BERT which encodes the question only once, and an offline BERT which pre-encodes all the documents and caches their encodings. On SQuAD Open and Natural Questions Open datasets, DC-BERT achieves 10x speedup on document retrieval, while retaining most (about 98%) of the QA performance compared to state-of-the-art approaches for open-domain question answering.

Motivation & Objective

  • Address the inefficiency of BERT-based document rerankers that re-encode the same question for every retrieved document.
  • Enable high-throughput open-domain question answering by decoupling question and document encoding.
  • Maintain high retrieval and answer accuracy while drastically reducing inference latency.
  • Explore a novel architecture that combines local context encoding with global question-document interaction via learnable embeddings and Transformers.

Proposed method

  • Decompose BERT into two separate models: an online BERT for single-question encoding and an offline BERT for pre-encoding and caching all documents.
  • Use local BERT layers to encode question and document independently, preserving syntactic and semantic information in lower layers.
  • Introduce trainable global position and type embeddings to model cross-attention between question and document representations.
  • Apply multiple Transformer layers on top of the decoupled encodings to enable rich question-document interactions.
  • Cache document embeddings offline to eliminate repeated encoding during inference, enabling instant retrieval.
  • Apply the framework to document reranking, where efficiency is most critical due to large document sets per query.

Experimental results

Research questions

  • RQ1Can decoupling question and document encoding in BERT reduce inference latency without sacrificing retrieval accuracy?
  • RQ2How effective are learnable global embeddings and Transformer layers in modeling question-document interactions compared to concatenation?
  • RQ3What is the trade-off between model depth (number of Transformer layers) and inference speed in the decoupled framework?
  • RQ4How does the decoupled approach compare to model compression and distillation techniques in terms of speed and performance?

Key findings

  • DC-BERT achieves over 10x speedup in document retrieval compared to standard BERT-based rerankers, with minimal latency impact on real-time inference.
  • On SQuAD Open and Natural Questions Open, DC-BERT retains 98% of the answer exact match (EM) performance of the BERT-base baseline.
  • DC-BERT outperforms both quantized BERT and DistilBERT in both retrieval and answer accuracy, despite lower model capacity.
  • Ablation studies show that using Transformers for interaction layers yields significantly better performance than linear or LSTM-based alternatives.
  • Increasing the number of interaction Transformer layers improves QA performance but reduces speedup, demonstrating a clear trade-off between capacity and efficiency.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.