Table of Contents
Fetching ...

Coupling Retrieval and Meta-Learning for Context-Dependent Semantic Parsing

Daya Guo, Duyu Tang, Nan Duan, Ming Zhou, Jian Yin

TL;DR

Context-dependent semantic parsing benefits from leveraging past datapoints, but single-model approaches struggle to generalize across varying contexts. The paper presents a context-aware retriever based on a variational encoder-decoder that maps (x,c) to latent variables and retrieves top-K similar examples; a model-agnostic meta-learning (MAML) framework then uses these retrieved examples as a pseudo-task for fast adaptation of a sequence-to-action parser. Experiments on CONCODE and CSQA show state-of-the-art results, with consistent gains from both the context-aware retrieval and the fast-adaptation strategy. Overall, the work demonstrates that integrating context-sensitive retrieval with rapid adaptation substantially improves performance on code generation and conversational QA tasks.

Abstract

In this paper, we present an approach to incorporate retrieved datapoints as supporting evidence for context-dependent semantic parsing, such as generating source code conditioned on the class environment. Our approach naturally combines a retrieval model and a meta-learner, where the former learns to find similar datapoints from the training data, and the latter considers retrieved datapoints as a pseudo task for fast adaptation. Specifically, our retriever is a context-aware encoder-decoder model with a latent variable which takes context environment into consideration, and our meta-learner learns to utilize retrieved datapoints in a model-agnostic meta-learning paradigm for fast adaptation. We conduct experiments on CONCODE and CSQA datasets, where the context refers to class environment in JAVA codes and conversational history, respectively. We use sequence-to-action model as the base semantic parser, which performs the state-of-the-art accuracy on both datasets. Results show that both the context-aware retriever and the meta-learning strategy improve accuracy, and our approach performs better than retrieve-and-edit baselines.

Coupling Retrieval and Meta-Learning for Context-Dependent Semantic Parsing

TL;DR

Context-dependent semantic parsing benefits from leveraging past datapoints, but single-model approaches struggle to generalize across varying contexts. The paper presents a context-aware retriever based on a variational encoder-decoder that maps (x,c) to latent variables and retrieves top-K similar examples; a model-agnostic meta-learning (MAML) framework then uses these retrieved examples as a pseudo-task for fast adaptation of a sequence-to-action parser. Experiments on CONCODE and CSQA show state-of-the-art results, with consistent gains from both the context-aware retrieval and the fast-adaptation strategy. Overall, the work demonstrates that integrating context-sensitive retrieval with rapid adaptation substantially improves performance on code generation and conversational QA tasks.

Abstract

In this paper, we present an approach to incorporate retrieved datapoints as supporting evidence for context-dependent semantic parsing, such as generating source code conditioned on the class environment. Our approach naturally combines a retrieval model and a meta-learner, where the former learns to find similar datapoints from the training data, and the latter considers retrieved datapoints as a pseudo task for fast adaptation. Specifically, our retriever is a context-aware encoder-decoder model with a latent variable which takes context environment into consideration, and our meta-learner learns to utilize retrieved datapoints in a model-agnostic meta-learning paradigm for fast adaptation. We conduct experiments on CONCODE and CSQA datasets, where the context refers to class environment in JAVA codes and conversational history, respectively. We use sequence-to-action model as the base semantic parser, which performs the state-of-the-art accuracy on both datasets. Results show that both the context-aware retriever and the meta-learning strategy improve accuracy, and our approach performs better than retrieve-and-edit baselines.

Paper Structure

This paper contains 24 sections, 10 equations, 6 figures, 4 tables, 1 algorithm.

Figures (6)

  • Figure 1: Code generation based on the class environment and a natural language documentation (NL). (a) shows a example of code generation by applying the class function $add()$, while (b) iterates the $vecElements$ array to increment each element.
  • Figure 2: An overview of our approach that couples context-aware retriever and meta-learning.
  • Figure 3: An overview of our context-dependent retriever.
  • Figure 4: Comparison between S2A and S2A+MAML with different portions of supervised data.
  • Figure 5: S2A+MAML with different number of retrieved examples on the CONCODE devset.
  • ...and 1 more figures