VisKoP: Visual Knowledge oriented Programming for Interactive Knowledge Base Question Answering

Zijun Yao, Yuanyong Chen, Xin Lv, Shulin Cao, Amy Xin, Jifan Yu, Hailong Jin, Jianjun Xu, Peng Zhang, Lei Hou, Juanzi Li

Introduction

Knowledge Base Question Answering (KBQA) systems are designed to retrieve precise answers to complex natural language questions from massive structured databases like Wikidata. The standard paradigm relies on neural semantic parsing, where a model translates a question into a formal query language. However, these models often fail due to structural logic errors or the misidentification of specific relations. Most existing systems operate as "black boxes," leaving users with incorrect answers and no means of intervention.

VisKoP (Visual Knowledge oriented Programming) addresses this by providing an interactive platform that makes query logic transparent and editable. By combining neural program induction with a visual programming interface, VisKoP allows non-experts to inspect, debug, and correct machine-generated queries in real-time.

The VisKoP Framework

The system is built upon three core pillars designed to balance automation with human control:

1. Neural Program Induction

VisKoP utilizes a fine-tuned BART model to translate natural language into Knowledge oriented Program Language (KoPL). KoPL is a modular language where discrete functions—such as Find, Relate, and Filter—represent specific steps in a reasoning chain. This modularity is essential for mapping logical steps to a visual interface.

2. Visual Programming Interface

Rather than requiring users to write raw code, VisKoP represents KoPL queries as flow-based graphs. Users can interact with the query through a "drag-and-drop" workspace. Key features include:

  • Slot-filling: Users can modify arguments (e.g., changing a specific relation) via an auto-completing search bar.
  • Structural Editing: Users can connect or disconnect operators to redefine the data flow and logic of the query.

3. High-Efficiency Execution Engine

To support real-time interaction, the authors developed a custom execution engine optimized for low latency. The engine employs inverted indices to bypass full database scans and utilizes operator merging—combining multiple logical steps into a single execution pass—to minimize overhead.

Key Insights: Transparency and Collaboration

A central innovation of VisKoP is the provision of intermediate results. By displaying the output of every individual node in the query graph, the system allows users to pinpoint exactly where a logic chain breaks. If a "Filter" node returns zero results, the user immediately identifies the error source. This "steering wheel" approach allows humans to refine a model's "best guess" into a 100% accurate query, bridging the gap between current AI capabilities and user requirements for high-stakes data retrieval.

Experimental Evaluation

The system was trained on the KQA Pro dataset (~94,000 question-program pairs) and evaluated against a million-entity subset of Wikidata.

Performance Metrics

  • Execution Speed: The VisKoP engine achieved an average latency of 111.5 ms per query. This represents a 16x speedup over the original KoPL engine and is 5x faster than the industry-standard Virtuoso engine for SPARQL.
  • Human-AI Synergy: In a user study involving complex questions that the AI initially failed to answer, human intervention enabled users to reach the correct answer 65.8% of the time.
  • User Effort: On average, participants required 110.6 seconds to identify and fix a broken query, demonstrating that the interface is efficient enough for practical use.

Limitations and Future Work

While VisKoP significantly improves query accuracy, it remains dependent on the underlying Knowledge Base; missing facts in Wikidata cannot be recovered through interface edits. Additionally, users occasionally face challenges with entity ambiguity when multiple entities share similar names. Future iterations of VisKoP may include features for updating the Knowledge Base directly through the interface and improved guidance systems to help users navigate massive datasets more effectively.

Summary updated

BibTeX
@inproceedings{yao2023viskop,
  author = {Zijun Yao and Yuanyong Chen and Xin Lv and Shulin Cao and Amy Xin and Jifan Yu and Hailong Jin and Jianjun Xu and Peng Zhang and Lei Hou and Juanzi Li},
  title = {{VisKoP: Visual Knowledge oriented Programming for Interactive Knowledge Base Question Answering}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-demo.17},
}
Figure