SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2308.12681 · 2023

LR-XFL: Logical Reasoning-based Explainable Federated Learning

arXiv · PDF · Open in the Atlas

Code that ran

4 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; 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/2308.12681.json · badge: /api/ran/2308.12681.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
yanci87/lr-xfl canonical (classifier label)
classifier basis: census
4 ran · 4 no recorded run
FunctionStatusWhere it lives
average_weights_class Ran
ran; our contract draft was wrong, not the code
yanci87/lr-xfl/experiments/utils.py
code served (permissive licence) · get_code("4a2b261c9aa1cd96")
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 copy

torch.manual_seed(0)

# Build a minimal state dict structure that matches what the function expects
# The function accesses w[user][key] and expects keys like 'model.0.weight', 'model.0.bias'
# and other model parameter keys

# Create weight dictionaries for 3 users
user_0_state = {
    'model.0.weight': torch.randn(2, 4, 3),  # [classes, dim1, dim2]
    'model.0.bias': torch.randn(2, 4),        # [classes, dim]
    'model.1.weight': torch.randn(4, 5),
    'model.1.bias': torch.randn(5)
}

user_1_state = {
    'model.0.weight': torch.randn(2, 4, 3),
    'model.0.bias': torch.randn(2, 4),
    'model.1.weight': torch.randn(4, 5),
    'model.1.bias': torch.randn(5)
}

user_2_state = {
    'model.0.weight': torch.randn(2, 4, 3),
    'model.0.bias': torch.randn(2, 4),
    'model.1.weight': torch.randn(4, 5),
    'model.1.bias': torch.randn(5)
}

# Dictionary mapping user IDs to their state dicts
w = {
    'user_0': user_0_state,
    'user_1': user_1_state,
    'user_2': user_2_state
}

# user_to_engage_class: list of lists, where each inner list contains user IDs for that class
# Since model.0 has 2 classes (dimension 0 is 2), we need 2 classes
user_to_engage_class = [
    ['user_0', 'user_1'],  # class 0
    ['user_1', 'user_2']   # class 1
]

ARGS = {
    'w': w,
    'user_to_engage_class': user_to_engage_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 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
replace_names Ran
ran; our contract draft was wrong, not the code
yanci87/lr-xfl/experiments/cub_tree.py
code served (permissive licence) · get_code("b87b1314a37f79af")
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 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.

import torch
import numpy as np
from typing import List

torch.manual_seed(0)

# Analyze the function:
# - mapping_flag: boolean flag that determines the order of mapping tuples
# - explanation: a string containing a formula with feature names
# - concept_names: a list of strings representing new concept names

# The function replaces names in the explanation string based on the mapping.
# It creates feature_abbreviations like 'feature0000000000', 'feature0000000001', etc.
# Then it creates a mapping between these abbreviations and concept_names
# depending on mapping_flag, and replaces them in the explanation string.

# Build test data
mapping_flag = True
concept_names = ["neuron_activation", "weight_magnitude", "bias_term"]
explanation = "feature0000000000 AND feature0000000001 OR feature0000000002"

ARGS = {
    "mapping_flag": mapping_flag,
    "explanation": explanation,
    "concept_names": concept_names,
}
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 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
tree_rules Ran
ran; our contract draft was wrong, not the code
yanci87/lr-xfl/experiments/cub_tree.py
code served (permissive licence) · get_code("0772a859a01b31ac")
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.

from sklearn.tree import DecisionTreeClassifier
import numpy as np

# Create a simple dataset
X = np.array([
    [1.0, 2.0, 3.0],
    [2.0, 3.0, 1.0],
    [3.0, 1.0, 2.0],
    [1.5, 2.5, 3.5]
])
y = np.array([0, 1, 0, 1])

# Train a decision tree classifier
tree = DecisionTreeClassifier(max_depth=2, random_state=42)
tree.fit(X, y)

# Feature names
feature_names = ['feature_0', 'feature_1', 'feature_2']

ARGS = {
    'tree': tree,
    'feature_names': feature_names
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — 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
weighted_weights Ran
ran; our contract draft was wrong, not the code
yanci87/lr-xfl/experiments/utils.py
code served (permissive licence) · get_code("3ad5dfe0c16fea02")
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 copy

torch.manual_seed(0)

# Create w: a dict of dicts containing tensors
# The function iterates over w.keys() and accesses w[key][inner_key]
# So w should be a dict where each value is itself a dict with tensor values
w = {
    "user_0": {
        "layer1": torch.randn(4, 3),
        "layer2": torch.randn(2, 5),
    },
    "user_1": {
        "layer1": torch.randn(4, 3),
        "layer2": torch.randn(2, 5),
    },
    "user_2": {
        "layer1": torch.randn(4, 3),
        "layer2": torch.randn(2, 5),
    },
}

# Create users_aggregation_weight: a dict mapping user keys to weights
# The function uses .keys(), .values(), and iterates with key access
users_aggregation_weight = {
    "user_0": 0.5,
    "user_1": 0.3,
    "user_2": 0.2,
}

ARGS = {
    "w": w,
    "users_aggregation_weight": users_aggregation_weight,
}
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
average_weights Not yet run
unverified (harvested, no recorded run)
yanci87/lr-xfl/experiments/utils.py
code served (permissive licence) · get_code("f78af8bb07ffd223")
How it ran

no invocation recorded.

client_selection_class Not yet run
unverified (harvested, no recorded run)
yanci87/lr-xfl/experiments/global_logic_aggregate.py
code served (permissive licence) · get_code("453bfdf84ccf9cbe")
How it ran

no invocation recorded.

global_decision_tree_select Not yet run
unverified (harvested, no recorded run)
yanci87/lr-xfl/experiments/cub_tree.py
code served (permissive licence) · get_code("d4e8a08214dd207c")
How it ran

no invocation recorded.

local_train Not yet run
unverified (harvested, no recorded run)
yanci87/lr-xfl/experiments/local_training.py
code served (permissive licence) · get_code("112f2aa7445ee616")
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 8 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 8 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) is an emerging approach for training machine learning models collaboratively while preserving data privacy. The need for privacy protection makes it difficult for FL models to achieve global transparency and explainability. To address this limitation, we incorporate logic-based explanations into FL by proposing the Logical Reasoning-based eXplainable Federated Learning (LR-XFL) approach. Under LR-XFL, FL clients create local logic rules based on their local data and send them, along with model updates, to the FL server. The FL server connects the local logic rules through a proper logical connector that is derived based on properties of client data, without requiring access to the raw data. In addition, the server also aggregates the local model updates with weight values determined by the quality of the clients' local data as reflected by their uploaded logic rules. The results show that LR-XFL outperforms the most relevant baseline by 1.19%, 5.81% and 5.41% in terms of classification accuracy, rule accuracy and rule fidelity, respectively. The explicit rule evaluation and expression under LR-XFL enable human experts to validate and correct the rules on the server side, hence improving the global FL model's robustness to errors. It has the potential to enhance the transparency of FL models for areas like healthcare and finance where both data privacy and explainability are important.

For agents

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

get_harvested_code_for_paper("2308.12681")
get_code_for_paper("2308.12681")
have("2308.12681")

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

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

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

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

Connect an agent — have() is free.