Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
119 tokens/sec
GPT-4o
56 tokens/sec
Gemini 2.5 Pro Pro
43 tokens/sec
o3 Pro
6 tokens/sec
GPT-4.1 Pro
47 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Graph Reasoning with Large Language Models via Pseudo-code Prompting (2409.17906v1)

Published 26 Sep 2024 in cs.LG

Abstract: 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.

User Edit Pencil Streamline Icon: https://streamlinehq.com
Authors (3)
  1. Konstantinos Skianis (12 papers)
  2. Giannis Nikolentzos (31 papers)
  3. Michalis Vazirgiannis (116 papers)
Citations (2)

Summary

We haven't generated a summary for this paper yet.