Skip to main content
QUICK REVIEW

[Paper Review] Making Neural Machine Reading Comprehension Faster

Debajyoti Chatterjee|arXiv (Cornell University)|Mar 29, 2019
Topic ModelingComputer Science39 references6 citations
TL;DR

This paper proposes a faster neural machine reading comprehension model using knowledge distillation to compress BERT into smaller, efficient architectures: a convolutional model (CONV MODEL) and a distilled BERT-small variant (BERT SMALL). The CONV MODEL achieves 79.80 F1 with 774 samples/sec inference speed, while BERT SMALL reaches 85.57 F1 at 217 samples/sec, significantly outperforming prior models in speed and accuracy trade-offs.

ABSTRACT

This study aims at solving the Machine Reading Comprehension problem where questions have to be answered given a context passage. The challenge is to develop a computationally faster model which will have improved inference time. State of the art in many natural language understanding tasks, BERT model, has been used and knowledge distillation method has been applied to train two smaller models. The developed models are compared with other models which have been developed with the same intention.

Motivation & Objective

  • Develop a computationally faster neural machine reading comprehension (MRC) model to enable real-time deployment.
  • Address the slow inference speed of RNN-based and attention-heavy models like BERT, especially on long contexts.
  • Improve inference efficiency without sacrificing answer accuracy by leveraging knowledge distillation.
  • Explore the effectiveness of convolutional architectures as an alternative to recurrent models in MRC.
  • Evaluate the performance and speed trade-offs of distilled BERT and convolutional models on the SQuAD benchmark.

Proposed method

  • Train a CONV MODEL using multi-window convolutional layers to capture local and global context, replacing RNNs with CNNs and self-attention.
  • Integrate a Transformer encoder layer after the multi-window convolution to model long-range dependencies.
  • Apply knowledge distillation from a fine-tuned BERT BASE model to transfer knowledge into smaller models (CONV MODEL and BERT SMALL).
  • Use soft labels from the teacher model (BERT BASE) during training to improve generalization and reduce overfitting.
  • Optimize the models using ADAM with linear warmup and cosine decay learning rate schedules, along with L2 weight decay and dropout.
  • Implement a span prediction layer to predict start and end positions of answers in the context passage.

Experimental results

Research questions

  • RQ1Can a convolutional neural network architecture achieve faster inference speed than RNN-based or attention-only models in MRC?
  • RQ2To what extent does knowledge distillation improve the performance of smaller models without increasing model capacity?
  • RQ3How does the multi-window convolution layer compare to a single convolutional window in terms of F1 score and robustness?
  • RQ4Can a distilled BERT model with only 6 layers (BERT SMALL) achieve performance close to BERT BASE while reducing computational cost?
  • RQ5What is the trade-off between inference speed and answer accuracy across different MRC model architectures?

Key findings

  • The CONV MODEL achieved an F1 score of 79.80 with an inference speed of 774 samples per second, outperforming FABIR (672 samples/sec) and QANet (163 samples/sec) in speed.
  • The BERT SMALL model achieved the highest F1 score of 85.57 among all models tested, approaching the teacher model’s performance (88.32) despite having only 6 layers.
  • The multi-window convolution layer improved F1 by 1.33 points compared to a single 7-kernel-size convolution, demonstrating the benefit of capturing diverse n-gram patterns.
  • Knowledge distillation increased the F1 score of the CONV MODEL from 72.33 (without distillation) to 79.80, reducing overfitting and improving generalization.
  • The BERT SMALL model reduced computational cost by approximately half compared to BERT BASE, while maintaining strong performance.
  • The CONV MODEL with a single 7-kernel convolution achieved 829 samples/sec, the fastest inference speed, but at the cost of a 1.33-point drop in F1 compared to the full CONV MODEL.

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.