TrustUQA: A Trustful Framework for Unified Structured Data Question Answering

Wen Zhang, Long Jin, Yushan Zhu, Jiaoyan Chen, Zhiwei Huang, Junjie Wang, Yin Hua, Lei Liang, Huajun Chen

Abstract

TrustUQA is a unified framework designed to enable Large Language Models (LLMs) to perform question answering across diverse structured data formats, including tables, Knowledge Graphs (KGs), and temporal KGs. By mapping disparate data sources into a unified "Condition Graph" and employing a two-layer querying mechanism, TrustUQA mitigates common issues like hallucinations and privacy risks associated with standard retrieval-augmented generation (RAG). Experimental results demonstrate state-of-the-art performance across multiple benchmarks, highlighting its robustness and explainability.

Introduction

Structured data is ubiquitous but fragmented, residing in relational tables, Knowledge Graphs (KGs), and Temporal KGs. Current approaches to Question Answering (QA) over this data typically fall into two categories: NL2Query (e.g., Text-to-SQL), which lacks generalization across data types, and Retrieval-Augmented Generation (RAG), which is prone to hallucinations and privacy concerns. TrustUQA addresses this gap by providing a unified and trustful framework for querying multiple structured data types simultaneously without the reliability issues of pure text generation.

The TrustUQA Framework

TrustUQA introduces three core innovations to bridge the gap between different data silos:

  1. Condition Graph (CG): This is a unified data representation. Whether the source is a table or a KG, TrustUQA translates it into a labeled directed graph. In this graph, edges represent relationships under specific "conditions" (e.g., a table header or a timestamp). This allows the system to treat a row in a table and a triple in a KG as the same type of object.
  2. Two-layer Function-based Querying: Writing complex formal queries (like SPARQL) is difficult for LLMs. TrustUQA breaks this into two steps:
  3. Layer 1: The LLM writes a simplified, human-readable "LLM Query" using basic functions like get_information().
  4. Layer 2: A rule-based translator converts these simplified functions into "Execution Queries" that run directly on the Condition Graph. This ensures the final answer comes from actual data execution, not LLM imagination.
  5. Dynamic Demonstration Retriever: To assist the LLM in writing better queries, the system uses a dense text encoder (SentenceBERT) to find the most similar question-query pairs from the training set to use as few-shot examples.
Overview of the TrustUQA architecture, showing the data translation to Condition Graphs and the two-layer query execution.

Unified Querying Across Data Silos

A key advantage of the TrustUQA approach is its ability to perform "QA across structured data." By leveraging the uniformity of the Condition Graph and the high-level logic of the two-layer querying system, the framework can navigate complex multi-hop questions that require information from multiple sources. For example, a system could find a movie director's name in a table and then find that director's awards in a KG to answer a single complex question.

A multi-hop query example where TrustUQA navigates across Table, KG, and TKG data sources to find the answer.

Experimental Evaluation

The framework was evaluated on five diverse benchmarks covering Table QA (WikiSQL, WikiTableQuestions), KG QA (WebQuestionsSP, MetaQA), and Temporal KG QA (CronQuestion). TrustUQA outperformed existing unified models across the board:

  • WikiSQL: Achieved 85.9% accuracy, a nearly 20% improvement over previous unified methods.
  • WebQSP: Set a new state-of-the-art for unified models with 83.5% accuracy.
  • CronQuestions: Achieved 97.2% accuracy, proving it can handle complex temporal reasoning.
  • Trustworthiness: In MetaQA, the system achieved over 99.9% set-comparison accuracy, meaning it almost never returned incorrect or "hallucinated" entity sets.

Limitations and Future Work

While powerful, TrustUQA faces challenges with complex, non-standard tables (e.g., WikiTableQuestions) where it scored 44.2% due to ambiguous entity mapping. Additionally, the system remains dependent on the LLM's initial logic; if the first-layer query is flawed, the execution engine cannot recover. Future directions include exploring scenarios where the system must autonomously decide which data source to trust when information conflicts.

Summary updated

BibTeX
@inproceedings{zhang2025trustuqa,
  author = {Wen Zhang and Long Jin and Yushan Zhu and Jiaoyan Chen and Zhiwei Huang and Junjie Wang and Yin Hua and Lei Liang and Huajun Chen},
  title = {{TrustUQA: A Trustful Framework for Unified Structured Data Question Answering}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i24.34787},
}
Figure