SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.04596 · ICML · 2024

Federated Representation Learning in the Under-Parameterized Regime

Jing Yang, Cong Shen, Renpu Liu

arXiv · PDF · Open in the Atlas

Code that ran

6 of 8 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; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 2 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/2406.04596.json · badge: /api/ran/2406.04596.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
RenpuLiu/flute canonical (classifier label)
classifier basis: census
6 ran · 2 no recorded run
FunctionStatusWhere it lives
balanced_softmax_loss Ran
ran; our contract draft was wrong, not the code
RenpuLiu/flute/models/bsml.py
code served (permissive licence) · get_code("c6d3bab23c40891a")
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 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)

# Construct arguments for balanced_softmax_loss
# labels: tensor of class indices for each sample
# logits: tensor of prediction scores, shape (batch_size, num_classes)
# sample_per_class: tensor counting samples per class

batch_size = 2
num_classes = 4

labels = torch.tensor([0, 2], dtype=torch.long)
logits = torch.randn(batch_size, num_classes)
sample_per_class = torch.tensor([3, 2, 4, 1], dtype=torch.long)

ARGS = {
    "labels": labels,
    "logits": logits,
    "sample_per_class": sample_per_class,
}
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 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
balanced_softmax_loss Ran
ran; our contract draft was wrong, not the code
RenpuLiu/flute/utils/bsml.py
code served (permissive licence) · get_code("9dc354a7407a75b8")
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 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
import torch.nn.functional as F

torch.manual_seed(0)

# Set up the arguments
batch_size = 2
num_classes = 4

# labels: int tensor of size [batch]
labels = torch.tensor([0, 2], dtype=torch.long)

# logits: float tensor of size [batch, num_classes]
logits = torch.randn(batch_size, num_classes, dtype=torch.float32)

# sample_per_class: int tensor of size [num_classes]
sample_per_class = torch.tensor([10, 5, 8, 7], dtype=torch.long)

# reduction: one of "none", "mean", "sum"
reduction = "mean"

ARGS = {
    "labels": labels,
    "logits": logits,
    "sample_per_class": sample_per_class,
    "reduction": reduction,
}
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 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
create_loss Ran
ran; our contract draft was wrong, not the code
RenpuLiu/flute/utils/bsml.py
pointer only (licence: MIT); the stored copy get_code serves, from jiawei-ren/BalancedMetaSoftmax-Classification, is pointer only (licence: NOASSERTION) · get_code("b30a377cff8dd790")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from jiawei-ren/BalancedMetaSoftmax-Classification, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

create_loss Ran
ran; our contract draft was wrong, not the code
RenpuLiu/flute/models/bsml.py
code served (permissive licence) · get_code("1cc29ca74b9238bb")
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 BalancedSoftmax. 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 json
import tempfile
import os

torch.manual_seed(0)

# Create a temporary frequency file
temp_dir = tempfile.mkdtemp()
freq_path = os.path.join(temp_dir, "freq.json")

# Create a small frequency distribution for 4 classes
frequencies = [10, 20, 15, 25]
with open(freq_path, 'w') as f:
    json.dump(frequencies, f)

ARGS = {
    'freq_path': freq_path
}
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 BalancedSoftmax — a BalancedSoftmax output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a BalancedSoftmax 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
fun_reg_2 Ran
ran; our contract draft was wrong, not the code
RenpuLiu/flute/models/Update.py
code served (permissive licence) · get_code("b42711feaf8c8817")
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. 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 and file for the rand_set_all data
temp_dir = tempfile.mkdtemp()
rand_set_file = os.path.join(temp_dir, 'rand_set_all.txt')

# Create mock rand_set_all data - a list where each index i contains a set of class indices
num_users_mock = 3
num_classes_mock = 5
rand_set_all = [set([0, 1]) for _ in range(num_users_mock)]
torch.save(rand_set_all, rand_set_file)

# Mock the file path globally so the function can find it
import builtins
original_open = builtins.open

def mock_open(path, *args, **kwargs):
    if 'rand_set_all.txt' in path:
        return original_open(rand_set_file, *args, **kwargs)
    return original_open(path, *args, **kwargs)

builtins.open = mock_open

# Create args object with dataset and num_classes
class Args:
    def __init__(self):
        self.num_classes = num_classes_mock
        self.dataset = 'cifar10'

args = Args()

# Create w_locals - dict mapping user index to model weights
# The function expects w_locals[idx]['fc3.weight'] and w_locals[idx]['fc3.bias']
w_locals = {}
k = 64  # for cifar10

for i in range(num_users_mock):
    # fc3.weight should be (num_classes, k) based on how it's indexed
    # fc3.bias should be (num_classes,) based on how it's indexed
    w_locals[i] = {
        'fc3.weight': torch.randn(num_classes_mock, k),
        'fc3.bias': torch.randn(num_classes_mock)
    }

# idxs_users - list of user indices to process
idxs_users = [0, 1, 2]

ARGS = {
    'args': args,
    'w_locals': w_locals,
    'idxs_users': idxs_users
}
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
read_data Ran
ran; our contract draft was wrong, not the code
RenpuLiu/flute/utils/train_utils.py
code served (permissive licence) · get_code("113b54f5013bd868")
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. 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 os
import json
import tempfile
import shutil

# Create temporary directories for train and test data
train_dir = tempfile.mkdtemp()
test_dir = tempfile.mkdtemp()

# Create sample train data files
train_data_1 = {
    "users": ["user_0", "user_1"],
    "user_data": {
        "user_0": {"x": [1, 2, 3], "y": [0]},
        "user_1": {"x": [4, 5, 6], "y": [1]}
    }
}

train_data_2 = {
    "users": ["user_2"],
    "hierarchies": ["group_A"],
    "user_data": {
        "user_2": {"x": [7, 8, 9], "y": [0]}
    }
}

# Write train data files
with open(os.path.join(train_dir, "train_1.json"), "w") as f:
    json.dump(train_data_1, f)

with open(os.path.join(train_dir, "train_2.json"), "w") as f:
    json.dump(train_data_2, f)

# Create sample test data files
test_data_1 = {
    "users": ["user_0", "user_1", "user_2"],
    "user_data": {
        "user_0": {"x": [10, 11, 12], "y": [1]},
        "user_1": {"x": [13, 14, 15], "y": [0]},
        "user_2": {"x": [16, 17, 18], "y": [1]}
    }
}

with open(os.path.join(test_dir, "test_1.json"), "w") as f:
    json.dump(test_data_1, f)

ARGS = {
    "train_data_dir": train_dir,
    "test_data_dir": test_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 tuple — a tuple 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
fun_reg Not yet run
unverified (harvested, no recorded run)
RenpuLiu/flute/models/Update.py
code served (permissive licence) · get_code("49fb46a01662d68d")
How it ran

no invocation recorded.

noniid Not yet run
unverified (harvested, no recorded run)
RenpuLiu/flute/utils/sampling.py
code served (permissive licence) · get_code("eacc168e830bc4ec")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 0 later) and 4 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
balanced_softmax_loss 2 other papers
2 dated earlier
2007.10740 (2020-07)
Balanced Meta-Softmax for Long-Tailed Visual Recognition
2307.08235 (2023-07)
Towards Heterogeneous Long-tailed Learning: Benchmarking, Metrics, and Toolbox
read_data 2 other papers
2 dated earlier
1812.06127 (2018-12)
Federated Optimization in Heterogeneous Networks
2206.13190 (2022-06)
An Empirical Study of Personalized Federated Learning
create_loss 1 other paper
1 dated earlier
2007.10740 (2020-07)
Balanced Meta-Softmax for Long-Tailed Visual Recognition

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 representation learning (FRL) is a popular personalized federated learning (FL) framework where clients work together to train a common representation while retaining their personalized heads. Existing studies, however, largely focus on the over-parameterized regime. In this paper, we make the initial efforts to investigate FRL in the under-parameterized regime, where the FL model is insufficient to express the variations in all ground-truth models. We propose a novel FRL algorithm FLUTE, and theoretically characterize its sample complexity and convergence rate for linear models in the under-parameterized regime. To the best of our knowledge, this is the first FRL algorithm with provable performance guarantees in this regime. FLUTE features a data-independent random initialization and a carefully designed objective function that aids the distillation of subspace spanned by the global optimal representation from the misaligned local representations. On the technical side, we bridge low-rank matrix approximation techniques with the FL analysis, which may be of broad interest. We also extend FLUTE beyond linear representations. Experimental results demonstrate that FLUTE outperforms state-of-the-art FRL solutions in both synthetic and real-world tasks.

For agents

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

get_harvested_code_for_paper("2406.04596")
get_code_for_paper("2406.04596")
have("2406.04596")

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

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

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

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

Connect an agent — have() is free.