SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.02776 · ICML · 2023

Efficient Personalized Federated Learning via Sparse Model-Adaptation

Yaliang Li, Bolin Ding, Daoyuan Chen, Dawei Gao, Liuyi Yao, Gating Layer

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 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; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 3 failures of our instrument; 0 no recorded run), 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/2305.02776.json · badge: /api/ran/2305.02776.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
alibaba/FederatedScope canonical (classifier label)
classifier basis: census
3 ran · 0 no recorded run
alibaba/federatedscope canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
yxdyc/pfedgate marked official in Papers with Code
Papers with Code archive
2 ran · 0 no recorded run
FunctionStatusWhere it lives
Client Ran
ran on a synthesized input · constructed an object; no result was computed
yxdyc/pfedgate/pFedGate/gated_client.py
code served (permissive licence) · get_code("4c66c7437573a0ed")
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, Client: 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.utils.data import DataLoader, TensorDataset
import logging

torch.manual_seed(0)

# Create a simple learner model
class SimpleLearner(nn.Module):
    def __init__(self, input_dim=4, output_dim=2):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, x):
        return self.linear(x)

# Create a learner wrapper that has the expected interface
class Learner:
    def __init__(self, model):
        self.model = model
    
    def fit_batch(self, batch, weights):
        return {"learner_0": None}
    
    def fit_epochs(self, iterator, n_epochs, weights):
        return {"learner_0": None}
    
    def evaluate_iterator(self, iterator):
        return (0.5, 0.8)

# Create learners ensemble with required interface
class LearnersEnsemble:
    def __init__(self, learners):
        self.learners = learners
        self.is_binary_classification = True
    
    def __len__(self):
        return len(self.learners)
    
    def __iter__(self):
        return iter(self.learners)
    
    def __getitem__(self, idx):
        return self.learners[idx]
    
    def fit_batch(self, batch, weights):
        return {"learner_0": None}
    
    def fit_epochs(self, iterator, n_epochs, weights):
        return {"learner_0": None}
    
    def evaluate_iterator(self, iterator):
        return (0.5, 0.8)

# Create small dataset
X_train = torch.randn(2, 4)
y_train = torch.randint(0, 2, (2,))
train_dataset = TensorDataset(X_train, y_train)
train_iterator = DataLoader(train_dataset, batch_size=2)

X_val = torch.randn(2, 4)
y_val = torch.randint(0, 2, (2,))
val_dataset = TensorDataset(X_val, y_val)
val_iterator = DataLoader(val_dataset, batch_size=2)

X_test = torch.randn(2, 4)
y_test = torch.randint(0, 2, (2,))
test_dataset = TensorDataset(X_test, y_test)
test_iterator = DataLoader(test_dataset, batch_size=2)

# Create learners ensemble
model1 = SimpleLearner(input_dim=4, output_dim=2)
learner1 = Learner(model1)
learners_ensemble = LearnersEnsemble([learner1])

# Create logger
logger = logging.getLogger("test_logger")
logger.setLevel(logging.INFO)

ARGS = {
    "learners_ensemble": learners_ensemble,
    "train_iterator": train_iterator,
    "val_iterator": val_iterator,
    "test_iterator": test_iterator,
    "logger": logger,
    "local_steps": 1,
    "tune_locally": False,
    "node_id": 0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, wandb — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Client — 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 Client 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
b64serializer Ran
ran on a synthesized input
alibaba/FederatedScope/federatedscope/core/message.py
pointer only (licence: Apache-2.0) · get_code("10fb8ac8ca4bd20c")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, alibaba/FederatedScope, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

convert Ran
ran; our contract draft was wrong, not the code
alibaba/federatedscope/benchmark/pFL-Bench/res_analysis_plot/get_total_run_time.py
code served (permissive licence) · get_code("5f1bef2d6dc15859")
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 str. 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.

# Setup code for convert function

ARGS = {
    "seconds": 90061
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
pFedGateClient Ran
ran on a synthesized input · constructed an object; no result was computed
yxdyc/pfedgate/pFedGate/gated_client.py
code served (permissive licence) · get_code("5e7fe94cf58de64a")
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, pFedGateClient: 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
import logging
from torch.utils.data import TensorDataset, DataLoader

torch.manual_seed(0)

# Create a minimal Learner class
class MinimalLearner(nn.Module):
    def __init__(self, input_dim=4, output_dim=2):
        super().__init__()
        self.model = nn.Linear(input_dim, output_dim)
    
    def forward(self, x):
        return self.model(x)
    
    def fit_batch(self, batch, weights):
        return {"loss": 0.1}
    
    def fit_epochs(self, iterator, n_epochs, weights):
        return {"loss": 0.1}
    
    def evaluate_iterator(self, iterator):
        return (0.5, 0.8)

# Create a minimal LearnersEnsemble class
class MinimalLearnersEnsemble(nn.Module):
    def __init__(self, n_learners=2):
        super().__init__()
        self.learners = nn.ModuleList([MinimalLearner(input_dim=4, output_dim=2) for _ in range(n_learners)])
        self.is_binary_classification = True
    
    def __len__(self):
        return len(self.learners)
    
    def __getitem__(self, idx):
        return self.learners[idx]
    
    def __iter__(self):
        return iter(self.learners)
    
    def fit_batch(self, batch, weights):
        return {"loss": 0.1}
    
    def fit_epochs(self, iterator, n_epochs, weights):
        return {"loss": 0.1}
    
    def evaluate_iterator(self, iterator):
        return (0.5, 0.8)

# Create minimal dataset and dataloaders
X_train = torch.randn(10, 4)
y_train = torch.randint(0, 2, (10,))
X_val = torch.randn(6, 4)
y_val = torch.randint(0, 2, (6,))
X_test = torch.randn(8, 4)
y_test = torch.randint(0, 2, (8,))

train_dataset = TensorDataset(X_train, y_train)
val_dataset = TensorDataset(X_val, y_val)
test_dataset = TensorDataset(X_test, y_test)

train_iterator = DataLoader(train_dataset, batch_size=2)
val_iterator = DataLoader(val_dataset, batch_size=2)
test_iterator = DataLoader(test_dataset, batch_size=2)

# Create logger
logger = logging.getLogger("test_logger")
logger.setLevel(logging.INFO)

class MinimalHandler(logging.Handler):
    def emit(self, record):
        pass

handler = MinimalHandler()
logger.addHandler(handler)

# Add add_scalar method to logger if not present
if not hasattr(logger, 'add_scalar'):
    def add_scalar(self, tag, value, step):
        pass
    logger.add_scalar = add_scalar.__get__(logger, type(logger))

# Create learners ensemble
learners_ensemble = MinimalLearnersEnsemble(n_learners=2)

ARGS = {
    "learners_ensemble": learners_ensemble,
    "train_iterator": train_iterator,
    "val_iterator": val_iterator,
    "test_iterator": test_iterator,
    "logger": logger,
    "local_steps": 2,
    "tune_locally": False,
    "node_id": 0,
    "bi_level_opt": 1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, wandb — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type pFedGateClient — 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 pFedGateClient 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
parse_client_cfg Ran
ran; our contract draft was wrong, not the code
alibaba/FederatedScope/federatedscope/core/cmd_args.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from Pengxin-Guo/FedSA-LoRA, is pointer only (licence: NONE) · get_code("93bfa4c750a44d4d")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from Pengxin-Guo/FedSA-LoRA, and GitHub detected no licence in that repository 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.

wrap_regularized_optimizer Ran
ran; our contract draft was wrong, not the code
alibaba/FederatedScope/federatedscope/core/optimizer.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from Pengxin-Guo/FedSA-LoRA, is pointer only (licence: NONE) · get_code("385ae669172a8fe2")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from Pengxin-Guo/FedSA-LoRA, and GitHub detected no licence in that repository 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.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 3 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 2 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
wrap_regularized_optimizer 4 other papers
4 later
2406.17706 (2024-06)
FedBiOT: LLM Local Fine-tuning in Federated Learning without Full Model
2406.18937 (2024-06)
Federated Graph Semantic and Structural Learning
2407.03038 (2024-07)
Towards Federated RLHF with Aggregated Client Preference for LLMs
and 1 more not named here
parse_client_cfg 3 other papers
3 later
2406.17706 (2024-06)
FedBiOT: LLM Local Fine-tuning in Federated Learning without Full Model
2407.03038 (2024-07)
Towards Federated RLHF with Aggregated Client Preference for LLMs
2410.01463 (2024-10)
Selective Aggregation for Low-Rank Adaptation in Federated Learning
convert 1 other paper
1 dated earlier
2206.03655 (2022-06)
pFL-Bench: A Comprehensive Benchmark for Personalized 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-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 (FL) aims to train machine learning models for multiple clients without sharing their own private data. Due to the heterogeneity of clients' local data distribution, recent studies explore the personalized FL that learns and deploys distinct local models with the help of auxiliary global models. However, the clients can be heterogeneous in terms of not only local data distribution, but also their computation and communication resources. The capacity and efficiency of personalized models are restricted by the lowest-resource clients, leading to suboptimal performance and limited practicality of personalized FL. To overcome these challenges, we propose a novel approach named pFedGate for efficient personalized FL by adaptively and efficiently learning sparse local models. With a lightweight trainable gating layer, pFedGate enables clients to reach their full potential in model capacity by generating different sparse models accounting for both the heterogeneous data distributions and resource constraints. Meanwhile, the computation and communication efficiency are both improved thanks to the adaptability between the model sparsity and clients' resources. Further, we theoretically show that the proposed pFedGate has superior complexity with guaranteed convergence and generalization error. Extensive experiments show that pFedGate achieves superior global accuracy, individual accuracy and efficiency simultaneously over state-of-the-art methods. We also demonstrate that pFedGate performs better than competitors in the novel clients participation and partial clients participation scenarios, and can learn meaningful sparse local models adapted to different data distributions.

For agents

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

get_harvested_code_for_paper("2305.02776")
get_code_for_paper("2305.02776")
have("2305.02776")

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

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

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

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

Connect an agent — have() is free.