HyperAIHyperAI

Command Palette

Search for a command to run...

5 months ago

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

Chiyu Song; Hongliang He; Haofei Yu; Pengfei Fang; Leyang Cui; Zhenzhong Lan

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

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. 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.

Code Repositories

dll-wu/uni-encoder
Official
pytorch
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
conversational-response-selection-on-douban-1Uni-Encoder
MAP: 0.622
MRR: 0.662
P@1: 0.481
R10@1: 0.303
R10@2: 0.514
R10@5: 0.852
conversational-response-selection-on-douban-1Uni-Enc+BERT-FP
MAP: 0.648
MRR: 0.688
P@1: 0.518
R10@1: 0.327
R10@2: 0.557
R10@5: 0.865
conversational-response-selection-on-personaUni-Encoder
MRR: 0.922
R20@1: 0.869
conversational-response-selection-on-ubuntu-1Uni-Enc+BERT-FP
R10@1: 0.916
R10@2: 0.965
R10@5: 0.994
conversational-response-selection-on-ubuntu-1Uni-Encoder
R10@1: 0.886
R10@2: 0.946
R10@5: 0.989
conversational-response-selection-on-ubuntu-2Uni-Encoder
R10@1: 0.859
R10@2: 0.938
R10@5: 0.990

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp
Uni-Encoder: A Fast and Accurate Response Selection Paradigm for Generation-Based Dialogue Systems | Papers | HyperAI