SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1812.06127 · Conference on Machine Learning and Systems · 2018

Federated Optimization in Heterogeneous Networks

Manzil Zaheer, Ameet Talwalkar, Tian Li, Maziar Sanjabi, Virginia Smith, Anit Kumar Sahu

arXiv · PDF · Open in the Atlas

Code that ran

15 of 26 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (6 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 11 have no contract verdict; 2 failures of our instrument; 11 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/1812.06127.json · badge: /api/ran/1812.06127.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
litian96/FedProx canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
zhuangdizhu/FedGen community
Papers with Code archive
3 ran · 1 no recorded run
Koukyosyumei/AIJack community
Papers with Code archive
1 ran · 2 no recorded run
intel/openfl community
Papers with Code archive
1 ran · 0 no recorded run
morningD/GrouProx community
Papers with Code archive
1 ran · 0 no recorded run
omarfoq/knn-per community
Papers with Code archive
1 ran · 0 no recorded run
omarfoq/fedem community
Papers with Code archive
0 ran · 2 no recorded run
MediaBrain-SJTU/FedLESAM community
Papers with Code archive
0 ran · 2 no recorded run
maxencenoble/Differential-Privacy-for-Heterogeneous-Federated-Learning community
Papers with Code archive
0 ran · 1 no recorded run
woodenchild95/fl-simulator community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
FedAVGAPI Ran
ran on a synthesized input
Koukyosyumei/AIJack/src/aijack/collaborative/fedprox/api.py
code served (permissive licence) · get_code("40b2aface22c3f65")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned NoneType. 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
import torch.optim as optim
from torch.utils.data import DataLoader, TensorDataset
from abc import abstractmethod

class BaseFedAPI:
    """Abstract class for Federated Learning API"""

    @abstractmethod
    def local_train(self):
        pass

    @abstractmethod
    def run(self):
        pass

class FedAVGAPI(BaseFedAPI):
    """Implementation of FedAVG"""

    def __init__(self, server, clients, criterion, local_optimizers, local_dataloaders, num_communication=1, local_epoch=1, use_gradients=True, custom_action=lambda x: x, device='cpu'):
        self.server = server
        self.clients = clients
        self.criterion = criterion
        self.local_optimizers = local_optimizers
        self.local_dataloaders = local_dataloaders
        self.num_communication = num_communication
        self.local_epoch = local_epoch
        self.use_gradients = use_gradients
        self.custom_action = custom_action
        self.device = device
        self.client_num = len(self.clients)
        local_dataset_sizes = [len(dataloader.dataset) for dataloader in self.local_dataloaders]
        sum_local_dataset_sizes = sum(local_dataset_sizes)
        self.server.weight = [dataset_size / sum_local_dataset_sizes for dataset_size in local_dataset_sizes]
        self.logging = {}

    def local_train(self, i):
        self.logging[i] = {}
        for client_idx in range(self.client_num):
            loss_log = self.clients[client_idx].local_train(self.local_epoch, self.criterion, self.local_dataloaders[client_idx], self.local_optimizers[client_idx], communication_id=i)
            self.logging[i][client_idx] = loss_log

    def run(self):
        self.server.force_send_model_state_dict = True
        self.server.distribute()
        self.server.force_send_model_state_dict = False
        for i in range(self.num_communication):
            self.local_train(i)
            self.server.receive(use_gradients=self.use_gradients)
            if self.use_gradients:
                self.server.update_from_gradients()
            else:
                self.server.update_from_parameters()
            self.server.distribute()
            self.custom_action(self)


class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc1 = nn.Linear(4, 8)
        self.fc2 = nn.Linear(8, 2)
    
    def forward(self, x):
        x = torch.relu(self.fc1(x))
        x = self.fc2(x)
        return x


class MockClient:
    def __init__(self, model):
        self.model = model
    
    def local_train(self, local_epoch, criterion, dataloader, optimizer, communication_id=0):
        loss_log = []
        for epoch in range(local_epoch):
            epoch_loss = 0.0
            for batch_x, batch_y in dataloader:
                optimizer.zero_grad()
                output = self.model(batch_x)
                loss = criterion(output, batch_y)
                loss.backward()
                optimizer.step()
                epoch_loss += loss.item()
            loss_log.append(epoch_loss)
        return loss_log


class MockServer:
    def __init__(self, model):
        self.model = model
        self.weight = []
        self.force_send_model_state_dict = False
        self.client_models = []
        self.client_gradients = []
    
    def distribute(self):
        pass
    
    def receive(self, use_gradients=True):
        pass
    
    def update_from_gradients(self):
        pass
    
    def update_from_parameters(self):
        pass


model = SimpleModel()
server = MockServer(model)

client1_model = SimpleModel()
client2_model = SimpleModel()
clients = [MockClient(client1_model), MockClient(client2_model)]

criterion = nn.CrossEntropyLoss()

optimizer1 = optim.SGD(client1_model.parameters(), lr=0.01)
optimizer2 = optim.SGD(client2_model.parameters(), lr=0.01)
local_optimizers = [optimizer1, optimizer2]

X1 = torch.randn(4, 4)
y1 = torch.randint(0, 2, (4,))
dataset1 = TensorDataset(X1, y1)
dataloader1 = DataLoader(dataset1, batch_size=2)

X2 = torch.randn(6, 4)
y2 = torch.randint(0, 2, (6,))
dataset2 = TensorDataset(X2, y2)
dataloader2 = DataLoader(dataset2, batch_size=2)

local_dataloaders = [dataloader1, dataloader2]

INIT_ARGS = {
    'server': server,
    'clients': clients,
    'criterion': criterion,
    'local_optimizers': local_optimizers,
    'local_dataloaders': local_dataloaders,
    'num_communication': 2,
    'local_epoch': 1,
    'use_gradients': True,
    'custom_action': lambda x: x,
    'device': 'cpu'
}

ARGS = {}

METHOD = 'run'

fed_avg_api = FedAVGAPI(**INIT_ARGS)
fed_avg_api.run()
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type NoneType — a NoneType output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NoneType 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
FedProxOptimizer Ran
ran on a synthesized input · constructed an object; no result was computed
intel/openfl/openfl/utilities/optimizers/torch/fedprox.py
code served (permissive licence) · get_code("06dfd1885c7c4e75")
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 an instance of its own class, FedProxOptimizer: the run constructed the object and did not call it, so no result was computed. 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
from torch.optim.optimizer import required

torch.manual_seed(0)

# Create a simple model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

model = SimpleModel()

# Get parameters
params = model.parameters()

# Create old weights list (same structure as params)
old_weights = [torch.clone(p.detach()) for p in model.parameters()]

ARGS = {
    'params': params,
    'lr': 0.01,
    'mu': 0.01,
    'momentum': 0.9,
    'dampening': 0,
    'weight_decay': 0.0001,
    'nesterov': False
}
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 FedProxOptimizer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a FedProxOptimizer 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
FedProxOptimizer Ran
ran on a synthesized input · constructed an object; no result was computed
zhuangdizhu/FedGen/FLAlgorithms/servers/serverFedProx.py
pointer only (licence: NONE) · get_code("7f652ac95bb4006c")
How it ran

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

PerturbedGradientDescent Ran
ran on a synthesized input · constructed an object; no result was computed
morningD/GrouProx/flearn/optimizer/pgd.py
pointer only (licence: NONE) · get_code("bbe68818d3f2e89a")
How it ran

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

ProxSGD Ran
ran on a synthesized input · constructed an object; no result was computed
omarfoq/knn-per/utils/optim.py
code served (permissive licence) · get_code("81f4645fc4657364")
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 an instance of its own class, ProxSGD: the run constructed the object and did not call it, so no result was computed. 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
from torch.optim.optimizer import required

torch.manual_seed(0)

# Create a simple model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

model = SimpleModel()

# Create parameters for the optimizer
params = model.parameters()

# Define all arguments for ProxSGD.__init__
ARGS = {
    'params': params,
    'lr': 0.1,
    'mu': 0.01,
    'momentum': 0.9,
    'dampening': 0.0,
    'weight_decay': 0.001,
    'nesterov': False
}
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 ProxSGD — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ProxSGD 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
Server Ran
ran on a synthesized input · constructed an object; no result was computed
zhuangdizhu/FedGen/FLAlgorithms/servers/serverFedProx.py
pointer only (licence: NONE) · get_code("451d36a73c8babcf")
How it ran

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

UserFedProx Ran
ran on a synthesized input · constructed an object; no result was computed
zhuangdizhu/FedGen/FLAlgorithms/servers/serverFedProx.py
pointer only (licence: NONE) · get_code("3e6d6a9103a13d63")
How it ran

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

batch_data Ran
ran on a synthesized input
litian96/FedProx/utils/model_utils.py
code served (permissive licence) · get_code("04eb2c09a69cabcd")
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 numpy as np

torch.manual_seed(0)

# Construct valid arguments for batch_data function
# The function expects:
# - data: a dict with 'x' and 'y' keys containing lists
# - batch_size: an integer

# Create sample data
data = {
    'x': [1, 2, 3, 4, 5, 6, 7],  # list of 7 items
    'y': [10, 20, 30, 40, 50, 60, 70]  # list of 7 items
}

batch_size = 3

ARGS = {
    'data': data,
    'batch_size': batch_size
}
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 — 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
letter_to_vec Ran
ran, honoured the contract we drafted
litian96/FedProx/utils/language_utils.py
code served (permissive licence) · get_code("9bc011aaf4c2fb8e")
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 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

ALL_LETTERS = '\n !"&\'(),-.0123456789:;>?ABCDEFGHIJKLMNOPQRSTUVWXYZ[]abcdefghijklmnopqrstuvwxyz}'

NUM_LETTERS = len(ALL_LETTERS)

def _one_hot(index, size):
    """returns one-hot vector with given size and value 1 at given index
    """
    vec = [0 for _ in range(size)]
    vec[int(index)] = 1
    return vec

def letter_to_vec(letter):
    """returns one-hot representation of given letter
    """
    index = ALL_LETTERS.find(letter)
    return _one_hot(index, NUM_LETTERS)

ARGS = {
    "letter": "A"
}
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 int — 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
parse_log Ran
ran on a synthesized input
litian96/FedProx/plot_fig2.py
code served (permissive licence) · get_code("3d95adf387c731eb")
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 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 tempfile
import os

# Create a temporary log file with content matching the regex patterns in parse_log
with tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.log') as f:
    f.write("At round 1 training accuracy: 0.85\n")
    f.write("At round 1 accuracy: 0.82\n")
    f.write("At round 1 training loss: 0.45\n")
    f.write("gradient difference: 0.12\n")
    f.write("At round 2 training accuracy: 0.90\n")
    f.write("At round 2 accuracy: 0.88\n")
    f.write("At round 2 training loss: 0.35\n")
    f.write("gradient difference: 0.08\n")
    temp_file_name = f.name

ARGS = {
    'file_name': temp_file_name
}
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 tuple, ndim 2, dtype family float — 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
parse_log Ran
ran on a synthesized input
litian96/FedProx/plot_final_e20.py
code served (permissive licence) · get_code("5391ae7139f5e1e0")
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 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 tempfile
import os

# Create a temporary log file with sample data
temp_dir = tempfile.mkdtemp()
log_file = os.path.join(temp_dir, "test_log.txt")

log_content = """At round 1 training accuracy: 0.75
At round 1 accuracy: 0.72
At round 1 training loss: 0.5
gradient difference: 0.02
At round 2 training accuracy: 0.80
At round 2 accuracy: 0.78
At round 2 training loss: 0.4
gradient difference: 0.015
At round 3 training accuracy: 0.85
At round 3 accuracy: 0.82
At round 3 training loss: 0.3
gradient difference: 0.01
"""

with open(log_file, 'w') as f:
    f.write(log_content)

ARGS = {
    'file_name': log_file
}
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 tuple, ndim 2, dtype family float — 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
read_data Ran
ran on a synthesized input
litian96/FedProx/flearn/utils/model_utils.py
code served (permissive licence) · get_code("a89afa036306a733")
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 json
import os
import tempfile
import shutil

# Create temporary directories for train and test data
train_data_dir = tempfile.mkdtemp()
test_data_dir = tempfile.mkdtemp()

# Create sample train data files
train_data_1 = {
    "users": ["user_1", "user_2"],
    "hierarchies": ["group_1"],
    "user_data": {
        "user_1": {"x": [1, 2, 3], "y": [0]},
        "user_2": {"x": [4, 5, 6], "y": [1]}
    }
}

train_data_2 = {
    "users": ["user_3"],
    "user_data": {
        "user_3": {"x": [7, 8, 9], "y": [0]}
    }
}

# Create sample test data files
test_data_1 = {
    "users": ["user_1", "user_2", "user_3"],
    "user_data": {
        "user_1": {"x": [10, 11, 12], "y": [1]},
        "user_2": {"x": [13, 14, 15], "y": [0]},
        "user_3": {"x": [16, 17, 18], "y": [1]}
    }
}

# Write train data files
with open(os.path.join(train_data_dir, "train_1.json"), "w") as f:
    json.dump(train_data_1, f)

with open(os.path.join(train_data_dir, "train_2.json"), "w") as f:
    json.dump(train_data_2, f)

# Write test data file
with open(os.path.join(test_data_dir, "test_1.json"), "w") as f:
    json.dump(test_data_1, f)

ARGS = {
    "train_data_dir": train_data_dir,
    "test_data_dir": test_data_dir
}
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 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
read_data Ran
ran; our contract draft was wrong, not the code
litian96/FedProx/utils/model_utils.py
code served (permissive licence) · get_code("dace4e03c5c252fe")
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 json
import os
import tempfile
import shutil

# Create temporary directories for train and test data
train_data_dir = tempfile.mkdtemp()
test_data_dir = tempfile.mkdtemp()

try:
    # Create sample train data file
    train_data_content = {
        "users": ["client_1", "client_2"],
        "hierarchies": ["group_1", "group_2"],
        "user_data": {
            "client_1": {"x": [1, 2, 3], "y": [0]},
            "client_2": {"x": [4, 5, 6], "y": [1]}
        }
    }
    
    # Create sample test data file
    test_data_content = {
        "users": ["client_1", "client_2"],
        "user_data": {
            "client_1": {"x": [7, 8, 9], "y": [0]},
            "client_2": {"x": [10, 11, 12], "y": [1]}
        }
    }
    
    # Write train data
    train_file_path = os.path.join(train_data_dir, "train_data.json")
    with open(train_file_path, 'w') as f:
        json.dump(train_data_content, f)
    
    # Write test data
    test_file_path = os.path.join(test_data_dir, "test_data.json")
    with open(test_file_path, 'w') as f:
        json.dump(test_data_content, f)
    
    ARGS = {
        "train_data_dir": train_data_dir,
        "test_data_dir": test_data_dir
    }

finally:
    # Note: cleanup would happen after function execution
    # Directories are kept for function execution
    pass
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 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
split_line Ran
ran; our contract draft was wrong, not the code
litian96/FedProx/utils/language_utils.py
code served (permissive licence) · get_code("e2b598f14cd058f3")
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 re

def split_line(line):
    """split given line/phrase into list of words

    Args:
        line: string representing phrase to be split
    
    Return:
        list of strings, with each string representing a word
    """
    return re.findall("[\\w']+|[.,!?;]", line)


ARGS = {
    "line": "Hello, world! How's everything?"
}
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 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
word_to_indices Ran
ran, honoured the contract we drafted
litian96/FedProx/utils/language_utils.py
code served (permissive licence) · get_code("e4cdde6a274b8fac")
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 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

ALL_LETTERS = '\n !"&\'(),-.0123456789:;>?ABCDEFGHIJKLMNOPQRSTUVWXYZ[]abcdefghijklmnopqrstuvwxyz}'

def word_to_indices(word):
    """returns a list of character indices

    Args:
        word: string
    
    Return:
        indices: int list with length len(word)
    """
    indices = []
    for c in word:
        indices.append(ALL_LETTERS.find(c))
    return indices


ARGS = {
    "word": "Hello"
}
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 int — 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
Aggregator Not yet run
unverified (harvested, no recorded run)
omarfoq/fedem/aggregator.py
code served (permissive licence) · get_code("60422dff1153974f")
How it ran

no invocation recorded.

BaseFedAPI Not yet run
unverified (harvested, no recorded run)
Koukyosyumei/AIJack/src/aijack/collaborative/fedprox/api.py
code served (permissive licence) · get_code("526a4afa8230f908")
How it ran

no invocation recorded.

CentralizedAggregator Not yet run
unverified (harvested, no recorded run)
omarfoq/fedem/aggregator.py
code served (permissive licence) · get_code("fa609f7144eb64b8")
How it ran

no invocation recorded.

Client Not yet run
unverified (harvested, no recorded run)
MediaBrain-SJTU/FedLESAM/client/fedprox.py
pointer only (licence: NONE) · get_code("13d5f640c099c234")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, MediaBrain-SJTU/FedLESAM 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. No invocation recorded.

FedLOptimizer Not yet run
unverified (harvested, no recorded run)
maxencenoble/Differential-Privacy-for-Heterogeneous-Federated-Learning/flearn/optimizers/fedoptimizer.py
pointer only (licence: GPL-3.0) · get_code("0554ed92f151547b")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, maxencenoble/Differential-Privacy-for-Heterogeneous-Federated-Learning, is not in the permissive set Syntology serves inline. 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. No invocation recorded.

FedProx Not yet run
unverified (harvested, no recorded run)
zhuangdizhu/FedGen/FLAlgorithms/servers/serverFedProx.py
pointer only (licence: NONE) · get_code("293cf8f7e5665e3a")
How it ran

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

FedProxAPI Not yet run
unverified (harvested, no recorded run)
Koukyosyumei/AIJack/src/aijack/collaborative/fedprox/api.py
code served (permissive licence) · get_code("cf20999d4c175f74")
How it ran

no invocation recorded.

fedprox Not yet run
unverified (harvested, no recorded run)
woodenchild95/fl-simulator/client/fedprox.py
pointer only (licence: NONE) · get_code("dbc073f0b7427f38")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, woodenchild95/fl-simulator 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. No invocation recorded.

fedprox Not yet run
unverified (harvested, no recorded run)
MediaBrain-SJTU/FedLESAM/client/fedprox.py
pointer only (licence: NONE) · get_code("49711512972b76af")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, MediaBrain-SJTU/FedLESAM 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. No invocation recorded.

graph_size Not yet run
unverified (harvested, no recorded run)
litian96/FedProx/utils/tf_utils.py
code served (permissive licence) · get_code("1040c34113873b16")
How it ran

no invocation recorded.

load_data Not yet run
unverified (harvested, no recorded run)
litian96/FedProx/utils/stats.py
code served (permissive licence) · get_code("aba66b6a320cf6f7")
How it ran

no invocation recorded.

Also present in other papers' code

Of 26 samples lifted from this paper's linked repositories, 26 carry a function identity and 0 do not. Of the 24 distinct functions with an identity, 6 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 5 later) and 18 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
word_to_indices 3 other papers
3 later
2012.04221 (2020-12)
Ditto: Fair and Robust Federated Learning Through Personalization
2206.02078 (2022-06)
Straggler-Resilient Personalized Federated Learning
2407.18365 (2024-07)
FADAS: Towards Federated Adaptive Asynchronous Optimization
read_data 2 other papers
2 later
2206.13190 (2022-06)
An Empirical Study of Personalized Federated Learning
2406.04596 (2024-06)
Federated Representation Learning in the Under-Parameterized Regime
split_line 2 other papers
2 later
1912.13445 (2019-12)
Robust Aggregation for Federated Learning
2206.02078 (2022-06)
Straggler-Resilient Personalized Federated Learning
Server
brick of this paper's assembly: helper
1 other paper
1 dated earlier
1602.05629 (2016-02)
Communication-Efficient Learning of Deep Networks from Decentralized Data
letter_to_vec 1 other paper
1 later
2012.04221 (2020-12)
Ditto: Fair and Robust Federated Learning Through Personalization
read_data 1 other paper
1 later
1905.10497 (2019-05)
Fair Resource Allocation in Federated Learning

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

Federated Learning is a distributed learning paradigm with two key challenges that differentiate it from traditional distributed optimization: (1) significant variability in terms of the systems characteristics on each device in the network (systems heterogeneity), and (2) non-identically distributed data across the network (statistical heterogeneity). In this work, we introduce a framework, FedProx, to tackle heterogeneity in federated networks. FedProx can be viewed as a generalization and re-parametrization of FedAvg, the current state-of-the-art method for federated learning. While this re-parameterization makes only minor modifications to the method itself, these modifications have important ramifications both in theory and in practice. Theoretically, we provide convergence guarantees for our framework when learning over data from non-identical distributions (statistical heterogeneity), and while adhering to device-level systems constraints by allowing each participating device to perform a variable amount of work (systems heterogeneity). Practically, we demonstrate that FedProx allows for more robust convergence than FedAvg across a suite of realistic federated datasets. In particular, in highly heterogeneous settings, FedProx demonstrates significantly more stable and accurate convergence behavior relative to FedAvg-improving absolute test accuracy by 22% on average.

For agents

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

get_harvested_code_for_paper("1812.06127")
get_code_for_paper("1812.06127")
have("1812.06127")

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

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

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

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

Connect an agent — have() is free.