Triad: A Framework Leveraging a Multi-Role LLM-based Agent to Solve Knowledge Base Question Answering

Chang Zong, Yuchen Yan, Weiming Lu, Jian Shao, Yongfeng Huang, Heng Chang, Yueting Zhuang

Abstract

Knowledge Base Question Answering (KBQA) requires translating natural language into precise structured queries (e.g., SPARQL) to retrieve information from large-scale knowledge bases. While Large Language Models (LLMs) excel at reasoning, they often struggle with the syntactic precision and entity-linking accuracy required for KBQA. This paper presents Triad, a unified framework that decomposes the KBQA pipeline into specialized subtasks handled by a single LLM acting in three distinct roles: a Generalist, a Decision-Maker, and an Advisor. Triad achieves state-of-the-art performance on major benchmarks using only few-shot learning, significantly outperforming traditional systems trained on massive datasets.

1. Introduction

Knowledge Base Question Answering (KBQA) is the process of answering natural language questions (e.g., "Who designed the airport in Kaneohe Bay?") by querying structured databases like DBpedia, YAGO, or Wikidata. Historically, this has been a "heavyweight" task requiring complex, multi-stage architectures and extensive task-specific training data to manage entity linking and query construction.

While LLMs have revolutionized natural language processing, their application to KBQA faces two primary hurdles: hallucination of URIs and failure to generate syntactically perfect SPARQL queries for complex questions. Triad addresses these challenges by organizing an LLM-based agent into a collaborative "team" of roles, testing whether a few-shot agentic approach can match or surpass specialized, full-shot systems.

2. The Triad Framework

The core innovation of Triad is its Multi-Role Agent architecture. Rather than treating KBQA as a single-step generation task, Triad decomposes the process into four phases—Parsing, Linking, Construction, and Generation—assigned to three specialized roles:

2.1 G-Agent (Generalist)

The G-Agent handles foundational NLP tasks. It extracts semantic triplets from the input question, generates SPARQL templates using variables instead of specific IDs, and classifies the expected answer type. This abstraction allows the model to focus on the logic of the question without being bogged down by specific database identifiers.

2.2 D-Agent (Decision-Maker)

The D-Agent serves as the bridge to the Knowledge Base. It filters through potential entity and relation candidates retrieved from the KB, selecting the most plausible matches based on the context provided by the G-Agent. It is also responsible for selecting the optimal final SPARQL query from a generated list of candidates.

2.3 A-Agent (Advisor)

The A-Agent performs the final quality check. It formulates the final natural language answer based on retrieved data. Crucially, the A-Agent includes a feedback loop: if the KB returns no results, it can trigger a "retry" signal to previous phases or fall back on the LLM’s internal knowledge if necessary.

3. Experimental Setup

Triad was evaluated on three established KBQA benchmarks:

  • LC-QuAD 1.0: A large-scale dataset based on DBpedia featuring complex questions.
  • QALD-9: A long-standing benchmark for question answering over linked data.
  • YAGO-QA: A benchmark based on the YAGO knowledge base.

Performance was compared against "full-shot" systems (trained on entire training sets) such as KGQAN and EDGQA, as well as zero/few-shot LLM baselines (GPT-3.5 and GPT-4).

4. Results and Discussion

Triad demonstrated that a few-shot agentic framework can rival and surpass specialized models. Triad-GPT4 achieved an F1 score of 0.564 on LC-QuAD 1.0 and 0.677 on YAGO-QA, representing improvements of 11.8% and 20.7% respectively over previous state-of-the-art (SOTA) systems.

4.1 Role Specialization and Efficiency

Ablation studies confirmed that every role is vital; removing either the D-Agent or G-Agent tasks significantly degraded performance. This suggests that task decomposition is essential for LLM success in structured domains. Furthermore, while the framework involves multiple steps, Triad maintained competitive response times by employing its "retry" mechanism only when initial attempts failed.

4.2 Key Insights

  • Quality Over Quantity: For the G-Agent, the relevance and quality of few-shot examples were more critical than the total number of examples provided.
  • The Linking Paradox: Providing the D-Agent with too many candidate URIs often decreased performance. Increased options introduced noise, leading to errors during the linking phase.
  • The Necessity of External Knowledge: Pure LLMs (without KB access) performed poorly, highlighting that even advanced models like GPT-4 require an external "source of truth" for factually accurate answers in niche or complex domains.

5. Limitations and Future Work

Despite its success, Triad faces challenges in three areas:

  1. Complex Syntax: Keywords like GROUP BY and HAVING account for approximately 20% of failures.
  2. Unexploited Semantics: The model occasionally fails to narrow search spaces based on implicit context (e.g., recognizing that "Argentine films" implies a specific category filter).
  3. Implicit Reasoning: Multi-hop traversal (e.g., interpreting "grandchildren" as "son of son") remains difficult.

Future research will focus on improving multi-hop reasoning and exploring more sophisticated collaboration methods between agents to handle increasingly complex semantic queries.

6. Conclusion

Triad proves that a unified, multi-role LLM agent can outperform specialized, data-heavy KBQA systems. By decomposing the pipeline into specialized roles—Generalist, Decision-Maker, and Advisor—the framework mitigates common LLM failures in structured data environments, setting a new standard for few-shot KBQA.

Summary updated

BibTeX
@inproceedings{zong2024triad,
  author = {Chang Zong and Yuchen Yan and Weiming Lu and Jian Shao and Yongfeng Huang and Heng Chang and Yueting Zhuang},
  title = {{Triad: A Framework Leveraging a Multi-Role LLM-based Agent to Solve Knowledge Base Question Answering}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.101},
}
Figure