SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.07040 · IJCAI · 2024

All in One: Multi-Task Prompting for Graph Neural Networks

Bo Liu, Hong Cheng, Jia Li, Xiangguo Sun, Jihong Guan

arXiv · PDF · Open in the Atlas

Code that ran

5 of 5 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (4 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 1 failure of our instrument; 0 no recorded run), measured 2026-11-22; 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/2403.07040.json · badge: /api/ran/2403.07040.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
sheldonresearch/ProG community
Papers with Code archive
5 ran · 0 no recorded run
FunctionStatusWhere it lives
averageemb Ran
ran; our contract draft was wrong, not the code
sheldonresearch/ProG/prompt_graph/prompt/MultiGprompt.py
code served (permissive licence) · get_code("3dac3e96855f63bd")
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 Tensor, ndim 2, dtype family float, shape (3, 4) 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)

# Construct arguments for averageemb function
# index: tensor of class labels for each sample
# input: tensor of embeddings (batch_size, embedding_dim)
# label_num: number of unique classes

batch_size = 2
embedding_dim = 4
label_num = 3

# Create index tensor with class labels
index = torch.tensor([0, 1])

# Create input embeddings tensor
input = torch.randn(batch_size, embedding_dim)

ARGS = {
    "index": index,
    "input": input,
    "label_num": label_num
}
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 Tensor, ndim 2, dtype family float, shape (3, 4) — shape (3, 4) 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
downprompt Ran
ran on a synthesized input · constructed an object; no result was computed
sheldonresearch/ProG/prompt_graph/prompt/MultiGprompt.py
code served (permissive licence) · get_code("d6d5e15009f0236f")
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 an instance of its own class, downprompt: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

# Small dimensions for testing
ft_in = 4  # feature input dimension
nb_classes = 3  # number of classes
batch_size = 2

# Create prompt tensors (3 prompts concatenated together, so each is ft_in dimensional)
prompt1 = torch.randn(1, ft_in)
prompt2 = torch.randn(1, ft_in)
prompt3 = torch.randn(1, ft_in)

# Create device
device = torch.device('cpu')

# Create parameter a4
a4 = 0.5

ARGS = {
    'prompt1': prompt1,
    'prompt2': prompt2,
    'prompt3': prompt3,
    'a4': a4,
    'ft_in': ft_in,
    'nb_classes': nb_classes,
    'device': device
}
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 downprompt — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a downprompt 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
downstreamprompt Ran
ran on a synthesized input · constructed an object; no result was computed
sheldonresearch/ProG/prompt_graph/prompt/MultiGprompt.py
code served (permissive licence) · get_code("6a4f6577ca85e535")
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 an instance of its own class, downstreamprompt: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

# The function only uses hid_units in __init__ to create a weight parameter
# The forward method expects graph_embedding to be a tensor that can be multiplied by weight
# weight has shape (1, hid_units), so graph_embedding should have compatible shape

hid_units = 4
model = nn.Module()

# Create a small graph_embedding tensor with shape (2, 4) for batch size 2, hidden units 4
graph_embedding = torch.randn(2, 4)

ARGS = {
    "hid_units": hid_units,
}
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 downstreamprompt — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a downstreamprompt 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
weighted_feature Ran
ran on a synthesized input · constructed an object; no result was computed
sheldonresearch/ProG/prompt_graph/prompt/MultiGprompt.py
code served (permissive licence) · get_code("ef4309c038c1da38")
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 an instance of its own class, weighted_feature: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

# Create a weighted_feature instance with weightednum=2
weightednum = 2
model = nn.Module()

# Create sample graph embeddings with batch size 2 and embedding dimension 4
graph_embedding1 = torch.randn(2, 4)
graph_embedding2 = torch.randn(2, 4)

ARGS = {
    'weightednum': weightednum,
}
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 weighted_feature — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a weighted_feature 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
weighted_prompt Ran
ran on a synthesized input · constructed an object; no result was computed
sheldonresearch/ProG/prompt_graph/prompt/MultiGprompt.py
code served (permissive licence) · get_code("9500ee66e9aca23d")
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 an instance of its own class, weighted_prompt: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

class weighted_prompt(nn.Module):

    def __init__(self, weightednum):
        super().__init__()
        self.weight = nn.Parameter(torch.FloatTensor(1, weightednum), requires_grad=True)
        self.act = nn.ELU()
        self.reset_parameters()

    def reset_parameters(self):
        self.weight[0][0].data.fill_(0.5)
        self.weight[0][1].data.fill_(0.4)
        self.weight[0][2].data.fill_(0.3)

    def forward(self, graph_embedding):
        graph_embedding = torch.mm(self.weight, graph_embedding)
        return graph_embedding


# Create a valid instance of weighted_prompt
model = weighted_prompt(weightednum=3)

# Create a graph_embedding tensor that can be used with torch.mm
# self.weight is (1, 3), so graph_embedding must be (3, N)
# Using a small tensor with shape (3, 4)
graph_embedding = torch.randn(3, 4)

ARGS = {
    "weightednum": 3
}
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 weighted_prompt — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a weighted_prompt 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

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 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 5 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-22.

Repositories linked to this paper

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

Abstract

This paper is an extended abstract of our original work published in KDD23, where we won the best research paper award. The paper introduces a novel approach to bridging the gap between pretrained graph models and the diverse tasks they're applied to, inspired by the success of prompt learning in NLP. Recognizing the challenge of aligning pre-trained models with varied graph tasks (node level, edge level, and graph level), which can lead to negative transfer and poor performance, we propose a multi-task prompting method for graphs. This method involves unifying graph and language prompt formats, enabling NLP's prompting strategies to be adapted for graph tasks. By analyzing the task space of graph applications, we reformulate problems to fit graph-level tasks and apply meta-learning to improve prompt initialization for multiple tasks. Experiments show our method's effectiveness in enhancing model performance across different graph tasks. Beyond the original work, in this extended abstract, we further discuss the graph prompt from a bigger picture and provide some of the latest work toward this area. * The original paper was published in KDD23

For agents

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

get_harvested_code_for_paper("2403.07040")
get_code_for_paper("2403.07040")
have("2403.07040")

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

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

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

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

Connect an agent — have() is free.