SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2107.06917 · 2021

A Field Guide to Federated Optimization

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 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 3 have no contract verdict; 1 failure of our instrument; 0 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/2107.06917.json · badge: /api/ran/2107.06917.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
google-research/federated canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
AParayil/AParayil-Distribued-Learning-via-Bayesian-Inferencing community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
FunctionStatusWhere it lives
accuracy_evaluation Ran
ran on a synthesized input
AParayil/AParayil-Distribued-Learning-via-Bayesian-Inferencing/mnist_dist_sgld_svhn_plot_pred_scores.py
code served (permissive licence) · get_code("11f9ca5c1750b097")
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 torch.nn as nn

torch.manual_seed(0)

# Create a minimal neural network that satisfies the function's usage
class SimpleNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(4, 3)  # 4 input features, 3 output classes
    
    def forward(self, x):
        return self.fc(x)

# Create a tiny data loader (list of (images, labels) tuples)
# batch_size=2, image_dim=4, 3 classes
data_loader = [
    (torch.randn(2, 4), torch.tensor([0, 1])),
    (torch.randn(2, 4), torch.tensor([2, 0])),
]

# Create the network instance
net = SimpleNet()

# Device (CPU only)
device = 'cpu'

ARGS = {
    'net': net,
    'data_loader': data_loader,
    '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 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_scores Ran
ran on a synthesized input
AParayil/AParayil-Distribued-Learning-via-Bayesian-Inferencing/mnist_dist_sgld_svhn_plot_pred_scores.py
code served (permissive licence) · get_code("a5fafd0528bc7da8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (4, 10) 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
import numpy as np

torch.manual_seed(0)

# Create a simple neural network that outputs 10 classes
class SimpleNet(nn.Module):
    def __init__(self):
        super(SimpleNet, self).__init__()
        self.fc1 = nn.Linear(12, 10)  # Input: 2*2*3=12, Output: 10 classes
    
    def forward(self, x):
        x = x.view(x.size(0), -1)
        x = self.fc1(x)
        return x

# Create the network
net = SimpleNet()

# Create a simple data loader as a list of (images, labels) tuples
# Each image is shape (3, 2, 2) - 3 channels, 2x2 spatial
images_1 = torch.randn(2, 3, 2, 2)
labels_1 = torch.tensor([0, 1])

images_2 = torch.randn(2, 3, 2, 2)
labels_2 = torch.tensor([2, 3])

# Create a simple data loader wrapper
class SimpleDataLoader:
    def __init__(self, data):
        self.data = data
        self.batch_size = 2
    
    @property
    def dataset(self):
        return self
    
    def __len__(self):
        return sum(len(batch[0]) for batch in self.data)
    
    def __iter__(self):
        return iter(self.data)

data_loader = SimpleDataLoader([
    (images_1, labels_1),
    (images_2, labels_2)
])

device = 'cpu'

ARGS = {
    'net': net,
    'data_loader': data_loader,
    'device': device
}
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 ndarray, ndim 2, dtype family float, shape (4, 10) — shape (4, 10) 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
keras_evaluate Ran
ran; our contract draft was wrong, not the code
google-research/federated/dp_ftrl/dp_fedavg.py
code served (permissive licence) · get_code("56987b87a91ec23f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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
import numpy as np

torch.manual_seed(0)

# Build a minimal model that can be called with model(x, training=False)
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(5, 3)
    
    def forward(self, x, training=False):
        return self.linear(x)

model = SimpleModel()

# Build test_data as a list of batches
# Each batch can be a tuple (x, y) or a dict {'x': ..., 'y': ...}
batch1 = (torch.randn(2, 5), torch.randn(2, 3))
batch2 = {'x': torch.randn(2, 5), 'y': torch.randn(2, 3)}
test_data = [batch1, batch2]

# Build metrics that have reset_states() and update_state(y_true=..., y_pred=...)
class MockMetric:
    def __init__(self):
        self.value = 0.0
    
    def reset_states(self):
        self.value = 0.0
    
    def update_state(self, y_true, y_pred):
        self.value += torch.mean((y_true - y_pred) ** 2).item()

metrics = [MockMetric(), MockMetric()]

ARGS = {
    'model': model,
    'test_data': test_data,
    'metrics': metrics
}
Setup block drafted by
a language model, Claude Sonnet 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 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
loss_function_evaluation Ran
ran on a synthesized input
AParayil/AParayil-Distribued-Learning-via-Bayesian-Inferencing/mnist_dist_sgld_svhn_plot_pred_scores.py
code served (permissive licence) · get_code("a1d5be45477f71a8")
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 torch.nn as nn

torch.manual_seed(0)

# Define a simple neural network
class SimpleNet(nn.Module):
    def __init__(self):
        super(SimpleNet, self).__init__()
        self.linear1 = nn.Linear(4, 8)
        self.linear2 = nn.Linear(8, 3)
    
    def forward(self, x):
        x = torch.relu(self.linear1(x))
        x = self.linear2(x)
        return x

# Create a simple data loader (list of (images, labels) tuples)
data_loader = [
    (torch.randn(2, 4), torch.tensor([0, 1])),
    (torch.randn(2, 4), torch.tensor([2, 0]))
]

# Create instances
net = SimpleNet()
criterion = nn.CrossEntropyLoss(reduction='sum')
device = 'cpu'

ARGS = {
    'net': net,
    'data_loader': data_loader,
    'criterion': criterion,
    '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 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

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 3 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
keras_evaluate 2 other papers
1 dated earlier, 1 later
2008.03606 (2020-08)
Mime: Mimicking Centralized Stochastic Algorithms in Federated Learning
2303.10218 (2023-03)
An Empirical Evaluation of Federated Contextual Bandit Algorithms

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 and analytics are a distributed approach for collaboratively learning models (or statistics) from decentralized data, motivated by and designed for privacy protection. The distributed learning process can be formulated as solving federated optimization problems, which emphasize communication efficiency, data heterogeneity, compatibility with privacy and system requirements, and other constraints that are not primary considerations in other problem settings. This paper provides recommendations and guidelines on formulating, designing, evaluating and analyzing federated optimization algorithms through concrete examples and practical implementation, with a focus on conducting effective simulations to infer real-world performance. The goal of this work is not to survey the current literature, but to inspire researchers and practitioners to design federated learning algorithms that can be used in various practical applications.

For agents

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

get_harvested_code_for_paper("2107.06917")
get_code_for_paper("2107.06917")
have("2107.06917")

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

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

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

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

Connect an agent — have() is free.