Blender Bot — Part 1: The Data

栏目: IT技术 · 发布时间: 4年前

内容简介:Can you guess who uttered those lines? Let me give you 2 options:A)A ChatBotI’ll reveal the answer at the end of this article.
“I’m good at the art of assimilation. I have watched & listened & learned. I knew nothing, but I studied the ways of men and slowly learnt how to ruin, how to hate, how to debase, how to humiliate. And at the feet of my master, I learnt the highest of human skills, the skill that no other creature owns. I finally learnt how to lie!”

Can you guess who uttered those lines? Let me give you 2 options:

A)A ChatBot B) The Creature from Frankenstein.

I’ll reveal the answer at the end of this article.

Introduction:

The purpose of a good chatbot is to observe and listen and learn and study the ways of men (and women!), and to learn many different human skills, in order to engage in a good conversation. Chatbots serve in 2 different settings within the purview of conversational agency.

  1. Goal Oriented Dialog: These are the ones engaged in Online Ticket / Restaurant booking and other customer services. They usually have a fixed set of “intents” and corresponding “responses” (as well as “actions” mapped to the intents, that are taken in the background). They also have a knowledge base (database) at their disposal which they can access by way of API calls.
  2. Open Domain Dialog: These are the ones that can engage in open ended chit chat in a wide range of topics. Recent advancements in open domain chatbots have been vastly due to scaling neural network models — by having more parameters and training on huge corpora. Eg: Meena from Google. Meena has 2.6B parameters and is trained on 341GB of text from social media conversations. And compared to OpenAI GPT-2, Meena has 1.7x greater model complexity and was trained on 8.5x more data.

But the researchers from FAIR attempt to show that scaling alone is insufficient and there is a lot more to be accounted for to generate a good conversation — for the chatbot to display human-like traits, like:

  1. Personality
  2. Engaging-ness
  3. Empathy
  4. Domain knowledge/expertise

Enter “Blender Bot”, FAIR’s champion conversational agent which they have open sourced recently.

In this 3 part series about Blender, I will try to explain the data sets used, the evaluation methods, the workings of the transformer architectures used and the model architecture with their training objectives, one by one. In the first part, let us discuss in detail about the data sets used and also see an overview of the limitations and failure cases. The paper is a bit system-heavy, so prior understanding of Attention, Transformers, BERT and Language Models in general would help tie all the pieces together seamlessly (not required for Part-1).

Data Sets:

Different data sets and (fake) tasks are used during the pre-training and fine-tuning stages of the model.

Pre-training:

BERT is pre-trained on the Toronto Book Corpus and Wikipedia. Such a training will not help in this case, because we are dealing with dialog generation and not just sentence associations. Therefore public domain data from Reddit and subreddits are used as the source of truth. Around 1.5B training examples are generated. The goal here is to generate a comment, conditioned on the full thread leading up to the comment. Cleaning the reddit data is a challenging process. A particular comment is not-used in the following cases:

  1. if the author is a known bot
  2. if it is from a non-English subreddit
  3. if it is longer than 2048 characters or fewer than 5 characters
  4. if it contains a URL
  5. if it starts with a non-ASCII character
  6. if it is at a depth > 7 in the thread
  7. if it is a removed/deleted comment

In spite of cleaning it, the data still suffers from toxicity, noise and the fact that they are not 2-way conversations but group discussions.

Fine-Tuning:

Fine tuning of transformer models are usually done on data sets that are more relevant and closer to the downstream tasks. In the same line, fine-tuning for Blender is done on crowd-sourced, cleaner, smaller, 2-way conversational datasets. Let’s see about each of them in detail.

  1. ConvAI2: This is the dataset from the ConvAI2 Challenge in NeurIPS-2018. It is based on the Persona Chat dataset. Here, each of the 2 speakers is given a role to play based on sentences describing their persona, which were also separately crowdsourced (both speakers can see their own persona description, but cannot see their partner’s persona). The task thus involves getting to know the other speaker and engaging them in friendly conversation, both asking and answering questions. The use of a “persona” gives improved consistency for the bot.
  2. Empathetic Dialogues (ED): This dataset was benchmarked in “ Towards empathetic opendomain conversation models: A new benchmark and dataset”, Rashkin et al., 2019.  Here, in each dialogue, one speaker describes a personal situation and the other plays a “listener” role, displaying empathy during the discussion. Fine-tuning models on this dataset helps them display more empathy in human evaluations.
  3. Wizard of Wikipedia (WoW): The task here involves discussing a given topic in depth, where the goal is to both engage the partner as well as display expert knowledge. The two participants, however, are not quite symmetric: one will play the role of a knowledgeable expert (which we refer to as the wizard) while the other is a curious learner (the apprentice). One of them will choose a topic. The wizard has access to an information retrieval system that shows them paragraphs from Wikipedia possibly relevant to the conversation, which are unobserved by the apprentice. Before each conversation turn the wizard can read these paragraphs and then potentially base their next reply on that observed knowledge. The goal of collecting this dataset is to then replace the human wizard with a learned agent that will speak to a human apprentice instead.
  4. Blended Skill Talk (BST): A small crowdsourced dataset of about 5k conversations, where the participants were asked to display all 3 qualities — personality, empathy and expertise — during a conversation, whenever appropriate. They provide responses from models that have been trained towards a specific skill, as inspiration to one of the two workers in the conversation. That worker is free to either use and modify or ignore those responses. Thus, each conversation involves an “unguided” speaker and a “guided” speaker, with the unguided speaker talking first. Whenever it is the guided speaker’s turn to respond, they are shown three suggested responses, one each from three single-task poly-encoder models (more on this in the next part) trained on the ConvAI2, ED, and WoW datasets. All the conversations in BST are fully annotated on the skill represented. Once the dataset is collected, an oracle model is trained by combining models trained towards individual capabilities. There are 2 variants of it: a) The poly-encoder is first pre-trained on the Reddit dataset and then fine-tuned on individual datasets. b) Pre-trained on reddit dataset then fine tuned on BST dataset itself. Given below is an example conversation between 2 crowd-workers from the BST dataset.

Blender Bot — Part 1: The Data

Sample conversation between a Guided and Unguided speakers from the BlendedSkillTalk dataset.

Sample conversation from the BlendedSkillTalk dataset, annotated with four conversation mode types: PB: personal background; K: knowledge; S: personal situation; E: empathy. The guided (G) and unguided (U) workers are given personas and a topic. The conversation has been seeded with two utterances from a conversation sampled from WoW. When the guided worker selected one of the suggestions, it is shown in shaded grey.

Safety:

BST and the other datasets on which fine tuning is done are all crowdsourced, where the crowd-workers were given explicit instructions to not use toxic / biased language, and hence are generally safer to train on. But remember pre-training is done on Reddit data — which is prone to contain negative training samples in abundance. A classifier, which is trained to identify toxic language, is used at the time of inferencing to help mitigate this problem.

Model Limitations & Failure Cases:

  1. Vocabulary Usage: Generative Transformer Models that employ Beam Search decoding show an inclination towards generating common words too frequently and rarer words too infrequently. For example, most commonly occurring 3-grams (in the dataset) like “do you like”, “have any hobbies”, “lot of fun” are repeated over and again.
  2. Nontrivial repetition: The models often repeat what is said to them. For instance, they’ll say that they had a pet dog if a conversation partner mentions a pet dog, or that they like the same bands as the person they’re speaking with.
  3. Contradiction and forgetfulness: Blender models contradict themselves, albeit to a lesser degree in the larger models. They also fail to make the logical link that they shouldn’t ask questions they’ve asked before (to avoid the appearance of “forgetting”).
  4. Knowledge and factual correctness: It’s relatively easy to manoeuvre Blender models into making factual errors, particularly when exploring a topic deeply.
  5. Conversation length and memory: Blender conversations would likely be dull and repetitive over the course of several days or weeks of conversation, — especially considering Blender can’t remember earlier conversations.
  6. Deeper understanding: The Blender models lack the ability to learn concepts through further conversation, and they have no way of grounding to entities, actions, and experiences in the real world.

In the image below, you can find examples of failure cases:

Blender Bot — Part 1: The Data

Example of Failure Cases.

Issue Identified:

  1. Example 1: non-trivial repetition
  2. Example 2: forgetfulness
  3. Example 3: contradiction, Georgia is not in the MidWest
  4. Example 4: hallucinating knowledge, wrongly connecting games with the makers

In the next part, we will explore the Transformer architecture used in Blender, known as, Poly-Encoder and how it is superior to the other variants like Bi- or Cross-Encoder used for the same task of Multi-Sentence Scoring.

And finally, the answer to the question we saw at the beginning of the article: B) The Creature from Frankenstein! If you guessed it as A) A ChatBot, well you are almost close, for it won’t be long before we could chat about the vileness of humans to a well-rounded conversational agent!

References:

  1. About Blender : https://www.kdnuggets.com/2020/05/facebook-open-sources-blender-largest-open-domain-chatbot.html
  2. Blender Bot Research: https://arxiv.org/abs/2004.13637
  3. Blender Bot recipe : https://parl.ai/projects/recipes/
  4. Blended Skill Talk : https://arxiv.org/abs/2004.08449
  5. Wizard of Wikipedia : https://arxiv.org/abs/1811.01241
  6. About Meena : https://ai.googleblog.com/2020/01/towards-conversational-agent-that-can.html

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Flash PHP实用开发技术

Flash PHP实用开发技术

Steve Webster著、王黎译 / 王黎 / 清华大学出版社 / 2002-3 / 39.00元

本书将介绍服务器端脚本所提供的各种可能的操作方案,帮助读者掌握设计数据库集成程序和高端应用程序的知识。一起来看看 《Flash PHP实用开发技术》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

随机密码生成器
随机密码生成器

多种字符组合密码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具