SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.11624 · 2024

Rethinking Fair Graph Neural Networks from Re-balancing

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 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 0 have no contract verdict; 5 failures of our instrument; 1 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/2407.11624.json · badge: /api/ran/2407.11624.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
zhixunlee/fairgb canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
feature_norm Ran
ran, honoured the contract we drafted
zhixunlee/fairgb/data_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from yushundong/bind, is pointer only (licence: NONE) · get_code("89f67681e037b8bd")
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 yushundong/bind, 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.

get_data_info Ran
ran; our contract draft was wrong, not the code
zhixunlee/fairgb/utils.py
code served (permissive licence) · get_code("9f8e6445c859c1ad")
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)

class MockData:
    def __init__(self):
        # Create tensors with appropriate sizes
        batch_size = 8
        
        # y: class labels (0 or 1), shape (batch_size,)
        self.y = torch.tensor([0, 1, 0, 1, 0, 1, 0, 1])
        
        # sens: sensitive attribute (0 or 1), shape (batch_size,)
        self.sens = torch.tensor([0, 0, 1, 1, 0, 1, 0, 1])
        
        # train_mask: boolean mask, shape (batch_size,)
        self.train_mask = torch.tensor([True, True, True, True, False, False, False, False])

data = MockData()
device = 'cpu'

ARGS = {
    'data': data,
    'device': device,
}
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
index_to_mask Ran
ran; our contract draft was wrong, not the code
zhixunlee/fairgb/data_utils.py
code served (permissive licence) · get_code("9ed7d6ea040a9619")
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 (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 torch

torch.manual_seed(0)

# Analyze the function:
# - node_num: int, used as size for torch.zeros and indexing mask
# - index: used to index into the mask tensor, should be a tensor or list of indices

node_num = 5
index = torch.tensor([0, 2, 4])

ARGS = {
    "node_num": node_num,
    "index": index,
}
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 (5,) — shape (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
saliency_mixup Ran
ran; our contract draft was wrong, not the code
zhixunlee/fairgb/mixup.py
code served (permissive licence) · get_code("b91a123dbb6ccb0e")
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 (3, 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 arguments for saliency_mixup
x = torch.randn(2, 4)  # batch_size=2, feature_dim=4
sampling_src_idx = torch.tensor([0])  # indices for source samples
sampling_dst_idx = torch.tensor([1])  # indices for destination samples
lam = torch.tensor([0.6])  # mixing coefficient

ARGS = {
    'x': x,
    'sampling_src_idx': sampling_src_idx,
    'sampling_dst_idx': sampling_dst_idx,
    'lam': lam
}
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 (3, 4) — shape (3, 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
sampling_idx_individual_dst Ran
ran; our contract draft was wrong, not the code
zhixunlee/fairgb/mixup.py
code served (permissive licence) · get_code("add89ac96bd47bdc")
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, ndim 2, dtype family int; 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 numpy as np

torch.manual_seed(0)
np.random.seed(0)

# Analyze the function:
# - group_num_list: list of integers (group sizes), indexed by target_group_id (0-3)
# - idx_info: list of tensors, one per group (4 groups total based on n_cls=2, n_grp=2)
# - eta: float parameter for probability threshold
# The function samples indices from groups based on inter/intra logic

# group_num_list needs 4 elements (for 2x2 groups)
# Each element is the size of that group
group_num_list = [5, 6, 7, 8]

# idx_info needs 4 tensors, one for each group
# Each tensor contains the actual indices for that group
# The tensors should have lengths matching group_num_list
idx_info = [
    torch.arange(0, 5),      # group 0: 5 indices
    torch.arange(5, 11),     # group 1: 6 indices
    torch.arange(11, 18),    # group 2: 7 indices
    torch.arange(18, 26),    # group 3: 8 indices
]

eta = 0.5

ARGS = {
    "group_num_list": group_num_list,
    "idx_info": idx_info,
    "eta": eta,
}
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 tuple, ndim 2, dtype family int — 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
sparse_mx_to_torch_sparse_tensor Ran
ran; our contract draft was wrong, not the code
zhixunlee/fairgb/data_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from yimengmin/geometricscatteringmaximalclique, is pointer only (licence: NONE) · get_code("bdc1f1dad6d978e7")
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 yimengmin/geometricscatteringmaximalclique, 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.

get_enc_cls_opt Not yet run
unverified (harvested, no recorded run)
zhixunlee/fairgb/utils.py
code served (permissive licence) · get_code("ee45556bce3d5091")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 1 the same month, 1 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.

FunctionAlso present inEarliest-datedOthers named
sparse_mx_to_torch_sparse_tensor 32 other papers
27 dated earlier, 2 the same month, 2 later, 1 same year, order not determinable · 4 only as an assembly brick
1806.09055 (2018-06)
DARTS: Differentiable Architecture Search
1902.07153 (2019-02)
Simplifying Graph Convolutional Networks
2002.01633 (2020-02)
Structural Deep Clustering Network
and 29 more not named here
feature_norm 1 other paper
1 dated earlier
2211.14383 (2022-11)
Interpreting Unfairness in Graph Neural Networks via Training Node Attribution

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

Driven by the powerful representation ability of Graph Neural Networks (GNNs), plentiful GNN models have been widely deployed in many real-world applications. Nevertheless, due to distribution disparities between different demographic groups, fairness in high-stake decision-making systems is receiving increasing attention. Although lots of recent works devoted to improving the fairness of GNNs and achieved considerable success, they all require significant architectural changes or additional loss functions requiring more hyper-parameter tuning. Surprisingly, we find that simple re-balancing methods can easily match or surpass existing fair GNN methods. We claim that the imbalance across different demographic groups is a significant source of unfairness, resulting in imbalanced contributions from each group to the parameters updating. However, these simple re-balancing methods have their own shortcomings during training. In this paper, we propose FairGB, Fair Graph Neural Network via re-Balancing, which mitigates the unfairness of GNNs by group balancing. Technically, FairGB consists of two modules: counterfactual node mixup and contribution alignment loss. Firstly, we select counterfactual pairs across inter-domain and inter-class, and interpolate the ego-networks to generate new samples. Guided by analysis, we can reveal the debiasing mechanism of our model by the causal view and prove that our strategy can make sensitive attributes statistically independent from target labels. Secondly, we reweigh the contribution of each group according to gradients. By combining these two modules, they can mutually promote each other. Experimental results on benchmark datasets show that our method can achieve state-of-the-art results concerning both utility and fairness metrics. Code is available at https://github.com/ZhixunLEE/FairGB.

For agents

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

get_harvested_code_for_paper("2407.11624")
get_code_for_paper("2407.11624")
have("2407.11624")

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

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

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

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

Connect an agent — have() is free.