DynamicGTR: Leveraging Graph Topology Representation Preferences to Boost VLM Capabilities on Graph QAs
Organizations: Southern University of Science and Technology · Hong Kong University of Science and Technology · Harbin Institute of Technology (Shenzhen) · Beihang University
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 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.
Figures & tables
| GTR | Type | Works | Charac. | Enc. | Train |
| Embeddings | Embed | GraphLLM [ 6 ] , GraphGPT [ 42 ] , GraphToken [ 39 ] , LLaGA [ 9 ] | Partial, Informative | Yes | Yes |
| Visual Graph | Visual | GITA [ 51 ] , VisionGraph [ 36 ] | Full, Intuitive, Explicit | No | No |
| Edge Set | Textual | GraphWiz [ 8 ] , NLGraph [ 46 ] , GPT4Graph [ 21 ] , GraphArena [ 43 ] , GCoder [ 58 ] | Full, Sequential, Implicit | No | No |
| Adjacent List | Textual | InstructGLM [ 56 ] , GraphText [ 59 ] | Full, Sequential, Implicit | No | No |
| Adjacent Matrix | Textual | GraphDPR [ 36 ] | Full, Redundant, Implicit | No | No |
| Model | GTRs | Conn | Cyc | TS | SP | MF | BGM | HP |
| GPT-4o | 1st | (92.3%) | (85.1%) | (58.5%) | (19.5%) | (21.7%) | (34.2%) | (30.4%) |
| 2nd | (92.1%) | (12.9%) | (36.2%) | (18.7%) | (20.8%) | (20.3%) | (20.3%) | |
| 3rd | (91.7%) | (12.2%) | (23.1%) | (17.1%) | (16.7%) | (19.8%) | (18.8%) | |
| Gemini 2.5 Pro | 1st | (88.8%) | (97.2%) | (41.0%) | (48.6%) | (40.0%) | (24.4%) | (42.9%) |
| 2nd | (88.2%) | (93.0%) | (30.3%) | (37.6%) | (36.0%) | (14.5%) | (31.7%) | |
| 3rd | (88.2%) | (71.8%) | (15.4%) | (26.6%) | (14.0%) | (14.5%) | (30.2%) |
| Conn | Cyc | TS | SP | MF | BGM | HP | ||||||||
| Method | ||||||||||||||
| Acc | Tok | Acc | Tok | Acc | Tok | Acc | Tok | Acc | Tok | Acc | Tok | Acc | Tok | |
| GPT-4o | ||||||||||||||
| CoT | 92.5 | 273.3 | 52.7 | 480.6 | 36.6 | 224.2 | 54.6 | 566.0 | 25.3 | 362.9 | 69.5 | 370.1 | 50.0 | 124.9 |
| NLGraph | 92.9 | 296.6 | 60.2 | 337.9 | 36.2 | 202.6 | 59.0 | 533.7 | 25.6 | 335.1 | 62.2 | 356.3 | 57.1 | 176.5 |
| GraphDPR | 94.3 | 412.2 | 68.7 | 626.4 | 40.2 | 411.0 | 59.1 | 496.3 | 31.2 | 502.7 | 76.5 | 582.1 | 62.7 | 475.8 |
| ca-GrQC | ca-HepTh | ogbl-ppa | PolBlog | Cora | ogbn-product | |||||||
| Method | ||||||||||||
| Acc | Tok | Acc | Tok | Acc | Tok | Acc | Tok | Acc | Tok | Acc | Tok | |
| GPT-4o | 66.2 | 191.2 | 77.4 | 229.8 | 42.6 | 199.4 | 59.2 | 255.7 | 52.2 | 228.5 | 33.2 | 192.6 |
| +CoT | 68.6 | 244.0 | 77.8 | 268.6 | 48.2 | 238.1 | 60.3 | 311.2 | 54.4 | 272.2 | 33.1 | 199.9 |
| +GITA | 73.1 | 203.1 | 83.1 | 245.9 | 52.8 | 266.2 | 63.6 | 226.6 | 56.8 | 184.4 | 35.5 | 233.4 |
| +DynamicGTR | 76.5 | 143.2 | 86.3 | 183.4 | 54.4 | 206.3 | 71.9 | 153.0 | 64.5 | 99.2 | 40.1 | 156.1 |
| Conn | Cyc | TS | SP | MF | BGM | HP | ||||||||||
| GTR | Avg.GRE | |||||||||||||||
| Acc | Tok | Acc | Tok | Acc | Tok | Acc | Tok | Acc | Tok | Acc | Tok | Acc | Tok | |||
| 1.16 | 78.5 | 8.4 | 80.0 | 8.0 | 12.3 | 346.0 | 14.5 | 146.3 | 7.5 | 410.2 | 91.2 | 244.3 | 13.3 | 40.0 | ||
| 1.20 | 95.1 | 7.7 | 87.1 | 8.0 | 3.0 | 30.0 | 20.0 | 130.1 | 10.8 | 387.4 | 87.2 | 280.0 | 11.1 | 40.0 | ||
| 1.13 | 89.7 | 8.2 | 70.7 | 8.0 | 3.0 | 30.0 | 18.2 | 153.5 | 8.1 | 421.3 | 88.2 | 271.6 | 14.4 | 40.0 | ||
| 0.88 | 96.0 | 8.1 | 60.5 | 8.0 | 3.0 | 30.0 | 17.3 | 150.5 | 8.1 | 389.2 | 82.9 | 295.3 | 4.4 | 74.0 | ||
| Metric | setting | I.D. | LP | NC |
| 69.6 | 73.1 | 59.3 | ||
| Acc | 69.5 | 72.4 | 58.8 | |
| 69.3 | 72.0 | 58.6 | ||
| Best Baseline | 61.8 | 69.7 | 52.0 | |
| 290.8 | 223.2 | 168.8 | ||
| Tok | 212.0 | 177.6 | 136.1 |
| Metric | setting | I.D. | LP | NC |
| 62.4 | 70.6 | 54.2 | ||
| Acc | 66.2 | 72.1 | 57.8 | |
| 69.5 | 72.4 | 58.8 | ||
| Best Baseline | 61.8 | 69.7 | 52.0 | |
| 286.2 | 198.2 | 196.6 | ||
| Tok | 232.4 | 181.6 | 158.9 |
| Metric | I.D. | LP | NC | Avg. |
| Transfer Gemini-2.5 Pro’s Router to GPT-4o | ||||
| -0.3(+6.1) | -0.1(+3.2) | -1.4(+6.6) | -0.6(+5.3) | |
| -35.5(-123.4) | -9.2(-56.4) | -40.1(-119.5) | -28.3(-99.8) | |
| Transfer GPT-4o’s Router to Gemini-2.5 Pro | ||||
| +0.1(+1.9) | +0.5(+4.0) | -0.1(+9.6) | +0.2(+5.2) | |
| +14.4(-216.2) | +26.9(-47.5) | +3.2(-115.6) | +14.8(-126.4) | |
| Model | GTRs | Conn | Cyc | TS | SP | MF | BGM | HP |
| GPT-4o | 1st | (92.3%) | (85.1%) | (58.5%) | (19.5%) | (21.7%) | (34.2%) | (30.4%) |
| 2nd | (92.1%) | (12.9%) | (36.2%) | (18.7%) | (20.8%) | (20.3%) | (20.3%) | |
| 3rd | (91.7%) | (12.2%) | (23.1%) | (17.1%) | (16.7%) | (19.8%) | (18.8%) | |
| 4th | (84.4%) | (10.5%) | (0.8%) | (16.3%) | (10.8%) | (13.4%) | (17.4%) | |
| 5th | (73.0%) | (61.1%) | (0.8%) | (13.8%) | (8.3%) | (9.1%) | (15.9%) | |
| 6th | (27.0%) | (10.8%) | (0.8%) | (12.2%) | (7.5%) | (7.0%) | (14.5%) |
| Conn | Cyc | TS | SP | MF | BGM | HP | |
| #sample | 16,410 | 4,100 | 2,910 | 1,560 | 1,500 | 1,860 | 900 |
| #nodes | 25.01 | 23.42 | 21.86 | 13.65 | 13.90 | 21.13 | 13.24 |
| #edges | 95.46 | 23.66 | 114.10 | 23.99 | 49.16 | 51.03 | 45.05 |
| ca-GrQC | ca-HepTh | ogbl-ppa | PolBlogs | Cora | ogbn-product | |
| # Nodes | 5,242 | 9,877 | 576,289 | 1,490 | 2,708 | 2,449,029 |
| # Edges | 14,496 | 25,998 | 30,326,273 | 19,025 | 5,278 | 61,859,140 |
| domain | collaboration | collaboration | protein association | social | citation | e-commerce |
| average degree | 5.53 | 5.26 | 105.25 | 25.54 | 3.9 | 50.52 |
| Conn | Cyc | TS | SP | MF | BGM | HP | ||||||||
| Method | ||||||||||||||
| Acc | Tok | Acc | Tok | Acc | Tok | Acc | Tok | Acc | Tok | Acc | Tok | Acc | Tok | |
| LLaVA-OneVision-7B | ||||||||||||||
| CoT | 85.2 | 312.5 | 45.3 | 528.8 | 30.1 | 268.4 | 48.2 | 612.7 | 18.7 | 405.3 | 60.3 | 412.8 | 42.5 | 156.3 |
| NLGraph | 85.7 | 338.9 | 52.1 | 382.4 | 29.8 | 241.7 | 52.6 | 586.2 | 19.2 | 378.5 | 54.8 | 398.6 | 48.9 | 212.7 |
| GraphDPR | 88.6 | 456.3 | 60.5 | 689.2 | 34.7 | 458.9 | 53.9 | 547.8 | 25.3 | 556.2 | 68.9 | 635.7 | 55.2 | 521.4 |
| ca-GrQC | ca-HepTh | ogbl-ppa | PolBlog | Cora | ogbn-product | |||||||
| Method | ||||||||||||
| Acc | Tok | Acc | Tok | Acc | Tok | Acc | Tok | Acc | Tok | Acc | Tok | |
| LLaVA-OneVision-7B | 58.4 | 229.7 | 69.2 | 276.3 | 34.8 | 241.8 | 51.5 | 298.4 | 44.7 | 265.9 | 26.8 | 235.2 |
| +CoT | 60.9 | 278.5 | 69.7 | 312.8 | 40.3 | 285.4 | 52.8 | 356.7 | 46.9 | 312.5 | 26.7 | 243.8 |
| +GITA | 65.7 | 245.3 | 75.8 | 298.6 | 45.2 | 312.9 | 56.2 | 269.3 | 49.2 | 221.7 | 29.3 | 278.6 |
| +DynamicGTR | 69.3 | 172.5 | 79.5 | 228.4 | 47.6 | 253.7 | 63.8 | 189.6 | 56.3 | 128.9 | 33.5 | 192.4 |
| Tasks | Task Instruction |
| Connectivity | Is there a path between node [P] and node [P] in this undirected graph? |
| Cycle | Is there a cycle in this undirected graph? |
| Topological Sort | This representation depicts a directed graph, in which each directed edge from node A to node B signifies that, according to the topological order, node A must precede node B. Q: The topological order of the directed graph is: |
| Shortest Path | This representation illustrates a directed graph, with each edge’s capacity indicated by a numerical label in close proximity.Q: What is the maximum flow from node 4 to node 0: |
| Maximum Flow | This representation illustrates a directed graph, with each edge’s capacity indicated by a numerical label in close proximity. Q: What is the maximum flow from node [P] to node [P]: |
| Bipartite Graph Matching | There are [P] hosts numbered from [P] to [P], and [P] tasks numbered from [P] to [P]. Each host has a set of tasks that it is interested in, represented by arrows from a host to a task in the diagram. However, each host is capable of solving only one task, and similarly, each task can be resolved by just one host. Q: What is the maximum number of hosts that can be assigned a task they are interested in? |
| Tasks | Task Instruction |
| Connectivity/ Cycle/ Link Predict | Please put the answer between <answer> and </answer> tags. For example, <answer>Yes</answer> or <answer>No</answer>. |
| Topological Sort/ Shortest Path/ Hamilton Path | Please put the answer between <answer> and </answer> tags. For example, <answer>0->1->2->3->4</answer> or <answer>0->1->3->7->8->4->6->5->9->2</answer>. |
| Maximum Flow | Please put the answer between <answer> and </answer> tags. For example, <answer>3</answer> or <answer>8</answer>. |
| Node Classify | Please put the answer between <answer> and </answer> tags. For example, <answer>Class 1</answer> or <answer>Class 3</answer>. |
| Conn | Cyc | TS | SP | MF | BGM | HP | ||||||||||
| GTR | Avg.GRE | |||||||||||||||
| Acc | Tok | Acc | Tok | Acc | Tok | Acc | Tok | Acc | Tok | Acc | Tok | Acc | Tok | |||
| LLaVA-OneVision-7B | ||||||||||||||||
| 1.11 | 72.3 | 9.1 | 68.5 | 8.0 | 10.1 | 35.2 | 12.7 | 168.5 | 6.2 | 435.8 | 80.1 | 265.9 | 11.5 | 45.2 | ||
| 1.09 | 88.6 | 7.9 | 76.3 | 8.0 | 2.8 | 35.2 | 18.5 | 152.3 | 9.5 | 408.7 | 83.4 | 281.7 | 9.8 | 42.7 | ||
| 0.99 | 80.5 | 8.6 | 62.7 | 8.0 | 2.5 | 35.2 | 16.3 | 175.8 | 7.8 | 442.1 | 78.9 | 278.4 | 12.9 | 42.7 | ||
| Tasks | Template |
| Connectivity/ Cycle/ Hamilton Path | In an undirected graph, (i,j) means that node i and node j are connected with an undirected edge. The nodes are numbered from [P] to [P], and the edges are: ([P], [P]) , ([P], [P])... |
| Topological Sort | In a directed graph with [P] nodes numbered from [P] to [P]: node [P] should be visited before node [P] node [P] should be visited before node [P] ... |
| Shortest Path | In an undirected graph, the nodes are numbered from [P] to [P], and the edges are: an edge between node [P] and node [P] with weight [P], an edge between node [P] and node [P] with weight [P], ... |
| Maximum Flow | In a directed graph, the nodes are numbered from [P] to [P], and the edges are: an edge from node [P] to node [P] with capacity [P], an edge from node [P] to node [P] with capacity [P], ... |
| Bipartite Graph Matching | There are [P] hosts numbered from [P] to [P], and [P] tasks numbered from [P] to [P]. Each host has a set of tasks that it is interested in: Host [P] is interested in task [P]. Host [P] is interested in task [P]. ... |
| Link Predict/ Node Classify | In an undirected graph, (i,j) means that node i and node j are connected with an undirected edge. The nodes are numbered from [P] to [P], and the edges are: ([P], [P]) , ([P], [P])... The node attributes are: Node [P], Attribute [P] Node [P], Attribute [P] ... |
| Tasks | Template |
| Connectivity/ Cycle/ Hamilton Path | In an undirected graph, (i,j) means that node i and node j are connected with an undirected edge. The nodes are numbered from [P] to [P], and the edges are presented in an adjacent list format: [P] <-> [P], [P], [P],... [P] <-> [P], [P], [P],... ... |
| Topological Sort | In a directed graph with [P] nodes numbered from [P] to [P]: node [P] should be visited before node [P], [P], [P],... node [P] should be visited before node [P], [P], [P],... ... |
| Shortest Path | In an undirected graph, the nodes are numbered from [P] to [P], and the edges are presented in an adjacent list format: node [P] is connected to: node [P] with distance: [P], node [P] with distance: [P],... node [P] is connected to: node [P] with distance: [P], node [P] with distance: [P],... ... |
| Maximum Flow | In a directed graph, the nodes are numbered from [P] to [P], and the edges are presented in an adjacent list format: node [P] is connected to: node [P] with capacity: [P], node [P] with capacity: [P],... node [P] is connected to: node [P] with capacity: [P], node [P] with capacity: [P],... ... |
| Bipartite Graph Matching | There are [P] hosts numbered from [P] to [P], and [P] tasks numbered from [P] to [P]. Each host has a set of tasks that it is interested in: Host [P] is interested in tasks [P], [P], [P],.... Host [P] is interested in task [P], [P], [P],.... ... |
| Link Predict/ Node Classify | In an undirected graph, (i,j) means that node i and node j are connected with an undirected edge. The nodes are numbered from [P] to [P], and the edges are presented in an adjacent list format: [P] <-> [P], [P], [P],... [P] <-> [P], [P], [P],... ... The node attributes are: Node [P], Attribute [P] Node [P], Attribute [P] ... |
| Tasks | Template |
| Connectivity/ Cycle/ Hamilton Path | In an undirected graph, (i,j) means that node i and node j are connected with an undirected edge. The nodes are numbered from [P] to [P], and the edges are represented in an adjacent matrix format : node0 1 2... node0 [P] [P] [P],... node1 [P] [P] [P],... node2 [P] [P] [P],... ... |
| Topological Sort | In a directed graph with [P] nodes numbered from [P] to [P], the edges are represented in an adjacent matrix format : node0 1 2... node0 [P] [P] [P],... node1 [P] [P] [P],... node2 [P] [P] [P],... ... |
| Shortest Path/ Maximum Flow | In an undirected graph, the nodes are numbered from [P] to [P], and the edges are represented in an adjacent matrix format with weights : node0 1 2... node0 [P] [P] [P],... node1 [P] [P] [P],... node2 [P] [P] [P],... ... |
| Bipartite Graph Matching | There are [P] hosts numbered from [P] to [P], and [P] tasks numbered from [P] to [P]. Each host has a set of tasks that it is interested in : Task0 1 2... Host0 [P] [P] [P],... Host1 [P] [P] [P],... Host2 [P] [P] [P],... ... |
| Link Predict/ Node Classify | In an undirected graph, (i,j) means that node i and node j are connected with an undirected edge. The nodes are numbered from [P] to [P], and the edges are represented in an adjacent matrix format : node0 1 2... node0 [P] [P] [P],... node1 [P] [P] [P],... node2 [P] [P] [P],... ... The node attributes are: Node [P], Attribute [P] Node [P], Attribute [P] ... |
Graph Reasoning
Graph reasoning uses relationships among entities to solve multi-step inference, prediction, planning, and question-answering tasks.
See all 64 papers