Graph Reasoning with Large Language Models via Pseudo-code Prompting
Konstantinos Skianis, Giannis Nikolentzos, Michalis Vazirgiannis

TL;DR
This paper explores how pseudo-code prompting can enhance large language models' ability to solve graph reasoning problems, showing that such prompts generally improve performance across various models.
Contribution
It introduces pseudo-code prompting as a method to improve LLMs' performance on graph reasoning tasks, providing empirical evidence of its effectiveness.
Findings
Pseudo-code prompts improve LLM performance on graph tasks.
All considered LLMs benefit from pseudo-code prompting.
The approach is validated with publicly available resources.
Abstract
Large language models (LLMs) have recently achieved remarkable success in various reasoning tasks in the field of natural language processing. This success of LLMs has also motivated their use in graph-related tasks. Among others, recent work has explored whether LLMs can solve graph problems such as counting the number of connected components of a graph or computing the shortest path distance between two nodes. Although LLMs possess preliminary graph reasoning abilities, they might still struggle to solve some seemingly simple problems. In this paper, we investigate whether prompting via pseudo-code instructions can improve the performance of LLMs in solving graph problems. Our experiments demonstrate that using pseudo-code instructions generally improves the performance of all considered LLMs. The graphs, pseudo-code prompts, and evaluation code are publicly available.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsNatural Language Processing Techniques · Semantic Web and Ontologies · Topic Modeling
