DynamicGTR: Leveraging Graph Topology Representation Preferences to Boost VLM Capabilities on Graph QAs

Yanbin Wei, Jiangyue Yan, Chun Kang, Yang Chen, Hua Liu, James Kwok, Yu Zhang

Abstract

Vision-Language Models (VLMs) have emerged as versatile solutions for zero-shot question answering (QA) across various domains. However, enabling VLMs to effectively comprehend structured graphs and perform accurate, efficient QA remains challenging. Existing approaches typically rely on one single graph topology representation (GTR), such as fixed-style visual images or unified text descriptions. This "one-size-fits-all" strategy often neglects model-specific and task-specific preferences, resulting in inaccurate or over-lengthy responses to graph-related queries. To address this, we propose the DynamicGTR framework, which dynamically selects the optimal GTR for each query during inference, thereby enhancing the zero-shot graph QA capabilities of VLMs with a customizable accuracy and brevity trade-off. Extensive experiments show that DynamicGTR not only improves VLM-based graph algorithm QA performance but also successfully transfers the experience trained from synthetic graph algorithm tasks to real-world applications like link prediction and node classification, without any additional training. Additionally, DynamicGTR demonstrates strong transferability across tasks, domains, and models, suggesting its potential as a flexible solution for broad graph scenarios.

Introduction

While Vision-Language Models like GPT-4o and Gemini are incredibly versatile, they often struggle when reasoning about structured data like graphs. Current research typically feeds graphs to these models in a single, fixed format—either a text-based list of edges or a static image. This "one-size-fits-all" approach is fundamentally flawed because different graph tasks require different cognitive approaches. For example, a VLM might spot a cycle in a circular visual layout almost instantly but require a structured adjacency list to calculate a complex shortest path. Using an inappropriate representation leads to two major issues: inaccuracy (model confusion) and verbosity (expensive, rambling explanations).

Methodology

DynamicGTR acts as an intelligent "switchboard" for graph data, selecting the most effective representation for a given query to optimize both accuracy and brevity. The framework consists of several key components:

  1. Diverse GTR Pool: A library of eight distinct Graph Topology Representations, including five visual layouts (e.g., neato, circo, fdp) and three textual formats (Edge Set, Adjacency List, and Adjacency Matrix).
  2. Graph Response Efficiency (GRE) Metric: A novel scoring system that evaluates representations based on both correctness and conciseness. A tunable hyperparameter ($\alpha$) allows users to prioritize either maximum accuracy or cost-saving brevity.
  3. The GTR Router: A lightweight model (DeBERTaV3-base) trained to predict the optimal GTR from the pool based on the natural language question.
The DynamicGTR framework overview, showing the GTR Router training and the inference pipeline.

Experimental Setup

The study utilizes a mix of synthetic and real-world data to evaluate the framework's robustness:

  • In-Domain (Synthetic): The GVLQA-BASE benchmark, covering seven fundamental graph algorithms: Connectivity, Cycle Detection, Topological Sort, Shortest Path, Maximum Flow, Bipartite Matching, and Hamilton Path.
  • Out-of-Domain (Real-World): Six datasets for Link Prediction (e.g., ogbl-ppa) and Node Classification (e.g., Cora).
  • GTR Preference Dataset ($D_{GTRP}$): A newly created dataset of 7,000 graph-question pairs labeled with the empirically "best" representation based on extensive probing of leading VLMs.

Results and Discussion

Representational Bias and Model Preferences

Experiments confirm that VLMs have distinct preferences depending on the task. Perceptual-intensive tasks, such as finding cycles, are dominated by visual representations like $V_{sfdp}$ or $V_{neato}$. Conversely, computation-heavy tasks like Maximum Flow or Shortest Path prefer textual formats (e.g., $T_{list}$, $T_{mat}$) that facilitate sequential, analytical reasoning.

Top-3 GTR preferences for GPT-4o and Gemini 2.5 Pro across various graph tasks, highlighting task-specific representational bias.

Accuracy and Efficiency Gains

DynamicGTR consistently outperforms static baselines. For instance, on GPT-4o Connectivity tasks, it achieved 96.1% accuracy using only 38.8 tokens on average, compared to 92.5% accuracy and 273.3 tokens for standard Chain-of-Thought approaches. In Cycle Detection for Gemini 2.5 Pro, token consumption was reduced from 716.6 to just 16.7—a nearly 43x improvement in efficiency—while maintaining near-perfect accuracy.

Generalizability

A critical finding is that a router trained only on small, synthetic graphs successfully selects representations for complex real-world graphs by applying the "Locality Principle," focusing on subgraphs relevant to the query. Furthermore, GTR preferences are consistent across models; a router trained on GPT-4o preferences provides a significant boost when used with Gemini 2.5 Pro.

Conclusion

DynamicGTR demonstrates that moving away from fixed graph descriptions significantly enhances VLM performance and efficiency. While building the initial preference dataset requires an upfront probing cost, the resulting gains in accuracy and massive reductions in token consumption make it a flexible and powerful solution for broad graph-based reasoning scenarios. Future work may explore generative GTRs that design custom layouts on the fly for even more complex graph topologies.

Summary updated

BibTeX
@inproceedings{wei2026dynamicgtr,
  author = {Yanbin Wei and Jiangyue Yan and Chun Kang and Yang Chen and Hua Liu and James Kwok and Yu Zhang},
  title = {{DynamicGTR: Leveraging Graph Topology Representation Preferences to Boost VLM Capabilities on Graph QAs}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=Daxl2tEUp5},
}
Figure