SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2607.10804 · 2026

When does distribution shift break graph neural networks calibration?

Abderaouf Bahi

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 (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 2 failures of our instrument; 0 no recorded run), measured 2026-11-24; 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/2607.10804.json · badge: /api/ran/2607.10804.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
AraoufBh/GNN-Calibration community
Papers with Code archive
5 ran · 0 no recorded run
FunctionStatusWhere it lives
_binned_cal_loss Ran
ran; our contract draft was wrong, not the code
AraoufBh/GNN-Calibration/code/stac.py
code served (permissive licence) · get_code("1c6ce2d093d8cbff")
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 float64, ndim 0, dtype family float, 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 numpy arrays for confidence scores and correctness proxy
np.random.seed(0)

# Generate confidence scores (between 0 and 1)
conf = np.random.uniform(0, 1, size=8)

# Generate correctness proxy q (between 0 and 1)
q = np.random.uniform(0, 1, size=8)

# n_bins parameter
n_bins = 15

ARGS = {
    "conf": conf,
    "q": q,
    "n_bins": n_bins,
}
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 float64, ndim 0, dtype family float, 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
_standardize Ran
ran, honoured the contract we drafted
AraoufBh/GNN-Calibration/code/stac.py
code served (permissive licence) · get_code("aace96845af47824")
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 (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 numpy as np

# _standardize takes a single parameter 'cols' which should be a list/sequence of arrays
# The function stacks them along axis=1, converts to float, computes mean and std
# So cols should be a list of 1D arrays (columns)

# Create a list of small 1D numpy arrays to use as columns
col1 = np.array([1.0, 2.0, 3.0, 4.0])
col2 = np.array([5.0, 6.0, 7.0, 8.0])
col3 = np.array([9.0, 10.0, 11.0, 12.0])

cols = [col1, col2, col3]

ARGS = {
    "cols": cols
}
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 ndarray, ndim 2, dtype family float, shape (4, 3) — shape (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
apply_temp Ran
ran, violated the contract we drafted
AraoufBh/GNN-Calibration/code/stac.py
code served (permissive licence) · get_code("5ff9034d35aa72f6")
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 (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 numpy as np

# Create logits: shape (batch_size=2, num_classes=4)
logits = np.array([
    [1.0, 2.0, 3.0, 4.0],
    [2.5, 1.5, 3.5, 0.5]
], dtype=np.float32)

# Create temperature parameter - test with scalar
T_scalar = 1.5

ARGS = {
    "logits": logits,
    "T": T_scalar
}
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 ndarray, 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
softmax Ran
ran, honoured the contract we drafted
AraoufBh/GNN-Calibration/code/stac.py
code served (permissive licence) · get_code("7ceb8f93a02b4ee3")
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 (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 numpy as np

# Create a small 2D numpy array for Z parameter
# Shape: (2, 4) - batch size 2, 4 features
Z = np.array([
    [1.0, 2.0, 3.0, 4.0],
    [5.0, 6.0, 7.0, 8.0]
], dtype=np.float32)

ARGS = {
    "Z": Z
}
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 ndarray, 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
stac_pernode Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
AraoufBh/GNN-Calibration/code/stac.py
code served (permissive licence) · get_code("56d449b7902502aa")
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 ndarray, 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 numpy as np

np.random.seed(0)
rng = np.random.RandomState(0)

# Create small synthetic data
batch_size = 2
num_classes = 4
num_features = 6

# logits: (batch_size, num_classes)
logits = rng.randn(batch_size, num_classes).astype(np.float32)

# sig: dict with required keys for feature_set='full'
sig = {
    'inst_feat': rng.randn(batch_size).astype(np.float32),
    'inst_edge': rng.randn(batch_size).astype(np.float32),
    'agree_corr': rng.randn(batch_size).astype(np.float32),
    'entropy': rng.randn(batch_size).astype(np.float32),
    'margin': rng.randn(batch_size).astype(np.float32),
    'logdeg': rng.randn(batch_size).astype(np.float32),
}

# proxy: correctness proxy (batch_size,)
proxy = rng.uniform(0, 1, batch_size).astype(np.float32)

# T_glob: global temperature scalar
T_glob = 1.0

ARGS = {
    'logits': logits,
    'sig': sig,
    'proxy': proxy,
    'T_glob': T_glob,
    'feature_set': 'full',
    'c': 0.5,
    'lam': 0.01,
    'restarts': 2,
    'rng': rng,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 (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

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-24.

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 increasingly deployed in real-world applications where distribution shift is unavoidable. However, how such shifts affect model calibration, defined as the agreement between predictive confidence and actual accuracy, remains poorly understood, and existing graph calibration methods typically rely on labeled validation data from the deployment distribution. In this work, I present the first closed-form theoretical characterization of GNN calibration under distribution shift. I show that calibration is governed by a single scalar quantity that explicitly depends on structural changes between the source and target graphs, as well as feature quality. This characterization precisely identifies when a model becomes over-confident, under-confident, or remains calibrated, and directly yields the optimal temperature scaling strategy. I further extend the analysis to graph convolutional networks with symmetric normalization, multi-class classification, and covariate shift, and derive a theoretical upper bound on the expected calibration error. My analysis also reveals that, under homogeneous distribution shift, a single global temperature is theoretically optimal, providing a principled explanation for why more complex nodewise recalibration methods offer no additional benefit. Building on these theoretical insights, I propose STAC, a source-free, label-free calibration method. Experiments on synthetic benchmarks demonstrate substantial calibration improvements, while evaluations on five real-world graph datasets show that reliable calibration without target labels remains challenging despite the strong predictive power of the theory. These findings identify label-free accuracy estimation under distribution shift as the central unresolved challenge for practical calibration of GNNs and establish a theoretical foundation for future research on trustworthy graph learning. Project details are available at https://github.com/AraoufBh/GNN-Calibration.

For agents

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

get_harvested_code_for_paper("2607.10804")
get_code_for_paper("2607.10804")
have("2607.10804")

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

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

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

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

Connect an agent — have() is free.