Few-shot In-context Learning for Knowledge Base Question Answering

Tianle Li, Xueguang Ma, Alex Zhuang, Yu Gu, Yu Su +1 more
5/2/2023
cs.CLcs.AI

No official code found. Best implementation: TIGER-AI-Lab/KB-BINDER (66 stars, MIT, last commit 2025-01-27).

Abstract

Question answering over knowledge bases is considered a difficult problem due to the challenge of generalizing to a wide variety of possible natural language questions. Additionally, the heterogeneity of knowledge base schema items between different knowledge bases often necessitates specialized training for different knowledge base question-answering (KBQA) datasets. To handle questions over diverse KBQA datasets with a unified training-free framework, we propose KB-BINDER, which for the first time enables few-shot in-context learning over KBQA tasks. Firstly, KB-BINDER leverages large language models like Codex to generate logical forms as the draft for a specific question by imitating a few demonstrations. Secondly, KB-BINDER grounds on the knowledge base to bind the generated draft to an executable one with BM25 score matching. The experimental results on four public heterogeneous KBQA datasets show that KB-BINDER can achieve a strong performance with only a few in-context demonstrations. Especially on GraphQA and 3-hop MetaQA, KB-BINDER can even outperform the state-of-the-art trained models. On GrailQA and WebQSP, our model is also on par with other fully-trained models. We believe KB-BINDER can serve as an important baseline for future research. Our code is available at https://github.com/ltl3A87/KB-BINDER.

View on arXivView PDF

Code Implementations(1)

MIT

"Few-shot In-context Learning for Knowledge Base Question Answering" [ACL2023]

668Python, Jupyter NotebookMay 4, 20231 years agoMIT
graphkbllmreasoning

Similar Papers

Cite this paper

@article{li2023fewshot,
  title  = {Few-shot In-context Learning for Knowledge Base Question Answering},
  author = {Tianle Li and Xueguang Ma and Alex Zhuang and Yu Gu and Yu Su and Wenhu Chen},
  year   = {2023},
  eprint = {2305.01750},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.01750v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.01750.svg)](https://codeofpaper.com/paper/2305.01750)

Discussion