Graph Reasoning with Large Language Models via Pseudo-code Prompting

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Skianis, Konstantinos, Nikolentzos, Giannis, Vazirgiannis, Michalis
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866929516217106432
author Skianis, Konstantinos
Nikolentzos, Giannis
Vazirgiannis, Michalis
author_facet Skianis, Konstantinos
Nikolentzos, Giannis
Vazirgiannis, Michalis
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2409_17906
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Graph Reasoning with Large Language Models via Pseudo-code Prompting
Skianis, Konstantinos
Nikolentzos, Giannis
Vazirgiannis, Michalis
Machine Learning
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.
title Graph Reasoning with Large Language Models via Pseudo-code Prompting
topic Machine Learning
url https://arxiv.org/abs/2409.17906