SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.02518 · NeurIPS · 2024

Unifying Generation and Prediction on Graphs with Latent Graph Diffusion

Muhan Zhang, Xiyuan Wang, Cai Zhou

arXiv · PDF · Open in the Atlas

Code that ran

8 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; 1 honoured the contract we drafted, 3 violated it and 0 have no contract verdict; 4 failures of our instrument; 5 no recorded run), measured 2026-11-22; 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/2402.02518.json · badge: /api/ran/2402.02518.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
zhouc20/latentgraphdiffusion canonical (classifier label)
classifier basis: census
6 ran · 5 no recorded run
zhouc20/LatentGraphDiffusion canonical (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
FunctionStatusWhere it lives
disabled_train Ran
ran, violated the contract we drafted
zhouc20/LatentGraphDiffusion/lgd/ddpm/LGD.py
code served (permissive licence) · get_code("4cb732f513d69dfd")
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) 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

torch.manual_seed(0)

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

model = SimpleModel()

ARGS = {
    "self": model,
    "mode": True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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_activation Ran
ran; our contract draft was wrong, not the code
zhouc20/latentgraphdiffusion/lgd/layer/Exphormer.py
code served (permissive licence) · get_code("b888018e8acd3f1d")
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) and returned tuple, 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
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'activation': 'relu'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
get_final_pretrained_ckpt Ran
ran; our contract draft was wrong, not the code
zhouc20/latentgraphdiffusion/lgd/finetuning.py
code served (permissive licence) · get_code("1bb331bf70a78136")
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 str. 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 os
import tempfile
import shutil

# Create a temporary directory with checkpoint files
temp_dir = tempfile.mkdtemp()

# Create some checkpoint files with epoch numbers
checkpoint_files = ['1.ckpt', '2.ckpt', '5.ckpt', '3.ckpt']
for ckpt_file in checkpoint_files:
    filepath = os.path.join(temp_dir, ckpt_file)
    with open(filepath, 'w') as f:
        f.write('dummy checkpoint data')

# Define arguments for the function
ARGS = {
    'ckpt_dir': temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
is_seed Ran
ran, violated the contract we drafted
zhouc20/latentgraphdiffusion/lgd/agg_runs.py
pointer only (licence: MIT); the stored copy get_code serves, from sunjss/over-aggregating, is pointer only (licence: NONE) · get_code("c98a702be0660ac9")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from sunjss/over-aggregating, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

is_split Ran
ran, violated the contract we drafted
zhouc20/latentgraphdiffusion/lgd/agg_runs.py
pointer only (licence: MIT); the stored copy get_code serves, from sunjss/over-aggregating, is pointer only (licence: NONE) · get_code("438635c08adfe2aa")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from sunjss/over-aggregating, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

join_list Ran
ran, honoured the contract we drafted
zhouc20/latentgraphdiffusion/lgd/agg_runs.py
pointer only (licence: MIT); the stored copy get_code serves, from sunjss/over-aggregating, is pointer only (licence: NONE) · get_code("40e98e1ecbf39f34")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from sunjss/over-aggregating, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

new_optimizer_config Ran
ran; our contract draft was wrong, not the code
zhouc20/latentgraphdiffusion/pretrain.py
code served (permissive licence) · get_code("585566394225e457")
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 OptimizerConfig. 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.graphgym.config import cfg, set_cfg
from torch_geometric.graphgym.optim import OptimizerConfig

torch.manual_seed(0)

# Create a minimal config object that has the optim attributes the function needs
class MinimalConfig:
    def __init__(self):
        self.optim = MinimalOptimConfig()

class MinimalOptimConfig:
    def __init__(self):
        self.optimizer = "adam"
        self.base_lr = 0.001
        self.weight_decay = 1e-5
        self.momentum = 0.9

cfg_instance = MinimalConfig()

ARGS = {
    "cfg": cfg_instance
}
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 OptimizerConfig — a OptimizerConfig output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OptimizerConfig 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
uniform_on_device Ran
ran; our contract draft was wrong, not the code
zhouc20/LatentGraphDiffusion/lgd/ddpm/LGD.py
code served (permissive licence) · get_code("d48d8354986e3b0e")
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) and returned Tensor, ndim 2, dtype family float, shape (2, 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)

# Analyze the function:
# - r1: used in arithmetic (r1 - r2), should be a scalar or tensor
# - r2: used in arithmetic (r1 - r2), should be a scalar or tensor
# - shape: unpacked with *shape in torch.rand(*shape, device=device), should be a tuple/list of ints
# - device: passed to torch.rand, should be a valid torch device

ARGS = {
    "r1": 2.0,
    "r2": 1.0,
    "shape": (2, 4),
    "device": torch.device("cpu")
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 (2, 4) — shape (2, 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
apply_chunking_to_forward Not yet run
unverified (harvested, no recorded run)
zhouc20/latentgraphdiffusion/lgd/layer/bigbird_layer.py
pointer only (licence: MIT); the stored copy get_code serves, from sunjss/over-aggregating, is pointer only (licence: NONE) · get_code("ae56bcfaae96da3c")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from sunjss/over-aggregating, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

create_model_custom Not yet run
unverified (harvested, no recorded run)
zhouc20/latentgraphdiffusion/pretrain.py
code served (permissive licence) · get_code("7267dc7d02fa739e")
How it ran

no invocation recorded.

init_model_from_pretrained Not yet run
unverified (harvested, no recorded run)
zhouc20/latentgraphdiffusion/lgd/finetuning.py
code served (permissive licence) · get_code("b8ea7231e959f164")
How it ran

no invocation recorded.

load_pretrained_model_cfg Not yet run
unverified (harvested, no recorded run)
zhouc20/latentgraphdiffusion/lgd/finetuning.py
code served (permissive licence) · get_code("28028986fdd293d2")
How it ran

no invocation recorded.

random_mask Not yet run
unverified (harvested, no recorded run)
zhouc20/latentgraphdiffusion/utils.py
code served (permissive licence) · get_code("a7aa470daf7aba0e")
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, 10 are also present in other papers whose code we hold (10 with at least one paper dated earlier, 7 the same month, 10 later) and 3 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.

FunctionAlso present inEarliest-datedOthers named
disabled_train 173 other papers
80 dated earlier, 5 the same month, 80 later, 8 same year, order not determinable · 5 only as an assembly brick
2012.09841 (2020-12)
Taming Transformers for High-Resolution Image Synthesis
2102.05379 (2021-02)
Argmax Flows and Multinomial Diffusion: Learning Categorical Distributions
2104.07652 (2021-04)
Geometry-Free View Synthesis: Transformers and no 3D Priors
and 170 more not named here
uniform_on_device 44 other papers
25 dated earlier, 1 the same month, 15 later, 3 same year, order not determinable
2112.10752 (2021-12)
High-Resolution Image Synthesis with Latent Diffusion Models
2204.06125 (2022-04)
Hierarchical Text-Conditional Image Generation with CLIP Latents
2206.02779 (2022-06)
Blended Latent Diffusion
and 41 more not named here
get_final_pretrained_ckpt 27 other papers
11 dated earlier, 2 the same month, 14 later
2302.04181 (2023-02)
Attending to Graph Transformers
2302.08647 (2023-02)
Multiresolution Graph Transformers and Wavelet Positional Encoding for Learning Hierarchical Structures
2305.08018 (2023-05)
DRew: Dynamically Rewired Message Passing with Delay
and 24 more not named here
apply_chunking_to_forward 21 other papers
10 dated earlier, 2 the same month, 9 later
2002.01685 (2020-02)
Parsing as Pretraining
2210.09545 (2022-10)
Fine-mixing: Mitigating Backdoors in Fine-tuned Language Models
2302.04181 (2023-02)
Attending to Graph Transformers
and 18 more not named here
is_seed 15 other papers
4 dated earlier, 2 the same month, 9 later
2302.04181 (2023-02)
Attending to Graph Transformers
2309.00367 (2023-09)
Where Did the Gap Go? Reassessing the Long-Range Graph Benchmark
2310.19285 (2023-10)
Facilitating Graph Neural Networks with Random Walk on Simplicial Complexes
and 12 more not named here
is_split 15 other papers
4 dated earlier, 2 the same month, 9 later
2302.04181 (2023-02)
Attending to Graph Transformers
2309.00367 (2023-09)
Where Did the Gap Go? Reassessing the Long-Range Graph Benchmark
2310.19285 (2023-10)
Facilitating Graph Neural Networks with Random Walk on Simplicial Complexes
and 12 more not named here
join_list 15 other papers
4 dated earlier, 2 the same month, 9 later
2302.04181 (2023-02)
Attending to Graph Transformers
2309.00367 (2023-09)
Where Did the Gap Go? Reassessing the Long-Range Graph Benchmark
2310.19285 (2023-10)
Facilitating Graph Neural Networks with Random Walk on Simplicial Complexes
and 12 more not named here
load_pretrained_model_cfg 6 other papers
3 dated earlier, 3 later
2305.17589 (2023-05)
Graph Inductive Biases in Transformers without Message Passing
2306.07812 (2023-06)
Automated 3D Pre-Training for Molecular Property Prediction
2310.19285 (2023-10)
Facilitating Graph Neural Networks with Random Walk on Simplicial Complexes
and 3 more not named here
get_activation 5 other papers
2 dated earlier, 3 later
2303.06147 (2023-03)
Exphormer: Sparse Transformers for Graphs
2310.19285 (2023-10)
Facilitating Graph Neural Networks with Random Walk on Simplicial Complexes
2406.05815 (2024-06)
What Can We Learn from State Space Models for Machine Learning on Graphs?
and 2 more not named here
new_optimizer_config 4 other papers
1 dated earlier, 3 later
2305.12322 (2023-05)
Learning Large Graph Property Prediction via Graph Segment Training
2404.03380 (2024-04)
On the Theoretical Expressive Power and the Design Space of Higher-Order Graph Transformers
2405.11951 (2024-05)
Distinguished In Uniform: Self Attention Vs. Virtual Nodes
and 1 more not named here

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

In this paper, we propose the first framework that enables solving graph learning tasks of all levels (node, edge and graph) and all types (generation, regression and classification) using one formulation. We first formulate prediction tasks including regression and classification into a generic (conditional) generation framework, which enables diffusion models to perform deterministic tasks with provable guarantees. We then propose Latent Graph Diffusion (LGD), a generative model that can generate node, edge, and graph-level features of all categories simultaneously. We achieve this goal by embedding the graph structures and features into a latent space leveraging a powerful encoder and decoder, then training a diffusion model in the latent space. LGD is also capable of conditional generation through a specifically designed cross-attention mechanism. Leveraging LGD and the "all tasks as generation" formulation, our framework is capable of solving graph tasks of various levels and types. We verify the effectiveness of our framework with extensive experiments, where our models achieve state-of-the-art or highly competitive results across a wide range of generation and regression tasks.

For agents

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

get_harvested_code_for_paper("2402.02518")
get_code_for_paper("2402.02518")
have("2402.02518")

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

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

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

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

Connect an agent — have() is free.