atlas

Research map / Graph learning / Knowledge and temporal graphs

Talk like a Graph: Encoding Graphs for Large Language Models

ICLR 2024 · Graph learning › Knowledge and temporal graphs · approach: Graph-based dialog systems · 13 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Systematic study of how encoding graphs as text (node/edge encodings, question phrasing, graph structure) affects black-box LLM performance on basic graph tasks, plus a new benchmark GraphQA.

Problem

LLMs are poor at graph reasoning, and how graphs are serialized as text, how questions are phrased, and what graph structure is used all affect performance; this had not been systematically studied for black-box LLMs.

Approach

Decompose graph prompting into graph encoding function, question encoder, and graph structure; systematically vary node naming (integers, names, characters), edge phrasing (adjacency, incident, friendship, etc.), prompting heuristics, and random graph generators on basic graph tasks, and release a benchmark (GraphQA) built on this.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Replace graph question encoder with application question encoder (ablation)zero-shot prompting with PaLM 2-XXS · GQA Edge Existenceaccuracy: 42.8 -> 60.8Helped
Replace zero-shot with zero-shot CoT (ablation)PaLM 62B graph reasoning · GQA basic graph tasksaccuracy: 44.5 / 9.4 -> 33.5 / 11.6; 76.0 / 13.2 -> 32.3 / 23.2Hurt
Replace zero-shot prompting with CoT prompting (ablation)PaLM 62B graph reasoning · GQA Node degreeaccuracy: 14.0/16.0 -> 29.2 / 60.4Helped
Use incident encoding instead of adjacency encodingPaLM 62B zero-shot · GQA Connected nodesaccuracy: 19.8 -> 53.8Helped
Use integer node encodinggraph encoding for integer-output tasks · GQA node degree, node count, and edge countaccuracyHelped
Replace graph task wording with a friendship-based application question (ablation)graph question encoder · GQA basic graph tasksaccuracy: 42.8 -> 60.8Mixed
Represent edges with multiple randomized relation words (ablation)friendship graph encoding · GQA graph tasksaccuracyHelped
Increase model capacityPaLM 2 · GQA graph reasoning tasksaccuracyHelped
Add few-shot examples to zero-shot prompting (ablation)PaLM 62B on path-graph cycle checking · GQA Cycle check on path graphsaccuracy: 5.9 -> 19.7Helped
Use a complete graph rather than a path graphPaLM 62B zero-shot · GQA Cycle checkaccuracy: 5.9 -> 91.7Mixed
Use a path graph rather than a complete graphPaLM 62B zero-shot · GQA Edge Existenceaccuracy: 19.8 -> 60.9Mixed
Find disconnected nodes rather than connected nodesLLM prompting methods · GQA Disconnected nodesaccuracy: 0.5%; close to 0.0%Hurt

Surprising findings

Limitations

Experimental setup

Datasets: randomly generated graphs via NetworkX (ER, BA, SFN, SBM, star, path, complete)

Benchmarks: GraphQA

Metrics: accuracy

Baselines: zero-shot few-shot chain-of-thought zero-shot CoT cot-bag majority baseline

Builds on: chain-of-thought prompting zero-shot CoT Talk like a Graph bag prompting (Wang et al.) NetworkX

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy