S truct F act: Reasoning Factual Knowledge from Structured Data with Large Language Models (2025)

Abstract: Large language models (LLMs) have made significant strides in natural language processing by leveraging their ability to comprehend and reason with factual knowledge. However, a significant amount of factual knowledge is stored in structured data, which has unique characteristics not typically encountered in the unstructured texts used for pretraining LLMs. To evaluate the capability of LLMs in handling facts structurally stored, we introduce a benchmark called StructFact, which includes meticulously annotated factual questions, spanning five tasks that reflect the intrinsic properties of structured data. This benchmark aims to delineate the strengths and limitations of LLMs in reasoning with structured data for knowledge-intensive tasks in practical applications. Extensive experiments conducted on 10 common LLMs have yielded several insights, one notable finding being that these models struggle significantly with the heterogeneity of structured data during reasoning.

## introduction large language models (llms) have revolutionized various downstream natural language processing (nlp) tasks with their impressive capabilities to comprehend and reason on textual data. previous studies have demonstrated that factual knowledge can be stored within llms as a knowledge base, serving knowledge-sensitive tasks such as factchecking and question-answering @xcite @xcite . compared to the traditional method of retrieving knowledge from knowledge bases, reasoning over factual knowledge with llms can introduce difficult-tocorrect errors due to deviations in inference parameters @xcite . additionally, llms are pretrained on serialized data, overlooking the structural nature of factual knowledge storage, e.g., tables @xcite . therefore, effectively using structured data to infer factual knowledge with llms remains challenging. compared to unstructured data, certain unique characteristics of structured data affect the ability of llms to understand and reason about factual knowledge @xcite . these characteristics include: (1) heterogeneity. structured knowledge consists of diverse data types (e.g., texts, numerics, dates). misunderstandings or biases of any type can lead to inaccuracies in the factual knowledge. (2) topological interdependencies. most llms are based on the transformer architecture @xcite and are trained with a next-word prediction loss objective, primarily designed to process continuous text data. extracting relevant interdependencies from complex topological structures is a significant challenge for llms in understanding and reasoning about facts. (3) order invariance. a key assumption in pretraining is that the order of words significantly impacts their semantics @xcite . however, in structured data, the permutation of entities (e.g., rows or columns in a table) does not alter the underlying factual knowledge. (4) sparsity. to maintain the same performance in sparse structured data (e.g., missing values or incomplete descriptions) as in data-rich scenarios, llms need to accurately utilize the general knowledge learned during pretraining and avoid non-factual imputations. (5) lack of prior knowledge. structured data holds domain-specific knowledge not exposed during pretraining, challenging the accurate application of general reasoning to downstream tasks without distortion @xcite @xcite . these characteristics of structured data impact the ability of llms to reason about factual issues, limiting their real-world applications, especially in high-risk domains such as healthcare and finance. to enable llms to effectively utilize knowledge embedded in structured data and enhance reliable reasoning, it is essential to examine their capabilities based on the specific characteristics of structured data. in light of these characteristics, we specifically focus on the structural challenge posed in previous works represented by the pinocchio benchmark @xcite , and analyze the reasoning capabilities of llms on structured data from the perspective of five factual tasks: arithmetic calculation, geography-time reasoning, multihop reasoning, composition understanding, combining structured and unstructured. we develop structfact, a benchmark comprising 13,407 factual queries and corresponding evidence in various structures (i.e., tables, lists, and graphs), covering diverse data types, knowledge domains, timeliness, and regions. we categorized these questions into five factual tasks and provided fine-grained difficulty annotations based on the specific focus of each task to facilitate a multifaceted analysis. additionally, to specifically test the capability of llms to reason over fresh structured facts not encountered during pretraining in real-world applications, we have developed structfact-unseen. through explorations with structfact, we examine how 10 commonly used llms understand and reason with factual knowledge stored in structured data. for instance, in tasks that rely on heterogeneous data, llms heavily depend on the order of information for understanding. we aim for struct-fact to serve as a compass in exploring the boundaries of llms in knowledge-sensitive tasks involving structural facts, while also advancing their practical applications in real-world scenarios. ## dataset construction to assess llms' reasoning abilities over structured facts, we define five tasks based on characteristics of structured data and carefully curate factual questions supported by diverse data types. geography-time reasoning. geographic and temporal information often appears simultaneously in structured data and can be presented in various formats. geographical data encompass geographic coordinates (such as latitude and longitude), city names, and country names, whereas temporal data include dates and time periods. this heterogeneity challenges llms to precisely interpret and align these diverse formats. for example, to determine whether washington d.c. or new york was closer to the u.s. capital in 1792, as shown in figure 1 , llms must combine the year information of the u.s. capital with the geographic coordinates of these cities. to evaluate the proficiency of llms in geography-time reasoning, we integrate factual knowledge pertaining to geographical, temporal, and geography-time entities. multi-hop reasoning. factual knowledge in structural data involves entities dispersed across multiple sources @xcite . in figure 1 , the query from the tourist llama involves structured knowledge about the olympics and travel guides. however, language models typically generate answers by gathering factual knowledge separately, thereby overlooking the topological interdependencies @xcite . when gathering data from multiple sources, models should recognize the order invariance of structural data. unlike textual data, which is order-dependent, the order of entities within a similar topological structure should not affect the inherent factual knowledge. in structfact, we include questions where knowledge is spread across multiple discontinuous structured sources. composition understanding. reasoning about factual knowledge in structural data suffers from the sparsity issue due to missing values or incomplete descriptions. beyond that, llms are expected to accurately reason through these sparse information while without misinterpreting topological interdependencies. as figure 1 displays, to answer the question "is joe biden's running mate in 2024 kamala harris?", llms have to comprehend the header "2024 u.s. election", which spans multiple columns with a missing value denoted by "n/a". to assess whether llms comprehend structural compositions, structfact includes factual questions about components with missing data, complex structures, and incomplete descriptions. combining structured and unstructured. given the sparsity and lack of prior knowledge of the domain-specific information in structured data, llms needs to fully leverage the factual knowledge learned from textual contexts. the knowledge presented in unstructured data (e.g., table captions) often provides an important context for understanding the knowledge in structured data. moreover, the general knowledge base of llms aids in reasoning domain-specific knowledge within structured data. as exemplified in figure 1 , general knowledge of nut proteins helps infer the cause of the allergy from the shopping receipt. to assess how structured data combined with their unstructured contexts in llms, structfact includes factual ques-tions that require factuality verification spanning both structured and unstructured evidences. ## main results to examine the factual reasoning capabilities of llms on structured data, we conduct experiments with structfact across 10 llms trained through pretraining, instruction tuning, and reinforcement learning with human feedback (rlhf). given the bias of llms towards "yes" answer @xcite , we replaced the fact./non-fact./nei options with a/b/c, respectively foot_1 and report each model's average performance with respect to weighted accuracy and f1 score over three runs with varied option orders. detailed descriptions of the prompting strategies and selected llms can be found in figure 13 , appendix f and k.1, respectively. ## analysis building on the main results, we perform in-depth analyses from various perspectives to assess the llms' abilities in completing the five tasks, with gpt-4o-mini (which achieves best in experiments) as the representative model. analyses of other llms are included in appendix l. ## related work extensive benchmarks and empirical studies conducted towards investigating the performance of llms over structured data. form the perspective of instruction-tuning, researchers investigates different prompting strategies in understanding @xcite @xcite and question answering @xcite @xcite ## conclusions in this work, we present structfact, a benchmark specifically developed to assess the factual reasoning abilities of llms over structured data. struct-fact comprises 13,407 questions spanning five factual tasks built upon the characteristics of structured data. we tested 10 llms with structfact and observed that they struggle with reasoning over heterogeneous structured data, especially in complex arithmetic operations. additionally, their diminished resilience to evidence highlights the ongoing challenge of effectively leveraging their knowledge base for reasoning with structured facts. our work underscores the pressing need to develop advanced techniques that help llms to better comprehend and reason over structured data. with the vast wealth of structured knowledge, we believe this will enhance reliable reasoning and pave the way for broader uses of llms in the future.