SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2010.02056 · 2020

Specialized federated learning using a mixture of experts

arXiv · PDF · Open in the Atlas

Code that ran

7 of 8 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 6 have no contract verdict; 1 failure of our instrument; 1 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/2010.02056.json · badge: /api/ran/2010.02056.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
edvinli/federated-learning-mixture canonical (classifier label)
classifier basis: census
7 ran · 1 no recorded run
FunctionStatusWhere it lives
FedAvg Ran
ran on a synthesized input
edvinli/federated-learning-mixture/models/FederatedAveraging.py
code served (permissive licence) · get_code("542a499a7eafaa04")
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 copy
import numpy as np
import torch

torch.manual_seed(0)

# The function expects:
# w: a list of dicts where each dict maps layer names to tensors/arrays
# alpha: a numpy array of weights for each client

# Create a small model state dict structure
# w is a list of model weight dicts, one per client
w = [
    {
        'layer1': np.random.randn(4, 3),
        'layer2': np.random.randn(2, 4),
    },
    {
        'layer1': np.random.randn(4, 3),
        'layer2': np.random.randn(2, 4),
    },
    {
        'layer1': np.random.randn(4, 3),
        'layer2': np.random.randn(2, 4),
    },
]

# alpha: weights for each client (will be normalized in the function)
alpha = np.array([1.0, 1.0, 1.0])

ARGS = {
    'w': w,
    'alpha': alpha,
}
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 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
cifar_iid Ran
ran on a synthesized input
edvinli/federated-learning-mixture/utils/sample_languagedata.py
code served (permissive licence) · get_code("ce92e0c1fa3c65a0")
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 numpy as np

# Create a minimal stand-in dataset
class MinimalDataset:
    def __init__(self, size):
        self.size = size
    
    def __len__(self):
        return self.size

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

# Create arguments
dataset = MinimalDataset(100)  # dataset with 100 samples
num_users = 5  # number of clients
n_data = 15  # samples per client

ARGS = {
    "dataset": dataset,
    "num_users": num_users,
    "n_data": n_data
}
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 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
cifar_iid2 Ran
ran on a synthesized input
edvinli/federated-learning-mixture/utils/sample_languagedata.py
code served (permissive licence) · get_code("98fe2f24aee60e8c")
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 numpy as np

class DummyDataset:
    def __init__(self, size):
        self.size = size
    
    def __len__(self):
        return self.size

np.random.seed(0)
dataset = DummyDataset(100)
num_users = 5

ARGS = {
    "dataset": dataset,
    "num_users": num_users,
}
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 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
emnist_iid Ran
ran on a synthesized input
edvinli/federated-learning-mixture/utils/sample_data.py
code served (permissive licence) · get_code("79660985a20ca0a1")
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 numpy as np
import torch
from torch.utils.data import Dataset

torch.manual_seed(0)
np.random.seed(0)

class MockEMNISTDataset(Dataset):
    """Minimal dataset with __len__ method"""
    def __init__(self, size=3000):
        self.size = size
        self.data = np.random.randn(size, 28, 28).astype(np.float32)
        self.targets = np.random.randint(0, 10, size)
    
    def __len__(self):
        return self.size
    
    def __getitem__(self, idx):
        return self.data[idx], self.targets[idx]

dataset = MockEMNISTDataset(size=3000)
num_users = 5

ARGS = {
    "dataset": dataset,
    "num_users": num_users
}
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 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
evaluate_validation Ran
ran on a synthesized input
edvinli/federated-learning-mixture/models/LanguageClientUpdate.py
code served (permissive licence) · get_code("5dc56978c5ae6baf")
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 torch.nn as nn

torch.manual_seed(0)

# Create scores tensor: batch_size=2, num_classes=4
scores = torch.randn(2, 4)

# Create gold tensor: batch_size=2, with class indices
gold = torch.tensor([0, 2])

# Create a loss function that accepts (scores, gold)
loss_function = nn.CrossEntropyLoss()

ARGS = {
    "scores": scores,
    "loss_function": loss_function,
    "gold": gold
}
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 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
mnist_iid Ran
ran; our contract draft was wrong, not the code
edvinli/federated-learning-mixture/utils/sample_data.py
code served (permissive licence) · get_code("d9107114749c3e49")
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 numpy as np

# Create a minimal dataset stand-in
class MinimalDataset:
    def __init__(self, size):
        self.size = size
    
    def __len__(self):
        return self.size

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

# Create arguments
dataset = MinimalDataset(size=100)
num_users = 5

ARGS = {
    "dataset": dataset,
    "num_users": num_users
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — 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
mnist_noniid Ran
ran on a synthesized input
edvinli/federated-learning-mixture/utils/sample_data.py
code served (permissive licence) · get_code("80eaa4c2dace63d8")
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 numpy as np
import torch
from torch.utils.data import Dataset

torch.manual_seed(0)
np.random.seed(0)

class MockMNISTDataset(Dataset):
    def __init__(self, num_samples=60000):
        self.num_samples = num_samples
        self.train_labels = torch.randint(0, 10, (num_samples,))
    
    def __len__(self):
        return self.num_samples
    
    def __getitem__(self, idx):
        return torch.randn(28, 28), self.train_labels[idx]

# Create a mock MNIST dataset
dataset = MockMNISTDataset(num_samples=60000)

ARGS = {
    "dataset": dataset,
    "num_users": 10,
    "p": 0.5
}
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 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
agnews_noniid Not yet run
unverified (harvested, no recorded run)
edvinli/federated-learning-mixture/utils/sample_languagedata.py
code served (permissive licence) · get_code("e93dc99aaaeb74e7")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 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 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
mnist_iid 5 other papers
4 dated earlier, 1 later
1812.07108 (2018-12)
Learning Private Neural Language Modeling with Attentive Aggregation
1907.01132 (2019-07)
Astraea: Self-balancing Federated Learning for Improving Classification Accuracy of Mobile Deep Learning Applications
1908.07873 (2019-08)
Federated Learning: Challenges, Methods, and Future Directions
and 2 more not named here

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

In federated learning, clients share a global model that has been trained on decentralized local client data. Although federated learning shows significant promise as a key approach when data cannot be shared or centralized, current methods show limited privacy properties and have shortcomings when applied to common real-world scenarios, especially when client data is heterogeneous. In this paper, we propose an alternative method to learn a personalized model for each client in a federated setting, with greater generalization abilities than previous methods. To achieve this personalization we propose a federated learning framework using a mixture of experts to combine the specialist nature of a locally trained model with the generalist knowledge of a global model. We evaluate our method on a variety of datasets with different levels of data heterogeneity, and our results show that the mixture of experts model is better suited as a personalized model for devices in these settings, outperforming both fine-tuned global models and local specialists.

For agents

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

get_harvested_code_for_paper("2010.02056")
get_code_for_paper("2010.02056")
have("2010.02056")

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

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

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

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

Connect an agent — have() is free.