GraphArena: Evaluating and Exploring Large Language Models on Graph Computation

Jianheng Tang, Qifan Zhang, Yuhan Li, Nuo Chen, Jia Li

Overview

GraphArena is a novel benchmarking tool designed to evaluate Large Language Models (LLMs) on real-world graph computational problems. Ranging from simple shortest-path calculations to complex NP-complete challenges like the Traveling Salesman Problem, the benchmark provides a comprehensive look at how well models understand structured, non-Euclidean data. The study reveals that while top-tier models like Claude-3.5-Sonnet lead the pack, all LLMs suffer from severe "hallucinations"—inventing non-existent nodes and edges—as graph complexity and size increase.

Introduction & Motivation

While LLMs have demonstrated impressive reasoning capabilities in mathematics and coding, evaluating their ability to handle structured data like graphs has remained difficult. Existing benchmarks often rely on synthetic, overly simplistic graphs (such as Erdős-Rényi models) and basic tasks (like checking if two nodes are connected).

Furthermore, most evaluations only check the final answer. If a model claims the shortest path is "4," it might have guessed correctly without truly understanding the graph's topology. This paper addresses the critical need for realistic data, complex algorithmic tasks, and a rigorous evaluation framework that examines the model's entire reasoning path to distinguish between genuine logic, lucky guesses, and hallucinations.

The GraphArena Framework

The authors introduce GraphArena, which stands out through three core methodological shifts:

  1. Path-Based Evaluation: Instead of just checking a final number, the framework requires LLMs to output the specific solution path or component. It then uses a three-step verification:
  2. Extraction: Can a valid path be found in the response?
  3. Feasibility: Does this path actually exist in the provided graph? (Failing this results in a "Hallucination" classification).
  4. Optimality: Is this the best possible solution? (Failing this results in a "Suboptimal" classification).
  5. Task Diversity: The benchmark includes four polynomial-time (P) tasks (e.g., Graph Diameter) to test direct algorithmic execution, and six NP-complete tasks (e.g., Maximum Clique) to test "meta-algorithmic planning."
  6. Realistic Datasets: GraphArena moves away from synthetic data by sampling subgraphs from five diverse, real-world sources: DBLP (academic networks), Social Networks (Digg, Lastfm), DBpedia (knowledge graphs), OpenFlights (flight routes), and PubChemQC (molecular structures). The benchmark consists of 10,000 problems split between "small" and "large" graph scales.
Overview of the GraphArena framework

Key Insights: Hallucinations and Reasoning Limits

  • The Hallucination Wall: As graphs grow from 5 nodes to 30, hallucination rates skyrocket. For example, on the Graph Diameter task, GPT-4o’s hallucination rate jumps from roughly 16% to over 80%. The models literally "lose their place" in the graph's structure, inventing connections that do not exist.
Hallucination probability across graph sizes
  • P vs. NP Reasoning: LLMs are significantly better at "direct reasoning" (step-by-step algorithms) than "meta-planning." For NP-complete problems, models almost always default to simple greedy heuristics rather than exploring more optimal approximation strategies.
  • Code is the "Silver Bullet" for Scale: Prompting an LLM to write code to solve a graph problem—rather than solving it purely in text—drastically reduces hallucinations on large graphs. It shifts the burden from the LLM's shaky "mental map" to a precise execution environment.
  • Instruction Tuning's Limits: While fine-tuning a model on graph problems (SFT) helps it master small-scale tasks, it fails to generalize to the complex strategic thinking required for large-scale NP-complete problems.

Performance Benchmarks

  • Top Performers: Claude-3.5-Sonnet and GPT-4o are the current state-of-the-art, though their accuracy on large NP-complete tasks remains dismal (often below 10%).
  • Open Source Leader: Llama3-70b is the strongest open-source contender, significantly outperforming smaller models like Llama3-8b.
  • The Scaling Effect: Increasing "test-time compute" (allowing the model more attempts or using "progressive hints") consistently improves feasibility. However, accuracy gains are modest, suggesting that more "thinking time" doesn't necessarily fix a fundamental lack of algorithmic understanding.
  • Comparison to GNNs: Interestingly, top LLMs like Claude-3.5-Sonnet can outperform specialized Graph Neural Networks (GNNs) on certain tasks because the LLMs can interpret the natural language context of the graph better than a pure structural model.

Limitations & Future Directions

The authors acknowledge that LLMs still struggle with long-context reasoning; a graph represented as text can quickly exceed 6,000 tokens, overwhelming the model's attention mechanism. Additionally, the "Code Writing" approach, while highly successful, is only as good as the LLM's ability to accurately translate the text-based graph into a data structure (like an adjacency list) without errors.

Future research directions include developing more efficient "graph tokenizers" and exploring hybrid architectures that integrate symbolic solvers or external algorithmic modules directly into the LLM's reasoning loop.

Summary updated

BibTeX
@inproceedings{tang2025grapharena,
  author = {Jianheng Tang and Qifan Zhang and Yuhan Li and Nuo Chen and Jia Li},
  title = {{GraphArena: Evaluating and Exploring Large Language Models on Graph Computation}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=Y1r9yCMzeA},
}
Figure