当前位置:网站首页>基于布朗运动的文本生成方法-LANGUAGE MODELING VIA STOCHASTIC PROCESSES
基于布朗运动的文本生成方法-LANGUAGE MODELING VIA STOCHASTIC PROCESSES
2022-08-09 06:54:00 【just do it now】
标题:LANGUAGE MODELING VIA STOCHASTIC PROCESSES
文章:https://arxiv.org/abs/2203.11370
代码:https://github.com/rosewang2008/language_modeling_via_stochastic_processes
本篇文章可谓是开放域对话的又一开山制作,众所周知,开放域对话是无状态的,不能像任务式对话那样进行状态的追踪,也即不可控性。本文则提出了一种基于布朗桥的文本生成方法,对对话过程进行编码,构建布朗桥来控制对话的过程。
1. 基于布朗桥过程的编码器
首先训练一个编码器,将句子从文本空间X映射到隐空间Z, 记为f:X->Z。在隐空间中的移动轨迹应遵循布朗桥运动。也就是说,该轨迹的起点和终点固定,设为z0和zT则在时间点 t 时, zt 服从以下正态分布:
其均值是z0和zT之间随时间变化的线性插值。方差部分,可以直观理解为:在靠起点和终点处方差较小,而中间部分则方差较大(如下图左侧所示)。
- 怎样训练一个编码器来拟合这个过程呢?
对于句子序列,从中随机采样顺序(但未必相邻)的三个句子(x0,xt,xT)优化目标为:使得f(x0)遵循布朗桥运动轨迹。其目标函数可以写为:
可以理解为:使得(x0,xt,xT)更加接近布朗桥过程,而其他负样本三元组与布朗桥过程的差异变大。其中,函数d(.)用于度量编码器预测结果到布朗桥轨迹的距离
2. 基于GPT微调解码器生成
用上述编码器得到隐空间中的布朗桥轨迹后,需要再使用一个解码器,以该轨迹为条件生成对应的文本。对于该解码器的训练,直接对GPT2进行微调。
在 inference 时,给定隐空间起点z0与终点zT,只需随机采样一个两点之间的布朗桥过程,然后用上述解码器进行生成即可,如下图所示:
3. 结果
RQ1:Can Time Control model local text dynamics?
Section 4.1 investigates this question using a sentence ordering prediction task: given two sentences from the same document, we evaluate whether different models can predict their original order.
RQ2: Can Time Control generate locally coherent text?
Section 4.2 investigates this question using the text-infilling task: given prefix and suffix, we evaluate how well different models can fill in between.
RQ3: Can Time Control model global text dynamics?
Section 4.3 investigates this question on text generation for Wikipedia city articles by examining the length of generated sections.
RQ4: Can Time Control generate long coherent documents?
Section 4.4 investigates this question on forced long text generation: we evaluate how well models preserve global text statistics (such as typical section orders and lengths) when forced to extrapolate during generation.
边栏推荐
- 高项 04 项目变更管理
- Explain the wait() function and waitpid() function in C language in detail
- Variable used in lambda expression should be final or effectively final报错解决方案
- shardingsphere数据分片配置项说明和示例
- shardingsphere data sharding configuration item description and example
- 变压器的工作原理(图解,原理图讲解,一看就懂)
- codeforces Valera and Elections (这思维题是做不明白了)
- 错误:为 repo ‘oracle_linux_repo‘ 下载元数据失败 : Cannot download repomd.xml: Cannot download repodata/repomd.
- Inception V3 闭眼检测
- Built-in macros in C language (define log macros)
猜你喜欢
随机推荐
stm32定时器之简单封装
Introduction and use of BeautifulSoup4
The Integer thread safe
APP商品详情源数据接口(淘宝/京东/拼多多/苏宁/抖音等平台详情数据分析接口)代码对接教程
排序第三节——交换排序(冒泡排序+快速排序+快排的优化)(5个视频讲解)
分布式事务的应用场景
leetcode 之盛水问题
高项 04 项目变更管理
VS2019常用快捷键
细谈VR全景:数字营销时代的宠儿
mysql summary
长沙学院2022暑假训练赛(一)六级阅读
分布式id 生成器实现
使用百度EasyDL实现智能垃圾箱
力扣 636. 函数的独占时间
Import the pycharm environment package into another environment
Example of using the cut command
String.toLowerCase(Locale.ROOT)
单例模式
【烂笔头】各厂商手机手动抓log