Towards End-to-End Reinforcement Learning of Dialogue Agents for Information Access
This paper proposes KB-InfoBot — a multi-turn dialogue agent which helps users search Knowledge Bases (KBs) without composing complicated queries. Such goal-oriented dialogue agents typically need to interact with an external database to access real-world knowledge. Previous systems achieved this by issuing a symbolic query to the KB to retrieve entries based on their attributes. However, such symbolic operations break the differentiability of the system and prevent endto-end training of neural dialogue agents. In this paper, we address this limitation by replacing symbolic queries with an induced “soft” posterior distribution over the KB that indicates which entities the user is interested in. Integrating the soft retrieval process with a reinforcement learner leads to higher task success rate and reward in both simulations and against real users. We also present a fully neural end-to-end agent, trained entirely from user feedback, and discuss its application towards personalized dialogue agents.
1 Introduction
The design of intelligent assistants which interact with users in natural language ranks high on the agenda of current NLP research. With an increasing focus on the use of statistical and machine learning based approaches (Young et al., 2013), the last few years have seen some truly remarkable conversational agents appear on the market (e.g. Apple Siri, Microsoft Cortana, Google Allo). These agents can perform simple tasks, answer factual questions, and sometimes also aimlessly chit-chat with the user, but they still lag far be-
hind a human assistant in terms of both the variety and complexity of tasks they can perform. In particular, they lack the ability to learn from interactions with a user in order to improve and adapt with time. Recently, Reinforcement Learning (RL) has been explored to leverage user interactions to adapt various dialogue agents designed, respectively, for task completion (Gašić et al., 2013), information access (Wen et al., 2016b), and chitchat (Li et al., 2016a).
We focus on KB-InfoBots, a particular type of dialogue agent that helps users navigate a Knowledge Base (KB) in search of an entity, as illustrated by the example in Figure 1. Such agents must necessarily query databases in order to retrieve the requested information. This is usually done by performing semantic parsing on the input to construct a symbolic query representing the beliefs of the agent about the user goal (see, e.g., Wen et al. (2016b) and Williams and Zweig (2016)). We call such an operation a HardKB lookup. While natural, this approach has two drawbacks: (1) the retrieved results do not carry any information about uncertainty in semantic parsing, and (2) the retrieval operation is non differentiable, and hence the parser and dialog policy are trained separately. This makes online endto-end learning from user feedback difficult once the system is deployed.
In this work, we propose a probabilistic framework for computing the posterior distribution of the user target over a knowledge base, which we term a Soft-KB lookup. This distribution is constructed from the agent’s belief about the attributes of the entity being searched for. The dialogue policy network, which decides the next system action, receives as input this full distribution instead of a handful of retrieved results. We show in our experiments that this framework allows the agent to achieve a higher task success rate in fewer dia-
2
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
Figure 1: An interaction between a user looking for a movie and the KB-InfoBot. An entity-centric knowledge base is shown above the KB-InfoBot (missing values denoted by X).
logue turns. Further, the retrieval process is differentiable, allowing us to construct an end-to-end trainable KB-InfoBot, all of whose components are updated online using RL.
Reinforcement learners typically require an environment to interact with, and hence static dialogue corpora cannot be used for their training. Running experiments on human subjects, on the other hand, is unfortunately too expensive. A common workaround in the dialogue community (Young et al., 2013; Schatzmann et al., 2007b; Scheffler and Young, 2002) is to instead use user simulators which mimic the behavior of real users in a consistent manner. For training KB-InfoBot, we adapt the publicly available1 simulator described in Li et al. (2016b).
Evaluation of dialogue agents has been the subject of much research (Walker et al., 1997; Möller et al., 2006). While the metrics for evaluating an InfoBot are relatively clear — the agent should return the correct entity in a minimum number of turns — the environment for testing it not so much. Unlike previous KB-based QA systems, our focus is on multi-turn interactions, and as such there are no publicly available benchmarks for this problem. We evaluate several versions of KB-InfoBot with the simulator and on real users, and show that the proposed Soft-KB lookup helps the reinforcement learner discover better dialogue policies. Initial experiments on the end-to-end agent also demonstrate its strong learning capability.
2 Related Work
Our work is motivated by the neural GenQA (Yin et al., 2016a) and neural enquirer (Yin et al., 2016b) models for querying KBs via natural language in a fully “neuralized” way. However, the
1 https://github.com/MiuLab/UserSimulator
key difference is that these systems assume that users can compose a complicated, compositional natural language query that can uniquely identify the element/answer in the KB. The research task is to parse the query, i.e., turning the natural language query into a sequence of SQL-like operations. Instead we focus on how to query a KB interactively without composing such complicated queries in the first place. Our work is motivated by the observations that (1) users are more used to issuing simple queries of length less than 5 words (Spink et al., 2001); (2) in many cases, it is unreasonable to assume that users can construct compositional queries without prior knowledge of the structure of the KB to be queried.
Also related is the growing body of literature focused on building end-to-end dialogue systems, which combine feature extraction and policy optimization using deep neural networks. Wen et al. (2016b) introduced a modular neural dialogue agent, which uses a Hard-KB lookup, thus breaking the differentiability of the whole system. As a result, training of various components of the dialogue system is performed separately. The intent network and belief trackers are trained using supervised labels specifically collected for them; while the policy network and generation network are trained separately on the system utterances. We retain modularity of the network by keeping the belief trackers separate, but replace the hard lookup with a differentiable one.
Dialogue agents can also interface with the database by augmenting their output action space with predefined API calls (Williams and Zweig, 2016; Zhao and Eskenazi, 2016; Bordes and Weston, 2016). The API calls modify a query hypothesis maintained outside the end-to-end system which is used to retrieve results from this KB. This framework does not deal with uncertainty in language understanding since the query hypothesis can only hold one slot-value at a time. Our approach, on the other hand, directly models the uncertainty to construct the posterior over the KB.
Wu et al. (2015) presented an entropy minimization dialogue management strategy for InfoBots. The agent always asks for the value of the slot with maximum entropy over the remaining entries in the database, which is optimal in the absence of LU errors, and serves as a baseline against our approach. Reinforcement learning neural turing machines (RL-NTM) (Zaremba and Sutskever,
3
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
2015) also allow neural controllers to interact with discrete external interfaces. The interface considered in that work is a one-dimensional memory tape, while in our work it is an entity-centric KB.
3 Probabilistic KB Lookup
This section describes a probabilistic framework for querying a KB given the agent’s beliefs over the fields in the KB.
3.1 Entity-Centric Knowledge Base (EC-KB)
A Knowledge Base consists of triples of the form (h, r, t), which denotes that relation r holds between the head h and tail t. We assume that the KB-InfoBot has access to a domain-specific entity-centric knowledge base (EC-KB) (Zwicklbauer et al., 2013) where all head entities are of a particular type (such as movies or persons), and the relations correspond to attributes of these head entities. Such a KB can be converted to a table format whose rows correspond to the unique head entities, columns correspond to the unique relation types (slots henceforth), and some entries may be missing. An example is shown in Figure 1.
3.2 Notations and Assumptions
Let T denote the KB table described above and Ti,j denote the jth slot-value of the ith entity. 1 ≤ i ≤ N and 1 ≤ j ≤M . We let V j denote the vocabulary of each slot, i.e. the set of all distinct values in the j-th column. We denote missing values from the table with a special token and write Ti,j = Ψ. Mj = {i : Ti,j = Ψ} denotes the set of entities for which the value of slot j is missing. Note that the user may still know the actual value of Ti,j , and we assume this lies in V j . We do not deal with new entities or relations at test time.
We assume a uniform prior G ∼ U [{1, ...N}] over the rows in the table T , and let binary random variables Φj ∈ {0, 1} indicate whether the user knows the value of slot j or not. The agent maintains M multinomial distributions ptj(v) for v ∈ V j denoting the probability at turn t that the user constraint for slot j is v, given their utterances U t1 till that turn. The agent also maintains M binomials qtj = Pr(Φj = 1) which denote the probability that the user knows the value of slot j.
We assume that column values are independently distributed to each other. This is a strong assumption but it allows us to model the user goal for each slot independently, as opposed to model-
ing the user goal over KB entities directly. Typically maxj |V j | < N and hence this assumption reduces the number of parameters in the model.
3.3 Soft-KB Lookup
Let ptT (i) = Pr(G = i|U t1) be the posterior probability that the user is interested in row i of the table, given the utterances up to turn t. We assume all probabilities are conditioned on user inputs U t1 and drop it from the notation below. From our assumption of independence of slot values, we can write ptT (i) ∝ ∏M j=1 Pr(Gj = i), where Pr(Gj = i) denotes the posterior probability of user goal for slot j pointing to Ti,j . Marginalizing this over Φj gives:
Pr(Gj = i) = 1∑
φ=0
Pr(Gj = i,Φj = φ) (1)
= qtj Pr(Gj = i|Φj = 1)+ (1− qtj) Pr(Gj = i|Φj = 0).
For Φj = 0, the user does not know the value of the slot, and from the prior:
Pr(Gj = i|Φj = 0) = 1
N , 1 ≤ i ≤ N (2)
For Φj = 1, the user knows the value of slot j, but this may be missing from T , and we again have two cases:
Pr(Gj = i|Φj = 1) =
{ 1 N , i ∈Mj
ptj(v) Nj(v)
( 1− |Mj |
N
) , i 6∈Mj (3)
Here, Nj(v) is the count of value v in slot j. Detailed derivation for (3) is provided in Appendix A. Combining (1), (2), and (3) gives us the procedure for computing the posterior over KB entities.
4 Towards an End-to-End-KB-InfoBot
We claim that the Soft-KB lookup method has two benefits over the Hard-KB method – (1) it helps the agent discover better dialogue policies by providing it more information from the LU unit, (2) it allows end-to-end training of both dialogue policy and LU in an online setting. In this section we describe several agents to test these claims.
4.1 Overview
Figure 2 shows an overview of the components of the KB-InfoBot. At each turn, the agent receives a natural language utterance ut as input, and selects
4
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
Belief Trackers
Policy Network Beliefs Summary
Soft-KB Lookup
KB-InfoBot
User
User Utterance
System Action
Figure 2: High-level overview of the end-to-end KBInfoBot. Components with trainable parameters are highlighted in gray.
an action at as output. The action space, denoted byA, consists ofM+1 actions — request(slot=i) for 1 ≤ i ≤ M will ask the user for the value of slot i, and inform(I) will inform the user with an ordered list of results I from the KB. The dialogue ends once the agent chooses inform.
We adopt a modular approach, typical to goaloriented dialogue systems (see for e.g. (Wen et al., 2016b)), consisting of: a belief tracker (LU) module for identifying user intents, extracting associated slots, and tracking the dialogue state (Yao et al., 2014; Hakkani-Tür et al., 2016; Chen et al., 2016; Henderson et al., 2014; Henderson, 2015); an interface with the database to query for relevant results (Soft-KB lookup); a summary module to summarize the state into a vector; a dialogue policy which selects the next system action based on current state (Young et al., 2013). We assume the agent only responds with dialogue acts. A template-based Natural Language Generator (NLG) can be easily constructed for converting dialogue acts into natural language.
4.2 Belief Trackers
The InfoBot consists of M belief trackers, one for each slot, which get the user input xt and produce two outputs, ptj and q t j , which we shall collectively call the belief state: ptj is a multinomial distribution over the slot values v, and qtj is a scalar probability of the user knowing the value of slot j. We describe two versions of the belief tracker.
Hand-Crafted Tracker: We first identify mentions of slot-names (such as “actor”) or slot-values (such as “Bill Murray”) from the user input ut, using token-level keyword search. Let {w ∈ x} denote the set of tokens in a string x2, then for each slot in 1 ≤ j ≤ M and each value v ∈ V j , we compute its matching score as follows:
stj [v] = |{w ∈ ut} ∩ {w ∈ v}|
|{w ∈ v}| (4)
2We use the NLTK tokenizer available at http://www. nltk.org/api/nltk.tokenize.html
A similar score btj is computed for the slot-names. A one-hot vector reqt ∈ {0, 1}M denotes the previously requested slot from the agent, if any. qtj is set to 0 if reqt[j] is 1 but stj [v] = 0 ∀v ∈ V j , i.e. the agent requested for a slot but did not receive a valid value in return, else it is set to 1.
Starting from an prior distribution p0j (based on the counts of the values in the KB), ptj [v] is updated as:
ptj [v] ∝ pt−1j [v] + C ( stj [v] + b t j + 1(req t[j] = 1) ) (5)
Here C is a tuning parameter, and the normalization is given by setting the sum over v to 1.
Neural Belief Tracker: For the neural tracker the user input ut is converted to a vector representation xt, using a bag of n-grams (with n = 2) representation. Each element of xt is an integer indicating the count of a particular n-gram in ut. We let V n denote the number of unique n-grams, hence xt ∈ NV n0 .
Recurrent neural networks have been used for belief tracking (Henderson et al., 2014; Wen et al., 2016b) since the output distribution at turn t depends on all user inputs till that turn. We use a Gated Recurrent Unit (GRU) (Cho et al., 2014) for each tracker, which, starting from h0j = 0 computes htj = GRU(x
1, . . . , xt) (see appendix B for details). htj ∈ Rd can be interpreted as a summary of what the user has said about slot j till turn t. The belief states are computed from this vector as follows:
ptj = softmax(W p j h t j + b p j ) (6) qtj = σ(W Φ j h t j + b Φ j ) (7)
Here W pj ∈ RV j×d, bpj ∈ RV j , WΦj ∈ Rd and bΦj ∈ R, are trainable parameters.
4.3 Soft-KB Lookup + Summary
This module uses the Soft-KB lookup described in section 3.3 to compute the posterior ptT ∈ RN over the EC-KB from the belief states (ptj , q t j). Collectively, outputs of the belief trackers and the soft-KB lookup can be viewed as the current dialogue state internal to the KB-InfoBot. Let st = [pt1, p t 2, ..., p t M , q t 1, q t 2, ..., q t M , p t T ] be the vector of
size ∑
j V j+M+N denoting this state. It is pos-
sible for the agent to directly use this state vector to select its next action at. However, the large size of the state vector would lead to a large number of
5
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
parameters in the policy network. To improve efficiency we extract summary statistics from the belief states, similar to (Williams and Young, 2005).
Each slot is summarized into an entropy statistic over a distribution wtj computed from elements of the KB posterior ptT as follows:
wtj(v) ∝ ∑
i:Ti,j=v
ptT (i) + p 0 j (v) ∑ i:Ti,j=Ψ ptT (i) . (8)
Here, p0j is a prior distribution over the values of slot j, estimated using counts of each value in the KB. The probability mass of v in this distribution is the agent’s confidence that the user goal has value v in slot j. This two terms in (8) correspond to rows in KB which have value v, and rows whose value is unknown (weighted by the prior probability that an unknown might be v). Then the summary statistic for slot j is the entropy H(wtj). The KB posterior ptT is also summarized into an entropy statistic H(ptT ).
The scalar probabilities qtj are passed as is to the dialogue policy, and the final summary vector is s̃t = [H(p̃t1), ...,H(p̃ t M ), q t 1, ..., q t M , H(p t T )]. Note that this vector has size 2M + 1.
4.4 Dialogue Policy
The dialogue policy’s job is to select the next action based on the current summary state s̃t and the dialogue history. We present a hand-crafted baseline and a neural policy network.
Hand-Crafted Policy: The rule based policy is adapted from (Wu et al., 2015) – it asks for the slot with the minimum entropy, subject to certain constraints listed in Appendix C.
Neural Policy Network: For the neural approach, similar to (Williams and Zweig, 2016; Zhao and Eskenazi, 2016), we use an RNN to allow the network to maintain an internal state of dialogue history. Specifically, we use a GRU unit followed by a fully-connected layer and softmax nonlinearity to model the policy π over actions in A (W π ∈ R|A|×d, bπ ∈ R|A|):
htπ = GRU(s̃ 1, ..., s̃t) (9) π = softmax(W πhtπ + b π) . (10)
During training, the agent samples its actions from the policy to encourage exploration. If this action is inform(), it must also provide an ordered set of entities indexed by I = (i1, i2, . . . , iR) in the KB to the user. This is done by sampling R
items from the KB-posterior ptT . This mimics a search engine type setting, where R may be the number of results on the first page.
5 Training
Parameters of the neural components (denoted by θ) are trained using the REINFORCE algorithm (Williams, 1992). We assume that the learner has access to a reward signal rt throughout the course of the dialogue, details of which are in the next section. We can write the expected discounted return of the agent under policy π as J(θ) = Eπ [∑H t=0 γ trt ] (γ is the discounting factor). When only training the dialogue policy π using this signal, updates are given by (details in Appendix D):
∇θJ(θ) = Eπ [ H∑ k=0 ∇θ log πθ(ak) H∑ t=0 γtrt ] , (11)
For end-to-end training we need to update both the dialogue policy and the belief trackers using the reinforcement signal, and we can view the retrieval as another policy µθ (see Appendix D). The updates are given by:
∇θJ(θ) =Ea∼π,I∼µ [( ∇θ logµθ(I)+
H∑ h=0 ∇θ log πθ(ah) ) H∑ k=0 γkrk ] , (12)
In the case of end-to-end learning, we found that for a moderately sized KB, the agent almost always fails if starting from random initialization. In this case, credit assignment is difficult for the agent, since it does not know whether the failure is due to an incorrect sequence of actions or incorrect set of results from the KB. Hence, at the beginning of training we have an Imitation Learning (IL) phase where the belief trackers and policy network are trained to mimic the hand-crafted agents. Assume that p̂tj and q̂ t j are the belief states from a rule-based agent, and ât its action at turn t. Then the loss function for imitation learning is:
L(θ) = E [ D(p̂tj ||ptj(θ))+H(q̂tj , qtj(θ))−log πθ(ât) ] .
D(p||q) and H(p, q) denote the KL divergence and cross-entropy between p and q respectively.
The expectations are estimated using a minibatch of dialogues of size B. For RL we use RMSProp (Hinton et al., 2012) and for IL we use
6
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
vanilla SGD updates to train the parameters θ. For RL we also subtract the mean of the rewards across a batch to reduce the variance in the estimated gradients (Greensmith et al., 2004).
6 Experiments and Results
Previous work in KB-based QA has focused on single-turn interactions and is not directly comparable to the present study. Instead we compare different versions of the KB-InfoBot described above to test our claims
6.1 KB-InfoBot versions
We have described two belief trackers – (A) HandCrafted and (B) Neural, and two dialogue policies – (C) Hand-Crafted and (D) Neural.
Rule agents use the hand-crafted belief trackers and hand-crafted policy (A+C). RL agents use the hand-crafted belief trackers and the neural policy (A+D). We compare three variants of both sets of agents, which differ only in the inputs to the dialogue policy. The No-KB version only takes entropy H(p̂tj) of each of the slot distributions. The Hard-KB version performs a hard-KB lookup and selects the next action based on the entropy of the slots over retrieved results. This is the same approach as in (Wen et al., 2016b), except that we take entropy instead of summing probabilities. The Soft-KB version takes summary statistics of the slots and KB posterior described in Section 4. At the end of the dialogue, all versions inform the user with the top results from the KB posterior ptT , hence the difference only lies in the policy for action selection. Lastly, the E2E agent uses the neural belief tracker and the neural policy (B+D), with a Soft-KB lookup. For the RL agents, we also append q̂tj and a one-hot encoding of the previous agent action to the policy network input. Hyperparameter details for the agents are provided in Appendix E.
6.2 User Simulator
Training reinforcement learners is challenging because they need an environment to operate in. In the dialogue community it is common to use simulated users for this purpose (Schatzmann et al., 2007a,b; Cuayáhuitl et al., 2005; Asri et al., 2016). In this work we adapt the publicly-available user simulator presented in (Li et al., 2016b) to follow a simple agenda while interacting with the KB-InfoBot, as well as produce natural language
Table 1: Movies-KB statistics for four splits. Refer to Section 3.2 for description of columns.
KB-split N M maxj |V j | |Mj |
Small 277 6 17 20% Medium 428 6 68 20%
Large 857 6 101 20% X-Large 3523 6 251 20%
utterances3. Details about the simulator are included in Appendix F. During training, the simulated user also provides a reward signal at the end of each dialogue. The dialogue is a success if the user target is in top R = 5 results returned by the agent; and the reward is computed as max(0, 2(1 − (r − 1)/R)), where r is the actual rank of the target. For a failed dialogue the agent receives a reward of −1, and at each turn it receives a reward of −0.1 to encourage short sessions4. The maximum length of a dialogue is 10 turns beyond which it is deemed a failure.
6.3 Movies-KB
We use a movie-centric KB constructed using the IMDBPy5 package. We constructed four different splits of the dataset, with increasing number of entities, whose statistics are given in Table 1. The original KB was modified to reduce the number of actors and directors in order to make the task more challenging6. We randomly remove 20% of the values from the agent’s copy of the KB to simulate a scenario where the KB may be incomplete. The user, however, may still know these values.
6.4 Simulated User Evaluation
We compare each of the discussed versions along three metrics: the average rewards obtained (R), success rate (S) (where success is defined as providing the user target among top R results), and the average number of turns per dialogue (T). For the RL and E2E agents, during training we fix the model every 100 updates and run 2000 simulations with greedy action selection to evaluate its performance. Then after training we select the model with the highest average reward and run a further 5000 simulations and report the performance in Table 2. For reference we also show the perfor-
3Simulator & InfoBot code is included in the supplementary material, and will be made public upon acceptance
4A turn consists of one user action and one agent action. 5http://imdbpy.sourceforge.net/ 6We restricted the vocabulary to the first few unique values of these slots and replaced all other values with a random value from this set.
7
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
Table 2: Performance Comparison. Average (±std error) for 5000 runs after choosing the best model during training. T: Average number of turns. S: Success rate. R: Average reward.
Agent Small KB Medium KB Large KB X-Large KBT S R T S R T S R T S R
No KB Rule 5.04 .64 .26±.02 5.05 .77 .74±.02 4.93 .78 .82±.02 4.84 .66 .43±.02RL 2.65 .56 .24±.02 3.32 .76 .87±.02 3.71 .79 .94±.02 3.64 .64 .50±.02 Hard KB Rule 5.04 .64 .25±.02 3.66 .73 .75±.02 4.27 .75 .78±.02 4.84 .65 .42±.02RL 3.36 .62 .35±.02 3.07 .75 .86±.02 3.53 .79 .98±.02 2.88 .62 .53±.02 Soft KB Rule 2.12 .57 .32±.02 3.94 .76 .83±.02 3.74 .78 .93±.02 4.51 .66 .51±.02 RL 2.93 .63 .43±.02 3.37 .80 .98±.02 3.79 .83 1.05±.02 3.65 .68 .62±.02 E2E 3.13 .66 .48±.02 3.27 .83 1.10±.02 3.51 .83 1.10±.02 3.98 .65 .50±.02
Max 3.44 1.0 1.64 2.96 1.0 1.78 3.26 1.0 1.73 3.97 1.0 1.37
mance of an agent which receives perfect information about the user target without any errors, and selects actions based on the entropy of the slots (Max). This can be considered as an upper bound on the performance of any agent (Wu et al., 2015).
In each case the Soft-KB versions achieve the highest average reward, which is the metric all agents optimize. In general, the trade-off between minimizing average turns and maximizing success rate can be controlled by changing the reward signal. Note that, except the E2E version, all versions share the same belief trackers, but by re-asking values of some slots they can have different posteriors ptT to inform the results. This shows that having full information about the current state of beliefs over the KB helps the Soft-KB agent discover better policies. Further, reinforcement learning helps discover better policies than the handcrafted rule-based agents, and we see a higher reward for RL agents compared to Rule ones. This is due to the noisy natural language inputs; with perfect information the rule-based strategy is optimal. Interestingly, the RL-Hard agent has the minimum number of turns in 2 out of the 4 settings, at the cost of a lower success rate and average reward. This agent does not receive any information about the uncertainty in semantic parsing, and it tends to inform as soon as the number of retrieved results becomes small, even if they are incorrect.
Among the Soft-KB agents, we see that E2E>RL>Rule, except for the X-Large KB. For E2E, the action space grows exponentially with the size of the KB, and hence credit assignment gets more difficult. Future work should focus on improving the E2E agent in this setting. The difficulty of a KB-split depends on number of entities it has, as well as the number of unique values for each slot (more unique values make the problem easier). Hence we see that both the “Small” and “X-Large” settings lead to lower reward for the agents, since maxj |V
j | N is small for them.
Figure 3: Performance of KB-InfoBot versions when tested against real users. Left: Success rate, with the number of test dialogues indicated on each bar, and the p-values from a twosided permutation test. Right: Distribution of the number of turns in each dialogue (differences in mean are significant with p < 0.01).
6.5 Human Evaluation
We further evaluate the KB-InfoBot versions trained using the simulator against real subjects, recruited from the author’s affiliations. In each session, the subject was first presented with a target movie from the “Medium” KB-split along with a subset of its associated slot-values from the KB. To simulate the scenario where end-users may not know slot values correctly, the subjects in our evaluation were presented multiple values for the slots from which they could choose any one while interacting with the agent. Subjects were asked to initiate the conversation by specifying some of these values, and respond to the agent’s subsequent requests, all in natural language. We test RL-Hard and the three Soft-KB agents in this study, and in each session one of the agents was picked at random for testing. Figure 3 shows a comparison of these agents in terms of success rate and number of turns, and Figure 4 shows some sample dialogues from the user interactions with RL-Soft.
In comparing Hard-KB versus Soft-KB lookup methods we see that both Rule-Soft and RL-Soft agents achieve a higher success rate than RL-Hard, while E2E-Soft does comparably. They do so in an increased number of average turns, but achieve a
8
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
Figure 4: Sample dialogues between users and the KB-InfoBot (RL-Soft version). Each turn begins with a user utterance followed by the agent response. Rank denotes the rank of the target movie in the KB-posterior after each turn.
Figure 5: Average rewards against simulator as temperature of softmax in NLG output is increased. Higher temperature leads to more noise in output. Average over 5000 simulations after selecting the best model during training.
higher average reward as well. Between RL-Soft and Rule-Soft agents, the success rate is similar, however the RL agent achieves that rate in a lower number of turns on average. RL-Soft achieves a success rate of 74% on the human evaluation and 80% against the simulated user, indicating minimal overfitting. However, all agents take a higher number of turns against real users as compared to the simulator, due to the noisier inputs.
The E2E gets the highest success rate against the simulator, however, when tested against real users it performs poorly with a lower success rate and a higher number of turns. Since it has more trainable components, this agent is also most prone to overfitting. In particular, the vocabulary of the simulator it is trained against is quite limited (V n = 3078), and hence when real users provided inputs outside this vocabulary, it performed poorly. In the future we plan to fix this issue by employing a better architecture for the LU and Belief Tracker components (such as the one used in Hakkani-Tür et al. (2016)), as well as by pretraining on separate data.
While its generalization performance is poor, the E2E system also exhibits the strongest learn-
ing capability. In Figure 5, we compare how different agents perform against the simulator as the temperature of the output softmax in its NLG is increased. A higher temperature means a more uniform output distribution, which leads to generic simulator responses irrelevant to the agent questions. This is a simple way of introducing noise in the utterances. The performance of all agents drops as the temperature is increased, but less so for the E2E agent, which can adapt its belief tracker to the inputs it receives. Such adaptation is key to the personalization of dialogue agents, which motivates us to introduce the E2E agent.
7 Conclusions and Discussion
This work is aimed at facilitating the move towards end-to-end trainable dialogue agents for information access. We propose a differentiable probabilistic framework for querying a database given the agent’s beliefs over its fields (or slots). We show that such a framework allows the downstream reinforcement learner to discover better dialogue policies by providing it more information. We present an E2E agent for the task, which demonstrates a strong learning capacity in simulations but suffers from overfitting when tested on real users. Given these results, we propose the following deployment strategy that allows a dialogue system to be tailored to specific users via learning from agent-user interactions. The system could start off with an RL-Soft agent (which gives good performance out-of-the-box). As the user interacts with this agent, the collected data can be used to train the E2E agent, which has a strong learning capability. Gradually, as more experience is collected, the system can switch from RL-Soft to the personalized E2E agent. Effective implementation of this, however, requires the E2E agent to learn quickly and this is the research direction we plan to focus on in the future.
9
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
A Posterior Derivation
Here, we present a derivation for equation 3, i.e., the posterior over the KB slot when the user knows the value of that slot. For brevity, we drop Φj = 0 from the condition in all probabilities below. For the case when i ∈Mj , we can write:
Pr(Gj = i)
= Pr(Gj ∈Mj) Pr(Gj = i|Gj ∈Mj) = |Mj | N 1 |Mj | = 1 N , (13)
where we assume all missing values to be equally likely, and estimate the prior probability of the goal being missing from the count of missing values in that slot. For the case when i = v 6∈Mj :
Pr(Gj = i)
= Pr(Gj 6∈Mj) Pr(Gj = i|Gj 6∈Mj)
= ( 1− |Mj |
N
) × ptj(v)
Nj(v) , (14)
where the second term comes from taking the probability mass associated with v in the belief tracker and dividing it equally among all rows with value v.
We can also verify that the above distribution is valid: i.e., it sums to 1:∑
i
Pr(Gj = i)
= ∑ i∈Mj Pr(Gj = i) + ∑ i 6∈Mj Pr(Gj = i)
= ∑ i∈Mj 1 N + ∑ i 6∈Mj ( 1− |Mj | N ) ptj(v) #jv
= |Mj | N +
( 1− |Mj |
N ) ∑ i 6∈Mj ptj(v) #jv
= |Mj | N +
( 1− |Mj |
N )∑ i∈V j #jv ptj(v) #jv
= |Mj | N +
( 1− |Mj |
N
) × 1
= 1 .
B Gated Recurrent Units
A Gated Recurrent Unit (GRU) (Cho et al., 2014) is a recurrent neural network which operates on an input sequence x1, . . . , xt. Starting from an initial
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
state h0 (usually set to 0 it iteratively computes the final output ht as follows:
rt = σ(Wrxt + Urht−1 + br)
zt = σ(Wzxt + Uzht−1 + bz)
h̃t = tanh(Whxt + Uh(rt ht−1) + bh) ht = (1− zt) ht−1 + zt h̃t . (15)
Here σ denotes the sigmoid nonlinearity, and an element-wise product.
C Hand-Crafted Policy
The hand-crafted policy is to ask for the slot ĵ = arg minH(p̃tj) with the minimum entropy, except if – (i) the KB posterior entropyH(ptT ) < αR, (ii) H(p̃tj) < min(αT , βH(p̃ 0 j ), (iii) slot j has already been requested Q times. αR, αT , β, Q are tuned to maximize reward against the simulator.
D REINFORCE updates
We assume that the learner has access to a reward signal rt throughout the course of the dialogue, details of which are in the next section. We can write the expected discounted return of the agent under policy π as follows:
J(θ) = E [ H∑ t=0 γtrt ] (16)
Here, the expectation is over all possible trajectories τ of the dialogue, θ denotes the trainable parameters of the learner, H is the maximum length of an episode, and γ is the discounting factor. We can use the likelihood ratio trick (Glynn, 1990) to write the gradient of the objective as follows:
∇θJ(θ) = E [ ∇θ log pθ(τ)
H∑ t=0 γtrt
] , (17)
where pθ(τ) is the probability of observing a particular trajectory under the current policy. With a Markovian assumption, we can write
pθ(τ) = p(s0) H∏ k=0 p(sk+1|sk, ak)πθ(ak|sk),
(18) where θ denotes dependence on the neural network parameters. From 17,18 we obtain
∇θJ(θ) = Ea∼π [ H∑ k=0 ∇θ log πθ(ak) H∑ t=0 γtrt ] ,
(19)
If we need to train both the policy network and the belief trackers using the reinforcement signal, we can view the KB posterior ptT as another policy. During training then, to encourage exploration, when the agent selects the inform action we sampleR results from the following distribution to return to the user:
µ(I) = ptT (i1)× ptT (i2)
1− ptT (i1) × · · · . (20)
This formulation also leads to a modified version of the episodic REINFORCE update rule (Williams, 1992). Specifically, eq. 18 now becomes,
pθ(τ) = [ p(s0)
H∏ k=0 p(sk+1|sk, ak)πθ(ak|sk)
] µθ(I),
(21) Notice the last term µθ above which is the posterior of a set of results from the KB. From 17,21 we obtain
∇θJ(θ) =Ea∼π,I∼µ [( ∇θ logµθ(I)+
H∑ h=0 ∇θ log πθ(ah) ) H∑ k=0 γkrk ] , (22)
E Hyperparameters
We use GRU hidden state size of d = 50 for the RL agents and d = 100 for the E2E, a learning rate of 0.05 for the imitation learning phase and 0.005 for the reinforcement learning phase, and minibatch size 128. For the rule agents, hyperparameters were tuned to maximize the average reward of each agent in simulations [TODO:add details]. For the E2E agent, imitation learning was performed for 500 updates, after which the agent switched to reinforcement learning. The input vocabulary is constructed from the NLG vocabulary and bigrams in the KB, and its size is 3078.
F User Simulator
At the beginning of each dialogue, the simulated user randomly samples a target entity from the ECKB and a random combination of informable slots for which it knows the value of the target. The remaining slot-values are unknown to the user. The user initiates the dialogue by providing a subset of its informable slots to the agent and requesting for an entity which matches them. In subsequent turns, if the agent requests for the value of a slot,
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
the user complies by providing it or informs the agent that it does not know that value. If the agent informs results from the KB, the simulator checks whether the target is among them and provides the reward.
We convert dialogue acts from the user into natural language utterances using a separately trained natural language generator (NLG). The NLG is trained in a sequence-to-sequence fashion, using conversations between humans collected by crowd-sourcing. It takes the dialogue actions (DAs) as input, and generates template-like sentences with slot placeholders via an LSTM decoder. Then, a post-processing scan is performed to replace the slot placeholders with their actual values, which is similar to the decoder module in (Wen et al., 2015, 2016a). In the LSTM decoder, we apply beam search, which iteratively considers the top k best sentences up to time step t when generating the token of the time step t+ 1. For the sake of the trade-off between the speed and performance, we use the beam size of 3 in the following experiments.
There are several sources of error in user utterances. Any value provided by the user may be corrupted by noise, or substituted completely with an incorrect value of the same type (e.g., “Bill Murray” might become just “Bill” or “Tom Cruise”). The NLG described above is inherently stochastic, and may sometimes generate utterances irrelevant to the agent request. By increasing the temperature of the output softmax in the NLG we can increase the noise in user utterances.

This paper presents a dialogue agent where the belief tracker and the dialogue manager are jointly optimised using the reinforce algorithm. It learns from interaction with a user simulator. There are two training phases. The first is an imitation learning phase where the system is initialised using supervising learning from a rule-based model. Then there is a reinforcement learning phase where the system has jointly been optimised using the RL objective.  - Strengths: This paper presents a framework where a differentiable access to the KB is integrated in the joint optimisation. This is the biggest contribution of the paper.   - Weaknesses: Firstly, this is not a truly end-to-end system considering the response generation was handcrafted rather than learnt. Also, their E2E model actually overfits to the simulator and performs poorly in human evaluation. This begs the question whether the authors are actually selling the idea of E2E learning or the soft-KB access. The soft-KB access actually brings consistent improvement, however the idea of end-to-end learning not so much. The authors tried to explain the merits of E2E in Figure 5 but I also fail to see the difference. In addition, the authors didn't motivate the reason for using the reinforce algorithm which is known to suffer from high variance problem. They didn't attempt to improve it by using a baseline or perhaps considering the natural actor-critic algorithm which is known to perform better.  - General Discussion: Apart from the mentioned weaknesses, I think the experiments are solid and this is generally an acceptable paper. However, if they crystallised the paper around the idea which actually improves the performance (the soft KB access) but not the idea of E2E learning the paper would be better.


Improved Word Representation Learning with Sememes
Sememes are minimum semantic units of word meanings, and the meaning of each word sense is typically composed by several sememes. Since sememes are not explicit for each word, people manually annotate word sememes and form linguistic common-sense knowledge bases. In this paper, we present that, word sememe information can improve word representation learning (WRL), which maps words into a low-dimensional semantic space and serves as a fundamental step for many NLP tasks. The key idea is to utilize word sememes to accurately capture exact meanings of a word within specific contexts. More specifically, we follow the framework of Skip-gram and present three sememe-encoded models to learn representations of sememes, senses and words, where we apply the attention scheme to detect word senses in various contexts. We conduct experiments on two tasks including word similarity and word analogy, and our models significantly outperform baselines. The results indicate that WRL can benefit from sememes via the attention scheme, and also confirm our models being capable of properly modeling sememe information.
1 Introduction
Sememes are defined as minimum semantic units of word meanings, and there exists a limited close set of sememes to compose the semantic meanings of an open set of concepts (i.e. word sense). However, sememes are not explicit for each word. Hence, people manually annotate word sememes and build linguistic common-sense
knowledge bases. HowNet (Dong and Dong, 2003) is one of such knowledge bases, which annotates each concepts in Chinese with one or more relevant sememes. Different from WordNet (Miller, 1995), the philosophy of HowNet emphasizes the significance of part and attribute represented by sememes. HowNet has been widely utilized in word similarity computation (Liu and Li, 2002) and sentiment analysis (Xianghua et al., 2013), and in section 3.2 we will give detailed introduction on sememes, senses and words in HowNet.
In this paper, we aim to incorporate word sememes into word representation learning (WRL) and learn improved word embeddings in a lowdimensional semantic space. WRL is a fundamental and critical step in many NLP tasks such as language modeling (Bengio et al., 2003) and neural machine translation (Sutskever et al., 2014).
There have been a lot of researches for learning word representations, among which word2vec (Mikolov et al., 2013) achieves a nice balance between effectiveness and efficiency. In word2vec, each word corresponds to one single embedding, ignoring the polysemy of most words. To address this issue, (Huang et al., 2012) introduces multiprototype model for WRL, conducting unsupervised word sense induction and embeddings according to context clusters. (Chen et al., 2014) further utilizes the synset information in WordNet to instruct word sense representation learning.
From these previous studies we conclude that, word sense disambiguation are critical for WRL, and we believe that the sememe annotation of word senses in HowNet can provide essential semantic regularization for the both tasks. To explore its feasibility, we propose a novel Sememe-Encoded Word Representation Learning (SE-WRL) model, which detects word senses and learns representations simultaneously. More
2
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
specifically, this framework regards each word sense as a combination of its sememes, and iteratively performs word sense disambiguation according to their contexts and learn representations of sememes, senses and words by extending Skipgram in word2vec (Mikolov et al., 2013). In this framework, an attention-based method is proposed to automatically select appropriate word senses according to contexts. To take full advantages of sememes, we propose three different learning and attention strategies for SE-WRL.
In experiments, we evaluate our framework on two tasks including word similarity and word analogy, and further conduct case studies on sememe, sense and word representations. The evaluation results show that our models outperform other baselines significantly, especially on word analogy. This indicates that our models can automatically detect appropriate word senses according to contexts, and both word sense disambiguation and representation learning can benefit from the sememe annotation in HowNet.
The key contributions of this work are concluded as follows: (1) To the best of our knowledge, this is the first work to utilize sememes in HowNet to improve word representation learning. (2) We successfully apply the attention scheme to detect word senses and learn representations according to contexts with the favor of the sememe annotation in HowNet. (3) We conduct extensive experiments and verify the effectiveness of incorporating word sememes for improved WRL.
2 Related Work
2.1 Word Representation
Recent years have witnessed the great thrive in word representation learning. It is simple and straightforward to represent words using one-hot representations, but it usually struggles with the data sparsity issue and the neglect of semantic relations between words.
To address these issues, (Rumelhart et al., 1988) proposes the idea of distributed representation which projects all words into a continuous low-dimensional semantic space, considering each word as a vector. Distributed word representations are powerful and have been widely utilized in many NLP tasks, including neural language models (Bengio et al., 2003; Mikolov et al., 2010), machine translation (Sutskever et al., 2014; Bahdanau et al., 2015), parsing (Chen and Manning, 2014)
and text classification (Zhang et al., 2015). Word distributed representations are capable of encoding semantic meanings in vector space, serving as the fundamental and essential inputs of many NLP tasks.
There are large amounts of efforts devoted to learning better word representations. As the exponential growth of text corpora, model efficiency becomes an important issue. (Mikolov et al., 2013) proposes two models, CBOW and Skipgram, achieving a good balance between effectiveness and efficiency. These models assume that the meanings of words can be well reflected by their contexts, and learn word representations by maximizing the predictive probabilities between words and their contexts. (Pennington et al., 2014) further utilizes matrix factorization on word affinity matrix to learn word representations. However, these models merely arrange only one vector for each word, regardless of the fact that many words have multiple senses. (Huang et al., 2012; Tian et al., 2014) utilize multi-prototype vector models to learn word representations, and build distinct vectors for each word sense. (Neelakantan et al., 2015) presents an extension to Skip-gram model for learning non-parametric multiple embeddings per word. (Rothe and Schütze, 2015) also utilizes an Autoencoder to jointly learn word, sense and synset representations in the same semantic space.
This paper, for the first time, jointly learns representations of sememes, senses and words. The sememe annotation in HowNet provides useful semantic regularization for WRL. Moreover, the unified representations incorporated with sememes also provide us more explicit explanations of both word and sense embeddings.
2.2 Word Sense Disambiguation and Representation Learning
Word sense disambiguation (WSD) aims to computationally identify word senses or meanings in a certain context. There are mainly two approaches for WSD, namely the supervised methods and the knowledge-based methods. Supervised methods usually take the surrounding words or senses as features and use classifiers like SVM for word sense disambiguation (Lee et al., 2004), which are intensively limited to the time-consuming human annotation of training data.
On contrary, knowledge-based methods utilize large external knowledge resources such as knowl-
3
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
edge bases or dictionaries to suggest possible senses for a word. (Banerjee and Pedersen, 2002) exploits the rich hierarchy of semantic relations in WordNet (Miller, 1995) for an adapted dictionarybased WSD algorithm. (Bordes et al., 2011) introduces synset information in WordNet to WRL. (Chen et al., 2014) considers synsets in WordNet as different word senses, and jointly conducts word sense disambiguation and word / sense representation learning. (Guo et al., 2014) considers bilingual datasets to learn sense-specific word representations. Moreover, (Jauhar et al., 2015) proposes two approaches to learn sense-specific word representations that are grounded to ontologies. (Pilehvar and Collier, 2016) utilizes personalized PageRank to learn de-conflated semantic representations of words.
In this paper, we follow the knowledge-based approach and automatically detect word senses according to the contexts with the favor of sememe information in HowNet. To the best of our knowledge, this is the first attempt to apply attentionbased models to encode sememe information for word representation learning.
3 Methodology
In this section we present our framework SememeEncoded WRL (SE-WRL) that considers sememe information for word sense disambiguation and representation learning. Specifically, we learn our models on a large-scale text corpus with the semantic regularization of the sememe annotation in HowNet, and obtain sememe, sense and word embeddings for evaluation tasks.
In the following sections, we first introduce HowNet and the structures of sememes, senses and words. Then we discuss the conventional WRL model Skip-gram that we utilize for the the sememe-encoded framework. Finally, we propose three sememe-encoded models in details.
3.1 Sememes, Senses and Words in HowNet
In this section, we first introduce the arrangement of sememes, senses and words in HowNet. HowNet annotates precise senses to each word, and for each sense HowNet annotates the significance of parts and attributes represented by sememes.
Fig. 1 gives an example of sememes, senses and words in HowNet. The first layer represents the word “apple”. The word “apple” actually has two
main senses shown on the second layer: one is a sort of juicy fruit (apple), and another is a famous computer brand (Apple brand). The third and following layers are those sememes explaining each sense. For instance, the first sense Apple brand indicates a computer brand, and thus has sememes computer, bring and SpeBrand.
From Fig. 1 we can find that, sememes of many senses in HowNet are annotated with various relations, such as define and modifier, and form complicated hierarchical structures. In this paper, for simplicity we only consider all annotated sememes of each sense as a sememe set without considering their internal structure. HowNet assumes the limited annotated sememes can well represent senses and words in real-world scenario, and thus sememes are expected to be useful for both WSD and WRL.
We introduce the notions utilized in the following sections as follows. We define the overall sememe, sense and word sets used in training as X , S and W respectively. For each w ∈ W , there are possible multiple senses s(w)i ∈ S(w) where S(w) represents the sense set ofw. Each sense s(w)i consists of several sememes x(si)j ∈ X (w) i . For each target word w in a sequential plain text, C(w) represents its context word set.
3.2 Conventional Skip-gram Model
We directly utilize the widely-used model Skipgram to implement our SE-WRL model, because Skip-gram has well balanced effectiveness as well as efficiency (Mikolov et al., 2013). The standard skip-gram model assumes that word embeddings should relate to their context words. It aims at maximizing the predictive probability of context words conditioned on the target word w. For-
4
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
mally, we utilize a sliding window to select the context word set C(w). For a word sequence H = {w1, · · · , wn}, Skip-gram model intends to maximize:
L(H) = n−K∑ i=K log Pr(wi−K , · · · , wi+K |wi), (1)
where K is the size of sliding window. Pr(wi−K , · · · , wi+K |wi) represents the predictive probability of context words conditioned on the target word wi, formalized by the following softmax function:
Pr(wi−K , · · · , wi+K |wi) = ∏
wc∈C(wi)
Pr(wc|wi)
= ∏
wc∈C(wi)
exp(w>c ·wi)∑ w′i∈W exp(w>c ·w′i) ,
(2)
in which wc and wi stand for embeddings of context word wc ∈ C(wi) and target word wi respectively. We can also follow the strategies of hierarchical softmax and negative sampling proposed in (Mikolov et al., 2013) to accelerate the calculation of softmax.
3.3 SE-WRL Model
In this section, we introduce the SE-WRL models with three different strategies to utilize sememe information, including Simple Sememe Aggregation Model (SSA), Sememe Attention over Context Model (SAC) and Sememe Attention over Target Model (SAT).
3.3.1 Simple Sememe Aggregation Model
The Simple Sememe Aggregation Model (SSA) is a straightforward idea based on Skip-gram model. For each word, SSA considers all sememes in all senses of the word together, and represents the target word using the average of all its sememe embeddings. Formally, we have:
w = 1
m ∑ s (w) i ∈S(w) ∑ x (si) j ∈X (w) i x (si) j , (3)
which means the word embedding of w is composed by the average of all its sememe embeddings. Here, m stands for the overall number of sememes belonging to w.
This model simply follows the assumption that, the semantic meaning of a word is composed by
the semantic units, i.e., sememes. As compared to the conventional Skip-gram model, since sememes are shared by multiple words, this model can utilize sememe information to encode latent semantic correlations between words. In this case, similar words that share the same sememes may finally obtain similar representations.
3.3.2 Sememe Attention over Context Model
The SSA Model replaces the target word embedding with the aggregated sememe embeddings to encode sememe information into word representation learning. However, each word in SSA model still has only one single representation in different contexts, which cannot deal with polysemy of most words. It is intuitive that we should construct distinct embeddings for a target word according to specific contexts, with the favor of word sense annotation in HowNet.
To address this issue, we come up with the Sememe Attention over Context Model (SAC). SAC utilizes the attention scheme to automatically select appropriate senses for context words according to the target word. That is, SAC conducts word sense disambiguation for context words to learn better representations of target words. The structure of the SAC model is shown in Fig. 2.
More specifically, we utilize the original word embedding for target word w, but use sememe embeddings to represent context word wc instead of original context word embeddings. Suppose a word typically demonstrates some specific senses in one sentence. Here we employ the target word embedding as an attention to select the most appropriate senses to make up context word embeddings. We formalize the context word embedding wc as follows:
wc = |S(wc)|∑ j=1 att(s (wc) j ) · s (wc) j , (4)
5
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
where s(wc)j stands for the j-th sense embedding ofwc, and att(s (wc) j ) represents the attention score of the j-th sense with respect to the target word w, defined as follows:
att(s (wc) j ) = exp(w · ŝ(wc)j )∑|S(wc)| k=1 exp(w · ŝ (wc) k ) . (5)
Note that, when calculating attention, we use the average of sememe embeddings to represent each sense s(wc)j :
ŝ (wc) j =
1
|X(wc)j | |X(wc)j |∑ k=1 x (sj) k .
(6)
The attention strategy assumes that, the more relevant a context word sense embedding is to the target word w, the more this sense should be considered when building context word embeddings. With the favor of attention scheme, we can represent each context word as a certain distribution over its sense. This can be regarded as soft WSD. As shown in experiments, it will help learn better word representations.
3.3.3 Sememe Attention over Target Model
The Sememe Attention over Context Model can flexibly select appropriate senses and sememes for context words according to the target word. The process can be also applied to select appropriate senses for the target word, by taking context words as attention. Hence, we propose the Sememe Attention over Target Model (SAT) as shown in Fig. 3.
Wt
Wt-2 Wt-1 Wt+1 Wt+2
contextual embedding
att1 att2 att3
S1 S2 S3
context
word
sense
sememe
Figure 3: Sememe Attention over Target Model.
Different from SAC model, SAT learns the original word embeddings for context words, but sememe embeddings for target words. We apply context words as attention over multiple senses of
the target word w to build the embedding of w, formalized as follows:
w = |S(w)|∑ j=1 att(s (w) j ) · s (w) j , (7)
where s(w)j stands for the j-th sense embedding of w, and the context-based attention is defined as follows:
att(s (w) j ) = exp(w′c · ŝ (w) j )∑|S(w)|
k=1 exp(w ′ c · ŝ (w) k )
, (8)
where, similar to Eq. (6), we also use the average of sememe embeddings to represent each sense s (w) j . Here, w ′ c is the context embedding, consisting of a constrained window of word embeddings in C(wi). We have:
w′c = 1
2K ′ k=i+K′∑ k=i−K′ wk, k 6= i. (9)
Note that, since in experiment we find the sense selection of the target word only relies on more limited context words for calculating attention, hence we select a smaller K ′ as compared to K.
Recall that, SAC only uses one target word as attention to select senses of context words, but SAT use several context words together as attention to select appropriate senses of target words. Hence SAT is expected to conduct more reliable WSD and result in more accurate word representations, which will be explored in experiments.
4 Experiments
In this section, we evaluate the effectiveness of our SE-WRL models on two tasks including word similarity and word analogy, which are two classical evaluation tasks mainly focusing on evaluating the quality of learned word representations. We also explore the potential of our models in word sense disambiguation with case study, showing the power of our attention-based models.
4.1 Dataset
We use the webpages in Sogou-T1 as the text corpus to learn WRL models. Sogou-T is provided by a Chinese commercial search engine, which contains 2.7 billion words in total.
1https://www.sogou.com/labs/resource/ t.php
6
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
We also utilize the sememe annotation in HowNet. The number of distinct sememes used in this paper is 1, 889. The average senses for each word is about 2.4, while the average sememes for each sense is about 1.6. Throughout the Sogou-T corpus, we find that 42.2% of words have multiple senses. This indicates the significance of WSD.
For evaluation, we choose wordsim-240 and wordsim-2972 to evaluate the performance of word similarity computation. The two datasets both contain frequently-used Chinese word pairs with similarity scores annotated manually. We choose the Chinese Word Analogy dataset proposed by (Chen et al., 2015) to evaluate the performance of word analogy inference, that is, w(“king”) − w(“man”) ' w(“queen”) − w(“woman”).
4.2 Experimental Settings
We evaluate three SE-WRL models including SSA, SAC and SAT on all tasks. As for baselines, we consider three conventional WRL models including Skip-gram, CBOW and GloVe. For Skipgram and CBOW, we directly use the code released by Google (Mikolov et al., 2013). GloVe is proposed by (Pennington et al., 2014), which seeks the advantages of the WRL models based on statistics and those based on prediction. Moreover, we implement another baseline Maximum Selection over Target Model (MST) inspired by (Chen et al., 2014). It represents the current word embeddings with only the most probable sense according to the contexts, instead of viewing a word as a certain distribution over all its senses similar to that of SAT.
For a fair comparison, we train these models with the same experimental settings and with their best parameters. As for the parameter settings, we set the context window size K = 8 as the upper bound, and during training the window size is dynamically selected ranging from 1 to 8 randomly. We set the dimensions of word, sense and sememe embeddings to be the same 200. For learning rate α, its initial value is 0.025 and will descend through iterations. We set the number of negative samples to be 25. We also set a lower bound of word frequency as 50, and in the training set those words less frequent than this bound will be filtered out. For SAT, we set K ′ = 2.
2https://github.com/Leonard-Xu/CWE/ tree/master/data
4.3 Word Similarity
The task of word similarity aims to evaluate the quality of word representations by comparing the similarity ranks of word pairs computed by WRL models with the ranks given by dataset. WRL models typically compute word similarities according to their distances in the semantic space.
4.3.1 Evaluation Protocol
In experiments, we choose the cosine similarity between two word embeddings to rank word pairs. For evaluation, we compute the Spearman correlation between the ranks of models and the ranks of human judgements.
4.3.2 Experiment Results
Table 1 shows the results of these models for word similarity computation. From the results we can observe that:
(1) Our SAT model outperforms other models, including all baselines, on both two test sets. This indicates that, by utilizing sememe annotation properly, our model can better capture the semantic relations of words, and learn more accurate word embeddings.
(2) The SSA model represents a word with the average of its sememe embeddings. In general, SSA model performs slightly better than baselines, which tentatively proves that sememe information is helpful. The reason is that words which share common sememe embeddings will benefit from each other. Especially, those words with lower frequency, which cannot be learned sufficiently using conventional WRL models, in contrast can obtain better word embeddings from SSA simply because their sememe embeddings can be trained sufficiently through other words.
(3) The SAT model performs much better than SSA and SAC. This indicates that SAT can obtain more precise sense distribution of a word. The reason has been mentioned above that, different from
7
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
Model Accuracy Mean RankCapital City Relationship All Capital City Relationship All
CBOW 49.8 85.7 86.0 64.2 36.98 1.23 62.64 37.62 GloVe 57.3 74.3 81.6 65.8 19.09 1.71 3.58 12.63 Skip-gram 66.8 93.7 76.8 73.4 137.19 1.07 2.95 83.51 MST 65.7 95.4 82.7 74.5 50.29 1.05 2.48 31.05
SSA 62.3 93.7 81.6 71.9 45.74 1.06 3.33 28.52 SAC 61.6 95.4 77.9 70.8 19.08 1.02 2.18 12.18 SAT 83.2 98.9 82.4 85.3 14.42 1.01 2.63 9.48
Table 2: Evaluation results of word analogy inference.
SAC using only one target word as attention for WSD, SAT adopts richer contextual information as attention for WSD.
(4) SAT works better than MST, and we can conclude that, a soft disambiguation over senses prevents inevitable errors when selecting only one most-probable sense. The result makes sense because for many words, their various senses are not always completely different from each other, but share some common elements. In some contexts, a single sense may not convey the exact meaning of this word.
4.4 Word Analogy
Word analogy inference is another widely-used task to evaluate the quality of WRL models (Mikolov et al., 2013).
4.4.1 Evaluation Protocol
The dataset proposed by (Chen et al., 2015) consists of 1, 124 analogies, which contains three analogy types: (1) capitals of countries (Capital), 677 groups; (2) states/provinces of cities (City), 175 groups; (3) family words (Relationship), 272 groups. Given an analogy group of words (w1, w2, w3, w4), WRL models usually get w2−w1+w3 equal to w4. Hence for word analogy inference, we suppose w4 is missing, and WRL models will rank all candidate words according to their scores as follows:
R(w) = cos(w2 −w1 +w3,w), (10)
and select the top-ranked word as the answer. For word analogy inference, we consider two evaluation metrics: (1) Accuracy. For each analogy group, a WRL model selects the top-ranked word w = argmaxw R(w), which is judged as positive if w = w4. The percentage of positive samples is regarded as the accuracy score for this WRL model. (2) Mean Rank. For each analogy group, a WRL model will assign a rank for
the gold standard word w4 according to the scores computed by Eq. (10). We use the mean rank of all gold standard words as the evaluation metric.
4.4.2 Experiment Results
Table 2 shows the evaluation results of these models for word analogy inference. From the table, we can observe that:
(1) The SAT model performs best among all models, and the superiority is more significant than that on word similarity computation. This indicates that SAT will enhance the modeling of implicit relations between word embeddings in the semantic space. The reason is that sememes annotated to word senses have encoded these word relations. For example, capital and Cuba are two sememes of the word “Havana”, which provide explicit semantic relations between the words “Cuba” and “Havana”.
(2) The SAT model does well on both classes of Capital and City, because some words in these classes have low frequencies, while their sememes occur so many times that sememe embeddings can be learned sufficiently. With these sememe embeddings, these low-frequent words can be learned more efficiently by SAT.
(3) It seems that CBOW works better than SAT on Relationship class. Whereas for the mean rank, CBOW gets the worst results, which indicates the performance of CBOW is unstable. On the contrary, although the accuracy of SAT is a bit lower than that of CBOW, SAT seldom gives outrageous prediction. In most wrong cases, SAT predicts the word “grandfather” instead of “grandmother”, which is not completely non-sense, because in HowNet the words “grandmother”, “grandfather”, “grandma” and some other similar words share four common sememes while only one sememe of them are different. These similar sememes make the attention process less discriminative with each other. But for the wrong cases
8
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
Word: °J(“Apple brand/apple”) sense1: Apple brand (computer, PatternValue, able, bring, SpeBrand) sense2: duct (fruit)
°J kJ¥ {¡£Apple is always famous as the king of fruits¤ Apple brand: 0.28 apple: 0.72 °J>MÃ{ ~éÄ£The Apple brand computer can not startup
normally¤ Apple brand: 0.87 apple: 0.13
Word: *Ñ(“proliferate/metastasize”) sense1: proliferate (disperse) sense2: metastasize (disperse, disease)
¼ *Ñ£Prevent epidemic from metastasizing¤ proliferate: 0.06 metastasize: 0.94 Ø*ÑØÉì^ £Treaty on the Non-Proliferation of Nuclear
Weapons¤ proliferate: 0.68 metastasize: 0.32
Word: èÎ(“contingent/troops”) sense1: contingent (community) sense2: troops (army)
l|èÎ?\1 ãìNm£Eight contingents enter the second stage of team competition¤
contingent: 0.90 troops: 0.10
úSÄ èÎ| ï £Construct the organization of public security’s troops in grass-roots unit¤
contingent: 0.15 troops: 0.85
Table 3: Examples of sememes, senses and words in context with attention.
of CBOW, we find that many mistakes are about words with low frequencies, such as “stepdaughter” which occurs merely for 358 times. With the help of sememes, these low-frequency words arise no issue for SAT.
4.5 Case study
The above experiments verify the effectiveness of our models for WRL. Here we show some examples of sememes, senses and words for case study.
4.5.1 Word Sense Disambiguation
In order to demonstrate the validity of Sememe Attention, we select three attention results in training set, as shown in Table 3. In this table, the first rows of three examples are word-sense-sememe structures of each word. For instance, in the third example, the word has two senses, contingent and troops; contingent has one sememe community, while troops has one sememe army. The three examples all indicate that our models can estimate appropriate distributions of senses for a word given a context.
4.5.2 Effect of Context Words for Attention
We demonstrate the effect of context words for attention in Table. 4. The word “Havana” consists of four sememes, among which two sememes capital and Cuba describe distinct attributes of the word from different aspects.
Here, we list three different context words “Cuba”, “Russia” and “cigar”. Given the context word “Cuba”, both sememes get high weights, indicating their contributions to the meaning of “Havana” in this context. The context word “Russia” is more relevant to the sememe capital. When the context word is “cigar”, the sememe Cuba has more
influence, because cigar is a famous specialty of Cuba. From these examples, we can conclude that our Sememe Attention can accurately capture the word meanings in complicated contexts.
5 Conclusion and Future Work
In this paper, we propose a novel method to model sememe information for learning better word representations. Specifically, we utilize sememe information to represent various senses of each word, and propose Sememe Attention to automatically select appropriate senses in contexts. We evaluate our models on word similarity and word analogy, and results show the advantages of our Sememe-Encoded WRL models. We also analyze several cases in WSD and WRL, which confirms our models are capable of selecting appropriate word senses with the favor of sememe attention.
We will explore the following research directions in future: (1) The sememe information in HowNet is annotated with hierarchical structure and relations, which have not been considered in our framework. We will explore to utilize these annotations for better WRL. (2) We believe the idea of sememes is universal and could be wellfunctioned beyond languages. We will explore the effectiveness of sememe information for WRL in other languages.
9
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899

- Strengths:  1. The proposed models are shown to lead to rather substantial and consistent improvements over reasonable baselines on two different tasks (word similarity and word analogy), which not only serves to demonstrate the effectiveness of the models but also highlights the potential utility of incorporating sememe information from available knowledge resources for improving word representation learning. 2. The paper contributes to ongoing efforts in the community to account for polysemy in word representation learning. It builds nicely on previous work and proposes some new ideas and improvements that could be of interest to the community, such as applying an attention scheme to incorporate a form of soft word sense disambiguation into the learning procedure.  - Weaknesses:  1. Presentation and clarity: important details with respect to the proposed models are left out or poorly described (more details below). Otherwise, the paper generally reads fairly well; however, the manuscript would need to be improved if accepted. 2. The evaluation on the word analogy task seems a bit unfair given that the semantic relations are explicitly encoded by the sememes, as the authors themselves point out (more details below).  - General Discussion:  1. The authors stress the importance of accounting for polysemy and learning sense-specific representations. While polysemy is taken into account by calculating sense distributions for words in particular contexts in the learning procedure, the evaluation tasks are entirely context-independent, which means that, ultimately, there is only one vector per word -- or at least this is what is evaluated. Instead, word sense disambiguation and sememe information are used for improving the learning of word representations. This needs to be clarified in the paper. 2. It is not clear how the sememe embeddings are learned and the description of the SSA model seems to assume the pre-existence of sememe embeddings. This is important for understanding the subsequent models. Do the SAC and SAT models require pre-training of sememe embeddings? 3. It is unclear how the proposed models compare to models that only consider different senses but not sememes. Perhaps the MST baseline is an example of such a model? If so, this is not sufficiently described (emphasis is instead put on soft vs. hard word sense disambiguation). The paper would be stronger with the inclusion of more baselines based on related work. 4. A reasonable argument is made that the proposed models are particularly useful for learning representations for low-frequency words (by mapping words to a smaller set of sememes that are shared by sets of words). Unfortunately, no empirical evidence is provided to test the hypothesis. It would have been interesting for the authors to look deeper into this. This aspect also does not seem to explain the improvements much since, e.g., the word similarity data sets contain frequent word pairs. 5. Related to the above point, the improvement gains seem more attributable to the incorporation of sememe information than word sense disambiguation in the learning procedure. As mentioned earlier, the evaluation involves only the use of context-independent word representations. Even if the method allows for learning sememe- and sense-specific representations, they would have to be aggregated to carry out the evaluation task. 6. The example illustrating HowNet (Figure 1) is not entirely clear, especially the modifiers of  computer . 7. It says that the models are trained using their best parameters. How exactly are these determined? It is also unclear how K is set -- is it optimized for each model or is it randomly chosen for each target word observation? Finally, what is the motivation for setting K' to 2?