SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2204.01613 · ICML · 2022

SPECTRE: Spectral Conditioning Helps to Overcome the Expressivity Limits of One-shot Graph Generators

Andreas Loukas, Roger Wattenhofer, Nathanaël Perraudin, Karolis Martinkus

arXiv · PDF · Open in the Atlas

Code that ran

8 of 8 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 1 has no contract verdict; 5 failures of our instrument; 0 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/2204.01613.json · badge: /api/ran/2204.01613.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
KarolisMart/SPECTRE canonical (classifier label)
classifier basis not recorded on the link
8 ran · 0 no recorded run
FunctionStatusWhere it lives
clean_graphs Ran
ran; our contract draft was wrong, not the code
KarolisMart/SPECTRE/util/eval_helper.py
code served (permissive licence) · get_code("4c2a0e8f2404dcfb")
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 tuple. 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 numpy as np
from random import shuffle

# Create small stand-in graph objects
# The function expects graph_real and graph_pred to be lists of graphs
# where each graph has a len() method (used in: len(graph_real[i]))
# We'll represent graphs as simple lists

graph_real = [
    [1, 2, 3],           # graph with 3 nodes
    [1, 2, 3, 4, 5],     # graph with 5 nodes
    [1, 2],              # graph with 2 nodes
]

graph_pred = [
    [10, 11, 12, 13],    # graph with 4 nodes
    [20, 21],            # graph with 2 nodes
    [30, 31, 32, 33, 34, 35],  # graph with 6 nodes
]

ARGS = {
    "graph_real": graph_real,
    "graph_pred": graph_pred,
    "npr": None,
}
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 tuple — a tuple output has no array shape of its own; none is 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
degree_worker Ran
ran; our contract draft was wrong, not the code
KarolisMart/SPECTRE/util/eval_helper.py
code served (permissive licence) · get_code("2830d89cd6960c9d")
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 ndarray, ndim 1, dtype family int, shape (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 numpy as np
import networkx as nx

# Create a simple graph for testing
G = nx.Graph()
G.add_edges_from([(0, 1), (1, 2), (2, 3), (3, 0), (1, 3)])

ARGS = {
    "G": G
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family int, shape (4,) — shape (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
discretize Ran
ran; our contract draft was wrong, not the code
KarolisMart/SPECTRE/util/model_helper.py
code served (permissive licence) · get_code("e97fe300b007fc38")
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 3, dtype family float, shape (2, 4, 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
import torch.distributions as td

torch.manual_seed(0)

# Create a small adjacency matrix
# Shape: (batch=2, nodes=4, nodes=4)
# Values should be in [0, 1] for Bernoulli probabilities
A = torch.rand(2, 4, 4)

temperature = 2.0 / 3.0
hard = False

ARGS = {
    "A": A,
    "temperature": temperature,
    "hard": hard,
}
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 3, dtype family float, shape (2, 4, 4) — shape (2, 4, 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
find_nearest_idx Ran
ran, honoured the contract we drafted
KarolisMart/SPECTRE/util/eval_helper.py
code served (permissive licence) · get_code("a39feeeaa3cceac3")
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 int64, ndim 0, dtype family int, 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 numpy as np

# Create a numpy array with some sample values
array = np.array([1.2, 3.5, 5.8, 7.1, 9.3])

# Create a value to search for
value = 5.5

# Construct the ARGS dictionary
ARGS = {
    "array": array,
    "value": value
}
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 int64, ndim 0, dtype family int, 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
l2 Ran
ran, honoured the contract we drafted
KarolisMart/SPECTRE/util/dist_helper.py
pointer only (licence: MIT); the stored copy get_code serves, from lf-wen/hgdm, is pointer only (licence: NONE) · get_code("039fc6561a9516bc")
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 lf-wen/hgdm, 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.

n_community Ran
ran on a synthesized input
KarolisMart/SPECTRE/data.py
code served (permissive licence) · get_code("74ede2585b6c1835")
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 Graph. 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 numpy as np
import networkx as nx

# Set seed for reproducibility
np.random.seed(0)

ARGS = {
    "num_communities": 3,
    "max_nodes": 30,
    "p_inter": 0.05
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Graph — a Graph output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Graph output the recorded ndim 1 and dtype family int 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
rand_rot Ran
ran; our contract draft was wrong, not the code
KarolisMart/SPECTRE/util/model_helper.py
code served (permissive licence) · get_code("cb85ea32090da15f")
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 3, dtype family float, shape (2, 4, 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 a matrix tensor: shape (..., n, m) where n and m are square dimensions
# Using shape (2, 4, 4) for batch size 2, 4x4 matrices
matrix = torch.randn(2, 4, 4, dtype=torch.float32)

# Construct a mask tensor with compatible shape
# The function uses mask for element-wise multiplication on (..., n, m) shaped tensors
# Shape should match or be broadcastable to (2, 4, 4)
mask = torch.ones(2, 4, 4, dtype=torch.float32)

# Variance parameter for controlling noise magnitude
variance = 0.1

# Boolean flag for whether to apply right-side noise
right_noise = False

ARGS = {
    "matrix": matrix,
    "mask": mask,
    "variance": variance,
    "right_noise": right_noise,
}
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 3, dtype family float, shape (2, 4, 4) — shape (2, 4, 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
zero_diag Ran
ran; our contract draft was wrong, not the code
KarolisMart/SPECTRE/util/model_helper.py
code served (permissive licence) · get_code("56dc6197e373d95c")
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 3, dtype family float, shape (2, 4, 3) 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)

# Create a simple matrix tensor
# Using distinct sizes (4x3) to make dimensions unambiguous
matrix = torch.randn(2, 4, 3)

ARGS = {
    "matrix": matrix
}
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 3, dtype family float, shape (2, 4, 3) — shape (2, 4, 3) 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

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 7 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 7 later) and 1 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
l2 10 other papers
1 dated earlier, 9 later
1910.00760 (2019-10)
Efficient Graph Generation with Graph Recurrent Attention Networks
2305.19337 (2023-05)
HiGen: Hierarchical Graph Generative Networks
2306.07618 (2023-06)
Hyperbolic Graph Diffusion Model
and 7 more not named here
degree_worker 6 other papers
1 dated earlier, 5 later
1910.00760 (2019-10)
Efficient Graph Generation with Graph Recurrent Attention Networks
2305.19337 (2023-05)
HiGen: Hierarchical Graph Generative Networks
2312.17397 (2023-12)
Classifier-free graph diffusion for molecular property targeting
and 3 more not named here
find_nearest_idx 3 other papers
2 dated earlier, 1 later
1802.08773 (2018-02)
GraphRNN: Generating Realistic Graphs with Deep Auto-regressive Models
1910.00760 (2019-10)
Efficient Graph Generation with Graph Recurrent Attention Networks
2305.19337 (2023-05)
HiGen: Hierarchical Graph Generative Networks
clean_graphs 2 other papers
1 dated earlier, 1 later
1910.00760 (2019-10)
Efficient Graph Generation with Graph Recurrent Attention Networks
2305.19337 (2023-05)
HiGen: Hierarchical Graph Generative Networks
discretize 1 other paper
1 later
2408.16457 (2024-08)
HYGENE: A Diffusion-based Hypergraph Generation Method
rand_rot 1 other paper
1 later
2408.16457 (2024-08)
HYGENE: A Diffusion-based Hypergraph Generation Method
zero_diag 1 other paper
1 later
2408.16457 (2024-08)
HYGENE: A Diffusion-based Hypergraph Generation Method

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

We approach the graph generation problem from a spectral perspective by first generating the dominant parts of the graph Laplacian spectrum and then building a graph matching these eigenvalues and eigenvectors. Spectral conditioning allows for direct modeling of the global and local graph structure and helps to overcome the expressivity and mode collapse issues of one-shot graph generators. Our novel GAN, called SPECTRE, enables the one-shot generation of much larger graphs than previously possible with one-shot models. SPECTRE outperforms state-of-the-art deep autoregressive generators in terms of modeling fidelity, while also avoiding expensive sequential generation and dependence on node ordering. A case in point, in sizable synthetic and real-world graphs SPECTRE achieves a 4-to-170 fold improvement over the best competitor that does not overfit and is 23-to-30 times faster than autoregressive generators.

For agents

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

get_harvested_code_for_paper("2204.01613")
get_code_for_paper("2204.01613")
have("2204.01613")

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

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

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

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

Connect an agent — have() is free.