NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

pair2vec: Compositional Word-Pair Embeddings for Cross-Sentence Inference

Mandar Joshi, Eunsol Choi, Omer Levy, Daniel S. Weld, Luke Zettlemoyer

Introduction

Modern Natural Language Processing (NLP) models predominantly rely on single-word embeddings like GloVe or ELMo. While effective, these representations often fail to explicitly capture lexical inference—the nuanced relationships between word pairs across different sentences. For instance, recognizing that "golf is a cheap pastime" contradicts "golf is prohibitively expensive" requires an understanding of antonymy. Standard embeddings typically lack this explicit pairwise modeling, making them susceptible to adversarial attacks where minor word substitutions can lead to incorrect predictions.

Methodology

The authors propose pair2vec, a framework designed to learn compositional word-pair representations and inject them into existing neural architectures.

Compositional Representation

To avoid the data sparsity issues of a massive lookup table for all possible word pairs, pair2vec utilizes a 4-layer Multi-Layer Perceptron (MLP). This network composes a "pair vector" from the embeddings of two words ($x$ and $y$) and their element-wise product ($x \circ y$).

Multivariate Training Objective

The model is trained on Wikipedia using a multivariate version of Pointwise Mutual Information (PMI). Unlike standard word2vec, which models word-context co-occurrence, pair2vec models the three-way co-occurrence between word $x$, word $y$, and the context $c$ that links them (e.g., "X is a type of Y"). To enhance robustness, "typed sampling" with hard negative examples is employed to force the model to learn specific relational facts.

Model Integration

pair2vec is integrated into the cross-sentence attention layer of models like BiDAF (for Question Answering) and ESIM (for Natural Language Inference). By using existing attention weights to create a weighted average of pair embeddings, the model gains a relational feature boost during the reasoning phase.

Architecture of pair2vec integration into cross-sentence attention.

Evaluation and Results

The model was pre-trained on a 2018 English Wikipedia dump and evaluated across several benchmarks, including SQuAD 2.0, MultiNLI, and various adversarial datasets.

Key Results

On SQuAD 2.0, adding pair2vec to a BiDAF++ baseline yielded a 2.7 F1 point gain. The model demonstrated significant robustness on adversarial datasets like "AddSent," showing improvements of 6-7%. Furthermore, on word analogy tasks (BATS), pair2vec improved accuracy for encyclopedic relations by 356% and lexicographic relations by 51% compared to standard baselines.

Performance gains of BiDAF + pair2vec on SQuAD 2.0 and adversarial datasets.

Discussion

The primary innovation of pair2vec lies in leveraging the cross-sentence attention mechanism as a conduit for relational knowledge. By aligning words between a question and a passage, the pair vector provides explicit information on how these aligned words relate. While pre-training is computationally intensive, the explicit handling of relational reasoning offers a complementary advantage to models like BERT, which capture such information only implicitly. Future work may involve combining transformer-based contexts with explicit pairwise relational objectives.

Summary updated

BibTeX
@inproceedings{joshi2019pair,
  author = {Mandar Joshi and Eunsol Choi and Omer Levy and Daniel S. Weld and Luke Zettlemoyer},
  title = {{pair2vec: Compositional Word-Pair Embeddings for Cross-Sentence Inference}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2019},
  doi = {10.18653/v1/n19-1362},
}
Figure