SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.08578 · AAAI · 2024

FedLPS: Heterogeneous Federated Learning for Multiple Tasks with Local Parameter Sharing

Yongzhe Jia, Xuyun Zhang, Amin Beheshti, Wanchun Dou

arXiv · PDF · Open in the Atlas

Code that ran

2 of 2 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 2 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2402.08578.json · badge: /api/ran/2402.08578.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
jyzgh/FedLPS community
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
jyzgh/FedLPS/fedml_api/standalone/fedavg/fedlps_api.py
code served (permissive licence) · get_code("cf05c40ec5632e25")
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
import logging

logging.basicConfig(level=logging.INFO)

torch.manual_seed(0)

# Create a minimal model trainer with required methods
class MockModelTrainer:
    def __init__(self):
        self.model = nn.Linear(4, 2)
        self.client_id = None
    
    def set_id(self, client_idx):
        self.client_id = client_idx
    
    def set_model_params(self, weights):
        if weights is not None:
            with torch.no_grad():
                for param, weight in zip(self.model.parameters(), weights):
                    param.copy_(weight)
    
    def get_model_params(self):
        return [param.clone() for param in self.model.parameters()]
    
    def get_model(self):
        return self.model
    
    def train(self, local_training_data, device, args):
        # Minimal training logic
        self.model.train()
        for x, y in local_training_data:
            x, y = x.to(device), y.to(device)
            optimizer = torch.optim.SGD(self.model.parameters(), lr=args['learning_rate'])
            optimizer.zero_grad()
            output = self.model(x)
            loss = nn.functional.mse_loss(output, y)
            loss.backward()
            optimizer.step()
    
    def test(self, test_data, device, args):
        # Minimal test logic
        self.model.eval()
        total_loss = 0.0
        with torch.no_grad():
            for x, y in test_data:
                x, y = x.to(device), y.to(device)
                output = self.model(x)
                loss = nn.functional.mse_loss(output, y)
                total_loss += loss.item()
        return {'loss': total_loss / len(test_data)}

# Create minimal training and test data
# Data format: list of (x, y) tuples
local_training_data = [
    (torch.randn(2, 4), torch.randn(2, 2)),
    (torch.randn(2, 4), torch.randn(2, 2)),
]

local_test_data = [
    (torch.randn(2, 4), torch.randn(2, 2)),
    (torch.randn(2, 4), torch.randn(2, 2)),
]

# Create args dict
args = {
    'learning_rate': 0.01,
    'batch_size': 2,
    'epochs': 1,
}

# Device
device = torch.device('cpu')

# Model trainer
model_trainer = MockModelTrainer()

# Client index
client_idx = 0

# Local sample number
local_sample_number = 4

ARGS = {
    'client_idx': client_idx,
    'local_training_data': local_training_data,
    'local_test_data': local_test_data,
    'local_sample_number': local_sample_number,
    'args': args,
    'device': device,
    'model_trainer': model_trainer,
}
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 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
FedLPSAPI Ran
ran on a synthesized input · constructed an object; no result was computed
jyzgh/FedLPS/fedml_api/standalone/fedavg/fedlps_api.py
code served (permissive licence) · get_code("0d08ea031abacb3f")
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, FedLPSAPI: 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 copy
import logging

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

class SimpleModel(nn.Module):
    def __init__(self):
        super(SimpleModel, self).__init__()
        self.fc1 = nn.Linear(4, 8)
        self.fc2 = nn.Linear(8, 2)
    
    def forward(self, x):
        x = torch.relu(self.fc1(x))
        x = self.fc2(x)
        return x

class SimpleModelTrainer:
    def __init__(self):
        self.model = SimpleModel()
        self.client_id = 0
    
    def set_id(self, client_idx):
        self.client_id = client_idx
    
    def get_model(self):
        return copy.deepcopy(self.model)
    
    def get_model_params(self):
        return copy.deepcopy(self.model.state_dict())
    
    def set_model_params(self, params):
        self.model.load_state_dict(params)
    
    def train(self, train_data, device, args):
        self.model.train()
        for x, y in train_data:
            x = x.to(device)
            y = y.to(device)
            out = self.model(x)
    
    def test(self, test_data, device, args):
        self.model.eval()
        total_loss = 0.0
        with torch.no_grad():
            for x, y in test_data:
                x = x.to(device)
                y = y.to(device)
                out = self.model(x)
                total_loss += torch.nn.functional.cross_entropy(out, y).item()
        return {'loss': total_loss}

class ArgsConfig:
    def __init__(self):
        self.client_num_per_round = 2
        self.pr_type = 'fedlps'
        self.pr_strategy = 'uniform'
        self.dataset = 'mnist'
        self.model = 'r18'
        self.freeze_layer = 0
        self.epochs = 1
        self.lr = 0.01
        self.batch_size = 2

def create_dummy_data(num_samples=4, feature_dim=4, num_classes=2):
    data = []
    for i in range(num_samples):
        x = torch.randn(1, feature_dim)
        y = torch.tensor([i % num_classes])
        data.append((x, y))
    return data

device = torch.device('cpu')
args = ArgsConfig()
model_trainer = SimpleModelTrainer()

train_data_num = 8
test_data_num = 4
class_num = 2

train_data_global = create_dummy_data(8, 4, 2)
test_data_global = create_dummy_data(4, 4, 2)

train_data_local_num_dict = {0: 4, 1: 4}
test_data_local_num_dict = {0: 2, 1: 2}

train_data_local_dict = {
    0: create_dummy_data(4, 4, 2),
    1: create_dummy_data(4, 4, 2)
}

test_data_local_dict = {
    0: create_dummy_data(2, 4, 2),
    1: create_dummy_data(2, 4, 2)
}

dataset = [
    train_data_num,
    test_data_num,
    train_data_global,
    test_data_global,
    train_data_local_num_dict,
    train_data_local_dict,
    test_data_local_dict,
    class_num
]

ARGS = {
    'dataset': dataset,
    'device': device,
    'args': args,
    'model_trainer': model_trainer
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, wandb — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type FedLPSAPI — 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 FedLPSAPI 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

Also present in other papers' code

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

Repositories linked to this paper

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

Abstract

Federated Learning (FL) has emerged as a promising solution in Edge Computing (EC) environments to process the proliferation of data generated by edge devices. By collaboratively optimizing the global machine learning models on distributed edge devices, FL circumvents the need for transmitting raw data and enhances user privacy. Despite practical successes, FL still confronts significant challenges including constrained edge device resources, multiple tasks deployment, and data heterogeneity. However, existing studies focus on mitigating the FL training costs of each single task whereas neglecting the resource consumption across multiple tasks in heterogeneous FL scenarios. In this paper, we propose heterogeneous FEDerated learning with Local Parameter Sharing (FedLPS) to fill this gap. FedLPS leverages principles from transfer learning to facilitate the deployment of multiple tasks on a single device by dividing the local model into a shareable encoder and task-specific predictors. To further reduce resource consumption, a channel-wise model pruning algorithm that shrinks the footprint of local models while accounting for both data and system heterogeneity is employed in FedLPS. Additionally, a novel heterogeneous model aggregation algorithm is proposed to aggregate the heterogeneous predictors in FedLPS. We implemented the proposed FedLPS on a real FL platform and compared it with stateof-the-art (SOTA) FL frameworks. The experimental results on five popular datasets and two modern DNN models illustrate that the proposed FedLPS significantly outperforms the SOTA FL frameworks by up to 4.88% and reduces the computational resource consumption by 21.3%. Our code is available at: https://github.com/jyzgh/FedLPS.

For agents

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

get_harvested_code_for_paper("2402.08578")
get_code_for_paper("2402.08578")
have("2402.08578")

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

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

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

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

Connect an agent — have() is free.