Uni-Encoder: A Fast and Accurate Response Selection Paradigm for Generation-Based Dialogue Systems

Chiyu Song, Hongliang He, Haofei Yu, Pengfei Fang, Leyang Cui +1 more
6/2/2021
cs.CLcs.AI

Official code: dll-wu/Uni-Encoder (8 stars, Python, MIT, last commit 2023-12-08).

Abstract

Sample-and-rank is a key decoding strategy for modern generation-based dialogue systems. It helps achieve diverse and high-quality responses by selecting an answer from a small pool of generated candidates.

Show full abstract

The current state-of-the-art ranking methods mainly use an encoding paradigm called Cross-Encoder, which separately encodes each context-candidate pair and ranks the candidates according to their fitness scores. However, Cross-Encoder repeatedly encodes the same lengthy context for each candidate, resulting in high computational costs. Poly-Encoder addresses the above problems by reducing the interaction between context and candidates, but with a price of performance drop. In this work, we develop a new paradigm called Uni-Encoder, that keeps the full attention over each pair as in Cross-Encoder while only encoding the context once, as in Poly-Encoder. Uni-Encoder encodes all the candidates with the context in one forward pass. We use the same positional embedding for all candidates to ensure they are treated equally and design a new attention mechanism to avoid confusion. Our Uni-Encoder can simulate other ranking paradigms using different attention and response concatenation methods. Extensive experiments show that our proposed paradigm achieves new state-of-the-art results on four benchmark datasets with high computational efficiency. For instance, it improves R10@1 by 2.9% with an approximately 4X faster inference speed on the Ubuntu V2 dataset.

View on arXivView PDF

Code Implementations(1)

dll-wu/Uni-EncoderOfficial100%
MIT

The official implementation of Uni-Encoder.

80Python, ShellMay 9, 20232 years agoMIT

Similar Papers

Cite this paper

@article{song2021uniencoder,
  title  = {Uni-Encoder: A Fast and Accurate Response Selection Paradigm for Generation-Based Dialogue Systems},
  author = {Chiyu Song and Hongliang He and Haofei Yu and Pengfei Fang and Leyang Cui and Zhenzhong Lan},
  year   = {2021},
  eprint = {2106.01263},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2106.01263}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2106.01263.svg)](https://codeofpaper.com/paper/2106.01263)

Discussion