Extracting and Following Paths for Robust Relational Reasoning with Large Language Models
Ge Zhang [email protected], Mohammad Ali Alomrani [email protected], Hongjian Gu [email protected], Jiaming Zhou [email protected], Yaochen Hu [email protected], Bin Wang [email protected], Qun Liu [email protected], Mark Coates [email protected], Yingxue Zh · 2024
Read Extracting and Following Paths for Robust Relational Reasoning with Large Language Models by Ge Zhang [email protected], Mohammad Ali Alomrani [email protected], Hongjian Gu [email protected], Jiaming Zhou [email protected], Yaochen Hu [email protected], Bin Wang [email protected], Qun Liu [email protected], Mark Coates [email protected], Yingxue Zh (2024) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2412-17963.txt.
Introduction
Ge Zhang and co-authors present Path-of-Thoughts, a method that helps language models reason about relations, in a 2024 paper. Models know much but often stumble on kinship or spatial puzzles needing several linked steps. Their framework breaks the job into three stages.
First it extracts a graph of entities, relations, and attributes from the text. Then it finds the paths through that graph relevant to the question. Finally it reasons along those paths to an answer. On four data sets the method beat strong baselines by up to 21 percent, with no fine-tuning. It also held up better when the extraction step made errors or the wording was ambiguous.
Catalog record
| CREATOR | Ge Zhang [email protected], Mohammad Ali Alomrani [email protected], Hongjian Gu [email protected], Jiaming Zhou [email protected], Yaochen Hu [email protected], Bin Wang [email protected], Qun Liu [email protected], Mark Coates [email protected], Yingxue Zh |
|---|---|
| YEAR | 2024 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 122 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2412-17963
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Extracting and Following Paths for Robust Relational Reasoning with Large Language Models Ge Zhang [email protected], Mohammad Ali Alomrani [email protected], Hongjian Gu [email protected], Jiaming Zhou [email protected], Yaochen Hu [email protected], Bin Wang [email protected], Qun Liu [email protected], Mark Coates [email protected], Yingxue Zhang [email protected], Jianye Hao [email protected] Abstract Large language models (LLMs) possess vast semantic knowledge but often struggle with complex reasoning tasks, particularly in relational reasoning problems such as kinship or spatial reasoning. In this paper, we present Path-of-Thoughts (PoT), a novel framework for solving relation reasoning that decomposes the task into three key stages: graph extraction, path identification, and reasoning. Unlike previous approaches, PoT efficiently extracts a reasoning graph that identifies crucial entities, relations, and attributes within the context. Subsequently, PoT identifies query-relevant reasoning paths within the graph, facilitating downstream reasoning of potential answers. Experimental evaluations across four datasets of relational reasoning demonstrate that PoT surpasses state-of-the-art baselines by a significant margin (up to 21.3%) without requiring fine-tuning or extensive LLM calls. Furthermore, unlike prior neuro-symbolic methods, PoT exhibits improved resilience against LLM extraction errors and input ambiguity by leveraging the compositional nature of graphs. 1 Introduction Large language models (LLMs) have shown remarkable generalization abilities in natural language (NL) tasks ( Wei et al., 2022a ; Kojima et al., 2022 ) , such as generating useful code ( Chen et al., 2021 ) and fluently engaging in dialogue ( Thoppilan et al., 2022 ) . Their success can be attributed to pre-training on large human language datasets, which express real-world concepts, and thereby allow LLMs to implicitly learn about the entities and relations that exist in the physical world ( Patel and Pavlick, 2022 ) . Nonetheless, some argue that the underlying meaning of language cannot be learned from text alone without appropriate grounding to the (non-text) real-world experiences ( Bisk et al., 2020 ; Cohn and Blackwell, 2024 ) . Prior studies ( Tolman, 1948 ; Whittington et al., 2022 ; Garvert et al., 2017 ) have shown that humans can create “cognitive maps” while navigating and experiencing their environments. Cognitive maps represent the latent relational structure of a task/environment and are particularly helpful for multi-hop relational reasoning tasks such as planning/navigation ( Yamada et al., 2024 ; Momennejad et al., 2023 ) . While LLMs do exhibit some competence in basic planning tasks ( Momennejad et al., 2023 ; Valmeekam et al., 2023 ) , they are known to perform shallow reasoning and suffer in multi-hop relational reasoning tasks (e.g., kinship inference ( Sinha et al., 2019 ) , or spatial reasoning ( Shi et al., 2022 ) ). In contrast, symbolic solvers (e.g., Answer Set Programs (ASP) ( Lifschitz, 2008 ) ) can faithfully perform reasoning using well-defined symbolic rules written by domain experts. Consequently, there has been a surge of neuro-symbolic works ( Yang et al., 2023 ; Mirzaee and Kordjamshidi, 2023 ; Silver et al., 2024 ; Pan et al., 2023 ) which combine the rich LLM natural language abilities with interpretable symbolic solver modules. These works typically leverage LLMs to transfer any natural language (NL) based problem formulation to the appropriate symbolic language. This is then executed by the solver, hence maintaining the flexibility of LLMs while transferring the burden of complex reasoning to the symbolic reasoning module. This disentanglement of language understanding and reasoning displays significant performance improvements over prompt-based baselines (e.g., Chain-of-thought (CoT) ( Wei et al., 2022b ) ). This idea of task decomposition also demonstrates the benefits in other research domains ( Wang et al., 2023a ) . Nonetheless, prior works suffer from several shortcomings, such as task-specific and highly specialized translation and reasoning modules, brittleness to LLM errors, or requiring many LLM calls. In this work, we introduce a novel framework, Path-of-Thoughts (PoT), that decomposes a relational reasoning problem into three stages: graph extraction, path identification, and reasoning. During the first stage, a single LLM call extracts the key entities, relations, and their corresponding attributes in the problem, constructing a graph (akin to a cognitive map), which serves as a foundation for downstream relational reasoning tasks (e.g., kinship or spatial). Subsequently, the path identification module identifies the key reasoning paths in the graph that are associated with the question. Finally, an LLM or symbolic reasoner is used to infer probable answers based on the input and identified paths. Our evaluations across several well-established relational reasoning datasets indicate a maximum improvement of 21.3% in accuracy and superior robustness to LLM extraction errors and potential controversial descriptions. To the best of our knowledge, PoT is the first work that enhances relational reasoning tasks through identifying query-relevant subgraphs before reasoning. Our contributions can be summarized as follows: • We present a prompting-based approach to efficiently extract graphs and queries in a single LLM call. • We propose a path identification stage that can identify multiple independent reasoning paths involving the queried entities to infer all possible answers. • We benchmark on several kinship and spatial reasoning datasets to validate the performance gain of proposed framework against baselines. 2 Problem Definition In relational reasoning, a sample (s,a) consists of a textual story s and a target relation a\in\mathcal{R} , where \mathcal{R} is the overall set of pre-defined relations. A story s consists of a context c and a question q . The context c describes relations among a set of entities \mathcal{N} in natural language (e.g., A is the son of B), where the relation set mentioned in context c is a subset of \mathcal{R} . The question q asks about the relation between 2 entities, n_{i},n_{j}\in\mathcal{N} in natural language (e.g., How should B address C?), whose relation is not directly provided in the context c . Note that many prior works ( Yang et al., 2023 ; Mirzaee and Kordjamshidi, 2023 ) assume story s only consists of context c without question q , and 2 queried entities n_{i} and n_{j} are provided by the dataset instead of being extracted from the question q . We target a more general setting in which the dataset does not annotate 2 queried entities and must extract them from the question q for the story s . For some datasets, there could be multiple possible answers due to ambiguities or errors in the story (See Appendix A.8 for examples). Therefore, a method is allowed to output multiple possible relations. To complete the task, the algorithm must understand how relations combine (e.g., if A is to the west of B and C is north of A, then C is north-west of B). In the problems we address, we assume that these compositions are either common-sense (and thus implicitly encoded in an LLM) or that a domain-specific rule set is provided, specified as logical rules or a set of examples. Figure 1: The PoT framework with an example featuring robustness against LLM extraction errors highlighted in red (flipped relation). The LLM is employed to extract the graph representing the story’s relational structure. Path identification isolates the reasoning paths relevant to the query entities. PoT reasons over each path independently to alleviate cascading errors due to extraction and infers all possible answers. 3 Related Work Multi-hop Relational Reasoning: Before the advent of LLMs, several neural network architectures were proposed