SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2306.11867 · ICLR · 2023

Personalized Federated Learning with Feature Alignment and Classifier Collaboration

Jian Xu, Shao-Lun Huang, Xinyi Tong

arXiv · PDF · Open in the Atlas

Code that ran

12 of 16 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (5 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 4 failures of our instrument; 4 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/2306.11867.json · badge: /api/ran/2306.11867.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
jianxu95/fedpac canonical (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
bdemo/pfedbred_public community
Papers with Code archive
6 ran · 2 no recorded run
TsingZ0/PFL-Non-IID community
Papers with Code archive
4 ran · 2 no recorded run
FunctionStatusWhere it lives
CoV Ran
ran on a synthesized input
TsingZ0/PFL-Non-IID/system/flcore/servers/servergpfl.py
code served (permissive licence) · get_code("3d7abb4a25cdc3d6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, 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

class CoV(nn.Module):

    def __init__(self, in_dim):
        super(CoV, self).__init__()
        self.Conditional_gamma = nn.Sequential(nn.Linear(in_dim, in_dim), nn.ReLU(), nn.LayerNorm([in_dim]))
        self.Conditional_beta = nn.Sequential(nn.Linear(in_dim, in_dim), nn.ReLU(), nn.LayerNorm([in_dim]))
        self.act = nn.ReLU()

    def forward(self, x, context):
        gamma = self.Conditional_gamma(context)
        beta = self.Conditional_beta(context)
        out = torch.multiply(x, gamma + 1)
        out = torch.add(out, beta)
        out = self.act(out)
        return out


INIT_ARGS = {
    'in_dim': 4
}

ARGS = {
    'x': torch.randn(2, 4),
    'context': torch.randn(2, 4)
}

if __name__ == '__main__':
    model = CoV(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
GCE Ran
ran on a synthesized input · constructed an object; no result was computed
TsingZ0/PFL-Non-IID/system/flcore/servers/servergpfl.py
code served (permissive licence) · get_code("f4e4dd636edb7a83")
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, GCE: 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 torch.nn.functional as F

torch.manual_seed(0)

class GCE(nn.Module):

    def __init__(self, in_features, num_classes, dev='cpu'):
        super(GCE, self).__init__()
        self.in_features = in_features
        self.num_classes = num_classes
        self.embedding = nn.Embedding(num_classes, in_features)
        self.dev = dev

    def forward(self, x, label):
        embeddings = self.embedding(torch.tensor(range(self.num_classes), device=self.dev))
        cosine = F.linear(F.normalize(x), F.normalize(embeddings))
        one_hot = torch.zeros(cosine.size(), device=self.dev)
        one_hot.scatter_(1, label.view(-1, 1).long(), 1)
        softmax_value = F.log_softmax(cosine, dim=1)
        softmax_loss = one_hot * softmax_value
        softmax_loss = -torch.mean(torch.sum(softmax_loss, dim=1))
        return softmax_loss

# Create test data
in_features = 4
num_classes = 3
batch_size = 2
dev = 'cpu'

# Create GCE instance
gce_model = GCE(in_features=in_features, num_classes=num_classes, dev=dev)

# Create input tensor (batch_size, in_features)
x = torch.randn(batch_size, in_features, device=dev)

# Create label tensor (batch_size,) with valid class indices
label = torch.tensor([0, 2], device=dev)

ARGS = {
    'in_features': in_features,
    'num_classes': num_classes,
    'dev': dev
}
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 GCE — 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 GCE 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
LocalUpdate_FedPAC Ran
ran on a synthesized input · constructed an object; no result was computed
jianxu95/fedpac/methods/fedpac.py
pointer only (licence: NONE) · get_code("2a9ddc0dd4e3eb52")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, jianxu95/fedpac 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.

SGD_lrs Ran
ran on a synthesized input · constructed an object; no result was computed
bdemo/pfedbred_public/Algorithms/pFedBreD/pFedBreD_ns/pFedBreD_ns_lg/localpFedBreD_ns_lg.py
pointer only (licence: NONE) · get_code("3f19a8a64245b86d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, bdemo/pfedbred_public 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.

get_loss Ran
ran; our contract draft was wrong, not the code
bdemo/pfedbred_public/Algorithms/pFedBreD/pFedBreD_ns/pFedBreD_ns_lg/localpFedBreD_ns_lg.py
pointer only (licence: NONE) · get_code("9b0f0a1490e44f65")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, bdemo/pfedbred_public 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.

get_optimizer Ran
ran; our contract draft was wrong, not the code
bdemo/pfedbred_public/Algorithms/pFedBreD/pFedBreD_ns/pFedBreD_ns_lg/localpFedBreD_ns_lg.py
pointer only (licence: NONE) · get_code("af4dae2e3838a37b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, bdemo/pfedbred_public 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.

get_protos Ran
ran; our contract draft was wrong, not the code
jianxu95/fedpac/methods/fedpac.py
pointer only (licence: NONE) · get_code("8d5aa33ca2074482")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, jianxu95/fedpac 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.

kl_Optimizer Ran
ran on a synthesized input
bdemo/pfedbred_public/Algorithms/pFedBreD/pFedBreD_ns/pFedBreD_ns_lg/localpFedBreD_ns_lg.py
pointer only (licence: NONE) · get_code("05ae25b2ba9129de")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, bdemo/pfedbred_public 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.

lpFedBreD_ns_lg Ran
ran on a synthesized input · constructed an object; no result was computed
bdemo/pfedbred_public/Algorithms/pFedBreD/pFedBreD_ns/pFedBreD_ns_lg/localpFedBreD_ns_lg.py
pointer only (licence: NONE) · get_code("23b46954f2e378be")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, bdemo/pfedbred_public 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.

ns_iter_Optimizer Ran
ran on a synthesized input · constructed an object; no result was computed
bdemo/pfedbred_public/Algorithms/pFedBreD/pFedBreD_ns/pFedBreD_ns_lg/localpFedBreD_ns_lg.py
pointer only (licence: NONE) · get_code("7572a34779528911")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, bdemo/pfedbred_public 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.

read_client_data Ran
ran; our contract draft was wrong, not the code
TsingZ0/PFL-Non-IID/system/flcore/servers/servergpfl.py
code served (permissive licence) · get_code("54f545b907254f8e")
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 list. 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 numpy as np
import os
import tempfile
from collections import defaultdict

torch.manual_seed(0)

# Create a temporary directory structure for the dataset
temp_dir = tempfile.mkdtemp()
dataset_dir = os.path.join(temp_dir, 'dataset', 'News_dataset', 'train')
os.makedirs(dataset_dir, exist_ok=True)

# Create a sample .npz file for News dataset (text data)
news_data = {
    'x': [
        ([1, 2, 3], 4),
        ([2, 3, 4], 5),
    ],
    'y': [0, 1]
}
np.savez(os.path.join(dataset_dir, '0.npz'), data=news_data)

# Create a sample .npz file for Shakespeare dataset
shakespeare_data = {
    'x': [[1, 2, 3, 4], [2, 3, 4, 5]],
    'y': [0, 1]
}
np.savez(os.path.join(dataset_dir, '1.npz'), data=shakespeare_data)

# Create a sample .npz file for image dataset
image_data = {
    'x': [[0.1, 0.2, 0.3, 0.4], [0.2, 0.3, 0.4, 0.5]],
    'y': [0, 1]
}
np.savez(os.path.join(dataset_dir, '2.npz'), data=image_data)

# Patch os.path.join to use our temp directory
original_join = os.path.join
def patched_join(*args):
    if len(args) > 0 and args[0] == '../dataset':
        return original_join(temp_dir, 'dataset', *args[1:])
    return original_join(*args)

os.path.join = patched_join

ARGS = {
    'dataset': 'News_dataset',
    'idx': 0,
    'is_train': True,
    'few_shot': 0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
read_data Ran
ran, honoured the contract we drafted
TsingZ0/PFL-Non-IID/system/flcore/servers/servergpfl.py
code served (permissive licence) · get_code("863a33ba4360cc7f")
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 list, ndim 1, dtype family int; 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 os
import numpy as np
import tempfile
import shutil

# Create a temporary directory structure to simulate the dataset
temp_dir = tempfile.mkdtemp()
dataset_name = 'test_dataset'
dataset_path = os.path.join(temp_dir, 'dataset', dataset_name)
train_dir = os.path.join(dataset_path, 'train')
test_dir = os.path.join(dataset_path, 'test')

os.makedirs(train_dir, exist_ok=True)
os.makedirs(test_dir, exist_ok=True)

# Create sample .npz files for training and testing
sample_data_train = {'data': np.array([1, 2, 3, 4])}
sample_data_test = {'data': np.array([5, 6, 7, 8])}

np.savez(os.path.join(train_dir, '0.npz'), **sample_data_train)
np.savez(os.path.join(test_dir, '0.npz'), **sample_data_test)

# Patch os.path.join to redirect to our temp directory
original_join = os.path.join
def patched_join(*args):
    result = original_join(*args)
    if '../dataset' in result:
        result = result.replace('../dataset', os.path.join(temp_dir, 'dataset'))
    return result

os.path.join = patched_join

ARGS = {
    'dataset': 'test_dataset',
    'idx': 0,
    'is_train': True
}
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 list, ndim 1, dtype family int — a list 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
GPFL Not yet run
unverified (harvested, no recorded run)
TsingZ0/PFL-Non-IID/system/flcore/servers/servergpfl.py
code served (permissive licence) · get_code("20ebf8e1ec9753ab")
How it ran

no invocation recorded.

Server Not yet run
unverified (harvested, no recorded run)
TsingZ0/PFL-Non-IID/system/flcore/servers/servergpfl.py
code served (permissive licence) · get_code("88dc6530e6a80133")
How it ran

no invocation recorded.

lbase Not yet run
unverified (harvested, no recorded run)
bdemo/pfedbred_public/Algorithms/pFedBreD/pFedBreD_ns/pFedBreD_ns_lg/localpFedBreD_ns_lg.py
pointer only (licence: NONE) · get_code("1fc5a7086ab14b31")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, bdemo/pfedbred_public 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. No invocation recorded.

ns_Optimizer Not yet run
unverified (harvested, no recorded run)
bdemo/pfedbred_public/Algorithms/pFedBreD/pFedBreD_ns/pFedBreD_ns_lg/localpFedBreD_ns_lg.py
pointer only (licence: NONE) · get_code("da41de3f29c80bf9")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, bdemo/pfedbred_public 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. No invocation recorded.

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 16 distinct functions with an identity, 6 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 5 later) and 10 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
read_client_data
brick of this paper's assembly: helper
10 other papers
8 dated earlier, 2 later · 8 only as an assembly brick
1602.05629 (2016-02)
Communication-Efficient Learning of Deep Networks from Decentralized Data
2001.01523 (2020-01)
Think Locally, Act Globally: Federated Learning with Local and Global Representations
2012.04221 (2020-12)
Ditto: Fair and Robust Federated Learning Through Personalization
and 7 more not named here
read_data
brick of this paper's assembly: helper
10 other papers
8 dated earlier, 2 later · 9 only as an assembly brick
1602.05629 (2016-02)
Communication-Efficient Learning of Deep Networks from Decentralized Data
2001.01523 (2020-01)
Think Locally, Act Globally: Federated Learning with Local and Global Representations
2012.04221 (2020-12)
Ditto: Fair and Robust Federated Learning Through Personalization
and 7 more not named here
Server
brick of this paper's assembly: helper
4 other papers
4 dated earlier
1602.05629 (2016-02)
Communication-Efficient Learning of Deep Networks from Decentralized Data
2102.07623 (2021-02)
FedBN: Federated Learning on Non-IID Features via Local Batch Normalization
2106.06042 (2021-06)
FEDBABU: TOWARD ENHANCED REPRESENTATION FOR FEDERATED IMAGE CLASSIFICATION
and 1 more not named here
CoV
brick of this paper's assembly: model
1 other paper
1 later · 1 only as an assembly brick
2308.10279 (2023-08)
GPFL: Simultaneously Learning Global and Personalized Feature Information for Personalized Federated Learning
GCE
brick of this paper's assembly: model
1 other paper
1 later · 1 only as an assembly brick
2308.10279 (2023-08)
GPFL: Simultaneously Learning Global and Personalized Feature Information for Personalized Federated Learning
GPFL
brick of this paper's assembly: entry
1 other paper
1 later
2308.10279 (2023-08)
GPFL: Simultaneously Learning Global and Personalized Feature Information 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-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

Data heterogeneity is one of the most challenging issues in federated learning, which motivates a variety of approaches to learn personalized models for participating clients. One such approach in deep neural networks based tasks is employing a shared feature representation and learning a customized classifier head for each client. However, previous works do not utilize the global knowledge during local representation learning and also neglect the fine-grained collaboration between local classifier heads, which limit the model generalization ability. In this work, we conduct explicit local-global feature alignment by leveraging global semantic knowledge for learning a better representation. Moreover, we quantify the benefit of classifier combination for each client as a function of the combining weights and derive an optimization problem for estimating optimal weights. Finally, extensive evaluation results on benchmark datasets with various heterogeneous data scenarios demonstrate the effectiveness of our proposed method 1 .

For agents

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

get_harvested_code_for_paper("2306.11867")
get_code_for_paper("2306.11867")
have("2306.11867")

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

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

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

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

Connect an agent — have() is free.