SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.11790 · ICLR · 2023

FoSR: First-order spectral rewiring for addressing oversquashing in GNNs

Guido Montúfar, Kedar Karhadkar, Pradeep Kr, Mpi Banerjee, Mis

arXiv · PDF · Open in the Atlas

Code that ran

11 of 11 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, 0 violated it and 4 have no contract verdict; 6 failures of our instrument; 0 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/2210.11790.json · badge: /api/ran/2210.11790.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
kedar2/FoSR marked official in Papers with Code
Papers with Code archive
6 ran · 0 no recorded run
harel147/REFine community (classifier label)
classifier basis not recorded on the link
5 ran · 0 no recorded run
FunctionStatusWhere it lives
_edge_rewire Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
kedar2/FoSR/preprocessing/fosr.py
pointer only (licence: NONE) · get_code("8da3844af3011078")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, kedar2/FoSR 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.

add_edge Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
kedar2/FoSR/preprocessing/fosr.py
pointer only (licence: NONE) · get_code("8253415b0d9f44f0")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, kedar2/FoSR 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.

adj_matrix_multiply Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
kedar2/FoSR/preprocessing/fosr.py
pointer only (licence: NONE) · get_code("4240dff02339db3f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, kedar2/FoSR 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.

choose_edge_to_add Ran
ran, honoured the contract we drafted
kedar2/FoSR/preprocessing/fosr.py
pointer only (licence: NONE) · get_code("063fa9897760a77f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, kedar2/FoSR 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.

compute_degrees Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
kedar2/FoSR/preprocessing/fosr.py
pointer only (licence: NONE) · get_code("64f9409122eaca34")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, kedar2/FoSR 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.

compute_kernel_data Ran
ran on a synthesized input
harel147/REFine/algorithms/refine/REFine.py
code served (permissive licence) · get_code("511ae6a831d944f3")
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 2, dtype family float, shape (5, 5) 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
from scipy.spatial.distance import pdist, squareform

# Create sample data: 5 samples with 3 features each
np.random.seed(0)
data = np.random.randn(5, 3).astype(np.float64)

ARGS = {
    'data': data,
    'metric': 'euclidean',
    'eps': 0.01
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (5, 5) — shape (5, 5) 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
cut_graph_by_cutoff Ran
ran; our contract draft was wrong, not the code
harel147/REFine/algorithms/borf/util.py
code served (permissive licence) · get_code("ea8c61a8a9111315")
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 networkx as nx

# Create a simple NetworkX graph with weighted edges
G_origin = nx.Graph()

# Add nodes
G_origin.add_node(1)
G_origin.add_node(2)
G_origin.add_node(3)
G_origin.add_node(4)

# Add edges with weight attribute
G_origin.add_edge(1, 2, weight=0.5)
G_origin.add_edge(2, 3, weight=1.5)
G_origin.add_edge(3, 4, weight=2.0)
G_origin.add_edge(1, 4, weight=0.8)

# Set up arguments
ARGS = {
    'G_origin': G_origin,
    'cutoff': 1.0,
    'weight': 'weight'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx — 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
edge_rewire Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
kedar2/FoSR/preprocessing/fosr.py
pointer only (licence: NONE) · get_code("c73dc9f34fc49fed")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, kedar2/FoSR 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.

kernel_to_edge_index_and_edge_weight Ran
ran on a synthesized input
harel147/REFine/algorithms/refine/REFine.py
code served (permissive licence) · get_code("ee0c1b3c7efe196a")
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

torch.manual_seed(0)

# The function expects a kernel (a 2D tensor with sparse structure)
# It calls .nonzero(as_tuple=False) and indexes into it with [row, col]
# So we need a 2D tensor with some zero and non-zero values

kernel = torch.tensor([
    [1.0, 0.0, 2.0, 0.0],
    [0.0, 3.0, 0.0, 4.0],
    [5.0, 0.0, 0.0, 6.0],
    [0.0, 0.0, 7.0, 0.0]
])

ARGS = {
    "kernel": kernel
}
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 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
print_max_min_cluster_sizes Ran
ran on a synthesized input
harel147/REFine/algorithms/utils.py
code served (permissive licence) · get_code("f882e1c03fbe1140")
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)

class MockCluster:
    """Stand-in class for a cluster object with an x attribute."""
    def __init__(self, num_nodes):
        self.x = torch.randn(num_nodes, 4)

cluster_data = [
    MockCluster(5),
    MockCluster(3),
    MockCluster(8),
    MockCluster(2),
]

ARGS = {
    'cluster_data': cluster_data,
}
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 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
symmetric_normalize_tensor Ran
ran on a synthesized input
harel147/REFine/algorithms/refine/REFine.py
code served (permissive licence) · get_code("94b99f56c5136410")
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 (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)

# Create a small symmetric matrix for testing
# The function performs symmetric row normalization
# We'll create a 4x4 matrix with positive values
mx = torch.tensor([
    [2.0, 1.0, 0.5, 0.0],
    [1.0, 3.0, 1.0, 0.5],
    [0.5, 1.0, 2.0, 1.0],
    [0.0, 0.5, 1.0, 1.5]
], dtype=torch.float32)

ARGS = {
    "mx": mx
}
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 (4, 4) — shape (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

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 4 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 3 later) and 7 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
add_edge
brick of this paper's assembly: helper
1 other paper
1 later
2406.03671 (2024-06)
PANDA: Expanded Width-Aware Message Passing Beyond Rewiring
choose_edge_to_add
brick of this paper's assembly: helper
1 other paper
1 later
2406.03671 (2024-06)
PANDA: Expanded Width-Aware Message Passing Beyond Rewiring
compute_degrees
brick of this paper's assembly: helper
1 other paper
1 later
2406.03671 (2024-06)
PANDA: Expanded Width-Aware Message Passing Beyond Rewiring
cut_graph_by_cutoff 1 other paper
1 dated earlier
1907.03993 (2019-07)
Community Detection on Networks with Ricci Flow

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

Graph neural networks (GNNs) are able to leverage the structure of graph data by passing messages along the edges of the graph. While this allows GNNs to learn features depending on the graph structure, for certain graph topologies it leads to inefficient information propagation and a problem known as oversquashing. This has recently been linked with the curvature and spectral gap of the graph. On the other hand, adding edges to the message-passing graph can lead to increasingly similar node representations and a problem known as oversmoothing. We propose a computationally efficient algorithm that prevents oversquashing by systematically adding edges to the graph based on spectral expansion. We combine this with a relational architecture, which lets the GNN preserve the original graph structure and provably prevents oversmoothing. We find experimentally that our algorithm outperforms existing graph rewiring methods in several graph classification tasks.

For agents

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

get_harvested_code_for_paper("2210.11790")
get_code_for_paper("2210.11790")
have("2210.11790")

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

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

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

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

Connect an agent — have() is free.