SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.02478 · CVPR · 2024

FedSelect: Personalized Federated Learning with Customized Selection of Parameters for Fine-Tuning

Aviv Shamsian, Chulin Xie, Wenxuan Bao, Andy Zhou, Lapis Labs, Rishub Tamirisa, Ron Arel

arXiv · PDF · Open in the Atlas

Code that ran

16 of 19 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 10 failures of our instrument; 3 no recorded run), measured 2026-11-21; 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/2404.02478.json · badge: /api/ran/2404.02478.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
lapisrocks/fedselect community
Papers with Code archive
16 ran · 3 no recorded run
FunctionStatusWhere it lives
DatasetSplit Ran
ran on a synthesized input · constructed an object; no result was computed
lapisrocks/fedselect/fedselect.py
code served (permissive licence) · get_code("b2313014ce8d5048")
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, DatasetSplit: 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
from typing import Dict, List, OrderedDict, Tuple, Optional, Any

torch.manual_seed(0)

# Create a simple base dataset
class SimpleDataset(torch.utils.data.Dataset):
    def __init__(self, num_samples=4):
        self.num_samples = num_samples
    
    def __len__(self):
        return self.num_samples
    
    def __getitem__(self, idx):
        image = torch.randn(3, 4)
        label = idx % 2
        return (image, label)

base_dataset = SimpleDataset(num_samples=4)
indices = [0, 1, 2]

ARGS = {
    "dataset": base_dataset,
    "idxs": indices,
}
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 DatasetSplit — the run constructed an instance of its own class and did not call it; no shape 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
MaskLocalAltSGD Ran
ran on a synthesized input · constructed an object; no result was computed
lapisrocks/fedselect/fedselect.py
code served (permissive licence) · get_code("05acbeca87ff497d")
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, MaskLocalAltSGD: 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 collections import OrderedDict

torch.manual_seed(0)

# Create a simple model with parameters
model = nn.Sequential(
    nn.Linear(4, 3),
    nn.ReLU(),
    nn.Linear(3, 2)
)

# Create a mask OrderedDict where each mask corresponds to a parameter
# The mask should be binary (0s and 1s) and match the shape of each parameter
mask = OrderedDict()
step_idx = 0
for name, param in model.named_parameters():
    # Create a binary mask with the same shape as the parameter
    mask[name] = torch.randint(0, 2, param.shape)
    step_idx += 1

# Create parameters list from the model
params = list(model.parameters())

# Create dummy input and target for gradient computation
x = torch.randn(2, 4)
y = torch.randn(2, 2)
criterion = nn.MSELoss()

# Compute gradients so p.grad is not None during step()
output = model(x)
loss = criterion(output, y)
loss.backward()

ARGS = {
    'params': params,
    'mask': mask,
    'lr': 0.01
}
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 MaskLocalAltSGD — 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 MaskLocalAltSGD 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
_violates_bound Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lapisrocks/fedselect/fedselect.py
code served (permissive licence) · get_code("d9a08753f47b4b11")
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 bool, 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

torch.manual_seed(0)

# Create a small binary mask tensor
# The function uses torch.count_nonzero to count zeros and ones
mask = torch.tensor([[1, 0, 1, 0],
                     [1, 1, 0, 1]], dtype=torch.float32)

# Create arguments dict
ARGS = {
    "mask": mask,
    "bound": 0.5,
    "invert": 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 bool, 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
add_masks Ran
ran; our contract draft was wrong, not the code
lapisrocks/fedselect/fedselect.py
code served (permissive licence) · get_code("f2d184a11a427da7")
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 OrderedDict. 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
from collections import OrderedDict

torch.manual_seed(0)

# Create sample server mask dictionary with weight and bias keys
server_dict = OrderedDict([
    ('layer1.weight', torch.rand(4, 3)),
    ('layer1.bias', torch.rand(4)),
])

# Create sample client mask dictionary with weight and bias keys
client_dict = OrderedDict([
    ('layer1.weight', torch.rand(4, 3)),
    ('layer1.bias', torch.rand(4)),
    ('layer2.weight', torch.rand(5, 4)),
])

# Define arguments for the function
ARGS = {
    'server_dict': server_dict,
    'client_dict': client_dict,
    'invert': True,
}
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 OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict 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
add_server_weights Ran
ran; our contract draft was wrong, not the code
lapisrocks/fedselect/fedselect.py
code served (permissive licence) · get_code("e6e3c2c4cd5c033c")
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 OrderedDict. 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
from collections import OrderedDict

torch.manual_seed(0)

# Create small tensors for server_weights
server_weights = OrderedDict([
    ('layer1.weight', torch.randn(3, 4)),
    ('layer1.bias', torch.randn(3)),
    ('layer2.weight', torch.randn(2, 3)),
    ('layer2.bias', torch.randn(2)),
])

# Create small tensors for client_weights with same keys
client_weights = OrderedDict([
    ('layer1.weight', torch.randn(3, 4)),
    ('layer1.bias', torch.randn(3)),
    ('layer2.weight', torch.randn(2, 3)),
    ('layer2.bias', torch.randn(2)),
])

# Create binary masks for client_mask (0s and 1s)
client_mask = OrderedDict([
    ('layer1.weight', torch.randint(0, 2, (3, 4)).float()),
    ('layer1.bias', torch.randint(0, 2, (3,)).float()),
    ('layer2.weight', torch.randint(0, 2, (2, 3)).float()),
    ('layer2.bias', torch.randint(0, 2, (2,)).float()),
])

ARGS = {
    'server_weights': server_weights,
    'client_weights': client_weights,
    'client_mask': client_mask,
    'invert': True,
}
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 OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict 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
broadcast_server_to_client_initialization Ran
ran; our contract draft was wrong, not the code
lapisrocks/fedselect/fedselect.py
code served (permissive licence) · get_code("09941af00dbe7aa1")
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 OrderedDict. 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
from collections import OrderedDict

torch.manual_seed(0)

# Create small tensors with distinct shapes to allow probing
# Using shapes like (4, 3) and (5, 2) to distinguish dimensions

# Server weights - the source weights to broadcast
server_weights = OrderedDict([
    ('layer1.weight', torch.randn(4, 3)),
    ('layer1.bias', torch.randn(5,)),
    ('layer2.weight', torch.randn(6, 2)),
    ('layer2.bias', torch.randn(3,)),
])

# Mask - binary mask indicating local (1) vs global (0) parameters
# Same shape as server_weights
mask = OrderedDict([
    ('layer1.weight', torch.randint(0, 2, (4, 3))),
    ('layer1.bias', torch.randint(0, 2, (5,))),
    ('layer2.weight', torch.randint(0, 2, (6, 2))),
    ('layer2.bias', torch.randint(0, 2, (3,))),
])

# Client initialization - the target dict to update
client_initialization = OrderedDict([
    ('layer1.weight', torch.randn(4, 3)),
    ('layer1.bias', torch.randn(5,)),
    ('layer2.weight', torch.randn(6, 2)),
    ('layer2.bias', torch.randn(3,)),
])

ARGS = {
    'server_weights': server_weights,
    'mask': mask,
    'client_initialization': client_initialization,
}
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 OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict 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
cross_client_eval Ran
ran, honoured the contract we drafted
lapisrocks/fedselect/fedselect.py
code served (permissive licence) · get_code("948f6eaf9dbe70c8")
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 Tensor, ndim 2, dtype family float, shape (3, 3) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from collections import OrderedDict

torch.manual_seed(0)

# Small stand-in model
class SimpleNet(nn.Module):
    def __init__(self, num_classes=10):
        super().__init__()
        self.fc1 = nn.Linear(4, 8)
        self.fc2 = nn.Linear(8, num_classes)
    
    def forward(self, x):
        x = x.view(x.size(0), -1)
        x = torch.relu(self.fc1(x))
        x = self.fc2(x)
        return x

# Create a simple dataset
class SimpleDataset(torch.utils.data.Dataset):
    def __init__(self, size=20, num_classes=10):
        self.size = size
        self.num_classes = num_classes
        self.data = torch.randn(size, 4)
        self.labels = torch.randint(0, num_classes, (size,))
    
    def __len__(self):
        return self.size
    
    def __getitem__(self, idx):
        return self.data[idx], self.labels[idx]

# Create datasets
dataset_train = SimpleDataset(size=20, num_classes=10)
dataset_test = SimpleDataset(size=20, num_classes=10)

# Create data splits for 3 clients
dict_users_train = {
    0: np.array([0, 1, 2, 3]),
    1: np.array([4, 5, 6, 7]),
    2: np.array([8, 9, 10, 11])
}

dict_users_test = {
    0: np.array([0, 1, 2, 3]),
    1: np.array([4, 5, 6, 7]),
    2: np.array([8, 9, 10, 11])
}

# Create client state dicts
model = SimpleNet(num_classes=10)
client_state_dicts = {
    0: model.state_dict().copy(),
    1: model.state_dict().copy(),
    2: model.state_dict().copy()
}

# Args class
class Args:
    def __init__(self):
        self.local_bs = 2
        self.device = 'cpu'

args = Args()

ARGS = {
    'model': model,
    'client_state_dicts': client_state_dicts,
    'dataset_train': dataset_train,
    'dataset_test': dataset_test,
    'dict_users_train': dict_users_train,
    'dict_users_test': dict_users_test,
    'args': args,
    'no_cross': True
}
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 Tensor, ndim 2, dtype family float, shape (3, 3) — shape (3, 3) 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
delta_update Ran
ran; our contract draft was wrong, not the code
lapisrocks/fedselect/fedselect.py
code served (permissive licence) · get_code("56d8d20eb64efc68")
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 OrderedDict. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from collections import OrderedDict

torch.manual_seed(0)

# Create small tensors for testing
weight_shape = (4, 3)
bias_shape = (4,)

# Create current state dict with weights and biases
current_state_dict = OrderedDict([
    ('fc.weight', torch.randn(weight_shape)),
    ('fc.bias', torch.randn(bias_shape)),
    ('conv.weight', torch.randn(2, 3, 3, 3))
])

# Create previous state dict with slightly different values
prev_state_dict = OrderedDict([
    ('fc.weight', torch.randn(weight_shape)),
    ('fc.bias', torch.randn(bias_shape)),
    ('conv.weight', torch.randn(2, 3, 3, 3))
])

# Create current mask - binary masks for each parameter
current_mask = OrderedDict([
    ('fc.weight', torch.ones(weight_shape, dtype=torch.float32)),
    ('fc.bias', torch.ones(bias_shape, dtype=torch.float32)),
    ('conv.weight', torch.ones(2, 3, 3, 3, dtype=torch.float32))
])

# Prune about 30% of parameters
prune_percent = 0.3

# Bound on sparsity
bound = 0.8

# Invert flag
invert = True

ARGS = {
    'prune_percent': prune_percent,
    'current_state_dict': current_state_dict,
    'prev_state_dict': prev_state_dict,
    'current_mask': current_mask,
    'bound': bound,
    'invert': invert
}
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 OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict 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
div_server_weights Ran
ran; our contract draft was wrong, not the code
lapisrocks/fedselect/fedselect.py
code served (permissive licence) · get_code("06848736b32a3ad6")
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 OrderedDict. 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
from collections import OrderedDict

torch.manual_seed(0)

# Create small server_weights OrderedDict with weight and bias keys
server_weights = OrderedDict()
server_weights['layer1.weight'] = torch.randn(3, 4)
server_weights['layer1.bias'] = torch.randn(3)
server_weights['layer2.weight'] = torch.randn(2, 3)
server_weights['layer2.bias'] = torch.randn(2)

# Create corresponding server_mask OrderedDict with same shape
server_mask = OrderedDict()
server_mask['layer1.weight'] = torch.tensor([[1., 2., 0., 1.],
                                             [1., 1., 1., 0.],
                                             [2., 1., 0., 1.]])
server_mask['layer1.bias'] = torch.tensor([1., 2., 0.])
server_mask['layer2.weight'] = torch.tensor([[1., 1., 2.],
                                             [0., 1., 1.]])
server_mask['layer2.bias'] = torch.tensor([1., 1.])

ARGS = {
    'server_weights': server_weights,
    'server_mask': server_mask
}
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 OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict 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
eval_layer_sparsity Ran
ran; our contract draft was wrong, not the code
lapisrocks/fedselect/fedselect.py
code served (permissive licence) · get_code("111f70a6f268709f")
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
from collections import OrderedDict

torch.manual_seed(0)

# Create a small mask OrderedDict with binary masks for model parameters
mask = OrderedDict()
mask['layer1.weight'] = torch.randint(0, 2, (4, 3), dtype=torch.float32)
mask['layer1.bias'] = torch.randint(0, 2, (4,), dtype=torch.float32)
mask['layer2.weight'] = torch.randint(0, 2, (2, 4), dtype=torch.float32)

# Define layer name to analyze
layer_name = 'layer1.weight'

ARGS = {
    'mask': mask,
    'layer_name': layer_name
}
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
evaluate Ran
ran, honoured the contract we drafted
lapisrocks/fedselect/fedselect.py
code served (permissive licence) · get_code("9af578129e5fbde5")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from torch.utils.data import DataLoader, TensorDataset

torch.manual_seed(0)

# Create a small model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(4, 3)  # 4 input features, 3 classes
    
    def forward(self, x):
        return self.fc(x)

# Create tiny test data
# Batch size 2, feature dimension 4, 3 classes
x_test = torch.randn(4, 4)  # 4 samples, 4 features
y_test = torch.randint(0, 3, (4,))  # 4 labels, 3 classes

# Create dataset and dataloader
test_dataset = TensorDataset(x_test, y_test)
ldr_test = DataLoader(test_dataset, batch_size=2)

# Create model instance
model = SimpleModel()

# Create args object with device info
class Args:
    def __init__(self):
        self.device = 'cpu'

args = Args()

ARGS = {
    'model': model,
    'ldr_test': ldr_test,
    'args': args
}
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_mask_from_delta Ran
ran; our contract draft was wrong, not the code
lapisrocks/fedselect/fedselect.py
code served (permissive licence) · get_code("71427e03a95c01eb")
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 OrderedDict. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 collections import OrderedDict
import copy

torch.manual_seed(0)

# Create small tensors for state dicts
current_state_dict = OrderedDict([
    ('fc.weight', torch.randn(3, 4)),
    ('fc.bias', torch.randn(3)),
])

prev_state_dict = OrderedDict([
    ('fc.weight', torch.randn(3, 4)),
    ('fc.bias', torch.randn(3)),
])

# Create binary masks (1s and 0s) for each weight tensor
current_mask = OrderedDict([
    ('fc.weight', torch.randint(0, 2, (3, 4)).float()),
    ('fc.bias', torch.randint(0, 2, (3,)).float()),
])

ARGS = {
    'prune_percent': 0.3,
    'current_state_dict': current_state_dict,
    'prev_state_dict': prev_state_dict,
    'current_mask': current_mask,
    'bound': 0.8,
    'invert': True,
}
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 OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict 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
init_mask_zeros Ran
ran; our contract draft was wrong, not the code
lapisrocks/fedselect/fedselect.py
code served (permissive licence) · get_code("23ec196a055705f6")
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 OrderedDict. 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 collections import OrderedDict

torch.manual_seed(0)

# Create a simple neural network model
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

model = SimpleModel()

ARGS = {
    "model": model
}
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 OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict 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
prepare_dataloaders Ran
ran on a synthesized input
lapisrocks/fedselect/fedselect.py
code served (permissive licence) · get_code("997128aa3682c39c")
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.utils.data

torch.manual_seed(0)

# Create a simple base dataset
class SimpleDataset(torch.utils.data.Dataset):
    def __init__(self, num_samples: int, img_dim: int = 4, num_classes: int = 3):
        self.num_samples = num_samples
        self.img_dim = img_dim
        self.num_classes = num_classes
    
    def __len__(self) -> int:
        return self.num_samples
    
    def __getitem__(self, idx: int):
        image = torch.randn(self.img_dim)
        label = idx % self.num_classes
        return (image, label)

# Create training dataset with 10 samples
dataset_train = SimpleDataset(num_samples=10, img_dim=4, num_classes=3)

# Create test dataset with 8 samples
dataset_test = SimpleDataset(num_samples=8, img_dim=4, num_classes=3)

# Create dictionary mapping user to training indices
dict_users_train = [0, 1, 2, 3, 4]

# Create dictionary mapping user to test indices
dict_users_test = [0, 1, 2, 3]

# Create args object with local_bs attribute
class Args:
    def __init__(self, local_bs: int):
        self.local_bs = local_bs

args = Args(local_bs=2)

ARGS = {
    "dataset_train": dataset_train,
    "dict_users_train": dict_users_train,
    "dataset_test": dataset_test,
    "dict_users_test": dict_users_test,
    "args": args,
}
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
print_nonzeros Ran
ran, honoured the contract we drafted
lapisrocks/fedselect/fedselect.py
code served (permissive licence) · get_code("396c8158b6badd56")
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 float64, ndim 0, 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
from collections import OrderedDict

torch.manual_seed(0)

# Create a small model as an OrderedDict with tensor parameters
# The function expects items() to iterate over (name, p) pairs where p has .data.cpu().numpy()
model = OrderedDict([
    ('layer1.weight', type('Param', (), {'data': torch.tensor([[1.0, 0.0, 2.0, 0.0], [0.0, 3.0, 0.0, 0.0]], dtype=torch.float32)})()),
    ('layer1.bias', type('Param', (), {'data': torch.tensor([1.0, 0.0, 0.0, 2.0], dtype=torch.float32)})()),
    ('layer2.weight', type('Param', (), {'data': torch.tensor([[0.0, 0.0], [1.0, 2.0], [0.0, 3.0], [4.0, 0.0]], dtype=torch.float32)})()),
])

ARGS = {
    'model': model,
    'verbose': False,
    'invert': False,
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
train_personalized Ran
ran; our contract draft was wrong, not the code
lapisrocks/fedselect/fedselect.py
code served (permissive licence) · get_code("3341e398e8f8ec8a")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from collections import OrderedDict
import torch.utils.data

torch.manual_seed(0)

# Build a minimal model that works with the training loop
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 = torch.relu(self.linear1(x))
        x = self.linear2(x)
        return x

# Create model instance
model = SimpleModel()

# Create a binary mask for all parameters
# The mask needs one entry per parameter group
mask = OrderedDict()
for name, param in model.named_parameters():
    mask[name] = torch.ones_like(param)

# Create training data loader
# Each batch is (data, target) tuple
# data shape: (batch_size, input_dim)
# target shape: (batch_size,) with class indices
train_data = [
    (torch.randn(2, 4), torch.randint(0, 2, (2,))),
    (torch.randn(2, 4), torch.randint(0, 2, (2,))),
]
ldr_train = train_data

# Create args object with required attributes
class Args:
    def __init__(self):
        self.lr = 0.01
        self.la_epochs = 2
        self.clipgradnorm = False

args = Args()

# Optional initialization (model state dict)
initialization = None

# Build ARGS dict with all parameters
ARGS = {
    'model': model,
    'ldr_train': ldr_train,
    'mask': mask,
    'args': args,
    'initialization': initialization,
    'verbose': False,
    'eval': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — 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
fedselect_algorithm Not yet run
unverified (harvested, no recorded run)
lapisrocks/fedselect/fedselect.py
code served (permissive licence) · get_code("13b39ed7d451ca4d")
How it ran

no invocation recorded.

local_alt Not yet run
unverified (harvested, no recorded run)
lapisrocks/fedselect/fedselect.py
code served (permissive licence) · get_code("7c4602b460e62e29")
How it ran

no invocation recorded.

print_lth_stats Not yet run
unverified (harvested, no recorded run)
lapisrocks/fedselect/fedselect.py
code served (permissive licence) · get_code("22016817f52e1a70")
How it ran

no invocation recorded.

Also present in other papers' code

Of 19 samples lifted from this paper's linked repositories, 19 carry a function identity and 0 do not. Of the 19 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 19 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-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Standard federated learning approaches suffer when client data distributions have sufficient heterogeneity. Recent methods addressed the client data heterogeneity issue via personalized federated learning (PFL) -a class of FL algorithms aiming to personalize learned global knowledge to better suit the clients' local data distributions. Existing PFL methods usually decouple global updates in deep neural networks by performing personalization on particular layers (i.e. classifier heads) and global aggregation for the rest of the network. However, preselecting network layers for personalization may result in suboptimal storage of global knowledge. In this work, we propose FED-SELECT, a novel PFL algorithm inspired by the iterative subnetwork discovery procedure used for the Lottery Ticket Hypothesis. FEDSELECT incrementally expands subnetworks to personalize client parameters, concurrently conducting global aggregations on the remaining parameters. This approach enables the personalization of both client parameters and subnetwork structure during the training process. Finally, we show that FEDSELECT outperforms recent state-of-the-art PFL algorithms under challenging client data heterogeneity settings and demonstrates robustness to various real-world distributional shifts. Our code is available at https://github.com/lapisrocks/fedselect.

For agents

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

get_harvested_code_for_paper("2404.02478")
get_code_for_paper("2404.02478")
have("2404.02478")

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

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

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

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

Connect an agent — have() is free.