modulabs / beyondBERT

11.5기의 beyondBERT의 토론 내용을 정리하는 repository입니다.
MIT License
60 stars 6 forks source link

Recipes for building an open-domain chatbot #16

Closed seopbo closed 4 years ago

seopbo commented 4 years ago

어떤 내용의 논문인가요? 👋

적절한 대량의 데이터셋으로 Fine-tunning한 모델이 대화에서 흥미로운 대화 포인트를 소개하고 페르소나를 유지하는데 도움이 될 수 있습니다. unlikelihood 학습과 retrieve-and-refine 모델을 통해 지식에 대해 반복적이고 어눌하며 구체적이지 않은 답변을 피할 수 있습니다.

Abstract (요약) 🕵🏻‍♂️

Building open-domain chatbots is a challeng- ing area for machine learning research. While prior work has shown that scaling neural mod- els in the number of parameters and the size of the data they are trained on gives improved results, we show that other ingredients are im- portant for a high-performing chatbot. Good conversation requires a number of skills that an expert conversationalist blends in a seamless way: providing engaging talking points and lis- tening to their partners, and displaying knowl- edge, empathy and personality appropriately, while maintaining a consistent persona. We show that large scale models can learn these skills when given appropriate training data and choice of generation strategy. We build vari- ants of these recipes with 90M, 2.7B and 9.4B parameter models, and make our models and code publicly available. Human evaluations show our best models are superior to existing approaches in multi-turn dialogue in terms of engagingness and humanness measurements. We then discuss the limitations of this work by analyzing failure cases of our models.

이 논문을 읽어서 무엇을 배울 수 있는지 알려주세요! 🤔

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/50d61682-47f6-40ba-add0-a576155b5247/_2020-07-24_18-47-12.png

1. Model

1-1. Retriever

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b3ab12bf-8e6e-471f-aaaf-3a9940a02312/Untitled.png

We employ the poly-encoder architecture of (Humeau et al., 2019). Poly-encoders encode global features of the context using multiple representations (n codes, where n is a hyperparameter), which are attended to by each possible candidate response

Idea

Poly-Encoder

1-2. Generator

We employ a standard Seq2Seq Transformer architecture to generate responses rather than retrieve them from a fixed set.

standard seq2seq Transformer + BPE 토크나이저 사용

매우 큰 세개의 모델 사이즈를 고려: 90M, 2.7B, 9.4B

1-3. Retrieve and Refine

One approach to try to alleviate these problems is to combine a retrieval step before generation, referred to as a retrieve and refine model (Weston et al., 2018). We consider two variants for the retrieval step: dialogue retrieval and knowledge retrieval.

paper: Retrieve and Refine: Improved Sequence Generation Models For Dialogue

앞서 언급한 Retriever와 Generator를 결합한 구조

외부 데이터에 대해서 답변을 못하는 문제를 해결하기 위한 하나의 접근법으로 retrieve and refine 모델(Weston et al., 2018)이라고하는 생성 전에 retrieval 스텝을 결합하는 것

⇒ 이렇게 함으로써 생성 모델이 적절한 경우 검색 결과에서 단어 나 구를 복사하는 법을 배울 수 있다는 것을 기대한다

Dialogue retrieval

Knowledge Retrieval

2. Training Objectives

2-1. Ranking for Retrieval

검색모델을 학습하기 위해, $y{cand1}$은 정답 응답이고 나머지는 샘플링된 negatives인 로짓인 $y{cand1}...y_{candn}$의 cross-entropy loss를 최소화 합니다. batches of 512

2-2. Likelihood Training for Generation

standard maximum likelihood estimation (MLE) 방법을 사용합니다.

Given a dataset $D = {(x(i), y(i))}$, minimize:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/6f5d2a73-9918-4a31-81ff-ff020ae7cc44/Untitled.png

where $x^{(i)}$is a gold input context and $y^{(i)}$ is a gold next-utterance, and $y^{(i)}_t$ is $t$-th token of $y^{(i)}$.

2-3. α-blending for Retrieve and Refine(Dialogue retrieval)

2-4. Unlikelihood training for generation

우리의 언어모델이 실제 사람이 사용한 데이터셋의 분포와 비교하여 더 많이 사용하는 것들에 대해 확률 분포를 낮춤으로써 적절한 횟수의 사용을 하도록 하는게 목표

https://miro.medium.com/max/1492/1*1sEpfbsXBBnu278IOSEbOQ@2x.png

3. Decoding

  1. Beam search
  2. Top-k sampling: model distribution을 사용하여 각 step i마다 가장 적합한 단어가 sampling
  3. Minimum length: 응답 생성 시에 최소 길이를 강제로 지정, 말을 길게하라고 강제하면 구체적이게 답변할 수 있다
  4. Predictive length: 답변마다 필요한 길이를 예측(10, 20, 30...)하고 이를 최소 길이로 설정하여 답변 생성

4. Training data

Pretraining

PushShift에서 2019 년 7 월까지 획득 한 Reddit의 1.5B 학습 예제를 포함하여 comment

다음 조건 중 하나라도 충족되면 의견과 모든 후속 아동 의견을 삭제합니다.

  1. The author is a known bot.

  2. It comes from a known non-English subreddit.

  3. The comment is marked as removed / deleted.

  4. It is longer than 2048 characters and does not contain spaces.

  5. It is longer than 128 BPE tokens.

  6. It is shorter than 5 characters.

  7. It contains a URL.

  8. It starts with a non-ASCII character.

  9. It is further than depth 7 in the thread.

Our final dataset contains 1.50B comments totaling 56.8B label BPE tokens and 88.8B context tokens.

최종 데이터셋은 1.5B comment들, 즉 총 56.8B label BPE token 그리고 88.8B context 토큰을 가진다

Fine-tunning

5. Evaluation Methods

ACUTE-Eval

사람 평가자는 2개의 대화 쌍을 보고 아래를 기준으로 평가해야 된다

평가를 하는 annotator의 bias를 줄일 수 있다, 이전 대화와 대조되는 응답에 대한 문제를 해결 할 수있다

Self-Chat ACUTE-Eval

사람이 전체 대화를 봇이랑 진행한 후 ACUTE-Eval을 진행하는 대신 봇끼리 self-chat을 통해 대화를 진행한 후 사람에게 평가 진행. resource(사람)를 아끼고 parameter tunning 할 때 반복적으로 사용할 수 있다

같이 읽어보면 좋을 만한 글이나 이슈가 있을까요?

(Humeau 2019) Poly-encoders: architectures and pre-training strategies for fast and accurate multi-sentence scoring

(Adiwardana 2020) Towards a human-like open-domain chatbot

(Zhang 2019) DialoGPT: Large-scale generative pre-training for conversational response generation

(Weston 2018) Retrieve and Refine: Improved Sequence Generation Models For Dialogue

(Zhang 2018) Personalizing dialogue agents: I have a dog, do you have pets too?

레퍼런스의 URL을 알려주세요! 🔗

https://parl.ai/projects/recipes/ https://medium.com/dair-ai/recipes-for-building-an-open-domain-chatbot-488e98f658a7 https://towardsdatascience.com/blender-bot-part-3-the-many-architectures-a6ebff0d75a6