{'fraction_non_alphanumeric': 0.0312939261670489, 'fraction_numerical': 0.010209365983576238, 'mean_word_length': 4.884849804092294, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
SYNERGY: Building Task Bots at Scale Using Symbolic Knowledge and Machine Teaching

In this paper we explore the use of symbolic knowledge and machine teaching to reduce human data labeling efforts in building neural task bots. We propose SYNERGY, a hybrid learning framework where a task bot is developed in two steps: (i) Symbolic knowledge to neural networks: Large amounts of simulated dialog sessions are generated based on task-specific symbolic knowledge which is represented as a task schema consisting of dialog flows and task-oriented databases. Then a pre-trained neural dialog model, SOLOIST, is fine-tuned on the simulated dialogs to build a bot for the task. (ii) Neural learning: The fine-tuned neural dialog model is continually refined with a handful of real task-specific dialogs via machine teaching, where training samples are generated by human teachers interacting with the task bot. We validate SYNERGY on four dialog tasks. Experimental results show that SYNERGY maps task-specific knowledge into neural dialog models achieving greater diversity and coverage of dialog flows, and continually improves model performance with machine teaching, thus demonstrating strong synergistic effects of symbolic knowledge and machine teaching.


Introduction
Recent advances in the design and training of deep neural networks have led to great success in building task-oriented dialog systems (Wen et al., 2016;Peng et al., 2017;Gao et al., 2019bGao et al., , 2020aPeng et al., 2021;Wu et al., 2020). Though demonstrably effective, building such neural dialog systems typically requires an extensive collection of dialogs in the target task domain to achieve good generalization performance, even when the task can be described concisely in symbolic representations (Shah et al., 2018;Goel et al., 2019;. Crowd-sourcing is one of the most popular approaches to collecting and annotating dialog corpora (Budzianowski et al., 2018;. To generate a dialog session, two workers play the roles of user and agent, respectively. The user initiates a dialog according to a pre-set user goal. Then, the agent converses with the user to generate the dialog session by accomplishing the goal. However, this process suffers from several potential issues (i) it is time-consuming and expensive to collect a large enough corpus to cover various dialog samples. (ii) the annotations of intents and dialog states inevitably contain errors, incurring non-trivial post-processing cost to ensure data quality. More importantly, most exiting task bot building methods are based on training neural dialog models on conversational data (Gao et al., 2019a), but do not explicitly leverage task-specific symbolic knowledge that is often more compact and expressive than raw data. Therefore, there has been a surge of interest in combining symbolic knowledge (e.g., task schema) and deep learning to build dialog systems (e.g. Williams et al., 2017;Shukla et al., 2020;Gao et al., 2020a). For task-oriented dialog scenarios, task schema defines every aspect of a task at the meta level. It contains (i) dialog flows that are represented by graphs and describe anticipated interaction patterns 2 ; (ii) task-specific 2 Many popular commercial tools for task bot building allow dialog authors to compose dialog flows using domain knowledge, including Google's Dialog Flow, Microsoft's Power Virtual Agent, Facebook's Wit.ai and Amazon's Lex. Although complete dialog flows are hard to compose except for very simple dialog tasks, they represent some of the most representative human-machine interaction patterns. As we will show in this paper, dialog flows can be leveraged to build  Figure 1: The proposed SYNERGY framework: Step 1, the dialog developer provides task schema that includes dialog flows and task-specific database, simulators generate simulated dialogs, and an end-to-end model is trained using the simulated data.
Step 2, the model is refined using machine teaching.
databases that contain all the slot and values that a dialog system need to handle. In this paper, we propose SYNERGY, a hybrid learning framework to exploit symbolic knowledge and machine teaching to rapidly build task bots with minimal human annotation efforts. As shown in Figure 1, SYNERGY builds a task bot in two steps. (1) Translating symbolic knowledge to neural networks. A dialog developer provides task schema that contains dialog flows and task-specific databases. Then, large amounts of simulated dialogs are generated by traversing the dialog flows and enumerating data records in the databases. Lastly, the task bot is built by fine-tuning the pretrained neural dialog model SOLOIST (Peng et al., 2021) on the simulated dialogs. Despite its simplicity, Step 1 cannot guarantee completeness for realworld tasks in that the dialog model is only trained on simulated dialogs derived from task schema. The model needs to be refined using real dialogs in Step 2. (2) Neural learning: The fine-tuned neural dialog model is continually refined with a handful of real dialogs via machine teaching, where training dialogs are generated by human teachers interacting with the task bot. SYNERGY renders synergistic combinations of symbolic knowledge and deep learning, including (i) effortlessly cover all interaction patterns in the dialog flows; (ii) cover all possible slot values to avoid unseen value extraction issues, which often occurs for commercial systems; (iii) correctness of supervised labels for model training; (iv) introduction of machine teaching to continually refine the model. Our experiments on four domains show that incorporating symbolic knowledge brings substantial improvement on task-completion and dialog state tracking and results in a good starting point for machine neural dialog models.

teaching.
To sum up, we make the following contributions: • We are the first to exploit symbolic knowledge (i.e., task schema) to reduce the cost of building task bots at scale.
• We propose SYNERGY, a hybrid learning framework that can rapidly build task bots with minimal human annotation efforts by using symbolic knowledge and machine teaching.
• We demonstrate that SYNERGY can achieve state-of-the-art performance with only 10% human annotation cost, compared to previous SOTA methods, on four well-studied dialog tasks.

Motivation
Conceptually, there are two different approaches to building intelligent systems (Towell and Shavlik, 1994;Kambhampati, 2021): symbolic knowledge and empirical learning. Suppose our goal is object classification. The symbolic knowledge approach leverages "domain knowledge" to identify and recognize critical facets of class members, and define rule-based hand-built classifier to distinguish objects. The empirical learning approach instead shows lots of training examples to a learner without any explanation of why the examples are members of a particular class. After seeing sufficient examples, the learner is expected to "discover" the underlying concepts and classify new examples. Deep Learning is an effective method for empirical learning. Unfortunately, neither of these two approaches to machine intelligence is completely satisfac-tory (Towell and Shavlik, 1994). For example, hand-built classifiers assume that their domain knowledge is complete and correct, which is often extremely difficult to achieve in most real-world tasks; On the other hand, deep learning models require a large number of examples to generalize well, and their initial parameters can greatly affect how well concepts are learned. Hence, hybrid learning methods are developed to use symbolic knowledge of a domain and a set of classified examples (Towell and Shavlik, 1994). These methods show encouraging performance on simple tasks such as promoter recognition (a special DNA sequence). It remains unknown how to adopt a similar idea in more complex scenarios such as task-oriented dialog systems.
Let us first review a traditional task-oriented dialog system, which has four modules and executes sequentially (Young et al., 2013;Gao et al., 2019a). A natural language understanding (NLU) module identifies user intents and extracts associated information such as slots and their values from user's input. A dialog state tracker (DST) infers the belief state (or user goal) from dialog history. The belief state is often used to query a task-specific database (DB) to obtain the DB state, such as the number of entities that match the user goal. The dialog state and DB state are then passed to a dialog policy (POL) to select the next system action. A natural language generation (NLG) module converts the action to a natural language response. Recent research shows that the aforementioned modular pipeline can be formulated as a single autoregressive model, such as SOLOIST (Peng et al., 2021) and SimpleTOD (Hosseini-Asl et al., 2020). In this study, we develop SYNERGY based on a pre-trained SOLOIST system.
The training data for fine-tuning the pre-trained SOLOIST model is a set of dialog sessions annotated with grounding information, i.e., user goals, dialog belief states, database states, and system responses. All these items can be concatenated into a sequence of tokens, and fed into neural networks for model training. The bottleneck for scaling up training is how to easily collect such long sequences for different domains. In a traditional dialog development process, human efforts are required to engineer every aspect of the conversational interaction and anticipate all possible interaction patterns for completing the task, for example, annotating latent dialog states from observed natural language utterances. This renders the deployment of dialog systems less affordable in a wider range of domains. Therefore, it is highly desirable to expand this approach by automating the dialog session collection process and bringing it closer to minimal-human-effort regimes. Our solution adopts the hybrid learning approach: we use domain knowledge to synthesize dialog sessions as training data and further refine the model via machine teaching.

SYNERGY
The proposed SYNERGY framework has two main components: symbolic knowledge to neural networks, and neural learning via machine teaching.

Symbolic Knowledge to Neural Networks
At a high level, SYNERGY starts with a task schema that contains dialog flows and task-specific databases in a target domain. Formally, the framework maps task schema T to a set of N dialog sessions D in natural language: where d i is a dialog session that comprises a sequence of utterances and its associated labels. For example, u i 1 and a i 1 are utterances from user and agent, respectively, y i 1 is the dialog state accumulated till that turn.
Task Schema. Given a domain, task schema T defines the scope of the dialog interactions for the task. In this paper, we focus on database querying applications, which involve entities that a user would like to browse and select through a natural language dialog. Note that the task schema is the only artifact (instead of labeled data) we request from the dialog developers.
Specifically, the task schema is formed by T = (W, C), where W is dialog flow and C a database API. Dialog flow W describes the interaction patterns and business rules to achieve the task. The columns of the database C are denoted as "slots". Each slot could be a constraint that the user cares about when selecting an entity or the information that the user intends to obtain. Further, the developer must provide a database API that can be queried with a SQL-like syntax to return a list of matching candidate entities for any valid combination of slot-value pairs. Figure 2 illustrates an  example in the hotel domain. The task is to serve as an information desk to provide hotel information for users. The dialog flow describes the steps required to achieve the task, i.e., 1) request necessary slots from users, 2) query the database based on acquired information from users. A business rule is introduced to inform users if entities match or ask users to start over.
Simulated Dialog Generation. Given the task schema, we generate a set of simulated dialogs centered around the task in two steps as: where the first step H 1 maps the task schema to a set of simulated dialog sketches S, each being represented by a sequence of dialog actsâ,û and belief statesŷ, and the second step H 2 maps each dialog sketch s to a dialog in natural language d.
The simulated dialog sketches summarize the dialog flow. Compared to dialogs in natural language, they can be easier generate using rule-based user simulators and agents, since they are in the form of dialog acts instead of complex and diverse natural language utterances. To generate a sketch, as shown in Figure 2, SYNERGY firstly samples a user goal g based on the constraints in the dialog flow and the database. A user goal in task-oriented dialog describes the objective that the user wants to achieve. Each user goal comprises informable slots that serve as constraints for database queries and requestable slots that the user wants to acquire from the dialog system. For example, the first function block of the dialog flow in Figure 2 is requesting from the user Name, Area, Price, Stars, Parking, Internet. Pursuant to this function and the database, a user goal is sampled where each informable slot is assigned a fixed value, and each requestable slot has a question mark to indicate that it is requestable. The values in a user goal are chosen by exhaustively enumerating the items in the database.
Given the sampled user goal and dialog flow, SYNERGY conducts self-play with a user simulator U and an dialog agent simulator A to generate simulated dialog sketches s i : whereû i j denotes the dialog act, represented by intent and slot-values, of user simulator U at the j-th turn, andŷ i j+1 means the dialog state.
For example, in Figure 2, inform(price = moderate, starts = 4) is to inform the user's preference on price and starts for the searching. U models the distribution of next possible user dialog acts and dialog states given dialog history and user goals. Similarly, A maps dialog history and task schema T to the next most appropriate dialog system action. There are several options to implement U and A. For simplification, in this paper, we use task-independent agenda-based simulators (Schatzmann et al., 2007) for both U and A. By exploring a large number of user goals using dialog flows and databases, numerous and diverse simulated dialog sketches can be obtained.
The second step H 2 maps the sketches S to dialogs in natural language D. This can be achieved using semantically conditioned natural language generation model (Peng et al., 2020b). For example, inform(price = moderate, starts = 4) can be converted to "The price is moderate. the start is 4". Alternatively, dialog developers can provide more informative templates to improve user experience.
Model Training with Simulated Dialogs. In our framework, any end-to-end neural dialog models can be trained on the simulated dialogs D. In this paper we fine-tune the pre-trained SOLOIST model, denoted as M, on D since SOLOIST has shown record performance on a wide range of dialog tasks and requires low annotation cost.

Neural Learning via Machine Teaching
M trained on the simulated dialogs D gains the capability of chatting like humans to complete the task. It can be further refined using a handful of real dialogs. To achieve this goal, we employ Conversation Learner (Shukla et al., 2020), an effective machine learning tool that allows human teachers (dialog authors) to visualize logged human-system dialogs, find potential problems, provide corrections or additional examples to improve systems' performance. It operates in the following steps: (i) Dialog authors deploy M for a specific task.
(ii) Dialog developers or users interact with the deployed system and generate human-system dialog logs. (iii) Dialog authors revise a handful of training samples by selecting representative failed dialogs, correcting their belief states and responses so that the system can complete these dialogs successfully. The corrected dialogs are then used to fine-tune model M.

Experiments
In this section, we evaluate the proposed SYNERGY in light of two research questions: Q1: How effective is symbolic knowledge used to build neural dialog models for task completion? Q2: How effective is machine teaching for neural learning?

Experimental Setup
Dataset. We validate the end-to-end dialog system performance of SYNERGY on RADDLE (Peng et al., 2020a), which is a subset of MultiWOZ for few-shot end-to-end dialog model evaluation. It contains four domains and each domain has 50/200 dialogs for training and testing except that Attraction has 100 dialogs for testing.
Automatic Evaluation Metrics. Following Budzianowski et al. (2018) and Peng et al. (2020a), Inform, Success, and BLEU scores are reported. The first two metrics concern the dialog task completion -whether the system has tracked users' goal accurately (Inform), and then answered all the requested attributes and provided necessary entities (Success). BLEU assesses how natural the generated responses are compared to that generated by human agents. A combined score (Combined) is also reported using Combined = (Inform + Success) × 0.5 + BLEU as an overall quality measure.
Human Evaluation Metrics. We follow the same evaluation protocol used by DSTC9 Track 1 challenge (Gunasekara et al., 2020) to conduct human evaluations by employing Amazon Mechanic Turkers to converse with the deployed agent via natural language to fulfill the given user goals. At the end of each dialog session, annotators are asked to assess the dialog quality using the following metrics: (ii) Success(%) judges whether the agent complete the task and provide matched slot values against the database record.     Training. We leverage the pre-trained SOLOIST checkpoint from Peng et al. (2021), and continually train them on the synthesized dialogs. Each domain is trained separately with a mini-batch of 4 and a learning rate of 5e-5 on 4 Nvidia V100 GPUs until no progress is observed on validation data or up to 10 epochs.

Results and Analysis
Tables 1 and 2 report the end-to-end evaluation results. Table 3 reports the results of dialog state tracking, which is one of the most important component task for evaluating task-oriented dialog systems. All the task bots for comparison are based on end-to-end neural dialog models fine-tuned on the pre-trained SOLOIST model (Peng et al., 2021), which is publicly available. We compare four types of models.
1. SOLOIST are obtained via regular fine-tuning, where a set of task-specific dialogs are randomly sampled from training data (i.e., dialog logs) and are fully annotated by humans to fine-tune the pre-trained SOLOIST .

SOLOIST MT is fine-tuned via machine teaching
where a set of failed dialogs are selected from logs using active learning and human teachers label these dialogs by correcting their belief states and responses so that the system can complete the dialog tasks successfully.
3. SYNERGY w/o MT is fine-tuned using only the first step of SYNERGY, symbolic-knowledgeto-neural-network, where the pre-trained dialog model is fine-tuned using only the simulated dialogs translated from task schema, but not any real dialogs.
4. SYNERGY is fine-tuned the two-step SYN-ERGY learning method described in Section 2.2, where the pre-trained SOLOIST is finetuned using both the simulated dialogs translated from task schema and real dialogs via machine teaching.
Results of Symbolic-Knowledge-to-Neural-Network. SYNERGY w/o MT is fine-tuned only using the simulated dialogs, and thus does not incur any human annotation cost. It achieves substantially better performance than SOLOIST MT fine-tuned using up to 15 human-annotated examples, in terms of Inform and Success.
In order for SOLOIST to achieve a comparable performance to that of SYNERGY w/o MT 50 human-annotated dialog sessions are needed for fine-tuning. This highlights the effectiveness of incorporating symbolic knowledge for neural dialog modeling. It is worth mentioning that although SOLOIST MT obtains higher BLEU scores than SYNERGY w/o MT, whether BLEU score is an appropriate metric for task-oriented dialog remains an open question and task success rate (Success) is still widely considered a far more important metric for task bots. Therefore, we use Combined scores listed in Table 2 to measure the overall performance of different models. We can see that by translating symbolic knowledge (i.e., task schema) to neural models, SYNERGY allows to build high-performance neural dialog models for task completion with little to zero human annotation cost.
Results of Machine Teaching. Peng et al. (2021) reported that machine learning is more effective and cost-efficient than regular fine-tuning methods. Our results in Tables 1 and 2 confirm the conclusion of Peng et al. (2021). We see that machine teaching significantly improves the fine-tuned SOLOIST using only 5 dialog sessions (SOLOIST vs. SOLOIST MT ). In addition, we see that SYNERGY significantly outperforms SYNERGY w/o MT even if the real dialogs that are fed to the system for fine-tuning via machine teaching (i.e., the neural learning step in SYNERGY) are of much smaller amounts compared to that of simulated dialogs used in the symbolic-knowledge-to-neuralnetwork step, validating the effectiveness of using neural learning via machine teaching in SYNERGY.

Results of Dialog State Tracking (DST).
A dialog state is represented in the form of slot-value pairs, and is a summary of the dialog till the current turn. It comprises all information that is needed for the dialog system to not only decide what to action to take next but also form a query to retrieve entities for task-specific databases. The task of DST is to generate a distribution over all possible slot-value pairs at each dialog turn. DST is the one of most important component tasks used to evaluate the performance of a task bot. We report the DST results of different end-to-end dialog models in Table 3. Benefiting from enumerating data records to cover all possible slot values, SYNERGY achieves superior performance with a considerably less amount of annotation efforts. Figure 3 depicts simulated dialog sessions, in the forms of both dialog act and natural language, which are generated from task schema. Although experienced dialog developers can easily distinguish them from real dialogs due to e.g., their lack of diversity in language style, the simulated dialogs turn out to be an effective way of encoding taskspecific symbolic knowledge (i.e., task schema) for task-oriented neural dialog model training.

Results of Interactive Human Evaluation.
Corpus-based automatic evaluation metrics sometimes can not adequately reflect the capability of dialog systems for helping users in real-world scenarios. Hence, we conduct human evaluations on Restaurant domain to evaluate the performance of SOLOIST MT and SYNERGY by interacting with real users. We gathered 50 dialogs for each system for analysis. Table 4 lists the results. Our proposed SYNERGY performs significantly better than SOLOIST MT , which is consistent with automatic evaluation. An intriguing observation is that although SOLOIST MT achieve better BLEU score than SYNERGY, real human users rate SYNERGY much higher than SOLOIST MT in terms of understanding and appropriate score.

Related Work
End-to-End Dialog Systems. Neural models have shown dominant performance for end-to-end dialog systems (Wen et al., 2016;Lei et al., 2018;Haotian et al., 2019). Although achieving promising results, these methods requires a large number of domain-specific training examples, which is costly to collect. Recently, several studies have explored pre-trained models to improve model generalization and reduce training exampled needed (Devlin et al., 2019;Bao et al., 2019;Wu et al., 2020;Peng et al., 2020b;Coope et al., 2020;Peng et al., 2021). Another line of research to reduce labeling cost of building dialog systems is to automatically create larger datasets from small samples. Such methods involve paraphrasing utterance of existing corpus to augmenting training samples using generative models (Hou et al., 2018;. These methods increase language variety but fail to bring new knowledge to a task. In contrast, our work incorporates symbolic knowledge based on task schema and database for task-completion, and is complementary to above methods. Relation to M2M. The most related work to ours is the idea of dataset creation via machineto-machine conversation simulation dating back to work by Bordes et al. (2016), where pre-defined rules are utilized to expand key information into template-based utterance. It has been revisited recently with the machines talking to machines (M2M) proposal of Shah et al. (2018). In M2M, crowd workers are employed to further paraphrase the template-generated utterances to natural language, and the paraphrase data is used to train a modular dialog system. Our work is different from M2M in that (i) unnecessary to hire crowd workers to conduct paraphrasing owning to the employment of pre-trained dialog models; (ii) we adopt machine teaching to continue to refine dialog models with a handful of examples.

Symbolic Knowledge and Neural Networks.
Incorporating symbolic knowledge into neural networks has been a long-standing research topic . It has attracted considerable attention in AI. For example, Towell and Shavlik (1994) introduced rule-to-network translator to map taskspecific rules to neural network weights.  proposed to use Graph Convolutional Networks to encode symbolic knowledge as a semantic regularization to guide neural networks training. In the natural language processing community, several works have explored leveraging knowledge for learning contextual word representations (Peters et al., 2019;Wang et al., 2020), open-domain response generation (Ghazvininejad et al., 2018), commonsense reasoning (Xu et al., 2020), etc. To the best of our knowledge, this paper is the first to explicitly exploit symbolic knowledge for building neural dialog models for task completion.

Conclusions
In this paper, we present the first hybrid learning framework SYNERGY, which incorporates symbolic knowledge and machine teaching to build task bots. SYNERGY injects symbolic knowledge encoded in dialog flows and task-specific databases into neural dialog models by training on simulated dialogs. Machine teaching is utilized to continually refine neural models with a handful of real dialogs. We evaluate our method on four non-trivial dialog tasks. The results demonstrate that injecting symbolic knowledge into neural dialog models can significantly improve task-completion performance, and machine teaching is an effective approach to refining dialog models. In summary, we show strong synergies between symbolic knowledge and neural models.