State-of-the-art Conversational AI
Ricardo Rei
01
Generative Pretrained Transformer
3
Generative Pretrained Transformer (GPT)
In 2018 and 2019, Alec Radford, Jeffrey Wu and their co-workers proposed two language models trained on a very large amount of data: GPT and GPT-2. Latter at ACL2020 Zhang et al., 2019 presented DialoGPT, a GPT model trained on large amount of conversational data from reddit.
4
Generative Pretrained Transformer (GPT)
We just have to teach them new skills! for example how to impersonate a character
5
Generative Pretrained Transformer (GPT)
6
Generative Pretrained Transformer (GPT)
Taking into account that the model was used to see continuous text (such as wikipedia articles etc..) the model knew nothing about the differences between history, persona and reply. In order to help the model understand that these segments have different meanings we introduce 2 things:
7
Generative Pretrained Transformer (GPT)
[BOS] I like playing football. I am from NYC [SPEAKER1] Hello, how are you? [SPEAKER2] I am fine, I just watched an amazing football game! [EOS]
8
Generative Pretrained Transformer (GPT)
02
Combining Generation with Retrieval
10
Combining Generation with Retrieval
In order to help the model understand what makes a good reply we have to teach the model what is a bad reply!
To do that we will let the model look a possible answer and, using the last hidden state, let the model decide if that answer is appropriated or not.
11
Combining Generation with Retrieval
12
Combining Generation with Retrieval
After tokenization our batch will look like this:
On top of the autoregressive training we take the last token and we produce a score for each reply. Then we maximize the score of the correct answer!
03
Inference
14
Inference
After training the model we can do two things:
Decoding strategies:
I’ll not going to talk about possible decoding strategies but I recommend you to read the following blog-post: https://huggingface.co/blog/how-to-generate
All this strategies can be tested in our code: https://github.com/HLT-MAIA/lightning-convai
15
Inference
Ranking candidates:
Ranking candidates follows the same strategy described above, we give the model a batch such as this one:
For each candidate we take the last hidden state and we produce a score for each candidate. Then we only have to sort them by score and pick the candidate with the highest score.
04
Demo