SC O R E : P RE -T RAINING FOR C ONTEXT R EPRESENTATION IN C ONVERSATIONAL S EMANTIC P ARSING
A BSTRACT
Conversational Semantic Parsing (CSP) is the task of converting a sequence of natural language queries to formal language (e g., SQL, SPARQL) that can be executed against a structured ontology (e g. databases, knowledge bases).
To accomplish this task, a CSP system needs to model the relation between the unstructured language utterance and the structured ontology while representing the multi-turn dynamics of the dialog.
Pre-trained language models (LMs) are the state-of-the-art for various natural language processing tasks.
However, existing pre-trained LMs that use language modeling training objectives over free-form text have limited ability to represent natural language references to contextual structural data.
In this work, we present SC O R E , a new pre-training approach for CSP tasks designed to induce representations that capture the alignment between the dialogue ﬂow and the structural context.
We demonstrate the broad applicability of SC O R E to CSP tasks by combining SC O R E with strong base systems on four different tasks (SP AR C, C O SQL, MW O Z, and SQA).
We show that SC O R E can improve the performance over all these base systems by a signiﬁcant margin and achieves state-of-the-art results on three of them
I NTRODUCTION
The goal of task-oriented dialog systems is to assist the user in completing a certain task by performing an action or retrieving relevant information (Tur & Mori, 2011).
They are often built on top of a structured ontology grounded in a knowledge base, a database, or a set of API calls.
This in contrast to open-domain dialog systems (also referred to as chit-chat systems) where the goal is to maximize engagement with users in open-ended conversations (Jafarpour et al., 2010; Ritter et al., 2011).
A key component of task-oriented conversational systems is Conversational Semantic Parsing (CSP), which converts each utterance in the dialog into a formal language query (e.g., SQL, SPARQL) that can be executed against the structured ontology.
CSP has been extensively studied in several academic and industrial research settings such as dialog systems (e.g., dialog state tracking in
MW O Z (Budzianowski et al., 2018)), interacting with physical agents (e.g., (Chai et al., 2018)), context-dependent semantic parsing (e.g., SP AR C
(Yu et al., 2019b)), SQL-grounded state tracking (e.g., C O SQL (Yu et al., 2019a)), and sequential question answering (e.g., SQA (Iyyer et al., 2017)).
These settings differ in some respect, but they share the same overall objective and key challenge: how to jointly represent the natural language utterances and underlying structured ontology while taking into consideration the multi-turn dynamics of the dialog .
Similar to many other natural language tasks, recent work in CSP has signiﬁcantly beneﬁted from advances in language model pre-training.
However, existing general-purpose pre-trained language models, e.g. BERT (Devlin et al., 2019), are pre-trained on free-form text data using language model objectives.
This limits their ability in modeling the structural context or the multi-turn dynamics of the dialogs.
This presents an opportunity to improve pre-trained LMs to speciﬁcally address these limitations for CSP tasks.
Recent work has demonstrated the beneﬁts of adapting pre-trained LMs [Figure] [Figure] [Figure]
[Table]
[Figure] [Figure]
[Table]
[Figure] [Figure]
TCS 
 TCS 
 CCS 
 CCS 
 CCS 
 CCS <mask> MLM to speciﬁc domains (Gururangan et al., 2020) or tasks (Zhang et al., 2019b) via a second phase of pre-training.
For example, open-domain dialogue language models such as DialoGPT (Zhang et al., 2020) and ConveRT (Henderson et al., 2019) are pre-trained on the Reddit data and applied to dialog response generation and retrieval tasks.
In this paper, we introduce SC O R E ( S tructured & S equential Co ntext Re presentation), a language model pre-training approach for CSP tasks.
SC O R E adapts general pre-trained LMs by introducing a second phase of pre-training using multiple objectives that capture both multi-turn dynamics and the structural contexts in a dialog.
In contrast to open-domain dialogs, CSP datasets are usually much smaller due to the difﬁculty and expense of obtaining and labeling data (mapping natural language utterances to formal language).
Unlike most prior work on contextualized LMs which are pre-trained on free text, according to the ﬁnding where questions in CSP tasks are more compositional than other free-text since they can be mapped into formal representations, we propose to train SC O R E on synthesized conversational semantic parsing data with multiple training objectives that aim to ground utterances into the schema of the underlying ontology and to model the relationship between different utterances in the multi-turn conversation.
In this way, SC O R E can effectively inject structural and conversational inductive biases in LMs that can translate to many CSP tasks.
SC O R E uses an order of magnitude smaller dataset for the second stage of pre-training, does not require changes to the pre-trained model architecture, can be used as a drop-in replacement of general pre-trained LMs with any semantic parsing model, can be out many
We apply SC O R E to four different CSP tasks: (1) sequential text-to-SQL (SP AR C), (2) conversational text-to-SQL (C O SQL), (3) dialog state tracking (MW O Z), and (4) weakly-supervised sequential question answering (SQA).
The fours tasks represent different scenarios, types of ontologies, supervision signals, system responses, and domains (see Table 1 for a detailed comparison and Figurefor examples).
We demonstrate that: (1) SC O R E training objectives can effectively incorporate synthesized data, (2) a single pre-trained SC O R E model can be used for several CSP tasks and can be combined with many baseline systems with different model architectures and (3) SC O R E signiﬁcantly improve all baseline systems and achieves new state-of-the-art results on three benchmarks (SP AR C, SP AR C, and MW O Z) and comparable performance to state-of-the-art results on the fourth (SQA).
A PPROACH
The key challenge of CSP is to capture the relationship between the natural language utterance and the structured ontology in the multi-turn dialog dynamics.
To this end, we inject structural and conversational inductive biases in SC O R E by introducing two objective functions: Column
Contextual Semantics (CCS) and the Turn Contextual Switch (TCS) .
Because the size of existing semantic parsing datasets is limited, we produce synthesized data for pretraining SC O R E by sampling from the context-free grammar induced from complex text-to-SQL examples in different domains. Moreover, to prevent SC O R E from overﬁtting to the linguistic pattern of our synthesized data, we use the Masked Language Modeling (MLM) objective on human-generated utterances as regularization.
2. P RELIMINARIES
Task Deﬁnition
In CSP, at each turn t , we aim to produce a formal representation q t given the current utterance u t , the interaction history h t =
[ u 1 , u 2 , . . .
, u t − 1 ] , and the schema c (table and column names, slots, etc.) of the target database (ontology) d .
To cover different problem variants, we
[Table] [Table]
consider four popular CSP tasks shown in Table 1: They have different target formal language and structured ontology:
• For the utterance u , it is the user question for SP AR C and SQA, while for C O SQL and MW O Z, u is the combination of a user query and a system response.
• For the database d , SP AR C and C O SQL use multi-table databases; for MW O Z, the pre-deﬁned ontology d can also be viewed as a database; for SQA, d is a single table.
• For the formal representation q , it is the SQL query for SP AR C and C O SQL; in MW O Z it is the slot-value pairs that can be viewed as simple SQL queries consisting of SELECT and WHERE clauses; and for SQA, q is the latent program.
Base Architecture
The base architecture of SC O R E takes as input a single turn of a CSP dialog (cid:104) u t , h t (cid:105) jointly with the underlying database schema c .
Given this contextualized conversational input C t = (cid:104) u t , h t , c (cid:105) , SC O R E encodes it into contextualized conversation representations (cid:126)S t for each token in C t .
The encoder architecture follows RoBERTa
(Liu et al., 2019b).
It is then followed by a linear layer and normalized (Ba et al., 2016) to produce ﬁnal representations (cid:126)h t for each token:
C t = (cid:104) u t , h t , c (cid:105) , (cid:126)S t
[Equation]
R
[Equation]
C t ) ,
[Equation]
t,i
[Equation] LayerNorm [Equation] where GELU is an activation by Hendrycks & Gimpel (2016) and W 1 is a learned parameter matrix.
To build C t , we ﬁrst concatenate current utterances u t and dialog history h t separated by a special token 
 , as this simple strategy has been shown effective in state-of-the-art CSP systems (Zhang et al., 2019c; Wu et al., 2019; Liu et al., 2020;
Heck et al., 2020).
To incorporate the database schema, we follow Hwang et al.
(2019) to concatenate all column names as a single sequence.
Column names are separated by the special token 
 and preﬁxed by their corresponding table name.
2. SC O R E P RE - TRAINING
SC O R E addresses the challenges of CSP by pre-training a task-oriented language model contextualized by the conversational ﬂow and the underlying ontology .
In pre-training, the SC O R E model is self-supervised by two novel objectives in addition to the established Masked Language Modeling (MLM) objective.
These objectives facilitate the accurate representation of the conversational ﬂow between dialog turns and how this ﬂow maps to the desired columns in the ontology.
Column Contextual Semantics
The ﬁrst challenge of CSP is capturing the alignment between the natural language utterance and the underlying database schema.
To address it, we optimize the
SC O R E model with the auxiliary objective of Column Contextual Semantics (CCS) .
For each column in the database schema c , CCS targets the operations that should be performed on this column in a given conversational turn.
Speciﬁcally, each formal representation q is decomposed into operations on columns and tables, e.g. GROUP BY and HAVING for SQL queries, or WHERE for the slot-value pairs.
In this way, our data covers 148 column operations.
We use the encoding of the special token
right before each column or table name to predict its corresponding operations, and then compute the CCS loss:
[Equation]
where h ct,i is the contextualized representation of the i th column’s special token <
/s> in the contextualized input C t , CCS ( q t ) returns the column operation label for the current formal representation q t ,
CrossEntropy 148 computes the 148-way cross-entropy between the column operation prediction and label, and W 2 is a learned parameter matrix.
[Figure]
[Figure] [Figure]
[Figure]
[Table]
[Figure] [Figure] [Table]
[Figure]
Turn Contextual Switch
The second challenge of CSP is capturing the conversational context ﬂow and how it is grounded into the formal representations.
The TCS objective aims to capture this grounding of context ﬂow.
To this end, it targets predicting the difference in formal representations between dialog turns based on the natural language utterance.
Based on the context-free grammar of SQL, we identify 26 possible turn difference operations that a conversational turn could elicit.
They encode changes between different turns of user queries (the system response is not involved here) since we assume that most turn contextual shifts are from the user.
For example, INS(WHERE) indicates inserting a new WHERE condition and DEL(SELECT.agg) indicates removing an aggregate operation from a SELECT statement (e.g. when an utterance “Show all the ages instead.”
elicits a change SELECT MAX(age) ...
→ SELECT age ... ).
We use the encoding of the special token
right before each turn to predict the context switch label between this turn and the previous history:
[Equation]
(3) where H st ∈ R ( t − 1) × d is the contextualized representation of all previous turns in C t with hidden dimension d , TCS ( q t , q t − 1 ) returns the turn difference operations from q t − 1 to q t , and W 3 is a learned parameter matrix.
We don’t use this objective to pre-train SC O R E for MW O Z because the context switch label between turns is relatively simple in MW O Z (only select and where changes).
Masked Language Modeling As in prior work on large-scale language models (Devlin et al., 2019), we use the Masked Language Modeling (MLM) objective to facilitate contextual representation learning for natural language utterances.
Importantly for regularization, we only apply this loss on in-domain human-annotated natural language data.
Namely, it includes utterances in SP AR C,
C O SQL, and SQA as well as nine task-oriented dialog datasets processed by Wu et al.
(2020) for
MW O Z (see data statistics in Figure 4).
Formally, the MLM loss is given by:
[Equation]
where h mt are the contextualized representations of the masked 15% of tokens in C t , and W 4 is a learned parameter matrix.
Pre-Training Setup and Steps To summarize the pre-training steps, we ﬁrst collect a dataset D nat of combined human-annotated natural language questions (without labels) from existing CSP tasks (as mentioned above), and create a large synthesized conversational data D syn that is generated by a grammar induced from a small set of SP AR C annotated examples (See 2.3).
After that, we incorporate both two datasets in pre-training.
More speciﬁcally, synthetic and natural examples are randomly sampled during pre-training.
The total pre-training loss is the sum of the three objectives with CCS and TCS only applied to D syn and MLM only to D nat :
[Equation]
[Equation]
Figure 2 shows an overview of SC O R E pre-training on an example SP AR C dialogue from Figure 1.
We report additional implementation details for pre-training SC O R E in Section 3.3 and Appendix C.
2. D ATA S YNTHESIS
We re-use the synthetic dataset of 120k synthetic task-oriented dialogues for MW O Z, introduced by
Campagna et al.
In this work, we introduce a complementary procedure to synthesize data for conversational text-to-SQL dialogues.
We use about 400k tables in W IKI T ABLES (Bhagavatula et al., 2015) (after ﬁltering and cleaning), WikiSQL, and Spider datasets as underlying databases d , and then synthesize about one dialog for each table.
Finally, we synthesize 435k text-to-SQL conversations in total.
Table 12 in Appendix B shows an example of the synthesized question-SQL pairs and their corresponding templates in our grammar. [Table] [Table] else
[Table]
[Table]
ONSTRAINT
[Table]
HECK
[Table]
c
[Table]
p ) then
[Table]
[Table]
[Table]
[Table]
[Table] [Table] h To this end, we use only 500 dev examples from SP AR C to induce two utteranceSQL generation grammars: (1) a singleturn context-free grammar G s for generating context-independent question-SQL pairs, and (2) a follow-up context-free grammar G c for follow-up question-SQL pairs.
The single-turn grammar G s contains a list of synchronous question-SQL templates where typed slots ( COLUMN0 , OP0 , VALUE0 , . . . )
represent mentions of tables, columns, values, and SQL operations.
The follow-up grammar G c contains context switch labels and lists of follow-up question templates.
For example, if the context switch label is INS(SELECT.column0) , the corresponding question could be “How about show column0 too?” .
To ensure generalization, we only induce the grammars from the SP AR C training set.
Appendix B shows examples of the grammar rules and synthesized utterances.
The data synthesis procedure using the two grammars is shown in Algorithm 1.
Given a database d and a sampled single-turn question-SQL template, the function R AND A SSIGN S LOTS samples values (column names, cell values, and SQL operations) for typed slots in the template and returns the ﬁrst synthesized question ˜ u 0 and the corresponding SQL query ˜ q 0 .
To generate T follow-up question-SQL pairs, the function C ONSTRAINT C HECK ( r c , ˜ q p ) checks if the previous query
˜
q p satisﬁes constraints of the sampled template r c (e.g. contains its mentioned nonterminal).
Finally, E DIT A SSIGN (˜ q p , r c ) edits the previous SQL ˜
q p to generate the current follow-up SQL label ˜
q t and samples values for typed slots in the template to generate the corresponding follow-up question ˜ u t .
E XPERIMENT S ETTINGS 3. D ATASETS AND E VALUATION M ETRICS
We evaluate SC O R E on four popular CSP tasks: SP AR C (sequential text-to-SQL), C O SQL (conversational text-to-SQL), MW O Z (dialogue state tracking), and SQA (sequential question answering), summarized in Table 1.
SP AR C
(Yu et al., 2019b) 1 is a large collection of sequences of inter-related context-dependent question-SQL pairs.
It contains 4.3K questions sequences and 12k+ questions.
C O SQL (Yu et al., 2019a) 2 is a large conversational text-to-SQL corpus, with 3k dialogues, collected under the Wizardof-Oz (WOZ) setting.
We focus on the SQL-grounded dialogue state tracking task which maps user intents into SQL queries if possible given the interaction history.
Both SP AR C and C O SQL cover 200 complex DBs spanning 138 domains.
MW O Z (Budzianowski et al., 2018;
Eric et al., 2019) 3 is a corpus of over 10k human-human written task-oriented dialogs created through a WOZ crowdsourcing setting.
We focus on the belief state tracking task in MW O Z which maps multi-turn user utterances to slot-value annotations.
SQA (Iyyer et al., 2017) 4 is constructed from a subset of WikiTableQuestions (Pasupat & Liang, 2015) by decomposing highly compositional questions into a sequence of simple questions.
The task is weakly-supervised because each resulting decomposed question is only annotated with answers as one or more table cells, while the logic program is latent.
It has 6,066 question sequences with 17,553 questions in total on 982 unique open-domain tables from Wikipedia.
We adopt the ofﬁcial metrics deﬁned for each of the tasks.
For SP AR C and C O SQL, we report question match accuracy (QM): the exact set match accuracy (Yu et al., 2018b) over SQL templates and interaction match accuracy (IM): the ratio of interactions for which all questions are predicted correctly.
For MW O Z, we report joint goal accuracy (JGA) which is similar to the IM accuracy used in SP AR C and C O SQL.
Finally, for SQA, we report denotation QM and IM accuracies.
3. B ASE M ODELS AND OTHER B ASELINES
For SP AR C and C O SQL, we use RAT-SQL (Wang et al., 2020) as our base model.
Since it is originally developed for single-turn text-to-SQL, we extend it to a multi-turn setting by concatenating current utterances and dialog history (see Section 2.2).
Note that RAT-SQL alone, without SC O R E , achieves better or comparable results to state-of-the-art models developed for SP AR C and C O SQL.
For MW O Z, we employ Trippy (Heck et al., 2020).
It achieves state-of-the-art performance on
MW O Z and uses BERT base to encode user and system utterances and dialog history.
We report higher results (around 2%) for Trippy than reported by Heck et al.
(2020) since we train it for more epochs (25 vs. 10).
To show the improvement of SC O R E is not tied to speciﬁc base systems, we also experiment with another strong base model SOM-DST (Kim et al., 2020) for MW O Z and follow the same experimental details to train it.
For SQA, we use the weakly-supervised semantic parser proposed by Wang et al.
The model ﬁrst generates an abstract program given an input question and then instantiates it by searching for alignments between slots in the abstract program and question spans.
As it is originally developed for single-turn questions, we extend it to the multi-turn setting in the same way as RAT-SQL.
We report additional implementation details for all base models in Appendix C.
In addition to reporting results for all base models with SC O R E , we also report original base models results (with
BERT and/or R O BERT A ) and several other state-of-the-art baselines for each task.
3. D ATASET U SAGE IN P RE - TRAINING
In our experiments and ablation study, we train several versions of SC O R E with different objectives and datasets: (1) SC O R E (MLM): pre-trained on annotated natural questions using MLM.
(2) SC O R E (CCS+TCS): pre-trained on only synthesized data, which achieves the best results on SParC, CoSQL, and SQA.
(3) SC O R E (CCS+TCS+MLM): pre-trained on the synthesized data using CCS+TCS and annotated natural questions using MLM.
Furthermore, note that the synthesized data is generated using grammar induced by aboutexamples from only SP
AR C.
Therefore, no C O SQL or SQA data are seen in any pre-training steps.
For MW O Z, Campagna et al.
(2020) study only the dev examples to induce the data synthesis grammar.
R ESULTS AND A NALYSIS
Overall Results
The results of SP AR C and C O SQL, MW O Z, and SQA are in Table 2, 3, andrespectively.
We run each main experiment three times with different random seeds and report the mean.
Overall, SC O R E gains signiﬁcant improvements over BERT and R O BERT A on all tasks, achieving state-of-the-art performances on SP AR C, C O SQL, and MW O Z.
[Table]
[Table] [Table]
[Table]
For SP AR C and C O SQL in Table 2, compared with R O BERT A , SC O R E boosts the performance by 4.0% QM / 5.8% IM on SP AR C, and 2.0% QM / 2.7% IM on C O SQL.
This demonstrates the effectiveness of SC O R E on contextual semantic parsing tasks.
In addition, on MW O Z dialog state tracking task in Table 3, TripPy achieves 60.5% JGA by replacing BERT with SC O R E , outperforming the prior state-of-the-art (Hosseini-Asl et al., 2020) by 4.8%.
This indicates that dialog state tracking also beneﬁts from SC O R E .
Finally, SC O R E also achieves higher performance than R O BERT A on weakly supervised sequential question answering SQA task.
As Table 4 shows, SC O R E improves
QM by 2.6% and IM by 4.9% over R O BERT A with Wang et al.
as the base model.
This demonstrates that the enhanced ability of semantic parsing and context modeling in SC O R E is transferable to denotation-based CSP tasks.
[Table]
What is the effect of each pretraining objective?
Table 5 shows an ablation study on different pretraining objectives.
We ﬁnd that the best SC O R E results are achieved by pre-training on only synthesized data (CCS+TCS) without any natural questions (MLM) on SP AR C,
C O SQL, and SQA but not on MW O Z.
By adding MLM to CCS+TCS (CCS+TCS vs.
CCS+TCS+MLM)
, MLM actually hurts the performance (-3.9% on SParC, -0.3% on CoSQL, and -4.4% on SQA) while increases for MW O Z. One possible reason is that questions in MW O Z are more diverse in language but less compositional while semantic compositionality and turn changes are more important in the other three CSP tasks.
Also, the synthesized data used to pre-train SC O R E for SP AR C and C O SQL is generated by the grammar induced by SP AR C, which might overﬁt to
SP AR C.
In addition, SC O R E pre-trained with only MLM loss improves the performance ( 1.0%) but not as large as CCS+TCS (+5.5% on SP AR C, +1.7% on C O SQL, and +3.4% on SQA).
Finally, we test the effectiveness of TCS on SP AR C, C O SQL, and SQA by adding TCS to CCS (CCS only vs.
CCS+TCS), SC O R E gains improvements of 1.2% on SP AR C and 0.8% on C O SQL, and 4.4% on
SQA.
[Table] [Table]
Does SC O R E improve question match accuracy on individual turns?
Table 6 shows detailed results of SC O R E ’s question accuracy for individual conversation turns on the SP AR C dev set.
SC O R E provides a signiﬁcant improvement for every conversation turn except the ﬁrst (in which the task is more similar to single-turn semantic parsing).
C O SQL and SQA exhibit similar behavior and are presented in Appendix A.
[Table]
What if we use the synthesized data to simply augment the training data?
To answer this, we compare the results of the base models trained with or without the synthesized data on
C O SQL and MW O Z. As shown in Table 7, the extra synthetic data does not signiﬁcantly improve the performance, indicating that directly augmenting the synthetic data to the training set is not effective.
The similar ﬁndings are reported in many recent work (Zhang et al., 2019c; Herzig et al., 2020;
Campagna et al., 2020; Zhong et al., 2020).
In contrast, pre-training on the synthesized data with our objectives improves the performance on the downstream tasks.
[Table]
How general is SC O R E and its synthetic grammar?
For generalization in task settings, we have shown that the pre-training strategy of SC O R E can improve the performance over different CSP tasks including semantic parsing (SP AR C and C O SQL), dialog state tracking (MW O Z), and weakly supervised table question answering (SQA).
In addition, we demonstrate the effectiveness of SC O R E on different base models .
To this end, we experiment with a different base model SOM-DST for MW O Z.
As shown in Table 8, SC O R E can still improve the performance with a different base model on
MW O Z (SOM-DST+BERT vs. SOM-DST+SC O R E on syn.
MW O Z).
To demonstrate the generalization in synthetic grammar and data, as shown in Table 2 and 4, SC O R E (TCS+CCS) is pre-trained on the synthesized data of the grammar induced from SPARC only , and it still improves the performance on C O SQL (+2.7%) and SQA (+4.9%) where no any CoSQL and
SQA annotated data is seen in any pre-training steps.
Moreover, in Table 8 we show that SC O R E pre-trained on the text-to-SQL synthesized data could also surprisingly improve the performance on MW O Z.
We expect that higher performance could be achieved with SC O R E pre-trained on task-speciﬁc synthesized data.
Finally, our pre-training approach can be applied to any existing LMs including larger seq2seq LMs (e.g., BART (Lewis et al., 2020), T5 (Raffel et al., 2020)).
[Table]
Can SC O R E deliver more value when in-domain data is limited (e.g., in a low-resource setting)?
We want to answer this question similar to experiments other investigations of LMs as few-shot learners (Wu et al., 2020; Brown et al., 2020; Schick & Sch¨utze, 2020).
To this end, we compare R O BERT A and SC O R E under a few-shot setting on SQA when only 10% of training data is available.
We choose SQA because its annotation is most different from the synthetic text-to-SQL dataset we use for pretraining.
Table 9 demonstrates that SC O R E delivers even larger improvements compared to the R O BERT A baseline when only 10% training data is available (3.8% vs 2.6%).
R ELATED W ORK
Conversational Semantic Parsing Conversational semantic parsing is one of the most important research topics in conversational AI and has been studied in different settings including task-oriented dialogues, question answering, and text-to-SQL.
Task-oriented dialog systems (Henderson et al.,
2014; Wen et al., 2016; Mrkˇsi´c et al., 2017; Budzianowski et al., 2018) aim to help users accomplish a speciﬁc task (e.g. ﬂight booking) and often pre-deﬁne slot templates grounded in a domainspeciﬁc ontology.
In comparison, several other datasets were recently introduced for cross-domain conversational text-to-SQL tasks (SP AR C and C O SQL (Yu et al., 2019a;b)) and sequential questions answers over tables (Iyyer et al., 2017).
While the previous work has achieved signiﬁcant progress in different datasets separately, to the best of our knowledge, we are the ﬁrst to study four different
CSP tasks together (sequential text-to-SQL, conversational text-to-SQL, dialog state tracking, and weakly-supervised sequential question answering) by addressing the shared key challenge of learning representations in pre-trained language models that capture the alignment between the dialogue ﬂow and the structural context.
Conversational Language Model Pre-training Several recent efforts have demonstrated the value of adapting pre-trained LMs to speciﬁc tasks using different pre-training objectives, e.g., summarization (Zhang et al., 2019b), knowledge inference (Sun et al., 2019b; Liu et al., 2019a), etc.
Closest to our work is adapting pre-trained LMs for open-domain chit-chat models and for tabular data representation.
The former focuses on improving response generation on open-ended dialogues by adding a pre-training step on open-domain conversations data, such as Reddit data (Zhang et al., 2020; Henderson et al., 2019).
For example, Wu et al.
introduced ToD-BERT, a pre-trained language model combining 9 high-quality human-human task-oriented dialogue datasets to conduct language model and response selection pre-training.
However, they use language modeling training objectives over free-form text and therefore have limited ability to represent structural data.
The latter has focused on improving language model pre-training for encoding tabular data (Yin et al., 2020; Herzig et al., 2020), but they focus on the single turn semantic parsing setting.
Our approach is different from previous work because we address the challenge of conversational semantic parsing tasks by learning pretrained representation for both the multi-turn dynamics of the dialog and the relation between the unstructured language utterance and the structured ontology.
Furthermore, our pre-training approach is much more data-efﬁcient than prior LM pre-training work and saves a lot of time and computing resources (Appendix D for more details).
Our pre-training step can be done within only one day using 8 V100 GPUs.
Using Synthesized Data for Semantic Parsing Synthesized data has been frequently used in semantic parsing to alleviate the challenge of labeled data scarcity.
For example, Wang et al.
(2015) proposed a method for training semantic parsers in new domains by generating logical forms and canonical utterances and then paraphrasing the canonical utterances via crowd-sourcing.
Similar approaches were used to train semantic parsers in other domains and settings (Zhong et al., 2017;
Su et al., 2017; Cheng et al., 2018; Shah et al., 2018).
Another line of work has proposed using synthesized data to adapt single turn semantic parsing models to new domains (Jia & Liang, 2016; Yoo et al., 2018;
Campagna et al., 2019) and task-oriented dialogues (Campagna et al., 2020).
However, they reported that combining synthetic data and the supervised data does not yield signiﬁcant improvements, consistent with results by Herzig et al.
By contrast, we introduce a new data synthesize procedure for conversational text-to-SQL dialogues and use it in a different way by pretraining language models to induce better representations for many CSP tasks.
Our synthesized data can be easily generated without human involvement and the pre-trained models add value to different tasks simultaneously.
C ONCLUSION
We presented SC O R E a new pre-training approach for conversational semantic parsing.
The training objectives of SC O R E aim to induce natural language representations that capture the multi-turn dynamics, compositional semantic of the target language, and the references to the structural ontology appearing in the dialog.
SC O R E can be used with many semantic parsing models as a drop-in replacement for general pretrained LMs.
We demonstrated SC O R E effectiveness by using it as a feature representation encoder with strong baseline models for a wide range of CSP tasks.
In particular, our empirical results on four different CSP tasks demonstrated that SC O R E can be used to signiﬁcantly improve the performance of existing strong baseline models by simply replacing an existing pre-trained LM with our SC O R E pre-trained model.
Furthermore, we are able to achieve state-of-the-art results on three of these tasks.
We hope SC O R E will encourage further exploration of the beneﬁts and limitations of pre-training approaches for CSP systems.
A D ETAILED R ESULTS
[Table] [Table]
B S YNTHESIZED E XAMPLES & T EMPLATES
Table 12 shows an example of the synthesized question-SQL pairs and their corresponding templates in our grammars
[Table]
C I MPLEMENTATION D ETAILS C. SC O R E
For pre-training SC O R E on synthesized text-to-SQL data, we use R O BERT A large and pre-train it with batch size 12, gradient accumulation step 2, and maximum length 248.
We use a learning rate 1 e -5 and gradually reduce the learning rate without a warm-up period using Adam (Kingma & Ba, 2014) with epsilon 1 e -8.
BERT base is used in pre-training SC O R E on synthesized MW O Z data because it contains longer conversations.
We set the maximum length to 512 and batch size 24.
All SC O R E are pre-trained for 30 epochs, which usually take less than half a day on 8 V100 GPUs.
We experimented with SC O R E pre-trained for 5, 10, and 30 epochs and found that most of the best downstream performances occur when base systems incorporate with SC O R E pre-trained for less than 10 epochs.
Our implementation is based on the Transformers library (Wolf et al., 2019).
C. B ASE M ODELS
RAT-SQL:
For a fair comparison, all RAT-SQL experiments are trained for 40k steps.
We adopt the same hyperparameters as Shaw et al.
except for learning rates.
We ﬁnd that learning rates of 1 e -4 and 1 e -5 for RAT and BERT respectively produce more stable results.
TripPy:
We use the same hyperparameters for training TripPy on MW O Z as in (Heck et al., 2020) except we train it for 25 epochs (as opposed to 10 epochs as reported in (Heck et al., 2020)).
When we train TripPy for 25 epochs, we get a new result that is higher (around 2%) than the one reported in (Heck et al., 2020).
Similarly, when we train TripPy with SC O R E , we train it for 25 epochs.
SOM-DST: We use the same hyperparameters from Kim et al.
(2020) for all SOM-DST experiments on MW O Z.
Wang et al.
(2019): We use the same hyperparameters from Wang et al.
for SQA experiments.
Note that Herzig et al.
(2020) outperform Wang et al.
(2019) on SQA because (1) they don’t generate logic forms but select table cells and applying aggregation operators.
Wang et al.
(2019) generate latent programs, yet the grammar of the latent program can only cover 87% questions.
They reduce the search space by reusing the previous question answer.
We choose Wang et al.
as our base model because generating symbolic programs has many practical advantages (even at a cost of around 1% accuracy drop), such as showing interpretable reasoning steps, enabling formal reasoning, and operationalization without GPU/TPU accelerators.
[Figure]
Figure of pre-training time. We test the performance of SC O R E with respect to the number of pre-training epochs.
Figureshows that the best performance of the downstream tasks is usually achieved in early epochs, more speciﬁcally 5 for SP AR C and C O SQL and 15 for MW O Z. Longer pre-training time does not improve or even hurts the performance.
One possible reason is that longer pre-training makes
SC O R E overﬁt to the synthesized data whose utterances are unnatural.
As for the data, as shown in Table 5, even if
SC O R E is pre-trained with only a relatively small amount of synthesized data (without the MLM loss), most of the tasks can achieve much higher performances.
With a relatively smaller training corpus and shorter training time compared to other pre-trained language models, SC O R E is efﬁcient in time and data.
E A DDITIONAL R ESULTS
Effect of TCS We ran the TCS only experiment on SP AR C, and will add TCS only results (including for other tasks) to Table 5 in the ﬁnal version.
SC O R E (TCS only) outperforms RoBERTa by 2.4% so far (note: training is still going on) on SP AR C (39.1% vs. 36.7%).
Also, as discussed in Section 4, we also provide a secondary evidence by testing the effectiveness of TCS on SP AR C, C O SQL, and SQA by adding TCS to CCS (CCS only vs. CCS+TCS), SC O R E (with TCS) gains improvements of 1.2% on SP AR C and 0.8% on C O SQL, and 4.4% on SQA.
Incorporating Additional Examples Used in Synthetic Grammar Induction As we mentioned in Section 2.3, we used about 500 examples from SP AR C to induce the grammar for data synthesis in pre-training.
For a fair comparison, we also report the results of incorporating the additional SP AR C examples in C O SQL and SQA.
More speciﬁcally, we directly concatenate the additional SP AR C examples to C O SQL training set, and train RAT-SQL+R O BERT A on it, which slightly improves the performance (19.6% vs. 19.3%) but not as large as SC O R E (22.0% vs. 19.3%).’
Also, because SQA is weakly-supervised sequential question answering, which differs from SP AR C, we ﬁrst ﬁne-tune
R O BERT A on the additional SP AR C examples using CCS, and then apply it to SQA.
In this way, the
R O BERT A trained with additional SP AR C examples achieves a similar performance as the original one (62.7% vs 62.8%).
Performance Comparison with ToD-BERT ToD-BERT is pre-trained on human-annotated questions with both MLM and response contrastive objectives.
To compare TOD-BERT with SC O R E , we ran experiments of RAT-SQL + ToD-BERT on SP AR C. SC O R E (62.2%) outperforms ToD-BERT (54.6%) by 7.6%.
Comparison with Finetuning Larger Language Models Based on our experiments and other published results, we didn’t ﬁnd existing larger LMs (BART (Lewis et al., 2020), T5 (Raffel et al., 2020), GPT-2 (Radford et al., 2019)) outperform custom models + BERT on CSP tasks.
Our evidence is based on Spider (Yu et al., 2018b), which is the single-turn version of SParC and CoSQL.
For T5,
Shaw et al.
(2020) applied T5 as seq2seq to Spider, and compared with RAT-SQL + BERT-Large,
T5-Base performs much worse (57.1% vs. 69.6%), and T5-3B improves only 0.3, but it is 6 times larger.
Moreover, for Bart, we have performed experiments on Spider and we found that BART cannot outperform custom models + BERT: RAT-SQL + BERT 69.7%, RAT-SQL + BART encoder 67.8%, BART encoder + decoder (406M, as a seq2seq task) 62.4%.
In Rubin & Berant (2020), BART didn’t outperform BERT either.
As for GPT-2, Wu et al.
(2020) and Hosseini-Asl et al.
(2020) found it does not outperform BERT on MW O Z.
F T ASK -O RIENTED D IALOGUE D ATASETS
[Table]
3 Method
In this section, we ﬁrst discuss each dataset used for our task-oriented pre-training and how we process the data.
Then we introduce the selected pre- training base model and its objective functions.
3.1 Datasets
We collect nine different task-oriented datasets which are English-based, human-human, multiturn and publicly available.
In total, there are 100,707 dialogues, which contain 1,388,152 utterances over 60 domains.
Dataset statistics is shown in Table 1.
• MetaLWOZ (Lee et al., 2019):
Meta-Learning Wizard-of-Oz is a dataset designed to help develop models capable of predicting user
re- sponses in unseen domains.
This large dataset was created by crowdsourcing 37,884 goal- oriented dialogs, covering 227 tasks in 47 domains.
The MetaLWOZ dataset is used as the fast adaptation task for DSTC8 (Kim et al., 2019) dialogue competition.
• Schema (Rastogi et al., 2019): Schema-guided dialogue has 22,825 dialogues and provides a challenging testbed for several tasks, in partic- ular, dialogue state tracking.
Each schema is a set of tracking slots and each domain could have multiple possible schemas.
This allows a single dialogue system to support a large number of services and facilitates the simple integration of new services without requiring much training data.
The Schema dataset is used as the dialogue state tracking task for DSTC8 (Kim et al., 2019) dialogue competition.
Taskmaster (Byrne et al., 2019):
This dataset includes 13,215 dialogues comprising six domains, including 5,507 spoken and 7,708 writ- ten dialogs created with two distinct procedures.
One is a two-person Wizard of Oz approach that one person acts like a robot and the other is a self-dialogue approach in which crowdsourced workers wrote the entire dialog themselves.
It has 22.9 average conversational turns in a single dialogue, which is the longest among all taskoriented datasets listed.
• MWOZ (Budzianowski et al., 2018): Multi-
Domain Wizard-of-Oz dataset contains 10, dialogues over seven domains, and it has multi- ple domains in a single dialogue.
It has a detailed description of the data collection procedure, and user goal, system act, and dialogue state labels.
Different from most of the existing corpora , it also
[Figure]
to
[Figure] dialogues [Figure] booking
[Figure]