SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2104.14210 · 2021

FairDrop: Biased Edge Dropout for Enhancing Fairness in Graph Representation Learning

arXiv · PDF · Open in the Atlas

Code that ran

9 of 9 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; 0 honoured the contract we drafted, 0 violated it and 8 have no contract verdict; 1 failure 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/2104.14210.json · badge: /api/ran/2104.14210.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
juellsprott/graphair-reproducibility community (classifier label)
classifier basis not recorded on the link
9 ran · 0 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran on a synthesized input
juellsprott/graphair-reproducibility/models/fairgraph/utils/utils.py
code served (permissive licence) · get_code("e779655144066b77")
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 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 torch

torch.manual_seed(0)

# The function expects:
# - output: a tensor that can be squeezed and compared with > 0
# - labels: a tensor of labels with len() and eq() method, type_as() method

output = torch.tensor([0.5, -0.3, 0.8, -0.1])
labels = torch.tensor([1, 0, 1, 0])

ARGS = {
    "output": output,
    "labels": labels,
}
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 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
adv_loss_function Ran
ran on a synthesized input
juellsprott/graphair-reproducibility/models/fairgraph/method/fairadj/optimizer.py
code served (permissive licence) · get_code("8e3a0d2dfc2161dc")
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 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 torch
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# Create a simple adversarial network that takes embeddings and outputs logits
class SimpleAdNet(nn.Module):
    def __init__(self, emb_dim, output_dim):
        super().__init__()
        self.linear = nn.Linear(emb_dim, output_dim)
    
    def forward(self, x):
        return self.linear(x)

# Set up tiny tensors and models
batch_size = 2
emb_dim = 4
num_classes = 3

# Embeddings: (batch_size, emb_dim)
emb = torch.randn(batch_size, emb_dim, dtype=torch.float32)

# Sensitive labels for binary case: (batch_size,)
sensitive_binary = torch.randint(0, 2, (batch_size,), dtype=torch.float32)

# Adversarial network
ad_net = SimpleAdNet(emb_dim=emb_dim, output_dim=1)

# Pos weight for binary cross entropy
pos_weight = torch.tensor([1.5], dtype=torch.float32)

ARGS = {
    "emb": emb,
    "sensitive": sensitive_binary,
    "ad_net": ad_net,
    "binary": True,
    "pos_weight": pos_weight
}
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 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
auc Ran
ran on a synthesized input
juellsprott/graphair-reproducibility/models/fairgraph/utils/utils.py
code served (permissive licence) · get_code("90c475fc06ff234d")
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 float, 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 torch
import numpy as np
from sklearn.metrics import roc_auc_score

torch.manual_seed(0)

# Create sample output tensor (logits/probabilities)
# Shape: (2,) for batch size 2, squeezable to 1D
output = torch.tensor([[0.8], [0.3]], dtype=torch.float32)

# Create sample labels tensor (binary labels 0 or 1)
# Shape: (2,) for batch size 2
labels = torch.tensor([1, 0], dtype=torch.float32)

ARGS = {
    "output": output,
    "labels": labels,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, 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
get_best_params Ran
ran on a synthesized input
juellsprott/graphair-reproducibility/utils.py
code served (permissive licence) · get_code("2698daf68d5b9b59")
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 dict. 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 json
import tempfile
import os

# Create a temporary directory and a mock best_hparams.json file
temp_dir = tempfile.mkdtemp()
hparams_file = os.path.join(temp_dir, 'best_hparams.json')

# Create sample hyperparameters data
hparams_data = {
    "dataset_a": {"learning_rate": 0.001, "batch_size": 32, "epochs": 100},
    "dataset_b": {"learning_rate": 0.0001, "batch_size": 16, "epochs": 50}
}

with open(hparams_file, 'w', encoding='utf-8') as f:
    json.dump(hparams_data, f)

# Change to the temporary directory so the function can find best_hparams.json
original_dir = os.getcwd()
os.chdir(temp_dir)

ARGS = {
    "dataset": "dataset_a"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float 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
loss_function Ran
ran on a synthesized input
juellsprott/graphair-reproducibility/models/fairgraph/method/fairadj/optimizer.py
code served (permissive licence) · get_code("cf61291f93016fe4")
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 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 torch
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors for the function parameters
batch_size = 2
n_nodes = 4
pred_dim = 3
latent_dim = 5

# preds: predictions from model, shape (batch_size, pred_dim)
preds = torch.randn(batch_size, pred_dim)

# labels: binary targets, shape (batch_size, pred_dim)
labels = torch.randint(0, 2, (batch_size, pred_dim)).float()

# mu: mean from VAE encoder, shape (batch_size, latent_dim)
mu = torch.randn(batch_size, latent_dim)

# logvar: log variance from VAE encoder, shape (batch_size, latent_dim)
logvar = torch.randn(batch_size, latent_dim)

# n_nodes: number of nodes (scalar integer)
n_nodes = 4

# norm: normalization weight (scalar float)
norm = 1.0

# pos_weight: positive class weight for BCE, shape (pred_dim,)
pos_weight = torch.ones(pred_dim)

ARGS = {
    "preds": preds,
    "labels": labels,
    "mu": mu,
    "logvar": logvar,
    "n_nodes": n_nodes,
    "norm": norm,
    "pos_weight": pos_weight
}
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 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
preprocess_graph Ran
ran on a synthesized input
juellsprott/graphair-reproducibility/models/fairgraph/method/fairadj/utils.py
code served (permissive licence) · get_code("13d9858ea957f943")
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. 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 scipy.sparse as sp
import torch

torch.manual_seed(0)

# Create a small adjacency matrix (4x4)
# Using a sparse COO format representation
row = np.array([0, 1, 2, 3, 0, 1])
col = np.array([1, 2, 3, 0, 2, 3])
data = np.array([1.0, 1.0, 1.0, 1.0, 1.0, 1.0])
adj = sp.coo_matrix((data, (row, col)), shape=(4, 4))

ARGS = {
    "adj": adj
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, shape (4, 4) — shape (4, 4) as a later run recorded it
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
scipysp_to_pytorchsp Ran
ran on a synthesized input
juellsprott/graphair-reproducibility/models/fairgraph/utils/utils.py
code served (permissive licence) · get_code("c1b78858f7f1c950")
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. 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 scipy.sparse as sp
import torch

torch.manual_seed(0)

# Create a small scipy sparse matrix in COO format
rows = np.array([0, 1, 2, 0])
cols = np.array([0, 1, 2, 3])
data = np.array([1.0, 2.0, 3.0, 4.0])
sp_mx = sp.coo_matrix((data, (rows, cols)), shape=(3, 4))

ARGS = {
    "sp_mx": sp_mx
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, shape (3, 4) — shape (3, 4) as a later run recorded it
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 on a synthesized input
juellsprott/graphair-reproducibility/models/fairgraph/method/fairadj/utils.py
code served (permissive licence) · get_code("ef85e6c6e0154e09")
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. 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 torch
import scipy.sparse as sp

torch.manual_seed(0)

# Create a small scipy sparse matrix
# The function expects a scipy sparse matrix with .tocoo() method
row = np.array([0, 1, 2, 0])
col = np.array([0, 1, 2, 3])
data = np.array([1.0, 2.0, 3.0, 4.0])
sparse_mx = sp.coo_matrix((data, (row, col)), shape=(3, 4))

# Convert to a different sparse format first to test .tocoo() call
sparse_mx = sp.csr_matrix(sparse_mx)

ARGS = {
    "sparse_mx": sparse_mx
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, shape (3, 4) — shape (3, 4) as a later run recorded it
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_to_tuple Ran
ran; our contract draft was wrong, not the code
juellsprott/graphair-reproducibility/models/fairgraph/method/fairadj/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from mocherson/MedGCN, is pointer only (licence: NONE) · get_code("3965c8f8e2d0023e")
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 mocherson/MedGCN, 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.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 1 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
sparse_to_tuple 9 other papers
6 dated earlier, 3 later
1611.07308 (2016-11)
Variational Graph Auto-Encoders
1804.00099 (2018-04)
Graph Convolutional Neural Networks via Scattering
1904.00326 (2019-04)
MedGCN: Medication recommendation and lab test imputation via graph convolutional networks
and 6 more not named here
loss_function 1 other paper
1 dated earlier
1611.07308 (2016-11)
Variational Graph Auto-Encoders

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

Graph representation learning has become a ubiquitous component in many scenarios, ranging from social network analysis to energy forecasting in smart grids. In several applications, ensuring the fairness of the node (or graph) representations with respect to some protected attributes is crucial for their correct deployment. Yet, fairness in graph deep learning remains under-explored, with few solutions available. In particular, the tendency of similar nodes to cluster on several real-world graphs (i.e., homophily) can dramatically worsen the fairness of these procedures. In this paper, we propose a novel biased edge dropout algorithm (FairDrop) to counter-act homophily and improve fairness in graph representation learning. FairDrop can be plugged in easily on many existing algorithms, is efficient, adaptable, and can be combined with other fairness-inducing solutions. After describing the general algorithm, we demonstrate its application on two benchmark tasks, specifically, as a random walk model for producing node embeddings, and to a graph convolutional network for link prediction. We prove that the proposed algorithm can successfully improve the fairness of all models up to a small or negligible drop in accuracy, and compares favourably with existing state-of-the-art solutions. In an ablation study, we demonstrate that our algorithm can flexibly interpolate between biasing towards fairness and an unbiased edge dropout. Furthermore, to better evaluate the gains, we propose a new dyadic group definition to measure the bias of a link prediction task when paired with group-based fairness metrics. In particular, we extend the metric used to measure the bias in the node embeddings to take into account the graph structure.

For agents

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

get_harvested_code_for_paper("2104.14210")
get_code_for_paper("2104.14210")
have("2104.14210")

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

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

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

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

Connect an agent — have() is free.