SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2209.10083 · 2022

Federated Learning from Pre-Trained Models: A Contrastive Learning Approach

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 1 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/2209.10083.json · badge: /api/ran/2209.10083.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
TsingZ0/GFL community (classifier label)
classifier basis not recorded on the link
5 ran · 1 no recorded run
FunctionStatusWhere it lives
agg_func Ran
ran; our contract draft was wrong, not the code
TsingZ0/GFL/system/flcore/clients/clientktl.py
code served (permissive licence) · get_code("5d6dc231986a939a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# The function expects a dict where:
# - keys are labels
# - values are lists of tensors (proto_list)
# Each tensor should have a .data attribute and be normalizable with dim=0

protos = {
    0: [torch.randn(4), torch.randn(4)],  # Multiple prototypes for label 0
    1: [torch.randn(4)],  # Single prototype for label 1
    2: [torch.randn(4), torch.randn(4), torch.randn(4)],  # Multiple prototypes for label 2
}

ARGS = {
    "protos": protos
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
agg_func Ran
ran; our contract draft was wrong, not the code
TsingZ0/GFL/system/flcore/clients/clientgh.py
code served (permissive licence) · get_code("34ebb1820a560b2b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Construct a protos dictionary with labels as keys and lists of tensors as values
# The function expects each value to be a list of objects with a .data attribute
# We'll use simple tensors which have a .data attribute

proto_tensor_1 = torch.tensor([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]])
proto_tensor_2 = torch.tensor([[2.0, 3.0, 4.0, 5.0], [6.0, 7.0, 8.0, 9.0]])
proto_tensor_3 = torch.tensor([[3.0, 4.0, 5.0, 6.0], [7.0, 8.0, 9.0, 10.0]])
proto_tensor_4 = torch.tensor([[1.5, 2.5, 3.5, 4.5], [5.5, 6.5, 7.5, 8.5]])

protos = {
    0: [proto_tensor_1, proto_tensor_2, proto_tensor_3],  # Multiple protos for label 0
    1: [proto_tensor_4]  # Single proto for label 1
}

ARGS = {
    "protos": protos
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
agg_func Ran
ran; our contract draft was wrong, not the code
TsingZ0/GFL/system/flcore/clients/clientfd.py
code served (permissive licence) · get_code("00a3ba9dbf0b838b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# The function expects a dict where:
# - keys are labels (strings or similar)
# - values are lists of tensors (logit_list)
# Each tensor should have a .data attribute that supports arithmetic operations

# Create sample tensors with tiny dimensions
tensor1_label1 = torch.randn(2, 4)
tensor2_label1 = torch.randn(2, 4)
tensor1_label2 = torch.randn(2, 4)

logits = {
    'label_0': [tensor1_label1, tensor2_label1],
    'label_1': [tensor1_label2],
}

ARGS = {
    'logits': logits
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
decomposition Ran
ran; our contract draft was wrong, not the code
TsingZ0/GFL/system/flcore/clients/clientkd.py
code served (permissive licence) · get_code("a296eeb8fbc6ef9e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import torch

torch.manual_seed(0)

# Create a simple parameter iterator
# The function expects an iterable of (name, param) tuples
# where param has .detach().cpu().numpy() methods or is already a numpy array

class SimpleModel(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.weight1 = torch.nn.Parameter(torch.randn(4, 3))
        self.weight2 = torch.nn.Parameter(torch.randn(5, 6, 2, 2))
        self.embeddings = torch.nn.Parameter(torch.randn(2, 3))
    
    def forward(self, x):
        return x

model = SimpleModel()

# Create param_iter as a list of (name, param) tuples
param_iter = [
    ('weight1', model.weight1),
    ('weight2', model.weight2),
    ('embeddings', model.embeddings),
]

# Energy parameter: fraction of energy to preserve (0.95 = 95%)
energy = 0.95

ARGS = {
    'param_iter': param_iter,
    'energy': energy,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_item Ran
ran, honoured the contract we drafted
TsingZ0/GFL/system/flcore/clients/clientbase.py
code served (permissive licence) · get_code("132dfc2af9ff530c")
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 (2, 4) 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
import os
import tempfile

torch.manual_seed(0)

# Create a temporary directory for testing
temp_dir = tempfile.mkdtemp()

# Create a sample tensor to save
sample_tensor = torch.randn(2, 4)
torch.save(sample_tensor, os.path.join(temp_dir, 'test_role_test_item.pt'))

ARGS = {
    'role': 'test_role',
    'item_name': 'test_item',
    'item_path': temp_dir
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
recover Not yet run
unverified (harvested, no recorded run)
TsingZ0/GFL/system/flcore/clients/clientkd.py
code served (permissive licence) · get_code("77fd3aefd63cfad0")
How it ran

no invocation 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, 6 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 6 later) and 0 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
agg_func 3 other papers
3 later
2211.01572 (2022-11)
FedTP: Federated Learning by Transformer Personalization
2312.04992 (2023-12)
PFLlib: A Beginner-Friendly and Comprehensive Personalized Federated Learning Library and Benchmark
2401.03230 (2024-01)
FedTGP: Trainable Global Prototypes with Adaptive-Margin-Enhanced Contrastive Learning for Data and Model Heterogeneity in Federated Learning
load_item 3 other papers
3 later · 1 only as an assembly brick
2312.04992 (2023-12)
PFLlib: A Beginner-Friendly and Comprehensive Personalized Federated Learning Library and Benchmark
2401.03230 (2024-01)
FedTGP: Trainable Global Prototypes with Adaptive-Margin-Enhanced Contrastive Learning for Data and Model Heterogeneity in Federated Learning
2403.15760 (2024-03)
An Upload-Efficient Scheme for Transferring Knowledge From a Server-Side Pre-trained Generator to Clients in Heterogeneous Federated Learning
agg_func 2 other papers
2 later
2312.04992 (2023-12)
PFLlib: A Beginner-Friendly and Comprehensive Personalized Federated Learning Library and Benchmark
2403.15760 (2024-03)
An Upload-Efficient Scheme for Transferring Knowledge From a Server-Side Pre-trained Generator to Clients in Heterogeneous Federated Learning
agg_func 1 other paper
1 later
2312.04992 (2023-12)
PFLlib: A Beginner-Friendly and Comprehensive Personalized Federated Learning Library and Benchmark
decomposition 1 other paper
1 later
2312.04992 (2023-12)
PFLlib: A Beginner-Friendly and Comprehensive Personalized Federated Learning Library and Benchmark
recover 1 other paper
1 later
2312.04992 (2023-12)
PFLlib: A Beginner-Friendly and Comprehensive Personalized Federated Learning Library and Benchmark

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) is a machine learning paradigm that allows decentralized clients to learn collaboratively without sharing their private data. However, excessive computation and communication demands pose challenges to current FL frameworks, especially when training large-scale models. To prevent these issues from hindering the deployment of FL systems, we propose a lightweight framework where clients jointly learn to fuse the representations generated by multiple fixed pre-trained models rather than training a large-scale model from scratch. This leads us to a more practical FL problem by considering how to capture more client-specific and class-relevant information from the pre-trained models and jointly improve each client's ability to exploit those off-the-shelf models. In this work, we design a Federated Prototype-wise Contrastive Learning (FedPCL) approach which shares knowledge across clients through their class prototypes and builds client-specific representations in a prototype-wise contrastive manner. Sharing prototypes rather than learnable model parameters allows each client to fuse the representations in a personalized way while keeping the shared knowledge in a compact form for efficient communication. We perform a thorough evaluation of the proposed FedPCL in the lightweight framework, measuring and visualizing its ability to fuse various pre-trained models on popular FL datasets.

For agents

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

get_harvested_code_for_paper("2209.10083")
get_code_for_paper("2209.10083")
have("2209.10083")

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

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

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

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

Connect an agent — have() is free.