Poly-encoders: Transformer Architectures and Pre-training Strategies for Fast and Accurate Multi-sentence Scoring
Samuel Humeau, Kurt Shuster, Marie-Anne Lachaux, Jason Weston
Code Available — Be the first to reproduce this paper.
ReproduceCode
- github.com/sfzhou5678/PolyEncoderpytorch★ 249
- github.com/chijames/Poly-Encoderpytorch★ 167
- github.com/csong27/collision-bertpytorch★ 25
- github.com/fangrouli/Document-embedding-generation-modelspytorch★ 3
- github.com/llStringll/Poly-encoderspytorch★ 0
- github.com/i2r-simmc/i2r-simmc-2020pytorch★ 0
- github.com/Alexey-Borisov/3_course_diarynone★ 0
Abstract
The use of deep pre-trained bidirectional transformers has led to remarkable progress in a number of applications (Devlin et al., 2018). For tasks that make pairwise comparisons between sequences, matching a given input with a corresponding label, two approaches are common: Cross-encoders performing full self-attention over the pair and Bi-encoders encoding the pair separately. The former often performs better, but is too slow for practical use. In this work, we develop a new transformer architecture, the Poly-encoder, that learns global rather than token level self-attention features. We perform a detailed comparison of all three approaches, including what pre-training and fine-tuning strategies work best. We show our models achieve state-of-the-art results on three existing tasks; that Poly-encoders are faster than Cross-encoders and more accurate than Bi-encoders; and that the best results are obtained by pre-training on large datasets similar to the downstream tasks.
Tasks
Benchmark Results
| Dataset | Model | Metric | Claimed | Verified | Status |
|---|---|---|---|---|---|
| Douban | Poly-encoder | MAP | 0.61 | — | Unverified |
| DSTC7 Ubuntu | Bi-encoder (v2) | 1-of-100 Accuracy | 70.9 | — | Unverified |
| DSTC7 Ubuntu | Bi-encoder | 1-of-100 Accuracy | 66.3 | — | Unverified |
| RRS Ranking Test | Poly-encoder | NDCG@3 | 0.68 | — | Unverified |
| Ubuntu Dialogue (v1, Ranking) | Poly-encoder | R10@1 | 0.88 | — | Unverified |