Attention-Guided Answer Distillation for Machine Reading Comprehension

Minghao Hu, Yuxing Peng, Furu Wei, Zhen Huang, Dongsheng Li, Nan Yang, Ming Zhou

Introduction

Machine Reading Comprehension (MRC) has achieved significant performance gains, largely driven by the use of large-scale ensemble models. However, these ensembles—often comprising 10 to 30 individual models—are computationally expensive and slow, making them impractical for real-time deployment. Furthermore, even state-of-the-art models remain vulnerable to adversarial attacks, where semantically irrelevant "distractor" sentences can easily mislead the system.

To address these challenges, researchers have developed Attention-guided Answer Distillation (A2D). This framework leverages Knowledge Distillation (KD) to compress a heavy teacher ensemble into a single, efficient student model. Crucially, A2D goes beyond traditional distillation by teaching the student to ignore confusing distractors and mimic the teacher's internal reasoning via attention maps.

The A2D Framework

The A2D approach integrates three distinct distillation strategies to transfer knowledge effectively:

  1. Vanilla Knowledge Distillation: The student is trained to match the teacher’s output probability distributions for the start and end positions of the answer span.
  2. Answer Distillation: Recognizing that teachers can be biased by clever distractors, A2D identifies "confusing answers"—incorrect spans with high teacher confidence. A margin ranking loss is employed to explicitly penalize the student for high confidence in these distractors, fostering a more "skeptical" and robust model.
  3. Attention Distillation: Rather than just mimicking final outputs, the student learns to replicate the teacher's attention maps. These maps represent the semantic relationships between question and passage tokens, providing a rich signal that captures the model's underlying reasoning process more efficiently than raw hidden states.
The A2D framework combines vanilla KD, answer distillation to handle distractors, and attention distillation to capture reasoning.

Experimental Results

The A2D framework was evaluated on the SQuAD, Adversarial SQuAD, and NarrativeQA benchmarks. The results demonstrate that the distilled student model achieves a remarkable balance between efficiency and accuracy.

  • Efficiency: The student model provides a 12.3x speedup in inference time compared to the 12-model teacher ensemble.
  • Performance: On the SQuAD test set, the student achieved an 88.1 F1 score, nearly matching the ensemble's 88.5 F1 and significantly outperforming a standard single model (86.6 F1).
  • Robustness: In adversarial settings (e.g., the "AddSent" dataset), the student model (61.3 F1) actually outperformed its teacher ensemble (61.1 F1). This suggests that the distillation process, particularly the focus on confusing answers, acts as a powerful regularizer.
Comparison of answer probability distributions: the distilled model correctly identifies the target answer (2.8%), whereas the baseline is misled by a distractor (56.2%).

Discussion and Insights

A key finding of this work is that the "teacher" is not always an infallible oracle. By explicitly modeling the teacher's failures—specifically its over-confidence in distracting spans—the student can learn to surpass the master in robustness. Additionally, distilling the attention matrix proved to be a compact and effective way to transfer complex reasoning capabilities without the computational overhead of matching high-dimensional hidden states.

Future research will explore weighting distillation signals based on teacher prediction quality and extending these techniques to other NLP tasks like Natural Language Inference (NLI).

Conclusion

A2D successfully bridges the gap between the high performance of ensemble models and the efficiency required for real-world applications. By guiding the distillation process with attention and adversarial awareness, we can produce single models that are not only fast but also more resilient than the ensembles from which they were derived.

Summary updated

BibTeX
@inproceedings{hu2018attention,
  author = {Minghao Hu and Yuxing Peng and Furu Wei and Zhen Huang and Dongsheng Li and Nan Yang and Ming Zhou},
  title = {{Attention-Guided Answer Distillation for Machine Reading Comprehension}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2018},
  doi = {10.18653/v1/d18-1232},
}
Figure