SlowGuess/ACL_2020_OCR huggingface dataset:
Sungdong Kim Sohee Yang Gyuwan Kim Sang-Woo Lee Clova AI, Naver Corp.
{sungdong.kim, sh.yang, gyuwan.kim, sang.woo lee}@navercorp.com
Recent works in dialogue state tracking (DST) focus on an open vocabulary-based setting to resolve scalability and generalization issues of the predefined ontology-based approaches. However, they are inefficient in that they predict the dialogue state at every turn from scratch. Here, we consider dialogue state as an explicit fixed-sized memory and propose a selectively overwriting mechanism for more efficient DST. This mechanism consists of two steps: (1) predicting state operation on each of the memory slots, and (2) overwriting the memory with new values, of which only a few are generated according to the predicted state operations. Our method decomposes DST into two sub-tasks and guides the decoder to focus only on one of the tasks, thus reducing the burden of the decoder. This enhances the effectiveness of training and DST performance. Our SOM-DST (Selectively Overwriting Memory for Dialogue State Tracking) model achieves state-of-the-art joint goal accuracy with  $51.72\%$  in MultiWOZ 2.0 and  $53.01\%$  in MultiWOZ 2.1 in an open vocabulary-based DST setting. In addition, we analyze the accuracy gaps between the current and the ground truth-given situations and suggest that it is a promising direction to improve state operation prediction to boost the DST performance. $^{1}$
Building robust task-oriented dialogue systems has gained increasing popularity in both the research and industry communities (Chen et al., 2017). Dialogue state tracking (DST), one of the essential tasks in task-oriented dialogue systems (Zhong et al., 2018), is keeping track of user goals or intentions throughout a dialogue in the form of a set of slot-value pairs, i.e., dialogue state. Because the
Figure 1: An example of how SOM-DST performs dialogue state tracking at a specific dialogue turn (in this case, fifth). The shaded part is the input to the model, and "Dialogue State at turn 5" at the right-bottom part is the output of the model. Here, UPDATE operation needs to be performed on the 10th and 11th slot. DST at this turn is challenging since the model requires reasoning over the long-past conversation. However, SOM-DST can still robustly perform DST because the previous dialogue state is directly utilized like a memory.
next dialogue system action is selected based on the current dialogue state, an accurate prediction of the dialogue state has significant importance.
Traditional neural DST approaches assume that all candidate slot-value pairs are given in advance, i.e., they perform predefined ontology-based DST (Mrkšić et al., 2017; Zhong et al., 2018; Nouri and Hosseini-Asl, 2018; Lee et al., 2019). Most previous works that take this approach perform DST by scoring all possible slot-value pairs in the ontology and selecting the value with the highest score as the predicted value of a slot. Such an approach has been widely applied to datasets like DSTC2 and WOZ2.0, which have a relatively small ontology size. (Henderson et al., 2014; Wen et al., 2017)
<sup>1</sup>The code is available at github.com/clovaai/som-dst.
Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 567-582 July 5 - 10, 2020. ©2020 Association for Computational Linguistics
Although this approach simplifies the task, it has inherent limitations: (1) it is often difficult to obtain the ontology in advance, especially in a real scenario (Xu and Hu, 2018), (2) predefined ontology-based DST cannot handle previously unseen slot values, and (3) the approach does not scale large since it has to go over all slot-value candidates at every turn to predict the current dialogue state. Indeed, recent DST datasets often have a large size of ontology; e.g., the total number of slot-value candidates in MultiWOZ 2.1 is 4510, while the numbers are much smaller in DSTC2 and WOZ2.0 as 212 and 99, respectively (Budzianowski et al., 2018).
To address these issues, recent methods employ an approach that either directly generates or extracts a value from the dialogue context for every slot, allowing open vocabulary-based DST (Lei et al., 2018; Gao et al., 2019; Wu et al., 2019; Ren et al., 2019). While this formulation is relatively more scalable and robust to handling unseen slot values, many of the previous works do not efficiently perform DST since they predict the dialogue state from scratch at every dialogue turn.
In this work, we focus on an open vocabulary-based setting and propose SOM-DST (Selectively Overwriting Memory for Dialogue State Tracking). Regarding dialogue state as a memory that can be selectively overwritten (Figure 1), SOM-DST decomposes DST into two sub-tasks: (1) state operation prediction, which decides the types of the operations to be performed on each of the memory slots, and (2) slot value generation, which generates the values to be newly written on a subset of the memory slots (Figure 2). This decomposition allows our model to efficiently generate the values of only a minimal subset of the slots, while many of the previous works generate or extract the values of all slots at every dialogue turn. Moreover, this decomposition reduces the difficulty of DST in an open-vocabulary based setting by clearly separating the roles of the encoder and the decoder. Our encoder, i.e., state operation predictor, can focus on selecting the slots to pass to the decoder so that the decoder, i.e., slot value generator, can focus only on generating the values of those selected slots. To the best of our knowledge, our work is the first to propose such a selectively overwritable memory-like perspective and a discrete two-step approach on DST.
Our proposed SOM-DST achieves state-of-the-art joint goal accuracy in an open vocabulary-based
DST setting on two of the most actively studied datasets: MultiWOZ 2.0 and MultiWOZ 2.1. Error analysis (Section 6.2) further reveals that improving state operation prediction can significantly boost the final DST accuracy.
In summary, the contributions of our work built on top of a perspective that considers dialogue state tracking as selectively overwriting memory are as follows:
- Enabling efficient DST, generating the values of a minimal subset of the slots by utilizing the previous dialogue state at each turn.
- Achieving state-of-the-art performance on MultiWOZ 2.0 and MultiWOZ 2.1 in an open vocabulary-based DST setting.
- Highlighting the potential of improving the state operating prediction accuracy in our proposed framework.
2 Previous Open Vocabulary-based DST
Many works on recent task-oriented dialogue datasets with a large scale ontology, such as MultiWOZ 2.0 and MultiWOZ 2.1, solve DST in an open vocabulary-based setting (Gao et al., 2019; Wu et al., 2019; Ren et al., 2019; Le et al., 2020a,b).
Wu et al. (2019) show the potential of applying the encoder-decoder framework (Cho et al., 2014a) to open vocabulary-based DST. However, their method is not computationally efficient because it performs autoregressive generation of the values for all slots at every dialogue turn.
Ren et al. (2019) tackle the drawback of the model of Wu et al. (2019), that their model generates the values of all slots at every dialogue turn, by using a hierarchical decoder. In addition, they come up with a new notion dubbed Inference Time Complexity (ITC) to compare the efficiency of different DST models. ITC is calculated using the number of slots  $J$  and the number of corresponding slot values  $M$ . Following their work, we also calculate ITC in Appendix B for comparison.
Le et al. (2020b) introduce another work that tackles the efficiency issue. To maximize the computational efficiency, they use a non-autoregressive decoder to generate the slot values of the current dialogue state at once. They encode the slot type information together with the dialogue context and
2The notations used in the work of Ren et al. (2019) are  $n$  and  $m$ , respectively.
Figure 2: The overview of the proposed SOM-DST. SOM-DST takes the previous turn dialogue utterances  $D_{t-1}$ , current turn dialogue utterances  $D_t$ , and the previous dialogue state  $B_{t-1}$  as the input and outputs the current dialogue state  $B_t$ . This is performed by two sub-components: state operation predictor and slot value generator. State operation predictor takes  $D_{t-1}$ ,  $D_t$ , and  $B_{t-1}$  as the input and predicts the operations to perform on each of the slots. Domain classification is jointly performed as an auxiliary task. Slot value generator generates the values for the slots that take UPDATE as the predicted operation. The value generation for a slot is done in an autoregressive manner.
the delexicalized dialogue context. They do not use the previous turn dialogue state as the input.
Le et al. (2020a) process the dialogue context in both domain-level and slot-level. They make the final representation to generate the values using a late fusion approach. They show that there is a performance gain when the model is jointly trained with response generation. However, they still generate the values of every slot at each turn, like Wu et al. (2019).
Gao et al. (2019) formulate DST as a reading comprehension task and propose a model named DST Reader that extracts the values of the slots from the input. They introduce and show the importance of the concept of a slot carryover module, i.e., a component that makes a binary decision whether to carry the value of a slot from the previous turn dialogue state over to the current turn dialogue state. The definition and use of discrete operations in our work is inspired by their work.
Zhang et al. (2019) target the issue of ill-formatted strings that generative models suffer from. In order to avoid this issue, they take a hybrid approach. For the slots they categorize as picklist-based slots, they use a predefined ontology-based approach as in the work of Lee et al. (2019); for the slots they categorize as span-based slots, they use a span extraction-based method like DST-Reader (Gao et al., 2019). However, their hybrid model shows lower performance than when they use only the picklist-based approach. Although their solely picklist-based model achieves state-of-the-art joint accuracy in MultiWOZ 2.1, it is done in a prede
fined ontology-based setting, and thus cannot avoid the scalability and generalization issues of predefined ontology-based DST.
3 Selectively Overwriting Memory for Dialogue State Tracking
Figure 2 illustrates the overview of SOM-DST. To describe the proposed SOM-DST, we formally define the problem setting in our work.
Dialogue State We define the dialogue state at turn  $t$ ,  $\mathcal{B}_t = \{(S^j, V_t^j) \mid 1 \leq j \leq J\}$ , as a fixed-sized memory whose keys are slots  $S^j$  and values are the corresponding slot value  $V_t^j$ , where  $J$  is the total number of such slots. Following the convention of MultiWOZ 2.0 and MultiWOZ 2.1, we use the term "slot" to refer to the concatenation of a domain name and a slot name.
Special Value There are two special values NULL and DONTCARE. NULL means that no information is given about the slot up to the turn. For instance, the dialogue state before the beginning of any dialogue  $\mathcal{B}_0$  has only NULL as the value of all slots. DONTCARE means that the slot neither needs to be tracked nor considered important in the dialogue at that time.3
Operation At every turn  $t$ , an operation  $r_t^j \in \mathcal{O} = \{\text{CARRYOVER}, \text{DELETE}, \text{DONT CARE}, \text{UPDATE}\}$  is chosen by the state operation predictor (Section
<sup>3</sup>Such notions of "none value" and "dontcare value" appear in the previous works as well (Wu et al., 2019; Gao et al., 2019; Le et al., 2020b; Zhang et al., 2019).
3.1) and performed on each slot  $S^j$  to set its current turn corresponding value  $V_t^j$ . When an operation is performed, it either keeps the slot value unchanged (CARRYOVER) or changes it to some value different from the previous one (DELETE, DONTCARE, and UPDATE) as the following.
$$
V _ {t} ^ {j} = \left\{ \begin{array}{l l} V _ {t - 1} ^ {j} & \text {i f r _ {t} ^ {j} = \mathbf {C A R R Y O V E R}} \\ \text {N U L L} & \text {i f r _ {t} ^ {j} = \mathbf {D E L E T E}} \\ \text {D O N T C A R E} & \text {i f r _ {t} ^ {j} = \mathbf {D O N T C A R E}} \\ v & \text {i f r _ {t} ^ {j} = \mathbf {U P D A T E}} \end{array} \right.
$$
The operations that set the value of a slot to a special value (DELETE to NULL and DONT-CARE to DONTCARE, respectively) are chosen only when the previous slot value  $V_{t-1}^{j}$  is not the corresponding special value. UPDATE operation requires the generation of a new value  $v \notin \{V_{t-1}^{j}, NULL, DONTCARE\}$  by slot value generator (Section 3.2).
State operation predictor performs state operation prediction as a classification task, and slot value generator performs slot value generation to find out the values of the slots on which UPDATE should be performed. The two components of SOM-DST are jointly trained to predict the current turn dialogue state.
3.1 State Operation Predictor
Input Representation We denote the representation of the dialogue utterances at turn  $t$  as  $D_{t} = A_{t} \oplus ; \oplus U_{t} \oplus [\mathrm{SEP}]$ , where  $A_{t}$  is the system response and  $U_{t}$  is the user utterance.  $;$  is a special token used to mark the boundary between  $A_{t}$  and  $U_{t}$ , and [SEP] is a special token used to mark the end of a dialogue turn. We denote the representation of the dialogue state at turn  $t$  as  $B_{t} = B_{t}^{1} \oplus \ldots \oplus B_{t}^{J}$ , where  $B_{t}^{j} = [\mathrm{SLOT}]^{j} \oplus S^{j} \oplus -\oplus V_{t}^{j}$  is the representation of the  $j$ -th slot-value pair. - is a special token used to mark the boundary between a slot and a value. [SLOT] is a special token used to aggregate the information of the  $j$ -th slot-value pair into a single vector, like the use case of [CLS] token in BERT (Devlin et al., 2019). In this work, we use the same special token [SLOT] for all [SLOT] Our state operation predictor employs a pretrained BERT encoder. The input tokens to the state operation predictor are the concatenation of the previous turn dialog utterances, the current turn dialog utterances, and the current turn dialog utterances.
ances, and the previous turn dialog state:4
$$
X _ {t} = \left[ \begin{array}{c} \mathrm {C L S} \end{array} \right] \oplus D _ {t - 1} \oplus D _ {t} \oplus B _ {t - 1},
$$
where [CLS] is a special token added in front of every turn input. Using the previous dialogue state as the input serves as an explicit, compact, and informative representation of the dialogue history for the model.
When the value of the  $j$ -th slot at time  $t - 1$ , i.e.,  $V_{t - 1}^{j}$ , is NULL, we use a special token [NULL] as the input. When the value is DONTCARE, we use the string "dont care" to take advantage of the semantics of the phrase "don't care" that the pretrained BERT encoder would have already learned.
The input to BERT is the sum of the embeddings of the input tokens  $X_{t}$ , segment id embeddings, and position embeddings. For the segment id, we use 0 for the tokens that belong to  $D_{t-1}$  and 1 for the tokens that belong to  $D_{t}$  or  $B_{t-1}$ . The position embeddings follow the standard choice of BERT.
Encoder Output The output representation of the encoder is  $H_{t}\in \mathbb{R}^{|X_{t}|\times d}$ , and  $h_t^{[\mathrm{CLS}]},h_t^{[\mathrm{SLOT}]^j}\in$ $\mathbb{R}^d$  are the outputs that correspond to [CLS] and [SLOT] respectively.  $h_t^X$ , the aggregated sequence representation of the entire input  $X_{t}$ , is obtained by a feed-forward layer with a learnable parameter  $W_{pool}\in \mathbb{R}^{d\times d}$  as:
$$
h _ {t} ^ {X} = \operatorname {t a n h} \left(W _ {\text {p o o l}} h _ {t} ^ {[ \mathrm {C L S} ]}\right).
$$
State Operation Prediction State operation prediction is a four-way classification performed on top of the encoder output for each slot representation  $h_t^{[SLOT]j}$ :
$$
P _ {o p r, t} ^ {j} = \mathrm {s o f t m a x} (W _ {o p r} h _ {t} ^ {[ S L O T ] ^ {j}}),
$$
where  $W_{opr}\in \mathbb{R}^{|\mathcal{O}|\times d}$  is a learnable parameter and  $P_{opr,t}^j\in \mathbb{R}^{|\mathcal{O}|}$  is the probability distribution over operations for the  $j$  -th slot at turn  $t$  . In our formulation,  $|\mathcal{O}| = 4$  , because  $\mathcal{O} = \{\mathrm{CARRYOVER},$  DELETE,DONTCARE,UPDATE}.
Then, the operation is determined by  $r_t^j = \operatorname{argmax}(P_{opr,t}^j)$  and the slot value generation is performed on only the slots whose operation is UPDATE. We define the set of the slot indices which require the value generation as  $\mathbb{U}_t = \{j \mid r_t^j = \mathbf{UPDATE}\}$ , and its size as  $J_t' = |\mathbb{U}_t|$ .
4We use only the previous turn dialogue utterances  $D_{t - 1}$  as the dialogue history, i.e., the size of the dialogue history is 1. This is because our model assumes Markov property in dialogues as a part of the input, the previous turn dialogue state  $B_{t - 1}$ , can serve as a compact representation of the whole dialogue history.
3.2 Slot Value Generator
For each  $j$ -th slot such that  $j \in \mathbb{U}_t$ , the slot value generator generates a value. Our slot value generator differs from the generators of many of the previous works because it generates the values for only  $J_t'$  number of slots, not  $J$ . In most cases,  $J_t' \ll J$ , so this setup enables an efficient computation where only a small number of slot values are newly generated.
We use Gated Recurrent Unit (GRU) (Cho et al., 2014b) decoder like Wu et al. (2019). GRU is initialized with  $g_{t}^{j,0} = h_{t}^{\mathrm{X}}$  and  $e_t^{j,0} = h_t^{[\mathrm{SLOT}]^j}$ , and recurrently updates the hidden state  $g_{t}^{j,k}\in \mathbb{R}^{d}$  by taking a word embedding  $e_t^{j,k}$  as the input until [EOS] token is generated:
$$
g _ {t} ^ {j, k} = \mathrm {G R U} (g _ {t} ^ {j, k - 1}, e _ {t} ^ {j, k}).
$$
The decoder hidden state is transformed to the probability distribution over the vocabulary at the  $k$ -th decoding step, where  $E \in \mathbb{R}^{d_{vcb} \times d}$  is the word embedding matrix shared across the encoder and the decoder, such that  $d_{vcb}$  is the vocabulary size.
$$
P _ {v c b, t} ^ {j, k} = \operatorname {s o f t m a x} \left(E g _ {t} ^ {j, k}\right) \in \mathbb {R} ^ {d _ {v c b}}.
$$
As the work of Wu et al. (2019), we use the soft-gated copy mechanism (See et al., 2017) to get the final output distribution  $P_{val,t}^{j,k}$  over the candidate value tokens:
$$
P _ {c t x, t} ^ {j, k} = \operatorname {s o f t m a x} \left(H _ {t} g _ {t} ^ {j, k}\right) \in \mathbb {R} ^ {| X _ {t} |},
$$
$$
P _ {v a l, t} ^ {j, k} = \alpha P _ {v c b, t} ^ {j, k} + (1 - \alpha) P _ {c t x, t} ^ {j, k},
$$
such that  $\alpha$  is a scalar value computed as:
$$
\alpha = \mathrm {s i g m o i d} (W _ {1} [ g _ {t} ^ {j, k}; e _ {t} ^ {j, k}; c _ {t} ^ {j, k} ]),
$$
where  $W_{1}\in \mathbb{R}^{1\times (3d)}$  is a learnable parameter and  $c_t^{j,k} = P_{ctx,t}^{j,k}H_t\in \mathbb{R}^d$  is a context vector.
3.3 Objective Function
During training, we jointly optimize both state operation predictor and slot value generator.
State Operation Predictor In addition to the state operation classification, we use domain classification as an auxiliary task to force the model to learn the correlation of slot operations and domain transitions in between dialogue turns. Domain classification is done with a softmax layer on top of  $h_t^X$ :
$$
P _ {d o m, t} = \operatorname {s o f t m a x} (W _ {d o m} h _ {t} ^ {X}),
$$
where  $W_{dom} \in \mathbb{R}^{d_{dom} \times d}$  is a learnable parameter and  $P_{dom,t} \in \mathbb{R}^{d_{dom}}$  is the probability distribution over domains at turn  $t$ .  $d_{dom}$  is the number of domains defined in the dataset.
The loss for each of state operation classification and domain classification is the average of the negative log-likelihood, as follows:
$$
L _ {o p r, t} = - \frac {1}{J} \sum_ {j = 1} ^ {J} (Y _ {o p r, t} ^ {j}) ^ {\intercal} \log P _ {o p r, t} ^ {j},
$$
$$
L _ {d o m, t} = - (Y _ {d o m, t}) ^ {\intercal} \log P _ {d o m, t},
$$
where  $Y_{dom,t} \in \mathbb{R}^{d_{dom}}$  is the one-hot vector for the ground truth domain and  $Y_{opr,t}^j \in \mathbb{R}^{|\mathcal{O}|}$  is the one-hot vector for the ground truth operation for the  $j$ -th slot.
Slot Value Generator The objective function to train slot value generator is also the average of the negative log-likelihood:
$$
L _ {s v g, t} = - \frac {1}{| \mathbb {U} _ {t} |} \sum_ {j \in \mathbb {U} _ {t}} \frac {1}{K _ {t} ^ {j}} \sum_ {k = 1} ^ {K _ {t} ^ {j}} (Y _ {v a l, t} ^ {j, k}) ^ {\intercal} \log P _ {v a l, t} ^ {j, k},
$$
where  $K_{t}^{j}$  is the number of tokens of the ground truth value that needs to be generated for the  $j$ -th slot.  $Y_{val,t}^{j,k} \in \mathbb{R}^{d_{vcb}}$  is the one-hot vector for the ground truth token that needs to be generated for the  $j$ -th slot at the  $k$ -th decoding step.
Therefore, the final joint loss  $L_{joint,t}$  to be minimized at dialogue turn  $t$  is the sum of the losses mentioned above:
$$
L _ {j o i n t, t} = L _ {o p r, t} + L _ {d o m, t} + L _ {s v g, t}.
$$
We use MultiWOZ 2.0 (Budzianowski et al., 2018) and MultiWOZ 2.1 (Eric et al., 2019) as the datasets in our experiments. These datasets are two of the largest publicly available multi-domain task-oriented dialogue datasets, including about 10,000 dialogues within seven domains. MultiWOZ 2.1 is a refined version of MultiWOZ 2.0 in which the annotation errors are corrected. $^5$
Following Wu et al. (2019), we use only five domains (restaurant, train, hotel, taxi, attraction)
See Table 8 in Appendix A for more details of MultiWOZ 2.1.
excluding hospital and police. $^{6}$  Therefore, the number of domains  $d_{dom}$  is 5 and the number of slots  $J$  is 30 in our experiments. We use the script provided by Wu et al. (2019) to preprocess the datasets. $^{7}$
We employ the pretrained BERT-base-uncased model for state operation predictor and one GRU (Cho et al., 2014b) for slot value generator. The hidden size of the decoder is the same as that of the encoder,  $d$ , which is 768. The token embedding matrix of slot value generator is shared with that of state operation predictor. We use BertAdam as our optimizer (Kingma and Ba, 2015). We use greedy decoding for slot value generator.
The encoder of state operation predictor makes use of a pretrained model, whereas the decoder of slot value generator needs to be trained from scratch. Therefore, we use different learning rate schemes for the encoder and the decoder. We set the peak learning rate and warmup proportion to 4e-5 and 0.1 for the encoder and 1e-4 and 0.1 for the decoder, respectively. We use a batch size of 32 and set the dropout (Srivastava et al., 2014) rate to 0.1. We also utilize word dropout (Bowman et al., 2016) by randomly replacing the input tokens with the special [UNK] token with the probability of 0.1. The max sequence length for all inputs is fixed to 256.
We train state operation predictor and slot value generator jointly for 30 epochs and choose the model that reports the best performance on the validation set. During training, we use the ground truth state operations and the ground truth previous turn dialogue state instead of the predicted ones. When the dialogue state is fed to the model, we randomly shuffle the slot order with a rate of 0.5. This is to make state operation predictor exploit the semantics of the slot names and not rely on the position of the slot tokens or a specific slot order. During inference or when the slot order is not shuffled, the slots are sorted alphabetically. We use teacher forcing  $50\%$  of the time to train the decoder.
All experiments are performed on Naver Smart Machine Learning (NSML) platform (Sung et al., 2017; Kim et al., 2018). All the reported results of SOM-DST are averages over ten runs.
We compare the performance of SOM-DST with both predefined ontology-based models and open vocabulary-based models.
FJST uses a bidirectional LSTM to encode the dialogue history and uses a feed-forward network to predict the value of each slot (Eric et al., 2019).