Graph Serializations for Reasoning LLMs: A Study Across Knowledge Extraction and Structural Reasoning
Organizations: Oracle
Abstract
The way a knowledge graph is serialized as text for inclusion into LLM context can substantially affect downstream LLM performance, with prior work reporting tens of percentage points variations across formats. However, existing studies consider only a limited set of representations and predate frontier reasoning models, which now offer stronger reasoning, instruction-following, and long-context capabilities. We evaluate 15 graph representation formats across nine frontier LLM configurations on ontology-based knowledge extraction and structural graph reasoning tasks. While knowledge extraction is relatively insensitive to different serialization formats, the choice of the optimal format for structural reasoning tasks significantly affects accuracy. We demonstrate that the optimal representation choice depends on model, query, and task and propose to approach graph serialization as a dynamic orchestration decision.
Figures & tables
| formal semantics (RDF/OWL) | turtle , jsonld , shacl_lite |
|---|---|
| structured natural language | text2kgbench , entity_centric |
| relation_indexed | |
| tabular | markdown_table , toon |
| visual / diagrammatic | mermaid , dot |
| connectivity-focused | adjacency , edge_list , structured |
| prose | nl_summary , friendship |
| model | Text2KGBench | GraphQA | GraphQA-Hardened | GraphQA-Topology |
|---|---|---|---|---|
| gpt-5.4-high-reasoning | turtle / | structured / | — | — |
| gpt-5.4 | mermaid / | shacl_lite / | nl_summary / | jsonld / |
| gpt-5.4-mini | shacl_lite / | jsonld / | jsonld / | jsonld / |
| o3 | shacl_lite / | adjacency / | nl_summary / | structured / |
| claude-sonnet-4-6-thinking | jsonld / | text2kgbench / | text2kgbench / | jsonld / |
| claude-sonnet-4-6 | jsonld / | nl_summary / | entity_centric / | relation_indexed / |
| LLM calls/query | Resources/query | Outcome | |||||
|---|---|---|---|---|---|---|---|
| Policy | Selector | Generator | Input tok. | Output tok. | Rel. cost | Latency | Acc. (%) |
| Global fixed-best | s | ||||||
| Task-wise router | s | ||||||
| MV-5 (parallel) | s | ||||||
| Adaptive selector | s | ||||||
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
| task | question template | ref. example | in |
| GraphQA (11 tasks; adapted from Fatemi et al., 2024 added). | |||
| node_count | “How many nodes are in the graph?” | G | |
| edge_count | “How many edges are in the graph?” | G | |
| node_degree | “What is the degree of node ?” | G | |
| edge_existence | “Is there an edge directly between and ? Yes/No.” | No | G |
| connectivity | “Is there a path from to ? Yes/No.” | Yes | G |
| generator | parameters | degree distribution | edge count at |
|---|---|---|---|
| ER | binomial, sharp peak | ||
| BA | edges per new node | power-law | |
| SBM | communities, , | bimodal | |
| star | hub, leaves | ||
| complete | all-to-all | ||
| path |
| model | adjacency | dot | edge_list | entity_centric | friendship | jsonld | markdown_table | mermaid | nl_summary | relation_indexed | shacl_lite | structured | text2kgbench | toon | turtle |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| gpt-5.4-high-reasoning | 100.0 | 100.0 | 100.0 | 99.4 | 99.4 | 100.0 | 100.0 | 100.0 | 99.4 | 100.0 | 100.0 | 100.0 | 100.0 | 99.4 | 100.0 |
| gpt-5.4 | 90.9 | 88.5 | 92.1 | 92.7 | 90.3 | 92.7 | 90.3 | 90.3 | 92.7 | 90.3 | 93.3 | 91.5 | 92.7 | 92.7 | 89.1 |
| gpt-5.4-mini | 75.1 | 72.1 | 73.3 | 77.6 | 71.5 | 79.4 | 75.1 | 73.9 | 76.4 | 75.8 | 76.4 | 75.1 | 72.7 | 71.5 | 70.9 |
| o3 | 98.2 | 97.0 | 95.8 | 98.2 | 95.8 | 98.2 | 97.0 | 97.6 | 98.2 | 97.6 | 97.6 | 97.0 | 97.6 | 95.8 | 97.6 |
| claude-sonnet-4-6-thinking | 93.9 | 95.2 | 95.8 | 97.0 | 95.8 | 97.0 | 93.9 | 95.8 | 96.4 | 96.4 | 93.9 | 96.4 | 97.0 | 93.3 | 93.3 |
| claude-sonnet-4-6 | 93.9 | 94.5 | 92.1 | 92.7 | 92.7 | 94.5 | 93.9 | 92.7 | 94.5 | 93.3 | 93.3 | 93.3 | 93.3 | 93.3 | 93.9 |
| model | adjacency | dot | edge_list | entity_centric | friendship | jsonld | markdown_table | mermaid | nl_summary | relation_indexed | shacl_lite | structured | text2kgbench | toon | turtle |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| gpt-5.4 | 61.1 | 55.8 | 56.8 | 63.2 | 60.0 | 62.1 | 52.6 | 57.9 | 64.2 | 52.6 | 63.2 | 51.6 | 52.6 | 51.6 | 60.0 |
| gpt-5.4-mini | 37.9 | 35.8 | 32.6 | 35.8 | 39.0 | 41.0 | 34.7 | 34.7 | 40.0 | 33.7 | 40.0 | 34.7 | 33.7 | 33.7 | 34.7 |
| o3 | 85.3 | 81.0 | 79.0 | 86.3 | 75.8 | 87.4 | 82.1 | 84.2 | 87.4 | 80.0 | 85.3 | 82.1 | 77.9 | 81.0 | 82.1 |
| claude-sonnet-4-6-thinking | 83.2 | 79.0 | 79.0 | 83.2 | 82.1 | 82.1 | 82.1 | 83.2 | 82.1 | 82.1 | 83.2 | 81.0 | 83.2 | 82.1 | 82.1 |
| claude-sonnet-4-6 | 79.0 | 81.0 | 80.0 | 87.4 | 80.0 | 84.2 | 75.8 | 81.0 | 76.8 | 79.0 | 83.2 | 75.8 | 76.8 | 73.7 | 82.1 |
| claude-haiku-4-5 | 72.6 | 53.7 | 52.6 | 71.6 | 54.7 | 67.4 | 50.5 | 48.4 | 68.4 | 44.2 | 66.3 | 61.1 | 54.7 | 59.0 | 46.3 |
| model | adjacency | dot | edge_list | entity_centric | friendship | jsonld | markdown_table | mermaid | nl_summary | relation_indexed | shacl_lite | structured | text2kgbench | toon | turtle |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| gpt-5.4 | 84.7 | 79.2 | 75.0 | 81.9 | 77.8 | 90.3 | 77.8 | 79.2 | 84.7 | 76.4 | 90.3 | 83.3 | 81.9 | 77.8 | 75.0 |
| gpt-5.4-mini | 48.6 | 50.0 | 52.8 | 48.6 | 50.0 | 58.3 | 54.2 | 54.2 | 47.2 | 52.8 | 41.7 | 55.6 | 52.8 | 48.6 | 50.0 |
| o3 | 90.3 | 90.3 | 80.6 | 86.1 | 80.6 | 88.9 | 86.1 | 90.3 | 84.7 | 87.5 | 87.5 | 90.3 | 87.5 | 88.9 | 84.7 |
| claude-sonnet-4-6-thinking | 93.1 | 90.3 | 93.1 | 91.7 | 93.1 | 95.8 | 93.1 | 91.7 | 94.4 | 91.7 | 93.1 | 91.7 | 93.1 | 91.7 | 94.4 |
| claude-sonnet-4-6 | 80.6 | 83.3 | 80.6 | 80.6 | 77.8 | 81.9 | 80.6 | 80.6 | 83.3 | 84.7 | 81.9 | 81.9 | 83.3 | 81.9 | 81.9 |
| claude-haiku-4-5 | 77.8 | 66.7 | 66.7 | 79.2 | 72.2 | 75.0 | 73.6 | 68.1 | 80.6 | 65.3 | 79.2 | 68.1 | 73.6 | 65.3 | 63.9 |
| model | best | acc. | second | acc. | worst | acc. | spread |
|---|---|---|---|---|---|---|---|
| gpt-5.4 | jsonld | 41.8 | turtle | 40.0 | adj. | 13.6 | 28.2 |
| gpt-5.4-mini | jsonld | 30.9 | turtle | 29.1 | nl_sum. | 6.4 | 24.5 |
| model (year) | best fmt | F1 | vs. Vicuna 2023 |
|---|---|---|---|
| Vicuna-13B, 2023 | text2kgbench | — | |
| Alpaca-LoRA-13B, 2023 | text2kgbench | ||
| gpt-5.4-high-reasoning | turtle | ||
| gpt-5.4 | mermaid | ||
| gpt-5.4-mini | shacl_lite | ||
| o3 | shacl_lite |
| model | edge_list | entity_centric | jsonld | markdown_table | mermaid | nl_summary | relation_indexed | shacl_lite | structured | text2kgbench | toon | turtle |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| gpt-5.4-high-reasoning | 52.8 | 53.4 | 54.5 | 53.2 | 54.5 | 53.6 | 53.1 | 53.8 | 54.0 | 54.2 | 53.1 | 54.7 |
| gpt-5.4 | 50.6 | 51.8 | 49.9 | 49.4 | 52.7 | 50.3 | 50.0 | 51.9 | 49.8 | 50.2 | 49.9 | 50.3 |
| gpt-5.4-mini | 48.7 | 50.2 | 48.1 | 49.3 | 49.7 | 49.6 | 49.0 | 50.6 | 49.2 | 49.9 | 49.8 | 48.0 |
| o3 | 53.6 | 54.0 | 53.6 | 53.4 | 52.8 | 53.1 | 53.7 | 54.9 | 53.3 | 53.8 | 53.5 | 54.0 |
| claude-sonnet-4-6-thinking | 50.1 | 50.2 | 52.9 | 50.9 | 50.7 | 50.2 | 51.1 | 51.4 | 50.4 | 50.9 | 51.0 | 51.3 |
| claude-sonnet-4-6 | 50.3 | 51.2 | 52.2 | 50.3 | 50.7 | 50.0 | 50.6 | 52.0 | 50.6 | 51.3 | 50.6 | 50.8 |
| Statistic | min | median | mean | max |
|---|---|---|---|---|
| Concepts | ||||
| Relations | ||||
| Avg. rendered tokens |
| model | regime | fixed | ceiling | pp | sig |
|---|---|---|---|---|---|
| gpt-5.4 | GraphQA | ** | |||
| gpt-5.4 | Hardened | ** | |||
| gpt-5.4 | Topology | ** | |||
| gpt-5.4-mini | GraphQA | ** | |||
| gpt-5.4-mini | Hardened | ** | |||
| gpt-5.4-mini | Topology | ** |
| per-format mean accuracy ( ) | % |
|---|---|
| entity_centric | |
| nl_summary | |
| jsonld / shacl_lite | |
| adjacency | |
| friendship | |
| dot / mermaid |
| task | betweenness | local | max_clique | neigh_deg | graph | kcore | kth_shortest |
|---|---|---|---|---|---|---|---|
| _top1 | _clustering | _size | _ge | _diameter | _size | _path | |
| fixed-best % | |||||||
| selector % | |||||||
| in-cand. ceiling % | |||||||
| pp (sel. fxd.) | |||||||
| residual ceiling gap pp |
| band | selector acc. | vs. nl_summary | paired-BCa CI | mid- McNemar; | sig. |
|---|---|---|---|---|---|
| (default) | pp | ||||
| (headline) | pp |
| paper configuration | model identifier | inference control | temperature | original-panel access window |
|---|---|---|---|---|
| gpt-5.4 | openai.gpt-5.4-2026-03-05 | default reasoning | 0 | May 13–15, 2026 |
| gpt-5.4-high | openai.gpt-5.4-2026-03-05 | reasoning_effort=HIGH | 0 | May 13–23, 2026 |
| gpt-5.4-mini | openai.gpt-5.4-mini-2026-03-17 | default reasoning | 0 | May 13–15, 2026 |
| o3 | openai.o3-2025-04-16 | default reasoning | 0 | May 13–19, 2026 |
| claude-sonnet-4-6 | anthropic.claude-sonnet-4-6 | thinking off | 0 | May 18–25, 2026 |
| claude-sonnet-4-6-thinking | anthropic.claude-sonnet-4-6 | extended thinking | 1 | May 18–25, 2026 |
LLM Reasoning with Graphs
Large language model reasoning with graphs uses structured relationships to support multi-step inference, evidence retrieval, and planning.
See all 211 papers