Conversational Semantic Parsing using Dynamic Context Graphs

Parag Jain, Mirella Lapata

Introduction

Semantic parsing—the process of translating natural language into machine-executable code like SPARQL—is a cornerstone of modern Knowledge Base Question Answering (KBQA). However, when applied to conversational settings, the task becomes significantly more complex. Users frequently rely on context, utilizing pronouns (coreference) or omitting information entirely (ellipsis). Furthermore, performing this task over massive knowledge graphs (KGs) like Wikidata, which contains millions of entities and thousands of relations, introduces significant scaling and disambiguation challenges.

This paper introduces Dynamic Context Graphs (DCG), a novel framework designed to address these hurdles. By representing conversation history as a dynamically evolving subgraph and encoding it with a Graph Attention Network (GATv2), the DCG model significantly improves the resolution of linguistic nuances, outperforming previous state-of-the-art methods by over 20% in F1 score.

The Problem: Scale and Context Loss

Existing systems for conversational KBQA often struggle with three primary issues:

  1. Scale: General-purpose KGs are too large to be encoded in their entirety.
  2. Context Loss: Many methods "linearize" KG context into flat text sequences, which destroys the structural relationships between entities.
  3. Fluid Schemas: Unlike traditional SQL databases, KG schemas are vast; a single entity might have hundreds of potential relations, only a few of which are relevant to a specific dialogue.

The Dynamic Context Graph (DCG) Framework

The authors propose a four-stage pipeline to bridge the gap between natural language and structured queries:

1. Entity Grounding and Disambiguation

The system first identifies named entities within the user's utterance and links them to KG nodes. To resolve ambiguities—such as whether "Rainer Werner Fassbinder" refers to the filmmaker or a specific movie title—the model employs a popularity-based disambiguation strategy.

2. Context-Dependent Type Linking

Rather than searching the entire KG for relevant entity types, the model focuses on the immediate neighborhood of mentioned entities. It prunes potential types based on string overlap with the user's query, making the system more efficient and context-aware.

3. Dynamic Subgraph Construction

For every turn in a conversation, the model extracts a local subgraph and merges it with subgraphs from previous turns. This "dynamic" graph represents the evolving "common ground" of the conversation, capturing how entities mentioned several turns ago relate to the current topic.

4. Graph-Aware Encoding and Decoding

  • Encoder: A dual-stream encoder uses BERT to process the text (utterance history) and a GATv2 (Graph Attention Network) to encode the structural information of the dynamic subgraph.
  • Decoder: A Transformer-based decoder generates the SPARQL query. It utilizes a pointer-style mechanism to decide whether to generate a standard SPARQL keyword (e.g., SELECT) or "point" to a specific node within the dynamic context graph.

Experimental Evaluation

The model was evaluated on SPICE (Semantic Parsing for InteractiVE question answering), a large-scale dataset built on the CSQA benchmark. The dataset includes approximately 197,000 instances using Wikidata as a backend (12.8 million entities). Conversations in SPICE average 9.5 turns and feature complex logical reasoning and heavy use of discourse phenomena.

Key Results

The DCG model established a new state-of-the-art on the SPICE dataset:

  • Overall Performance: DCG achieved an 81.28% F1 score, a massive leap from the 59.00% achieved by the previous baseline (BertSP).
  • Logical Reasoning: The improvement in complex reasoning was particularly stark, jumping from 22.74% to 93.95% F1.
  • Discourse Resilience: While most models degrade as dialogues grow longer, DCG maintained high accuracy even at turn 10 and beyond. It achieved 74.23% accuracy on resolving coreferences from previous turns, nearly 25 points higher than the baseline.

Insights and Discussion

The success of DCG highlights that structure is a first-class citizen in conversational AI. Treating the KG as a graph rather than a string of text allows the model to capture the "topology" of a conversation. Furthermore, the authors found that local context trumps global indexing; disambiguating terms based on nearby nodes in the graph mimics human conversation more effectively than global lookups.

Limitations and Future Work

Despite its success, the DCG model has limitations. It relies heavily on an off-the-shelf Named Entity Recognition (NER) module; if the NER fails to identify an entity, the graph construction fails downstream. Future work may involve jointly learning the parser and the linker to reduce error propagation. Additionally, while the model excels at entity and type modeling, it does not yet explicitly model the relationships between them in a learnable way, and its ability to generalize to entirely unseen KGs (zero-shot) remains an open question.

Summary updated

BibTeX
@inproceedings{jain2023conversational,
  author = {Parag Jain and Mirella Lapata},
  title = {{Conversational Semantic Parsing using Dynamic Context Graphs}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.emnlp-main.535},
}
Figure