《The Adapter-Bot: All-In-One Controllable Conversational Model》
标题:《The Adapter-Bot: All-In-One Controllable Conversational Model》
作者:香港科技大学
时间:2020年8月
过去对话系统的问题:
have little or no control of the generated responses and miss two important features:
(1) continuous on-demand dialogue skills integration:连续性对话技术整合(e.g., emphatic response, weather information, movie recommendation)
(2)seamlessly leveraging diverse knowledge sources:无缝地利用多种的知识源(文本,表格,graph等)
作者实施了12种response style,8种goal-oriented skills,以及个性化和共情性的回复。
作者将其interactive system公开在了adapter.bot.ust.hk.
Introduction
过去的对话模型,尽管are finetuned on multiple conversational datasets, 但是,它们:
1、并没有一种可用的机制 (e.g., control codes or latent variables)来控制回答问题的skill。
2、无法add dialogue ‘skills’ continuously,在不重新学习所有模型参数的情况下
3、cannot generalize over knowledge of multiple types, e.g., text, tables, images, and graphs.
【按:这里所谓的多种知识源,可参看表1,例如查询天气、基于知识图谱的知识问答、闲聊、维基百科阅读理解。我个人将其分为三类:调用外部API;查询图数据库;调用百科知识库】

In this paper, we propose a general model that is able to process any kind of text-based knowledge.
【按:还有一种源是以images为输入的,参见论文《The dialogue dodecathlon: Open-domain knowledge and image grounded conversational agents.》。不过本文作者并没有实现以images为输入的对话系统。】
Methodology
我们提出了Adapter-Bot,由:
-
一个frozen backbone对话模型;
-
一组可训练的独立残差residual adapters;
-
一个可训练的对话管理器dialogue manager
组成。
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-i6K9bSWL-1602334961565)()]](https://i-blog.csdnimg.cn/blog_migrate/9ece7d37ab7a4ff4a51e8f2de58bcd86.png#pic_center)
看图1,输入的对话历史
X
X
X经过多元的meta-knowldge
M
M
M 处理后,使用对话管理器选择一个合适的adpater layer,生成回复
Y
Y
Y。
Y
=
f
Θ
(
X
,
M
)
Y=f_{\Theta}(X,M)
Y=fΘ(X,M)
本文生成模型使用DialoGPT。
下面依次讲解模型的三个组成部分。
1. Residual Adapters
考虑预训练语言模型的第 i i i层的隐藏状态 H i ∈ R n × d H_i\in R^{n\times d} Hi∈Rn×d
(n:generation step;d:hidden size)
则Residual Adapter这样计算:
A
θ
(
H
i
)
=
Relu
(
LN
(
H
i
)
W
i
E
)
W
i
D
+
H
i
\text{A}_{\theta}(H_i)=\text {Relu}(\text{LN}(H_i)W^E_i)W^D_i+H_i
Aθ(Hi)=Relu(LN(Hi)WiE)WiD+Hi
LN是layer normalization,即将
H
i
H_i
Hi经过LayerNorm和两层线性层后,再加自己。
Residual Adapters们,就是加到预训练语言模型的每一个transformer层顶部的可训练模块,用于在不改变原始权重的情况下操控输出分布。
2. The Adapter-Bot
假定我们共有p个residual adapters,分别记为 θ 1 , . . . θ t , . . . θ p \theta_1,...\theta_t ,... \theta_p θ1,...θt,...θp。相应的对话数据集为 D = { D 1 , . . . , D t , . . . , D p } D=\{D^1,...,D^t,...,D^p\} D={D1,...,Dt,...,Dp}(相当于对应的外部元知识M),
那么,用一个adapter skill-ids
t
t
t扩展公式输入如下:
Y
=
f
Θ
,
θ
t
(
X
,
M
,
t
)
Y=f_{\Theta, \theta_t}(X,M, t)
Y=fΘ,θt(X,M,t)
通过优化
θ
t
\theta_t
θt使
D
t
D_t
Dt与它的知识
M
M
M的negative log-likelihood最小
Dialogue Manager
对话管理器就是一个 p p p分类器,训练数据与上文一样是 D D D,区别是,我们的目的是给定来自 D t D^t Dt的对话历史输入,对话管理器能把 t t t预测出来。
Knowledge Retrieval
本节是关于如何从外部知识源抽取知识的。
对于WikiPedia,使用the TFIDF retriever,抽取出概率最高的paragraph作为元知识
【按:参阅开放域问答论文《Reading wikipedia to answer open-domain questions》】
对于knowledge graph,从用户话语中抽取实体后匹配对应的实体节点,返回子图,以三元组形式作为元知识。
对于query the online API(例如weather API),使用启发式规则(heuristic rules)抽取slot values,具体情况具体分析。
Response Re-ranking
这里的目的是,让模型能回答11种不同style/topics。具体地,采样多条回复,然后基于一定规则重新排序。作者为每一种style/topics使用一个额外的分类器to score each of the generated responses,The response with the higher score is returned to final user。
such as common sense, basic knowledge, asking/sharing about personality, likes/dislikes, opinions, feelings, hobbies, pleasantries
参考文献:
-
《Plug-and-play conversational models》
-
《Towards a human-like open-domain chatbot》
-
《Plug and play language models: a simple approach to controlled text generation》
Experimental Setup
We train each of the adapters using different dialogue datasets and settings. In this section, we summarize each of the datasets, which skill they represent, and how they have been pre-processed.
5万+

被折叠的 条评论
为什么被折叠?



