---
title: 【拡散モデル勉強会】Diffusion Models for Non-autoregressive Text Generation: A Survey
tags: 
author: [Deep Learning JP](https://www.docswell.com/user/DeepLearning2023)
site: [Docswell](https://www.docswell.com/)
thumbnail: https://bcdn.docswell.com/page/4EZG4122J3.jpg?width=480
description: 【拡散モデル勉強会】Diffusion Models for Non-autoregressive Text Generation: A Survey by Deep Learning JP
published: May 14, 24
canonical: https://www.docswell.com/s/DeepLearning2023/ZDNEM9-2024-08-19-125504
---
# Page. 1

![Page Image](https://bcdn.docswell.com/page/4EZG4122J3.jpg)

DEEP LEARNING JP Diffusion Models for Non-autoregressive
[Diffusion Papers] Text Generation: A Survey
⾼城 頌太（東京⼤学 ⼯学系研究科 松尾研 D1）
http://deeplearning.jp/
1


# Page. 2

![Page Image](https://bcdn.docswell.com/page/Y76Y3W66EV.jpg)

書誌情報
タイトル： Diffusion Models for Non-autoregressive Text Generation: A Survey
https://arxiv.org/abs/2303.06574
IJCAI 2023 Survey Track
著者： Yifan Li, Kun Zhou, Wayne Xin Zhao, Ji-Rong Wen
概要： Diffusionを⽤いたテキスト⽣成に関するサーベイ
2


# Page. 3

![Page Image](https://bcdn.docswell.com/page/G75GLM6574.jpg)

テキスト⽣成のアプローチ
• ⾃⼰回帰モデル(Autoregressive model: ARモデル)
– 前から順に単語を⽣成
• ⾮⾃⼰回帰モデル(Non-autoregressive model: NARモデル)
– 各単語を同じタイミングで出⼒
特にNARモデルに対して拡散モデルを適⽤した⼿法がいくつか提案されている
(※ARモデルでも拡散モデル適⽤する⽅法もあり)
3


# Page. 4

![Page Image](https://bcdn.docswell.com/page/9J2YL9MGJR.jpg)

テキスト⽣成のためのdiffusion modelの歴史
• Image, Video, Audioでdiffusion modelが⼤きな成功を集めているが，textではま
だうまくいっていない
• Diffusionを⽤いたテキスト⽣成に関する論⽂も年々増えてはいる
Diffusion models in text generation: a survey
4


# Page. 5

![Page Image](https://bcdn.docswell.com/page/DEYGQ4XGEM.jpg)

Diffusion Model
Forward diffusion process
Loss function
Reverese diﬀusion process
5


# Page. 6

![Page Image](https://bcdn.docswell.com/page/VJNGKY1878.jpg)

Text Diffusion Models
• 与えれた⼊⼒データに基づいて，ランダムノイズを⽬的のテキストに付与する
• ノイズの掛け⽅は離散 or 連続にかける⽅法がある
• ARモデルと⽐較するとNARモデルは推論時間は短縮されるが，NARモデルだと単
語の依存関係を考慮できないため精度は低下する
𝒴: target text, c: context, t: timestep
6


# Page. 7

![Page Image](https://bcdn.docswell.com/page/YE9WVP5XE3.jpg)

Diffusion Modelを離散のテキストに適応
• Discrete Text Diffusion Model
– tokenのように離散的なものを扱うモデル
– token⾃体にノイズをかけそれを取り除くように学習
• Continuous Text Diffusion Model
– embeddingのような連続的な値をもつものを扱うモデル
– embeddingに対してノイズをかけ，それを取り除くように学習
7


# Page. 8

![Page Image](https://bcdn.docswell.com/page/GE8NPDY97D.jpg)

Discrete Text Diffusion Model: D3PM
• 離散値に対して拡散モデルを適⽤するために提案
• カテゴリ分布に対して拡散モデルを適⽤し，ノイズ付与する操作の代わりに独⾃
な操作を導⼊(Q: 遷移確率⾏列)
Forward diffusion process
where
式変形: https://beckham.nz/2022/07/11/d3pms.html
8


# Page. 9

![Page Image](https://bcdn.docswell.com/page/LELP1M4M7R.jpg)

Discrete Text Diﬀusion Model: D3PM
Qの具体的な処理について
• Uniform
– ⼀様分布を加え，⼀定の確率で他の語彙に変化させる操作
• Absorbing state
– ⼀定の確率でトークンが[MASK]になるようにする操作
• Discretized Gaussian
– 通常の拡散モデルと同様にガウシアンノイズを加える操作
• Token embedding distance
– ⼀定の確率で類似性が⾼いトークンに変化させる
Structured Denoising Diffusion Models in Discrete State-Spaces
9


# Page. 10

![Page Image](https://bcdn.docswell.com/page/4JM4WYK67W.jpg)

Discrete Text Diffusion Model: D3PM
実験結果では，absorbing stateが最もNLLが低い
10


# Page. 11

![Page Image](https://bcdn.docswell.com/page/PJRWY9XN79.jpg)

Continuous Text Diffusion Model: Diffusion-LM
• 単語のembeddingに対して拡散モデルを適⽤させる
• 離散のテキストから埋め込みへ変換するEmbedding Stepと埋め込みからテキス
ト変換するRounding Stepを同時に学習
Embedding Step
Rounding Step
Loss function
11


# Page. 12

![Page Image](https://bcdn.docswell.com/page/PEXPGQ687X.jpg)

Continuous Text Diffusion Model: Diffusion-LM
学習時の⼯夫について
Reducing Rounding Errors
- 全ての時刻tでxtからx0を予測することによって単語のembeddingを学習する
Controllable Text Generation
- 制約を満たすように
12


# Page. 13

![Page Image](https://bcdn.docswell.com/page/3EKD491LJD.jpg)

Continuous Text Diﬀusion Model: Diﬀusion-LM
• Infilling taskで⽐較⼿法より⾼いスコア
• ARモデルにはHuman Evalでは負けている
13


# Page. 14

![Page Image](https://bcdn.docswell.com/page/L73RLWQ6J5.jpg)

拡散モデルにおけるテキスト⽣成のポイント
• Denoising Network
– 基本的にはTransformerベースのモデルを使⽤
– 事前学習モデルを使⽤することで性能改善(BERT, RoBERT)
• Noise Schedule
– ノイズをどのように付与するか
– LinearSchedule, Cosine Shcedule, Mutual Information Schedule, Sqrt Schdule…
• Objective Function
– X0-parameterized Loss
• hogehoge
– AuxialiaryLoss
• hogehoge
• Conditioning Strategy
– Unconditional Generation
– Attribute to text generation
– Text to text generation
14


# Page. 15

![Page Image](https://bcdn.docswell.com/page/87DYNK9M7G.jpg)

事前学習済みモデルの使⽤
• 事前学習済みモデルをDenoising Networkとしての利⽤
– DiffusionBERT, Diffusion-NAT
• 潜在空間への埋め込みに事前学習済みモデルを使⽤
– LD4LG, LatentOps
• Text Diffusion Modelに特化した事前トレーニング
– continuous paragraph denoising (CPD)
15


# Page. 16

![Page Image](https://bcdn.docswell.com/page/VJP65KZQE8.jpg)

潜在空間への埋め込みに事前学習済みモデルを使⽤: LD4LG
• 事前学習済みのBARTやT5を⽤いて潜在表現上でデノイジング
16


# Page. 17

![Page Image](https://bcdn.docswell.com/page/2EV3PVWP7Q.jpg)

潜在空間への埋め込みに事前学習済みモデルを使⽤: LD4LG
17


# Page. 18

![Page Image](https://bcdn.docswell.com/page/57G3PLDQJL.jpg)

Text Diffusion Modelの種類
18


# Page. 19

![Page Image](https://bcdn.docswell.com/page/4EQ52Y1WJP.jpg)

Text Diffusion Modelの結果⽐較
Diffusion models in text generation: a survey
19


# Page. 20

![Page Image](https://bcdn.docswell.com/page/KJ49LWR171.jpg)

Thank you.
20


