Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer)...
Transcript of Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer)...
![Page 1: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/1.jpg)
Coupling distributed and symbolic execution for natural language queries
Lili Mou Zhengdong Lu Hang Li Zhi Jin
![Page 2: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/2.jpg)
Outline
• Learning the semantics of a question from its execution
• Neural vs. Symbolic
• Our Proposal: coupling the two views
• Conclusion
![Page 3: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/3.jpg)
Outline
• Learning the semantics of a question from its execution
• Neural vs. Symbolic
• Our Proposal: coupling the two views
• Conclusion
![Page 4: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/4.jpg)
Learning the semantics of a question from its execution
NL questionSemanticParser
somethingexecutable
![Page 5: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/5.jpg)
+ KB
Learning the semantics of a question from its execution
NL questionSemanticParser
somethingexecutable answer
![Page 6: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/6.jpg)
+ KB
Learning the semantics of a question from its execution
NL questionSemanticParser
somethingexecutable answer
AnswerChecker
groundtruth
correctional signal
![Page 7: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/7.jpg)
select Duration wherearea = max(area)
Two parsing choices: (1)
Semantic parsing
① Question into a composite SQL-like command (Liang et al.ACL-17)
It is essentially a sequence-to-sequence model, while the output sequence is executable
![Page 8: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/8.jpg)
STEP-1: Row selection:argmax(area)
Two parsing choices: (2)
① Question into a composite SQL-like command (Liang et al.ACL-17)② Question into a sequence of “primitive” operations (Neelakantan et al. ICLR-16, Yin et al. IJCAI-16)
STEP-2: Value selection:select_value(Duration)
Semantic parsing
![Page 9: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/9.jpg)
Question as a sequence of operations
NL question
executor
controller ① Neural net controller sequentially emitsoperations (with argument)
② Each operation has its own semantics, sothe operation of each step can bepotentially supervised
③ Each operation is applied on KB andmemory from previous operation, with thenew result saved in the current memory
S1 S2 S3 S4
Memoryat time 1
KB
Memoryat time 2
Memoryat time 3
Memoryat time 4
We will use this as our base models
O1 O2 O3 O4
![Page 10: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/10.jpg)
Outline
• Learning the semantics of a question from its execution
• Neural vs. Symbolic
• Our Proposal: coupling the two worlds
• Conclusion
![Page 11: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/11.jpg)
We choose to parse questions into a sequence of operations
NL question
executor
controllerS1 S2 S3 S4
Memoryat time 1
KB
Memoryat time 2
Memoryat time 3
Memoryat time 4
O1 O2 O3 O4
![Page 12: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/12.jpg)
Symbolic executor vs. Neural executor
Again we have two modeling choices
① Symbolic Executor: the execution is purely symbolic, while the controller is neural net-based, whose optimization objective is non-differentiable
② Neural Executor: everything is “neuralized”, including the executor and the intermediatememory, so the objective is naturally differentiable. Although it is easy to learn, it suffersfrom low execution efficiency and low generalization ability
The choice of Neural Programmer (Neelakantan et al. ICLR-16) is an interesting middlecourse, but we don’t consider it due its limited potential for complex operations
![Page 13: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/13.jpg)
Choice-I: Symbolic executor
• Learning is hard (with reinforcement learning):• relatively big action space: primitive operators x argument• only final reward (when the executions return the correct result)
Bingo!
NL question S1 S2 S3 S4
Memoryat time 1
KB
Memoryat time 2
Memoryat time 3
Memoryat time 4
O1 O2 O3 O4
![Page 14: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/14.jpg)
Examples of symbolic operators
• We limit ourselves with knowledge-base with a single table• Each execution on a table is specified by a primitive operator with an argument
Example: argmax(year) selects the row with the field year having the greatest value
![Page 15: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/15.jpg)
Choice II: Neural executor
NL question S1 S2 S3 S4
Distributedmemory at
time 1
world
a distribution ofpossible predictionsDistributed
memory attime 2
Distributedmemory at
time 3
Distributedmemory at
time 4
• Neural Enquirer (Yin et al. IJCAI-16) as the example: Learning is typically easy through normalback-propagation. It can learn to deal with quite complicated questions
• Its execution efficiency is low due to its fully neural architecture, and the accuracy on parsingcomplex questions is not satisfying
![Page 16: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/16.jpg)
Neural Enquirer: Overall diagram
l Embed the table: keep the table structure, but embed the value and fieldl Fully “neuralized” execution (matrix/vector processing with gating and pooling )l Stacked layers of (Excutor, Memory) pairs to mimic the sequence of operations, while the
memory saves the intermediate result of each layer of execution
Each execution step in Neural Enquirer includes- Soft column attention (this part is naturally interpretable)- Distributed row annotation
![Page 17: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/17.jpg)
Neural vs. Symbolic
Symbolic Neural Wanted
Learning Efficiency Very low High High
Execution efficiency High Low High
Interpretability High Low High
Accuracy Low Low High
![Page 18: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/18.jpg)
Neural vs. Symbolic
Can we (sort-of) have the best of both worlds?
Symbolic Neural Wanted
Learning Efficiency Very low High High
Execution efficiency High Low High
Interpretability High Low High
Accuracy Low Low High
![Page 19: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/19.jpg)
Outline
• Learning the semantics of a question from its execution
• Neural vs. Symbolic
• Our Proposal: coupling the two views
• Conclusion
![Page 20: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/20.jpg)
General intuition
• Neural models and symbolic models are like two different views of the same complex semanticparsing process
• We can maintain both views in the same system, and let them talk to each other, to encouragesome consistency between the two views
• It is a bit like Multi-view Learning, while in this work the contrast of views come fromintrinsic representation choices, instead from different given aspects or features of thesame object
![Page 21: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/21.jpg)
The diagram
Neural view (Neural Enquirer)
Symbolic view
① We have both neural andsymbolic view in the samesystem
② There is informationexchange between the twoviews during the training
③ We will use only symbolicview for testing after thetraining is done, for highexecution efficiency
![Page 22: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/22.jpg)
Coupling the two views
General idea: (distributed symbolic)• STEP-1: Train the neural model as in (Yin et al. IJCAI-16) in an end-to-end fashion• STEP-2: Pre-train the field selection part of the symbolic model with the prediction of the
neural model trained in STEP-1 in a step-by-step way• STEP-3: Train the symbolic model with REINFORCE with the execution accuracy as reward
![Page 23: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/23.jpg)
Coupling the two views
General idea: (distributed symbolic)• STEP-1: Train the neural model as in (Yin et al. IJCAI-16) in an end-to-end fashion• STEP-2: Pre-train the field selection part of the symbolic model with the prediction of the
neural model trained in STEP-1 in a step-by-step way• STEP-3: Train the symbolic model with REINFORCE with the execution accuracy as reward
(distributed symbolic distributed)• STEP-4: (Feedback step) Use the symbolic model to train the attention of the neural
model in a step-by-step way
![Page 24: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/24.jpg)
Coupling the two views
General idea: (distributed symbolic)• STEP-1: Train the neural model as in (Yin et al. IJCAI-16) in an end-to-end fashion• STEP-2: Pre-train the field selection part of the symbolic model with the prediction of the
neural model trained in STEP-1 in a step-by-step way• STEP-3: Train the symbolic model with REINFORCE with the execution accuracy as reward
(distributed symbolic distributed)• STEP-4: (Feedback step) Use the symbolic model to train the attention of the neural
model in a step-by-step way
STEP-2 and STEP-4 approximately maintain the consistency of the two viewson field selection
![Page 25: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/25.jpg)
l Let m be the number of actions to pre-train, J is the function to be maximizel Only the parameters associated with field selection is trained in this phrase, the other parts are
left dangling
l We used supervised learning for pre-training, but many other ways (eg, some smart sampling)may also work
Step-by-step supervision
Imperfect supervision signal fromNeural Enquirer MAP prediction
Pre-training with supervision form neural view
![Page 26: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/26.jpg)
Policy improvement with REINFORCE
•
• Gradient:
• Reward R : 1 for correct result, 0 otherwise
• Tricks- Exploring with a small probability (0.1)- Subtracting the mean (reinforcement comparison)- Truncate negative reward (reward-inaction
![Page 27: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/27.jpg)
Experimental setting
l Dataset: from (Yin et al. IJCAI-16 )- Synthesized data: table has 10 fields (columns) and 10 rows, about Olympic games
- 25k samples (different queries and tables): tables are randomly generated, the questions andanswers are generated accordingly.
- Many questions are extremely complicated, eg ”How long is the last game which has smaller country size than the game whose host country GDP is 250?”
![Page 28: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/28.jpg)
Pasupat & Liang, ACL-16Compositional semantic parsing on semi-structured tables.
Experimental results: Accuracy
![Page 29: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/29.jpg)
accuracy on givingthe right answer
Experimental results: Accuracy
![Page 30: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/30.jpg)
accuracy on being righton every execution
Experimental results: Accuracy
![Page 31: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/31.jpg)
Experimental results: Learning efficiency
![Page 32: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/32.jpg)
Experimental results: Execution efficiency
![Page 33: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/33.jpg)
Experimental results: with feeding-back
![Page 34: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/34.jpg)
Outline
• Learning the semantics of a question from its execution
• Neural vs. Symbolic
• Our Proposal: coupling the two views
• Conclusion
![Page 35: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/35.jpg)
Conclusion and future work
• Coupling the symbolic view and distributed view in one model might be better than either oneworking alone, especially on hard problems
• We are looking for broader more profound ways to combine symbolic model and neuralmodels in real-world semantic parsing tasks
![Page 36: Coupling distributed and symbolic execution for natural ... · Neuralview (NeuralEnquirer) Symbolicview ①Wehavebothneuraland symbolicviewinthesame system ②Thereisinformation exchangebetweenthetwo](https://reader034.fdocuments.us/reader034/viewer/2022051607/602f645035ed5c71c9437d11/html5/thumbnails/36.jpg)
Thank you
Poster #36(today)for more questions and job positions at DeeplyCurious