SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2106.01425 · 2021

GAL: Gradient Assisted Learning for Decentralized Multi-Organization Collaborations

arXiv · PDF · Open in the Atlas

Code that ran

9 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; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 2 failures of our instrument; 2 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/2106.01425.json · badge: /api/ran/2106.01425.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
diaoenmao/GAL-Gradient-Assisted-Learning-for-Decentralized-Multi-Organization-Collaborations canonical (classifier label)
classifier basis: census
9 ran · 2 no recorded run
FunctionStatusWhere it lives
dp Ran
ran on a synthesized input
diaoenmao/GAL-Gradient-Assisted-Learning-for-Decentralized-Multi-Organization-Collaborations/src/privacy.py
code served (permissive licence) · get_code("25a541621c9bfbf6")
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 float, shape (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 numpy as np

np.random.seed(0)

# Create a small continuous-valued numpy vector
y = np.array([1.2, 2.5, 3.1, 4.8, 5.3, 6.7], dtype=np.float32)

ARGS = {
    "y": y,
    "alpha": 0.5
}
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 1, dtype family float, shape (6,) — shape (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
fetch_dataset Ran
ran on a synthesized input
diaoenmao/GAL-Gradient-Assisted-Learning-for-Decentralized-Multi-Organization-Collaborations/src/data.py
code served (permissive licence) · get_code("1842bcd1a9dc7088")
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 torch
import os
from unittest.mock import MagicMock, patch

torch.manual_seed(0)

# Create a mock datasets module with minimal implementations
class MockDataset:
    def __init__(self, root, split):
        self.root = root
        self.split = split
        self.data = torch.randn(2, 4)
        self.targets = torch.randint(0, 2, (2,))
    
    def __len__(self):
        return 2
    
    def __getitem__(self, idx):
        return self.data[idx], self.targets[idx]

class MockCompose:
    def __init__(self, transforms_list):
        self.transforms = transforms_list
    
    def __call__(self, x):
        return x

class MockToTensor:
    def __call__(self, x):
        if isinstance(x, torch.Tensor):
            return x
        return torch.tensor(x, dtype=torch.float32)

class MockTransforms:
    ToTensor = MockToTensor

class MockDatasetsModule:
    def __init__(self):
        self.Compose = MockCompose
        self.ToTensor = MockToTensor
    
    def Blob(self, root, split):
        return MockDataset(root, split)
    
    def Iris(self, root, split):
        return MockDataset(root, split)
    
    def Diabetes(self, root, split):
        return MockDataset(root, split)
    
    def BostonHousing(self, root, split):
        return MockDataset(root, split)
    
    def Wine(self, root, split):
        return MockDataset(root, split)
    
    def BreastCancer(self, root, split):
        return MockDataset(root, split)
    
    def QSAR(self, root, split):
        return MockDataset(root, split)
    
    def MNIST(self, root, split, transform=None):
        return MockDataset(root, split)
    
    def CIFAR10(self, root, split, transform=None):
        return MockDataset(root, split)
    
    def ModelNet40(self, root, split, transform=None):
        return MockDataset(root, split)
    
    def ShapeNet55(self, root, split, transform=None):
        return MockDataset(root, split)
    
    def MIMICL(self, root, split):
        return MockDataset(root, split)
    
    def MIMICM(self, root, split):
        return MockDataset(root, split)

# Patch the datasets module
mock_datasets = MockDatasetsModule()
mock_transforms = MockTransforms()

import sys
sys.modules['datasets'] = mock_datasets
sys.modules['torchvision.transforms'] = mock_transforms

ARGS = {
    'data_name': 'Blob',
    'verbose': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets, torch — 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
gather Ran
ran on a synthesized input
diaoenmao/GAL-Gradient-Assisted-Learning-for-Decentralized-Multi-Organization-Collaborations/src/train_model_al.py
code served (permissive licence) · get_code("b70c15bcf6a12a08")
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 list, ndim 1, dtype family float; 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 torch.nn as nn

torch.manual_seed(0)

# Define a minimal Organization model that has a predict method
class MinimalOrganization(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def predict(self, epoch, data):
        # data is a list of (x, y) tuples
        outputs = []
        for x, y in data:
            output = self.linear(x)
            outputs.append(output)
        # Stack outputs and return dict with 'target' key
        stacked = torch.stack(outputs)
        return {'target': stacked}

# Create data loaders - list of dicts mapping split names to data
# Each split is a list of (input_tensor, target_tensor) tuples
data_loader = [
    {
        'train': [
            (torch.randn(2, 4), torch.randn(2, 3)),
            (torch.randn(2, 4), torch.randn(2, 3))
        ],
        'val': [
            (torch.randn(2, 4), torch.randn(2, 3))
        ]
    },
    {
        'train': [
            (torch.randn(2, 4), torch.randn(2, 3))
        ],
        'val': [
            (torch.randn(2, 4), torch.randn(2, 3))
        ]
    }
]

# Create organization list with minimal Organization instances
organization = [
    MinimalOrganization(),
    MinimalOrganization()
]

# Epoch parameter
epoch = 0

ARGS = {
    'data_loader': data_loader,
    'organization': organization,
    'epoch': epoch
}
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 list, ndim 1, dtype family float — a list 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
input_collate Ran
ran; our contract draft was wrong, not the code
diaoenmao/GAL-Gradient-Assisted-Learning-for-Decentralized-Multi-Organization-Collaborations/src/data.py
code served (permissive licence) · get_code("6fd4f7ea4a79121e")
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 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 torch
import numpy as np
from torch.utils.data.dataloader import default_collate

torch.manual_seed(0)

# Test case 1: batch of dictionaries
batch_dicts = [
    {"input_ids": torch.tensor([1, 2, 3, 4]), "attention_mask": torch.tensor([1, 1, 1, 0])},
    {"input_ids": torch.tensor([5, 6, 7, 8]), "attention_mask": torch.tensor([1, 1, 1, 1])}
]

ARGS = {
    "batch": batch_dicts
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — 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
ip Ran
ran on a synthesized input
diaoenmao/GAL-Gradient-Assisted-Learning-for-Decentralized-Multi-Organization-Collaborations/src/privacy.py
code served (permissive licence) · get_code("445cc557f49a02e5")
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

# Set random seed for reproducibility
np.random.seed(42)

# Create a small numpy vector as input
y = np.array([1.2, 2.5, 3.7, 4.1, 5.3, 6.8, 7.2, 8.9], dtype=np.float32)

# Define arguments dict
ARGS = {
    "y": y,
    "num_thresh": 3,
    "leak": False
}
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
make_controls Ran
ran; our contract draft was wrong, not the code
diaoenmao/GAL-Gradient-Assisted-Learning-for-Decentralized-Multi-Organization-Collaborations/src/process.py
code served (permissive licence) · get_code("d817b1bf3eb37bf5")
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 list, ndim 2, dtype family float; 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 itertools
import torch
import torch.nn as nn

torch.manual_seed(0)

num_experiments = 4
exp = [str(x) for x in list(range(num_experiments))]

# data_names: list of lists of strings
# The function uses itertools.product on this, so it should be a list of lists
data_names = [
    ['dataset_a', 'dataset_b'],
    ['split_train', 'split_test']
]

# model_names: list of lists of strings
# The function uses itertools.product on this, so it should be a list of lists
model_names = [
    ['model_v1', 'model_v2'],
    ['size_small', 'size_large']
]

# control_name: list of lists of lists of strings
# The function iterates through control_name with range(len(control_name))
# and for each i, it does itertools.product(*control_name[i])
# So control_name[i] should be a list of lists
control_name = [
    [['lr_0.001', 'lr_0.01'], ['batch_32', 'batch_64']],
    [['seed_1', 'seed_2'], ['epochs_10', 'epochs_20']]
]

ARGS = {
    'data_names': data_names,
    'model_names': model_names,
    'control_name': control_name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family float — a list 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
make_flops Ran
ran on a synthesized input
diaoenmao/GAL-Gradient-Assisted-Learning-for-Decentralized-Multi-Organization-Collaborations/src/summary.py
code served (permissive licence) · get_code("d953f71ff87c935d")
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 int, 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 torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Create a Conv2d module for testing
conv_module = nn.Conv2d(in_channels=3, out_channels=4, kernel_size=3, bias=True)

# Create input and output tensors
# Input: (batch_size=2, channels=3, height=5, width=5)
input_tensor = torch.randn(2, 3, 5, 5)

# Output: (batch_size=2, channels=4, height=3, width=3)
# After Conv2d with kernel=3, no padding: (5-3+1) = 3
output_tensor = torch.randn(2, 4, 3, 3)

ARGS = {
    "module": conv_module,
    "input": input_tensor,
    "output": output_tensor,
}
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 int, 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
make_privacy Ran
ran on a synthesized input
diaoenmao/GAL-Gradient-Assisted-Learning-for-Decentralized-Multi-Organization-Collaborations/src/privacy.py
code served (permissive licence) · get_code("fd657724d9473791")
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 float, shape (8,) 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

# Set random seed for reproducibility
np.random.seed(0)

# Create a small numpy vector as input
input_vector = np.array([1.2, 2.5, 3.1, 4.8, 5.3, 6.7, 7.2, 8.9])

# Test with 'dp' mode
mode_dp = 'dp'
param_dp = 1.5

# Test with 'ip' mode
mode_ip = 'ip'
param_ip = 3

ARGS = {
    'input': input_vector,
    'mode': mode_dp,
    'param': param_dp
}
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 1, dtype family float, shape (8,) — shape (8,) 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
make_size Ran
ran on a synthesized input
diaoenmao/GAL-Gradient-Assisted-Learning-for-Decentralized-Multi-Organization-Collaborations/src/summary.py
code served (permissive licence) · get_code("8d994cf212a4e904")
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

torch.manual_seed(0)

# The function make_size takes input and output parameters
# It recursively unwraps tuples and calls .size() on the tensor objects
# We need to provide either:
# 1. Two tensors directly, or
# 2. Tuples containing tensors

# Create two tensors with distinct sizes
input_tensor = torch.randn(2, 4)
output_tensor = torch.randn(3, 5)

ARGS = {
    "input": input_tensor,
    "output": output_tensor
}
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, 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
make_control_list Not yet run
unverified (harvested, no recorded run)
diaoenmao/GAL-Gradient-Assisted-Learning-for-Decentralized-Multi-Organization-Collaborations/src/process.py
code served (permissive licence) · get_code("730309c1de9360b6")
How it ran

no invocation recorded.

make_controls Not yet run
unverified (harvested, no recorded run)
diaoenmao/GAL-Gradient-Assisted-Learning-for-Decentralized-Multi-Organization-Collaborations/src/make.py
code served (permissive licence) · get_code("eee61a8bb1e16455")
How it ran

no invocation recorded.

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 (3 with at least one paper dated earlier, 0 the same month, 2 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
input_collate 3 other papers
1 dated earlier, 2 later
2010.01264 (2020-10)
HeteroFL: Computation and Communication Efficient Federated Learning for Heterogeneous Clients
2212.01548 (2022-12)
FedRolex: Model-Heterogeneous Federated Learning with Rolling Sub-Model Extraction
2405.19789 (2024-05)
Estimating before Debiasing: A Bayesian Approach to Detaching Prior Bias in Federated Semi-Supervised Learning
make_controls 1 other paper
1 later
2410.23227 (2024-10)
(FL) 2 : Overcoming Few Labels in Federated Semi-Supervised Learning
make_flops 1 other paper
1 dated earlier
2010.01264 (2020-10)
HeteroFL: Computation and Communication Efficient Federated Learning for Heterogeneous Clients
make_size 1 other paper
1 dated earlier
2010.01264 (2020-10)
HeteroFL: Computation and Communication Efficient Federated Learning for Heterogeneous Clients

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

Collaborations among multiple organizations, such as financial institutions, medical centers, and retail markets in decentralized settings are crucial to providing improved service and performance. However, the underlying organizations may have little interest in sharing their local data, models, and objective functions. These requirements have created new challenges for multi-organization collaboration. In this work, we propose Gradient Assisted Learning (GAL), a new method for multiple organizations to assist each other in supervised learning tasks without sharing local data, models, and objective functions. In this framework, all participants collaboratively optimize the aggregate of local loss functions, and each participant autonomously builds its own model by iteratively fitting the gradients of the overarching objective function. We also provide asymptotic convergence analysis and practical case studies of GAL. Experimental studies demonstrate that GAL can achieve performance close to centralized learning when all data, models, and objective functions are fully disclosed.

For agents

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

get_harvested_code_for_paper("2106.01425")
get_code_for_paper("2106.01425")
have("2106.01425")

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

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

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

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

Connect an agent — have() is free.