Skip to main content
QUICK REVIEW

[Paper Review] BERTQA -- Attention on Steroids

Ankit Chadha, Rewa Sood|arXiv (Cornell University)|Dec 14, 2019
Topic ModelingComputer Science6 references5 citations
TL;DR

BERTQA introduces directed coattention mechanisms—Context-to-Query (C2Q) and Query-to-Context (Q2C)—to BERT, enhancing answer span detection in SQuAD 2.0. By integrating these with residual connections and 1D convolutions for local feature extraction, the model achieves a 77.03 F1 on the base architecture and 82.317 F1/79.442 EM on the ensemble, significantly improving no-answer detection and generalization via a backtranslated dataset (SQUAD 2.Q).

ABSTRACT

In this work, we extend the Bidirectional Encoder Representations from Transformers (BERT) with an emphasis on directed coattention to obtain an improved F1 performance on the SQUAD2.0 dataset. The Transformer architecture on which BERT is based places hierarchical global attention on the concatenation of the context and query. Our additions to the BERT architecture augment this attention with a more focused context to query (C2Q) and query to context (Q2C) attention via a set of modified Transformer encoder units. In addition, we explore adding convolution-based feature extraction within the coattention architecture to add localized information to self-attention. We found that coattention significantly improves the no answer F1 by 4 points in the base and 1 point in the large architecture. After adding skip connections the no answer F1 improved further without causing an additional loss in has answer F1. The addition of localized feature extraction added to attention produced an overall dev F1 of 77.03 in the base architecture. We applied our findings to the large BERT model which contains twice as many layers and further used our own augmented version of the SQUAD 2.0 dataset created by back translation, which we have named SQUAD 2.Q. Finally, we performed hyperparameter tuning and ensembled our best models for a final F1/EM of 82.317/79.442 (Attention on Steroids, PCE Test Leaderboard).

Motivation & Objective

  • Improve BERT’s performance on SQuAD 2.0, particularly in detecting unanswerable questions, by introducing directed coattention mechanisms.
  • Address the limitation of BERT’s global attention by focusing on hierarchical, context-aware attention flows between query and context.
  • Enhance feature representation by integrating 1D convolutions to capture local textual patterns alongside global self-attention.
  • Improve model generalization through data augmentation using backtranslation to create a more diverse training set (SQUAD 2.Q).
  • Optimize and ensemble models to achieve state-of-the-art performance on the SQuAD 2.0 dev set, especially in no-answer F1.

Proposed method

  • Augment BERT’s self-attention mechanism with dedicated C2Q and Q2C coattention modules that process query and context representations in a directed, hierarchical manner.
  • Introduce residual (skip) connections after coattention layers to stabilize training and improve gradient flow.
  • Insert 1D convolutional layers within the coattention architecture to extract localized n-gram features, enhancing representation of short-range dependencies.
  • Fine-tune the modified BERT architecture on SQuAD 2.0 using a combination of start and end span prediction heads, with separate logits for start and end positions.
  • Create an augmented dataset, SQUAD 2.Q, by backtranslating SQuAD 2.0 examples to English via NMT, increasing linguistic diversity and robustness.
  • Perform hyperparameter tuning and ensembling of the top three models to improve generalization and robustness, especially for unanswerable questions.

Experimental results

Research questions

  • RQ1Can directed coattention (C2Q and Q2C) improve BERT’s ability to detect unanswerable questions in SQuAD 2.0?
  • RQ2Does integrating 1D convolutional layers into the coattention mechanism enhance performance by capturing local textual patterns?
  • RQ3To what extent does data augmentation via backtranslation (SQUAD 2.Q) improve model generalization and robustness?
  • RQ4How do skip connections and ensemble learning affect the model’s F1 and EM scores, particularly on unanswerable questions?
  • RQ5Can the coattention mechanism better preserve word pair associations than standard BERT attention, as seen in qualitative examples?

Key findings

  • The addition of C2Q and Q2C coattention improved the no-answer F1 by 4 points in the base BERT model and 1 point in the large model.
  • Skip connections further improved no-answer F1 without degrading has-answer F1, indicating better generalization and training stability.
  • The base model achieved a dev F1 of 77.03 after integrating coattention and convolutional feature extraction.
  • The final ensemble model achieved a dev F1 of 82.317 and EM of 79.442 on the SQuAD 2.0 test set, representing a 3.5-point improvement over BERT Large.
  • Qualitative analysis showed that the model correctly identified unanswerable questions by preserving word pair associations (e.g., 'spirit' and 'Christian' as separate concepts), unlike BERT Large which incorrectly combined them.
  • Error analysis revealed that the model significantly reduced errors on 'What' questions (30 fewer errors than baseline), though 'Which' and 'What' categories were confounded due to backtranslation artifacts.

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.