SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2002.06440 · ICLR · 2020

Federated Learning with Matched Averaging

Hongyi Wang, Mikhail Yurochkin, Yuekai Sun, Dimitris Papailiopoulos, Yasaman Khazaeni

arXiv · PDF · Open in the Atlas

Code that ran

4 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, 2 violated it and 0 have no contract verdict; 2 failures of our instrument; 5 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, 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/2002.06440.json · badge: /api/ran/2002.06440.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
IBM/FedMA canonical (classifier label)
classifier basis: classifier_2025
4 ran · 5 no recorded run
FunctionStatusWhere it lives
collect_weights Ran
ran; our contract draft was wrong, not the code
IBM/FedMA/language_modeling/language_main.py
code served (permissive licence) · get_code("7a8a094a8b866225")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-05T00:32:56Z). 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 logging

torch.manual_seed(0)
logging.basicConfig(level=logging.INFO)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

class AnotherModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv = nn.Conv1d(4, 5, kernel_size=2)
        self.linear = nn.Linear(5, 2)
    
    def forward(self, x):
        x = self.conv(x)
        return x

model1 = SimpleModel()
model2 = AnotherModel()

models = [model1, model2]

ARGS = {
    'models': models
}
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 — a list 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
add_fit_args Ran
ran; our contract draft was wrong, not the code
IBM/FedMA/language_modeling/language_main.py
code served (permissive licence) · get_code("b7f7a1b9782566a2")
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 Namespace. 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 argparse
import torch

torch.manual_seed(0)

# Create a minimal ArgumentParser
parser = argparse.ArgumentParser(description='Test parser for add_fit_args')

ARGS = {
    'parser': parser
}
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 Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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
process_softmax_bias Ran
ran, violated the contract we drafted
IBM/FedMA/matching/pfnm.py
code served (permissive licence) · get_code("9c648207429148d6")
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 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 numpy as np

torch.manual_seed(0)

# Analyze the function:
# - batch_weights: indexed with [j][-1], so list of sequences where last element is accessed
# - last_layer_const: iterable that's zipped with softmax_bias, so same length as batch_weights
# - sigma: scalar, used as sigma_bias
# - sigma0: scalar, used as sigma0_bias

# batch_weights should be a list of J=2 sequences (to match last_layer_const length)
# Each sequence should have at least 1 element (accessed via [-1])
batch_weights = [
    [0.5, 0.3, 0.2],  # First batch item, last element is 0.2
    [0.4, 0.1, 0.5],  # Second batch item, last element is 0.5
]

# last_layer_const should be a list of J=2 scalars (one per batch item)
last_layer_const = [2.0, 3.0]

# sigma and sigma0 are scalars
sigma = 0.1
sigma0 = 0.2

ARGS = {
    "batch_weights": batch_weights,
    "last_layer_const": last_layer_const,
    "sigma": sigma,
    "sigma0": sigma0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, 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
row_param_cost_simplified Ran
ran, violated the contract we drafted
IBM/FedMA/matching/pfnm.py
code served (permissive licence) · get_code("cd6992373bd9ebe9")
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 (2,) 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

torch.manual_seed(0)

# Analyze the function:
# - global_weights: used in arithmetic (weights_j_l + global_weights) ** 2 / sij_p_gs
# - weights_j_l: used in arithmetic (weights_j_l + global_weights) ** 2 / sij_p_gs
# - sij_p_gs: used as divisor in division
# - red_term: subtracted from sum result
# All operations suggest these are numpy arrays or torch tensors
# The .sum(axis=1) indicates a 2D array where we sum along columns
# Result has shape matching axis=0 dimension

# Create small test data
# Shape: (2, 4) - 2 rows, 4 columns
global_weights = np.array([[0.1, 0.2, 0.3, 0.4],
                           [0.5, 0.6, 0.7, 0.8]], dtype=np.float32)

weights_j_l = np.array([[1.0, 2.0, 3.0, 4.0],
                        [5.0, 6.0, 7.0, 8.0]], dtype=np.float32)

sij_p_gs = np.array([[0.1, 0.2, 0.3, 0.4],
                     [0.5, 0.6, 0.7, 0.8]], dtype=np.float32)

red_term = np.array([5.0, 10.0], dtype=np.float32)

ARGS = {
    "global_weights": global_weights,
    "weights_j_l": weights_j_l,
    "sij_p_gs": sij_p_gs,
    "red_term": red_term
}
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 1, dtype family float, shape (2,) — shape (2,) 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
compute_cost Not yet run
unverified (harvested, no recorded run)
IBM/FedMA/matching/pfnm.py
code served (permissive licence) · get_code("0deab229a7b7de8e")
How it ran

no invocation recorded.

evaluate Not yet run
unverified (harvested, no recorded run)
IBM/FedMA/language_modeling/language_main.py
code served (permissive licence) · get_code("a4f89ab2ff25bf83")
How it ran

no invocation recorded.

fedma_whole Not yet run
unverified (harvested, no recorded run)
IBM/FedMA/matching/pfnm.py
code served (permissive licence) · get_code("b31318bddc5412d3")
How it ran

no invocation recorded.

match_layer Not yet run
unverified (harvested, no recorded run)
IBM/FedMA/matching/pfnm.py
code served (permissive licence) · get_code("c355964843bedb50")
How it ran

no invocation recorded.

matching_upd_j Not yet run
unverified (harvested, no recorded run)
IBM/FedMA/matching/pfnm.py
code served (permissive licence) · get_code("8a3d83e95a786484")
How it ran

no invocation 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, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 9 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.

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

Federated learning allows edge devices to collaboratively learn a shared model while keeping the training data on device, decoupling the ability to do model training from the need to store the data in the cloud. We propose the Federated matched averaging (FedMA) algorithm designed for federated learning of modern neural network architectures e.g. convolutional neural networks (CNNs) and LSTMs. FedMA constructs the shared global model in a layer-wise manner by matching and averaging hidden elements (i.e. channels for convolution layers; hidden states for LSTM; neurons for fully connected layers) with similar feature extraction signatures. Our experiments indicate that FedMA not only outperforms popular state-of-the-art federated learning algorithms on deep CNN and LSTM architectures trained on real world datasets, but also reduces the overall communication burden. 1 * Work performed while doing an internship at IBM Research.

For agents

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

get_harvested_code_for_paper("2002.06440")
get_code_for_paper("2002.06440")
have("2002.06440")

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

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

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

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

Connect an agent — have() is free.