SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.19119 · NeurIPS · 2024

Can Graph Learning Improve Planning in LLM-based Agents?

Wei Chen, Bohang Zhang, Hong Cheng, Kaitao Song, Dongsheng Li, Yifei Shen, Caihua Shan, Jiarui Feng, Siwei Wang, Xixi Wu, Yun Xiong

arXiv · PDF · Open in the Atlas

Code that ran

10 of 13 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 6 failures of our instrument; 3 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2405.19119.json · badge: /api/ran/2405.19119.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
wxxshirley/gnn4taskplan canonical (classifier label)
classifier basis: census
10 ran · 3 no recorded run
FunctionStatusWhere it lives
batch_f1_score Ran
ran, honoured the contract we drafted
wxxshirley/gnn4taskplan/evaluate.py
code served (permissive licence) · get_code("1ceb9aa1003a4591")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# batch_f1_score expects:
# - pred_list: a list of predictions, where each prediction is a list/set of items
# - gt_list: a list of ground truth, where each gt is a list/set of items

ARGS = {
    "pred_list": [
        [1, 2, 3],
        [4, 5],
    ],
    "gt_list": [
        [1, 2, 4],
        [4, 5, 6, 7],
    ],
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
batch_task_accuracy Ran
ran, honoured the contract we drafted
wxxshirley/gnn4taskplan/evaluate.py
code served (permissive licence) · get_code("1c4ed1924a7cfefe")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Analyzing the function:
# batch_task_accuracy takes pred_list and gt_list
# It zips them together and calls f1_score on each pair
# f1_score expects pred and gt to be iterables that support:
#   - len()
#   - set() conversion
#   - & (intersection) operation
# So pred and gt should be list-like objects containing elements

# Create small test data for pred_list and gt_list
# Each element in pred_list and gt_list should be a list/iterable of items

pred_list = [
    [1, 2, 3],           # prediction for sample 1
    [4, 5, 6, 7],        # prediction for sample 2
]

gt_list = [
    [1, 2, 3],           # ground truth for sample 1 (perfect match, F1 >= 0.99)
    [4, 5, 8],           # ground truth for sample 2 (partial match, F1 < 0.99)
]

ARGS = {
    "pred_list": pred_list,
    "gt_list": gt_list,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
build_conv Ran
ran; our contract draft was wrong, not the code
wxxshirley/gnn4taskplan/GraphToken/gnn.py
code served (permissive licence) · get_code("dd424c203b1493ae")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned type. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from torch_geometric.nn import GCNConv, GATConv, TransformerConv, SAGEConv, GINConv

torch.manual_seed(0)

ARGS = {
    'conv_type': 'GCN'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torch_geometric — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
f1_score Ran
ran; our contract draft was wrong, not the code
wxxshirley/gnn4taskplan/evaluate.py
code served (permissive licence) · get_code("8908fcb355c0a7cb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function f1_score takes two parameters: pred and gt
# Both are used with len() and set() operations
# So they should be list-like or set-like collections of comparable elements

pred = [1, 2, 3, 4]
gt = [2, 3, 4, 5]

ARGS = {
    "pred": pred,
    "gt": gt
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_response Ran
ran on a synthesized input
wxxshirley/gnn4taskplan/trainfree/direct.py
code served (permissive licence) · get_code("fad6e5fad73b7b31")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned coroutine. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
import asyncio

# The function is async and makes HTTP requests, so we need to provide:
# 1. url: a string representing the API endpoint
# 2. payload: a JSON string containing the request body
# 3. resource_type: a boolean flag

# Based on the function body, the payload must be a JSON string that can be parsed
# and contains a 'messages' key with at least one message having 'content'

# Constructing a minimal valid payload that would work with the function's logic
payload_dict = {
    "messages": [
        {
            "content": '{"task_steps": ["Step 1: Call tool A"], "task_nodes": [{"task": "tool_a", "arguments": ["arg1"]}], "task_links": []}'
        }
    ]
}
payload = json.dumps(payload_dict)

# Construct the arguments dictionary
ARGS = {
    "url": "https://api.example.com/v1/chat/completions",
    "payload": payload,
    "resource_type": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
aiohttp — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_response Ran
ran on a synthesized input
wxxshirley/gnn4taskplan/trainfree/direct_diffprompt.py
code served (permissive licence) · get_code("d85fa758ae62b493")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned coroutine. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json

ARGS = {
    "url": "http://localhost:8000/api/chat",
    "payload": json.dumps({
        "messages": [
            {
                "role": "user",
                "content": "Please analyze this task and format as JSON with task_steps, task_nodes, and task_links"
            }
        ],
        "model": "gpt-3.5-turbo"
    }),
    "resource_type": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
aiohttp — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
reformat_task_links Ran
ran; our contract draft was wrong, not the code
wxxshirley/gnn4taskplan/GraphToken/evaluate.py
code served (permissive licence) · get_code("9175392c007589aa")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

ARGS = {
    'content': {
        'task_links': [
            {'source': 'task_a', 'target': 'task_b'},
            {'source': 'task_c', 'target': 'task_d'},
            {'source': 'task_e', 'target': 'task_f'},
            None,
            {'source': 'task_g', 'target': 'task_h'},
            {'source': 123, 'target': 'task_i'},
            {'source': 'task_j', 'target': None},
        ]
    }
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
reformat_task_nodes Ran
ran; our contract draft was wrong, not the code
wxxshirley/gnn4taskplan/GraphToken/evaluate.py
code served (permissive licence) · get_code("4572b440193929ed")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Case 1: nodes are strings
content_case1 = {
    'task_nodes': [
        {'task': 'task_1'},
        {'task': 'task_2'},
        {'task': 'task_3'}
    ]
}

# Case 2: nodes are dicts with 'name' key
content_case2 = {
    'task_nodes': [
        {'task': {'name': 'named_task_1'}},
        {'task': {'name': 'named_task_2'}},
        {'task': {'name': 'named_task_3'}}
    ]
}

# Use case 1 as the primary test case
ARGS = {
    'content': content_case1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
reload_best_model Ran
ran; our contract draft was wrong, not the code
wxxshirley/gnn4taskplan/GraphToken/ckpt.py
code served (permissive licence) · get_code("9e57449c81b431e3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned MinimalModel. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from unittest.mock import MagicMock, patch
import os
import tempfile

torch.manual_seed(0)

# Create a minimal model
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create a minimal args object
class Args:
    def __init__(self):
        self.output_dir = tempfile.gettempdir()
        self.dataset = 'test_dataset'
        self.llm = 'test_llm'
        self.gnn_type = 'test_gnn'
        self.num_epochs = 10

# Create model instance
model = MinimalModel()

# Create checkpoint directory structure and save a dummy checkpoint
args = Args()
checkpoint_dir = os.path.join(args.output_dir, args.dataset, args.llm)
os.makedirs(checkpoint_dir, exist_ok=True)

# Save a checkpoint with the model state
checkpoint_path = os.path.join(checkpoint_dir, f'{args.gnn_type}_Epoch{args.num_epochs}_checkpoint_best.pth')
checkpoint = {
    'model': model.state_dict()
}
torch.save(checkpoint, checkpoint_path)

ARGS = {
    'model': model,
    'args': args
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MinimalModel — a MinimalModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MinimalModel output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
reload_model Ran
ran; our contract draft was wrong, not the code
wxxshirley/gnn4taskplan/GraphToken/ckpt.py
code served (permissive licence) · get_code("088b24f39a001de5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned SimpleModel. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import tempfile
import os

torch.manual_seed(0)

# Create a simple model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create model instance
model = SimpleModel()

# Create a checkpoint with model state dict
checkpoint_dir = tempfile.gettempdir()
checkpoint_path = os.path.join(checkpoint_dir, 'test_checkpoint.pt')

# Save a checkpoint with the expected structure
checkpoint = {
    'model': model.state_dict()
}
torch.save(checkpoint, checkpoint_path)

# Define arguments
ARGS = {
    'model': model,
    'checkpoint_path': checkpoint_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_llm_response Not yet run
unverified (harvested, no recorded run)
wxxshirley/gnn4taskplan/trainfree/graphsearch.py
code served (permissive licence) · get_code("636c719f3c82b366")
How it ran

no invocation recorded.

prompt_llm_candidate_tool_scores Not yet run
unverified (harvested, no recorded run)
wxxshirley/gnn4taskplan/trainfree/graphsearch.py
code served (permissive licence) · get_code("16f90924fc5c87be")
How it ran

no invocation recorded.

prompt_llm_final_solutions Not yet run
unverified (harvested, no recorded run)
wxxshirley/gnn4taskplan/trainfree/graphsearch.py
code served (permissive licence) · get_code("c4799a004d7c8690")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 13 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Task planning in language agents is emerging as an important research topic alongside the development of large language models (LLMs). It aims to break down complex user requests in natural language into solvable sub-tasks, thereby fulfilling the original requests. In this context, the sub-tasks can be naturally viewed as a graph, where the nodes represent the sub-tasks, and the edges denote the dependencies among them. Consequently, task planning is a decision-making problem that involves selecting a connected path or subgraph within the corresponding graph and invoking it. In this paper, we explore graph learning-based methods for task planning, a direction that is orthogonal to the prevalent focus on prompt design. Our interest in graph learning stems from a theoretical discovery: the biases of attention and auto-regressive loss impede LLMs' ability to effectively navigate decision-making on graphs, which is adeptly addressed by graph neural networks (GNNs). This theoretical insight led us to integrate GNNs with LLMs to enhance overall performance. Extensive experiments demonstrate that GNN-based methods surpass existing solutions even without training, and minimal training can further enhance their performance. The performance gain increases with a larger task graph size. 3 * denotes equal contributions. Work was done during Xixi Wu's (

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2405.19119")
get_code_for_paper("2405.19119")
have("2405.19119")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2405.19119.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2405.19119.svg)](https://syntology.ai/paper/2405.19119)

Connect an agent — have() is free.