SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.19337 · ICLR · 2024

HiGen: Hierarchical Graph Generative Networks

Mahdi Karami

arXiv · PDF · Open in the Atlas

Code that ran

9 of 14 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 5 have no contract verdict; 2 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/2305.19337.json · badge: /api/ran/2305.19337.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
karami-m/higen_main canonical (classifier label)
classifier basis: census
9 ran · 5 no recorded run
FunctionStatusWhere it lives
bipartite_subgraph Ran
ran on a synthesized input
karami-m/higen_main/utils/graph_helper.py
code served (permissive licence) · get_code("8f0e33ef95af3a70")
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 torch
import torch.nn as nn

torch.manual_seed(0)

# Create a bipartite graph with:
# - Left side (subset[0]): 5 nodes
# - Right side (subset[1]): 4 nodes
# - Edges connecting them

# Define subset: nodes to keep from left (indices 0,2) and right (indices 1,3)
subset = (torch.tensor([0, 2], dtype=torch.long), torch.tensor([1, 3], dtype=torch.long))

# Define edge_index for bipartite graph
# Left nodes connect to right nodes
# Shape: [2, num_edges]
edge_index = torch.tensor([
    [0, 1, 2, 3, 4],  # left node indices
    [0, 1, 2, 3, 0],  # right node indices
], dtype=torch.long)

# Optional edge attributes
edge_attr = torch.randn(5, 3)  # 5 edges, 3 features each

# Relabel nodes flag
relabel_nodes = False

# Size tuple (num_left_nodes, num_right_nodes)
size = (5, 4)

# Return edge mask flag
return_edge_mask = False

ARGS = {
    "subset": subset,
    "edge_index": edge_index,
    "edge_attr": edge_attr,
    "relabel_nodes": relabel_nodes,
    "size": size,
    "return_edge_mask": return_edge_mask,
}
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 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
clean_graphs Ran
ran; our contract draft was wrong, not the code
karami-m/higen_main/utils/eval_helper.py
code served (permissive licence) · get_code("f5d7e99da0c1815c")
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

def find_nearest_idx(array, value):
    idx = np.abs(array - value).argmin()
    return idx

def clean_graphs(graph_real, graph_pred, npr=None):
    """ Selecting graphs generated that have the similar sizes.
    It is usually necessary for GraphRNN-S version, but not the full GraphRNN model.
    """
    if npr is None:
        shuffle(graph_real)
        shuffle(graph_pred)
    else:
        npr.shuffle(graph_real)
        npr.shuffle(graph_pred)
    real_graph_len = np.array([len(graph_real[i]) for i in range(len(graph_real))])
    pred_graph_len = np.array([len(graph_pred[i]) for i in range(len(graph_pred))])
    pred_graph_new = []
    pred_graph_len_new = []
    for value in real_graph_len:
        pred_idx = find_nearest_idx(pred_graph_len, value)
        pred_graph_new.append(graph_pred[pred_idx])
        pred_graph_len_new.append(pred_graph_len[pred_idx])
    return (graph_real, pred_graph_new)

# Create sample graphs as lists of nodes/adjacency lists
graph_real = [
    [0, 1, 2],
    [0, 1, 2, 3],
    [0, 1]
]

graph_pred = [
    [0, 1, 2, 3],
    [0, 1, 2],
    [0, 1, 2, 3, 4]
]

npr_instance = np.random.RandomState(42)

ARGS = {
    "graph_real": graph_real,
    "graph_pred": graph_pred,
    "npr": npr_instance
}
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
karami-m/higen_main/utils/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
find_nearest_idx Ran
ran, honoured the contract we drafted
karami-m/higen_main/utils/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
get_nll_binomial Ran
ran on a synthesized input
karami-m/higen_main/utils/loss.py
code served (permissive licence) · get_code("e0384a1df050b9d9")
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 1, dtype family float, 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 torch
import numpy as np

torch.manual_seed(0)

# Create small tensors for the function arguments
batch_size = 2
dim_size = 4

# logit: tensor of logit values (mode='logit' is the default)
logit = torch.randn(batch_size, dim_size)

# target: tensor of target counts (must be <= n_trials)
target = torch.randint(0, 5, (batch_size, dim_size)).float()

# n_trials: tensor of number of trials (must be >= target)
n_trials = torch.randint(5, 10, (batch_size, dim_size)).float()

# reduction: one of 'sum', 'mean', or 'none'
reduction = 'mean'

# mode: one of 'logit', 'p', or 'logp'
mode = 'logit'

ARGS = {
    'logit': logit,
    'target': target,
    'n_trials': n_trials,
    'reduction': reduction,
    'mode': mode
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, 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
index_to_mask Ran
ran on a synthesized input
karami-m/higen_main/utils/graph_helper.py
code served (permissive licence) · get_code("9123e2f7b1ebd40b")
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 1, dtype family float, shape (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)

# Construct a small tensor of indices
index = torch.tensor([0, 1, 2, 1, 0], dtype=torch.long)

# Define arguments dict
ARGS = {
    "index": index,
    "size": 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 Tensor, ndim 1, dtype family float, shape (3,) — shape (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
l2 Ran
ran, honoured the contract we drafted
karami-m/higen_main/utils/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.

multinomial_logcoef Ran
ran on a synthesized input
karami-m/higen_main/utils/loss.py
code served (permissive licence) · get_code("fce0c51949e558b0")
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 1, dtype family float, 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 torch

torch.manual_seed(0)

# Analyze the function:
# - target: used in torch.lgamma(target + 1.0), should be a tensor
# - n_trials: used in torch.lgamma(n_trials + 1.0) and coef is created with zeros_like(n_trials), should be a tensor
# - index_scatter: used in scatter_add(0, index_scatter, src=...), should be a 1D index tensor

# Create small tensors
target = torch.tensor([1.0, 2.0, 3.0, 4.0])  # shape (4,)
n_trials = torch.tensor([5.0, 6.0, 7.0, 8.0])  # shape (4,)
index_scatter = torch.tensor([0, 1, 0, 2])  # shape (4,), indices for scatter_add

ARGS = {
    "target": target,
    "n_trials": n_trials,
    "index_scatter": index_scatter,
}
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 1, dtype family float, 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
tril_and_pad Ran
ran on a synthesized input
karami-m/higen_main/utils/graph_helper.py
code served (permissive licence) · get_code("197e6abd0f7bc179")
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 (5, 6) 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.nn.functional as F

torch.manual_seed(0)

# Create a small adjacency matrix (2x4 for distinct dimensions)
adj = torch.randn(2, 4)

# Set padded_size to a value larger than current width
padded_size = 6

# Set zero_rows to pad additional rows
zero_rows = 3

# Set tril_mode to 1 (extract lower triangular with diagonal=-1)
tril_mode = 1

ARGS = {
    'adj': adj,
    'padded_size': padded_size,
    'zero_rows': zero_rows,
    'tril_mode': tril_mode
}
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 (5, 6) — shape (5, 6) 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_augmented_graph Not yet run
unverified (harvested, no recorded run)
karami-m/higen_main/utils/higen_data.py
code served (permissive licence) · get_code("35bbe71eb9169226")
How it ran

no invocation recorded.

get_config Not yet run
unverified (harvested, no recorded run)
karami-m/higen_main/utils/arg_helper.py
code served (permissive licence) · get_code("49ab5476297c74bc")
How it ran

no invocation recorded.

get_nll_multinomial Not yet run
unverified (harvested, no recorded run)
karami-m/higen_main/utils/loss.py
code served (permissive licence) · get_code("2062967daf8ce8e4")
How it ran

no invocation recorded.

parse_arguments Not yet run
unverified (harvested, no recorded run)
karami-m/higen_main/utils/arg_helper.py
code served (permissive licence) · get_code("1409387dce8f1173")
How it ran

no invocation recorded.

update_config_with_defaults Not yet run
unverified (harvested, no recorded run)
karami-m/higen_main/utils/arg_helper.py
code served (permissive licence) · get_code("280ee33168ce8688")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 2 later) and 10 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
2 dated earlier, 8 later
1910.00760 (2019-10)
Efficient Graph Generation with Graph Recurrent Attention Networks
2204.01613 (2022-04)
SPECTRE: Spectral Conditioning Helps to Overcome the Expressivity Limits of One-shot Graph Generators
2306.07618 (2023-06)
Hyperbolic Graph Diffusion Model
and 7 more not named here
degree_worker 6 other papers
2 dated earlier, 4 later
1910.00760 (2019-10)
Efficient Graph Generation with Graph Recurrent Attention Networks
2204.01613 (2022-04)
SPECTRE: Spectral Conditioning Helps to Overcome the Expressivity Limits of One-shot Graph Generators
2312.17397 (2023-12)
Classifier-free graph diffusion for molecular property targeting
and 3 more not named here
find_nearest_idx 3 other papers
3 dated earlier
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
2204.01613 (2022-04)
SPECTRE: Spectral Conditioning Helps to Overcome the Expressivity Limits of One-shot Graph Generators
clean_graphs 2 other papers
2 dated earlier
1910.00760 (2019-10)
Efficient Graph Generation with Graph Recurrent Attention Networks
2204.01613 (2022-04)
SPECTRE: Spectral Conditioning Helps to Overcome the Expressivity Limits of One-shot Graph Generators

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

Most real-world graphs exhibit a hierarchical structure, which is often overlooked by existing graph generation methods. To address this limitation, we propose a novel graph generative network that captures the hierarchical nature of graphs and successively generates the graph sub-structures in a coarse-to-fine fashion. At each level of hierarchy, this model generates communities in parallel, followed by the prediction of cross-edges between communities using separate neural networks. This modular approach enables scalable graph generation for large and complex graphs. Moreover, we model the output distribution of edges in the hierarchical graph with a multinomial distribution and derive a recursive factorization for this distribution. This enables us to generate community graphs with integer-valued edge weights in an autoregressive manner. Empirical studies demonstrate the effectiveness and scalability of our proposed generative model, achieving state-ofthe-art performance in terms of graph quality across various benchmark datasets.

For agents

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

get_harvested_code_for_paper("2305.19337")
get_code_for_paper("2305.19337")
have("2305.19337")

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

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

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

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

Connect an agent — have() is free.