Exposure bias
- Training with Teacher forcing leads to exposure bias at generation time
- During training, our modelโs inputs are gold context tokens from real, human-generated texts.
$$L_{MLE} = -logP(y_t^* | {\color{red}{y^*}_{<t}})$$
- At generation time, our modelโs inputs are previouslyโdecoded tokens.
$$L_{dec} = -logP(\hat{y}t | {\color{blue}\hat{y}{<t}})$$
- At generation time, our modelโs inputs are previouslyโdecoded tokens.
$$L_{dec} = -logP(\hat{y}t | {\color{blue}\hat{y}{<t}})$$
- Exposure Bias Solutions
- Scheduled sampling (Bengio et al., 2015)
- Dataset Aggregation (DAgger; Ross et al., 2011)
- Sequence re-writing (Guu*, Hashimoto* et al., 2018)
- Reinforcement Learning: cast your text generation model as a Markov decision process
- State $s$ is the modelโs representation of the preceding context
- Actions $a$ are the words that can be generated
- Policy $\pi$ is the decoder
- Rewards $r$ are provided by an external score
- Learn behaviors by rewarding the model when it exhibits them.
- REINFORCE: Basic
- Sample a sequence from your model
- Next time, increase the probability of this sampled token in the same context.
- โฆbut do it more if I get a high reward from the reward function.
$$L_{RL} = -\sum_{t=1}^T {\color{red}r(\hat{y_t})}logP(\hat{y}t | y^*;{\color{blue}{\hat{y_t}}{<t}})$$
Exposure bias๋ teacher forcing์ ์ฌ์ฉํ๋ ์ต๋ ์ฐ๋ ์ถ์ (MLE) ํ๋ จ์์ ๋ฐ์ํ๋ ํ๋ จ๊ณผ ์ถ๋ก ์ ๋ถ์ผ์น ๋ฌธ์ ๋ฅผ ๋งํฉ๋๋ค.
- ์ด ๋ฌธ์ ๋ ์์ฐ์ด ์์ฑ(NLG) ๋ชจ๋ธ ํ๋ จ์ ์ค์ํ ๋ฌธ์ ๋ก ๊ฐ์ฃผ๋์ด ์์ต๋๋ค. Exposure bias๋ฅผ ํผํ๊ณ ์ ๊ฑฐํ๊ธฐ ์ํด ๋ง์ ์๊ณ ๋ฆฌ์ฆ์ด ์ ์๋์์ง๋ง, ์ด ๋ฌธ์ ๊ฐ ์ผ๋ง๋ ์ฌ๊ฐํ์ง ์ ๋์ ์ผ๋ก ์ธก์ ํ๋ ๋ฐฉ๋ฒ์ ์์ง ์ ์๋ ค์ ธ ์์ง ์์ต๋๋ค.
Exposure bias๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํ ๋ช ๊ฐ์ง ๋ฐฉ๋ฒ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
- Scheduled sampling: ํ๋ จ ๊ณผ์ ์์ ์ผ์ ํ ํ๋ฅ ๋ก ์ค์ ์ถ๋ ฅ์ ์ ๋ ฅ์ผ๋ก ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ ๋๋ค.
- Reinforcement learning: NLG ๋ชจ๋ธ์ ์์ด์ ํธ๋ก ๊ฐ์ฃผํ๊ณ ๋ณด์ ํจ์๋ฅผ ์ ์ํ์ฌ ํ์ตํ๋ ๋ฐฉ๋ฒ์ ๋๋ค.
- Professor forcing: ํ๋ จ๊ณผ ์ถ๋ก ์์ ๋์ผํ ์ํ ์ํ ๋ถํฌ๋ฅผ ์ ์งํ๊ธฐ ์ํด ์ ๋์ ์์ค์ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ ๋๋ค.
- Variational inference: NLG ๋ชจ๋ธ์ ์ ์ฌ ๋ณ์๋ฅผ ๋์ ํ์ฌ ํ๋ฅ ์ ์ผ๋ก ์ํ๋งํ๊ณ ๊ทผ์ฌ์ ์ธ ์ฌํ ๋ถํฌ๋ฅผ ํ์ตํ๋ ๋ฐฉ๋ฒ์ ๋๋ค.
Reinforcement learning์ด exposure bias ํด๊ฒฐ ๋ฐฉ๋ฒ์ด ๋ ์ ์๋ ์ด์ ๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
- Exposure bias๋ teacher forcing ๋ฐฉ์์ผ๋ก ํ๋ จ๋ ์ธ์ด ๋ชจ๋ธ์ด ์ถ๋ก ๋จ๊ณ์์ ํ๋ จ ์ฝํผ์ค์ ์๋ ์์ ์ ์ด์ ์์ธก์ ์์กดํ๋ ๋ฌธ์ ๋ฅผ ๋งํฉ๋๋ค.
- Reinforcement learning์ ์ธ์ด ๋ชจ๋ธ์ ์์ธก์ ๋ํด ์ธ๋ถ ๋ณด์์ ์ฃผ์ด ํ์ต์ ๊ฐ์ด๋ํ๋ ๋ฐฉ๋ฒ์ ๋๋ค.
- Reinforcement learning์ ์ธ์ด ๋ชจ๋ธ์ด ์์ ์ ์์ธก์ ๋ฐ๋ผ ๋ณด์์ ๋ฐ๊ธฐ ๋๋ฌธ์ exposure bias๋ฅผ ์ค์ผ ์ ์์ต๋๋ค.
- Reinforcement learning์ ๋ํ ์ธ์ด ๋ชจ๋ธ์ ๋ค์์ฑ๊ณผ ์ผ๊ด์ฑ์ ํฅ์์ํฌ ์ ์์ต๋๋ค.