atlas

Research map / Large language models / Agents, code and math

Can Large Language Models Analyze Graphs like Professionals? A Benchmark, Datasets and Models

NeurIPS 2024 · Large language models › Agents, code and math · approach: Mathematical and structural reasoning benchmarks · 5 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.

Introduces ProGraph, a 512-problem benchmark testing whether LLMs can solve graph analysis tasks by writing code against six Python graph libraries, plus LLM4Graph datasets (crawled API docs and about 29K auto-generated code QA pairs) that improve closed models via RAG and open models via fine-tuning.

Problem

Existing LLM graph benchmarks require reasoning over adjacency lists in prompts, which limits graphs to a few dozen nodes and relies on step-by-step reasoning. The paper asks whether LLMs can instead analyze graphs of practical scale by programming with external graph APIs, as human experts do.

Approach

Shift graph analysis evaluation from direct in-prompt reasoning to API-based programming: the benchmark requires executable code using NetworkX, igraph, CDlib, graspologic, Little Ball of Fur and Karate Club, and the training data pairs API documentation with back-instructed code, with Doc+Code CoT answers that first name the APIs.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
add RAG with 7 retrieved APIs (ablation)Claude 3 Opus · ProGraph overallaccuracy: 34.7 -> 46.2Helped
add RAG with 5 retrieved APIs (ablation)GPT-4 turbo · ProGraph overallaccuracy: 31.2 -> 39.6Helped
add RAG with 5 retrieved APIs (ablation)GPT-4o · ProGraph overallaccuracy: 36.3 -> 42.6Helped
add RAG with 5 retrieved APIs (ablation)Gemini 1.5 Pro · ProGraph overallaccuracy: 24.8 -> 37.3Helped
fine-tune on Code dataset (ablation)Llama 3 · ProGraph overallaccuracy: 11.7 -> 43.8Helped
fine-tune on Doc+Code dataset and use two-step retrieval (ablation)Llama 3 · ProGraph overallaccuracy: 11.7 -> 44.9Helped
fine-tune on Code dataset (ablation)Deepseek Coder · ProGraph overallaccuracy: 24.2 -> 43.1Helped
fine-tune on Doc+Code dataset and use two-step retrieval (ablation)Deepseek Coder · ProGraph overallaccuracy: 24.2 -> 46.6Helped
add RAG with 3 retrieved APIs to the Code Only model (ablation)Llama 3 · ProGraph overallaccuracy: 43.8 -> 31.6Hurt
add RAG with 3 retrieved APIs to the Code Only model (ablation)Deepseek Coder · ProGraph overallaccuracy: 43.1 -> 33.2Hurt
increase retrieved API count from 3 to 5 (ablation)GPT-4 turbo · ProGraph overallaccuracy: 36.2 -> 39.6Helped
increase retrieved API count from 5 to 7 (ablation)GPT-4 turbo · ProGraph overallaccuracy: 39.6 -> 39.1Hurt

Surprising findings

Limitations

Experimental setup

Datasets: LLM4Graph document dataset LLM4Graph Code (QA) LLM4Graph Doc+Code (QA)

Benchmarks: ProGraph

Metrics: pass rate accuracy

Baselines: GPT-3.5 GPT-4 turbo GPT-4o Claude 3 Haiku Claude 3 Sonnet Claude 3 Opus Gemini 1.0 Pro Gemini 1.5 Pro Llama-3-8B-Instruct Deepseek-Coder-7B-Instruct-v1.5

Builds on: chain-of-thought retrieval-augmented generation back-instruction

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