[Paper Review] DABERT: Dual Attention Enhanced BERT for Semantic Matching
DABERT proposes a dual attention mechanism that enhances BERT by explicitly modeling both affinity and difference features between sentence pairs, using a dual-channel attention module and an adaptive fusion mechanism. The model achieves over 2% absolute improvement on semantic matching tasks and demonstrates superior robustness to minor textual perturbations compared to BERT and other BERT-based models.
Transformer-based pre-trained language models such as BERT have achieved remarkable results in Semantic Sentence Matching. However, existing models still suffer from insufficient ability to capture subtle differences. Minor noise like word addition, deletion, and modification of sentences may cause flipped predictions. To alleviate this problem, we propose a novel Dual Attention Enhanced BERT (DABERT) to enhance the ability of BERT to capture fine-grained differences in sentence pairs. DABERT comprises (1) Dual Attention module, which measures soft word matches by introducing a new dual channel alignment mechanism to model affinity and difference attention. (2) Adaptive Fusion module, this module uses attention to learn the aggregation of difference and affinity features, and generates a vector describing the matching details of sentence pairs. We conduct extensive experiments on well-studied semantic matching and robustness test datasets, and the experimental results show the effectiveness of our proposed method.
Motivation & Objective
- To address the limitation of BERT in distinguishing semantically different but textually similar sentence pairs.
- To explicitly model fine-grained semantic differences between sentence pairs using a dual-channel attention mechanism.
- To develop a soft, adaptive fusion mechanism that integrates affinity and difference features without disrupting BERT's pre-trained representations.
- To improve model robustness against minor textual perturbations such as word additions, deletions, or substitutions.
- To achieve state-of-the-art performance on standard semantic matching benchmarks while maintaining end-to-end trainability.
Proposed method
- Introduces a Dual Attention module that uses two parallel attention streams: one for affinity (standard self-attention) and one for difference (subtraction-based cross-attention) to capture semantic contrasts.
- Employs a dual-channel injection mechanism to embed difference and affinity representations into multi-head attention layers, preserving distinct semantic signals.
- Designs an Adaptive Fusion module that uses cross-attention to inter-align difference and affinity features, followed by gated fusion for adaptive integration.
- Applies a fuse-gate module to scale the fused representation, minimizing disruption to BERT's pre-trained representations.
- Trains the entire model end-to-end, enabling soft integration of difference modeling into the pre-trained BERT framework.
- Uses attention weight visualization to validate that the model focuses on contrasting words (e.g., 'hardware' vs. 'software') rather than shared terms.
Experimental results
Research questions
- RQ1How can vanilla self-attention in BERT be enhanced to better capture fine-grained semantic differences between sentence pairs?
- RQ2What is the optimal way to fuse affinity and difference representations without degrading the pre-trained model's performance?
- RQ3Can explicit modeling of semantic differences improve robustness to minor textual perturbations in semantic matching tasks?
- RQ4How does the dual-channel attention mechanism compare to standard attention in capturing subtle semantic contrasts?
- RQ5To what extent does the adaptive fusion mechanism improve matching accuracy compared to hard or fixed-weight fusion strategies?
Key findings
- DABERT achieves an absolute improvement of over 2% on average across 10 public semantic matching datasets compared to standard BERT.
- The model outperforms other BERT-based models that use advanced techniques or external knowledge, even without additional data.
- On robustness evaluation datasets with injected noise (e.g., word swaps, deletions), DABERT maintains significantly higher accuracy than BERT and other baselines.
- Case studies show DABERT correctly identifies semantic conflicts caused by subtle differences (e.g., '12' vs. '24') where BERT and Syntax-BERT fail.
- Attention visualization confirms that DABERT increases attention weights on contrasting words (e.g., 'hardware' and 'software'), indicating effective difference modeling.
- The adaptive fusion mechanism successfully balances affinity and difference signals, reducing representation degradation from injected features.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.