Skip to main content
QUICK REVIEW

[Paper Review] ChatKBQA: A Generate-then-Retrieve Framework for Knowledge Base Question Answering with Fine-tuned Large Language Models

Haoran Luo, E Haihong|arXiv (Cornell University)|Oct 13, 2023
Topic ModelingComputer Science6 citations
TL;DR

ChatKBQA proposes a novel generate-then-retrieve framework for Knowledge Base Question Answering (KBQA) that first uses fine-tuned large language models (LLMs) like Llama-2 and Baichuan2 to generate logical forms, then retrieves and replaces entities and relations via unsupervised semantic retrieval. This approach achieves state-of-the-art performance on WebQSP and ComplexWebQuestions, improving retrieval efficiency and reducing error propagation compared to traditional retrieve-then-generate methods.

ABSTRACT

Knowledge Base Question Answering (KBQA) aims to answer natural language questions over large-scale knowledge bases (KBs), which can be summarized into two crucial steps: knowledge retrieval and semantic parsing. However, three core challenges remain: inefficient knowledge retrieval, mistakes of retrieval adversely impacting semantic parsing, and the complexity of previous KBQA methods. To tackle these challenges, we introduce ChatKBQA, a novel and simple generate-then-retrieve KBQA framework, which proposes first generating the logical form with fine-tuned LLMs, then retrieving and replacing entities and relations with an unsupervised retrieval method, to improve both generation and retrieval more directly. Experimental results show that ChatKBQA achieves new state-of-the-art performance on standard KBQA datasets, WebQSP, and CWQ. This work can also be regarded as a new paradigm for combining LLMs with knowledge graphs (KGs) for interpretable and knowledge-required question answering. Our code is publicly available.

Motivation & Objective

  • To address inefficiencies and error propagation in traditional KBQA pipelines that rely on early retrieval.
  • To reduce the complexity of multi-stage KBQA processing by decoupling logical form generation from retrieval.
  • To leverage the reasoning and generation capabilities of fine-tuned open-source LLMs for more accurate logical form creation.
  • To improve retrieval efficiency by operating on structured logical forms rather than unstructured natural language questions.
  • To establish a plug-and-play framework that allows flexible replacement of LLMs, tuning methods, and retrieval models.

Proposed method

  • Fine-tune open-source LLMs (e.g., Llama-2, Baichuan2, ChatGLM2) using instruction tuning to generate logical forms from questions.
  • Mask entities and relations in the question to create a skeleton, enabling the model to learn consistent logical form structures.
  • Use beam search during inference to generate candidate logical forms, achieving 74% exact match with ground truth on test questions.
  • Apply unsupervised phrase-level semantic retrieval using SimCSE, Contriever, or BM25 to retrieve and replace entities and relations in the generated logical form.
  • Replace placeholders in the generated logical form with retrieved entities and relations to form a valid SPARQL-like query.
  • Support plug-and-play integration by allowing interchangeable components: LLMs, efficient fine-tuning methods (LoRA, QLoRA, P-Tuning v2), and retrieval models.

Experimental results

Research questions

  • RQ1Can a generate-then-retrieve framework outperform traditional retrieve-then-generate KBQA methods in terms of accuracy and efficiency?
  • RQ2To what extent can fine-tuned LLMs generate accurate logical forms without relying on prior retrieval?
  • RQ3How does the efficiency of retrieval compare when performed on generated logical forms versus raw natural language questions?
  • RQ4Can the framework maintain high performance across diverse LLMs, tuning strategies, and retrieval models?
  • RQ5Does the plug-and-play design enable flexible and extensible deployment across different hardware and model configurations?

Key findings

  • ChatKBQA achieves a new state-of-the-art performance on the WebQSP benchmark with 82.6% F1, 85.2% Hits@1, and 77.5% accuracy using Llama-2-13B with LoRA fine-tuning and SimCSE retrieval.
  • On the ComplexWebQuestions (CWQ) dataset, the framework achieves 81.5% F1, 83.6% Hits@1, and 76.8% accuracy using Llama-2-13B with LoRA and Contriever retrieval.
  • Approximately 74% of generated logical forms match the ground truth exactly, and over 91% preserve the correct structural format when entities and relations are masked.
  • Retrieval efficiency is significantly improved in the generate-then-retrieve setting: semantic similarity scores for entity and relation retrieval are consistently higher in AG-R (after generation) than in NL-R (from natural language), especially for relations.
  • The plug-and-play design enables flexible component substitution—e.g., replacing LLMs from Baichuan2-7B to Llama-2-13B or retrieval models from SimCSE to BM25—while maintaining strong performance across variants.
  • The framework demonstrates robustness and extensibility, with performance improvements observed when upgrading LLMs, tuning methods (e.g., QLoRA), or retrieval models.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.