GraphOmni: A Comprehensive and Extensible Benchmark Framework for Large Language Models on Graph-theoretic Tasks

Hao Xu, Xiangru Jian, Xinjian Zhao, Wei Pang, Chao Zhang, Suyuchen Wang, Qixin Zhang, Zhengyuan Dong, Joao Monteiro, Bang Liu, Qiuzhuang Sun, Tianshu Yu

TL;DR

GraphOmni is a massive new benchmark designed to evaluate how Large Language Models (LLMs) reason about graphs described in natural language. By testing over 240,000 queries across varying graph structures, data formats, and prompting strategies, researchers found that model performance is highly sensitive to how a graph is "textualized." To manage the vast evaluation space, they also introduced a Reinforcement Learning (RL)-based optimizer that finds the best evaluation settings at a 75% lower cost.

What Problem Does This Paper Address?

While LLMs have mastered many linguistic tasks, their ability to perform structured reasoning on graph-theoretic problems—like finding the shortest path or detecting cycles—remains a significant hurdle.

The core challenge isn't just the model's raw "intelligence," but the interaction between variables. Previous benchmarks were often "one-dimensional," testing a model on a single graph type or using one specific way to write the graph (serialization). This makes it impossible to tell if a model failed because it doesn't understand graph theory, or simply because it struggles to read an adjacency matrix versus an edge list. GraphOmni addresses this by providing a multi-dimensional, extensible framework to disentangle these factors.

Overview of the GraphOmni framework

Methods and Datasets

The authors developed an end-to-end evaluation pipeline that jointly varies three critical dimensions:

  1. Graph Types: Using seven different synthetic generators (like Erdős–Rényi and Barabási–Albert) to create diverse topologies.
  2. Serialization Formats: Seven ways to represent a graph in text, ranging from compact Adjacency Lists to verbose XML-based GraphML.
  3. Prompting Schemes: Nine strategies, including Zero-shot, Chain-of-Thought (CoT), and "Algorithm" prompts that explicitly describe the steps of a graph algorithm (e.g., BFS).

The primary contribution is the GraphOmni dataset, containing 241,726 queries across six canonical tasks (Connectivity, Cycle Detection, Diameter, BFS Order, Triangle Counting, and Shortest Path). Tasks are split into Easy (5–10 nodes), Medium (10–20 nodes), and Hard (20–30 nodes) difficulties. To ensure synthetic results hold up, models were also tested on real-world datasets like IMDB-MULTI and ogbg-molhiv.

The RL Optimizer: To avoid the massive compute cost of testing every possible combination via grid search, the authors implemented a Deep Q-Network (DQN). This RL agent learns to adaptively select the best combination of serialization and prompt for a given task, significantly speeding up the evaluation process.

Key Insights

  • Sensitivity Divergence: A major finding was the difference in sensitivity between model types. Open-source models are highly sensitive to prompts (needing the right instructions to understand the task), whereas closed-source models are more sensitive to serialization formats (they understand the task but are picky about how the data is presented).
  • Scaling vs. Reasoning: Simply making a model bigger raises the "floor," improving performance on easy tasks. However, specialized reasoning models are required to lift the "ceiling" for complex combinatorial tasks like Triangle Counting.
  • The "Longest Path" Fallacy: Error analysis revealed models often rely on flawed heuristics. When asked for a graph's diameter, many erroneously calculated the length of the longest path they could find, rather than the "longest shortest path," showing a lack of deep conceptual grounding.
  • Format Matters: No single format is universally superior. While Adjacency Lists are generally robust, some tasks (like Cycle Detection) actually perform better when the graph is presented as a simple Edge Set.

Key Results

State-of-the-art closed-source models, specifically o4-mini and Claude-3.5-Sonnet, consistently led the pack across most tasks.

Radar charts of model performance across tasks and difficulties

However, even the best models struggle as complexity scales. For instance, o4-mini's performance dropped to just 17.53% on "Hard" Triangle Counting, demonstrating that holistic graph reasoning remains an open challenge.

On the efficiency front, the RL-based optimizer proved highly effective, reducing evaluation costs by 75% while maintaining a 0.9 success rate in identifying the optimal configuration for a task. Furthermore, including explicit algorithmic steps in the prompt (Algorithm-based prompting) significantly improved accuracy for structured tasks like BFS and Diameter calculation.

Limitations and Future Work

The authors acknowledge several areas for future growth:

  • Static Focus: The current benchmark focuses on static graphs. Future versions could include dynamic or temporal graphs where the structure changes over time.
  • Binary Metrics: Currently, the benchmark uses binary (correct/incorrect) scoring. Developing "partial credit" metrics (like edit distance for paths) could provide more nuanced training signals.
  • Complexity Gap: LLMs do not yet show the same "difficulty separation" humans do between polynomial-time and NP-hard tasks; they tend to fail uniformly as soon as the problem becomes combinatorial.

GraphOmni provides the community with a robust, modular foundation to start closing these gaps, moving us closer to LLMs that can truly "think" in nodes and edges.

Summary updated

BibTeX
@inproceedings{xu2026graphomni,
  author = {Hao Xu and Xiangru Jian and Xinjian Zhao and Wei Pang and Chao Zhang and Suyuchen Wang and Qixin Zhang and Zhengyuan Dong and Joao Monteiro and Bang Liu and Qiuzhuang Sun and Tianshu Yu},
  title = {{GraphOmni: A Comprehensive and Extensible Benchmark Framework for Large Language Models on Graph-theoretic Tasks}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=dc8Kf2g0KC},
}
Figure