Abstract
Large Language Models (LLMs) have demonstrated significant reasoning capabilities, yet their performance on structured algorithmic tasks remains a subject of intense scrutiny. We introduce GraphArena, a comprehensive benchmark designed to evaluate LLMs on complex graph computational problems using real-world data. Our findings reveal a distinct "hallucination wall": as graph complexity increases and tasks shift from polynomial-time (P) to NP-complete optimization, model accuracy degrades sharply while hallucination rates—the tendency to invent non-existent graph structures—rise monotonically.
Introduction
While LLMs excel in natural language tasks, concerns regarding "data leakage" suggest that their success in mathematical or coding domains may stem from memorization rather than genuine reasoning. Graph problems provide a robust alternative for evaluation, requiring systematic traversal and algorithmic planning that are difficult to replicate through simple pattern matching.
Existing graph benchmarks often suffer from synthetic bias, over-simplicity, and superficial evaluation metrics. GraphArena addresses these gaps by utilizing real-world subgraphs and implementing a Path-based Evaluation framework. This approach requires models to provide full solution paths (e.g., specific node lists for a clique) rather than just final numerical answers, allowing for a rigorous check of feasibility and optimality.
Methodology
GraphArena samples 10,000 problems across 10 distinct tasks from five diverse real-world datasets: DBLP (academic collaborations), Social Networks (Digg, Flixster), DBpedia (knowledge graphs), OpenFlights (flight routes), and PubChemQC (molecular structures). Tasks are categorized into a "Reasoning Quadrant," distinguishing between direct reasoning (Polynomial-time problems like Shortest Distance) and meta-algorithmic planning (NP-complete problems like the Traveling Salesman Problem).
The evaluation pipeline consists of:
- Path Extraction: Assessing the model's ability to format answers correctly.
- Feasibility Check: Verifying if the proposed solution exists within the graph topology.
- Optimality Verification: Determining if the solution is the global optimum.
Results and Discussion
The Hallucination-Size Correlation
A key finding is the nearly monotonic increase in hallucination rates as graph size grows. For instance, in the "Graph Diameter" task, GPT-4o’s hallucination rate escalated from 16% on small graphs to over 80% on larger instances. This suggests that LLMs struggle to maintain an accurate internal representation of graph topology as the context grows more complex.
Algorithmic Reasoning and "Greedy" Thinking
LLMs tend to default to "greedy" heuristics when faced with NP-complete problems, prioritizing immediate local gains over long-term planning. While top-tier models like Claude-3.5-Sonnet and GPT-4o outperform others, their accuracy on NP-complete tasks on large graphs remains below 10%. Interestingly, performance is notably higher on synthetic graphs compared to real-world data of the same size, indicating that the irregular structures of real-world networks present a more formidable challenge.
Mitigation Strategies
The study found that offloading reasoning to deterministic scripts—by asking LLMs to write and execute Python code—significantly improved performance. This approach bypasses the "lost in the middle" errors common in long-context reasoning. Conversely, while instruction tuning (SFT) helped smaller models with simple tasks, it did not improve the "meta-planning" required for complex optimization.
Conclusion
GraphArena highlights the fundamental limitations of current LLMs in handling non-Euclidean, graph-structured data. Future research should explore hybrid architectures, such as "Graph-LLMs" that integrate specialized graph encoders, or agentic workflows that leverage external solvers to overcome the "hallucination wall."
GraphArena is open-sourced at https://github.com/squareRoot3/GraphArena.
Summary updated