SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1812.07108 · 2018

Learning Private Neural Language Modeling with Attentive Aggregation

arXiv · PDF · Open in the Atlas

Code that ran

7 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 4 have no contract verdict; 3 failures of our instrument; 1 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/1812.07108.json · badge: /api/ran/1812.07108.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
shaoxiongji/fed-att canonical (classifier label)
classifier basis: census
3 ran · 0 no recorded run
shaoxiongji/federated-learning community (classifier label)
classifier basis not recorded on the link
4 ran · 1 no recorded run
FunctionStatusWhere it lives
FedAvg Ran
ran; our contract draft was wrong, not the code
shaoxiongji/federated-learning/models/Fed.py
pointer only (licence: MIT); the stored copy get_code serves, from hongshenghu/source-inference-fl, is pointer only (licence: NONE) · get_code("f9964d719c5cb8f4")
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 hongshenghu/source-inference-fl, and GitHub detected no licence in that repository 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.

aggregate_att Ran
ran on a synthesized input
shaoxiongji/fed-att/src/agg/aggregate.py
code served (permissive licence) · get_code("dad97f90c5c53b3c")
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 copy
import torch
import torch.nn.functional as F
from scipy import linalg
import numpy as np

torch.manual_seed(0)

# Create small model parameter dicts (what would normally be state_dict())
# Each dict maps parameter names to tensors
def create_model_params(seed=0):
    torch.manual_seed(seed)
    return {
        'layer1.weight': torch.randn(3, 4),
        'layer1.bias': torch.randn(3),
        'layer2.weight': torch.randn(2, 3),
    }

# Create server parameters
w_server = create_model_params(seed=0)

# Create client parameters (list of parameter dicts)
w_clients = [
    create_model_params(seed=1),
    create_model_params(seed=2),
    create_model_params(seed=3),
]

# stepsize: float for aggregation step size
stepsize = 0.1

# metric: order of norm (int or np.inf)
metric = 2

# dp: magnitude of randomization (differential privacy noise scale)
dp = 0.01

ARGS = {
    'w_clients': w_clients,
    'w_server': w_server,
    'stepsize': stepsize,
    'metric': metric,
    'dp': dp,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, 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 Ran
ran on a synthesized input
shaoxiongji/fed-att/src/agg/avg.py
code served (permissive licence) · get_code("7a711a11ae243b32")
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)

# The function expects:
# w: list of client model parameters (dicts mapping keys to tensors)
# dp: magnitude of randomization (scalar)

# Create sample model state dicts for 3 clients
client_state_1 = {
    'layer1.weight': torch.randn(4, 3),
    'layer1.bias': torch.randn(4),
    'layer2.weight': torch.randn(2, 4)
}

client_state_2 = {
    'layer1.weight': torch.randn(4, 3),
    'layer1.bias': torch.randn(4),
    'layer2.weight': torch.randn(2, 4)
}

client_state_3 = {
    'layer1.weight': torch.randn(4, 3),
    'layer1.bias': torch.randn(4),
    'layer2.weight': torch.randn(2, 4)
}

w = [client_state_1, client_state_2, client_state_3]
dp = 0.01

ARGS = {
    'w': w,
    'dp': dp
}
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
cifar_iid Ran
ran; our contract draft was wrong, not the code
shaoxiongji/federated-learning/utils/sampling.py
pointer only (licence: MIT); the stored copy get_code serves, from ghy0501/pilora, is pointer only (licence: NONE) · get_code("c29db2c2b5697607")
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 ghy0501/pilora, and GitHub detected no licence in that repository 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.

mnist_iid Ran
ran; our contract draft was wrong, not the code
shaoxiongji/federated-learning/utils/sampling.py
code served (permissive licence) · get_code("d9107114749c3e49")
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 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

# Create a minimal dataset stand-in
class MinimalDataset:
    def __init__(self, size):
        self.size = size
    
    def __len__(self):
        return self.size

# Set random seed for reproducibility
np.random.seed(0)

# Create arguments
dataset = MinimalDataset(size=100)
num_users = 5

ARGS = {
    "dataset": dataset,
    "num_users": num_users
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — 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
mnist_noniid Ran
ran on a synthesized input
shaoxiongji/federated-learning/utils/sampling.py
code served (permissive licence) · get_code("37a8837b66a64988")
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

# Create a stand-in dataset class that mimics MNIST structure
class MNISTStandIn:
    def __init__(self):
        # Create synthetic train_labels matching the expected shape
        # num_shards=200, num_imgs=300, so total 60000 samples
        # We need labels that when sorted will create the non-iid distribution
        self.train_labels = torch.randint(0, 10, (60000,))

# Construct the dataset
dataset = MNISTStandIn()

# Number of users for non-iid distribution
num_users = 10

ARGS = {
    "dataset": dataset,
    "num_users": num_users
}
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
partition Ran
ran on a synthesized input
shaoxiongji/fed-att/src/utils/sampling.py
code served (permissive licence) · get_code("bc9519946c0aea20")
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

np.random.seed(0)

ARGS = {
    "len_dataset": 100,
    "num_users": 10
}
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 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
test Not yet run
unverified (harvested, no recorded run)
shaoxiongji/federated-learning/main_nn.py
code served (permissive licence) · get_code("a15078a8d47f36f1")
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, 4 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 4 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
FedAvg 9 other papers
2 dated earlier, 7 later
1602.05629 (2016-02)
Communication-Efficient Learning of Deep Networks from Decentralized Data
1710.10196 (2017-10)
Progressive Growing of GANs for Improved Quality, Stability, and Variation
1907.01132 (2019-07)
Astraea: Self-balancing Federated Learning for Improving Classification Accuracy of Mobile Deep Learning Applications
and 6 more not named here
mnist_iid 5 other papers
5 later
1907.01132 (2019-07)
Astraea: Self-balancing Federated Learning for Improving Classification Accuracy of Mobile Deep Learning Applications
1908.07873 (2019-08)
Federated Learning: Challenges, Methods, and Future Directions
2009.01974 (2020-09)
FedBE: Making Bayesian Model Ensemble Applicable to Federated Learning
and 2 more not named here
cifar_iid 2 other papers
2 later
1907.01132 (2019-07)
Astraea: Self-balancing Federated Learning for Improving Classification Accuracy of Mobile Deep Learning Applications
2401.02094 (2024-01)
PILoRA: Prototype Guided Incremental LoRA for Federated Class-Incremental Learning
mnist_noniid 1 other paper
1 later
1907.01132 (2019-07)
Astraea: Self-balancing Federated Learning for Improving Classification Accuracy of Mobile Deep Learning Applications

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

Mobile keyboard suggestion is typically regarded as a word-level language modeling problem. Centralized machine learning technique requires massive user data collected to train on, which may impose privacy concerns for sensitive personal typing data of users. Federated learning (FL) provides a promising approach to learning private language modeling for intelligent personalized keyboard suggestion by training models in distributed clients rather than training in a central server. To obtain a global model for prediction, existing FL algorithms simply average the client models and ignore the importance of each client during model aggregation. Furthermore, there is no optimization for learning a well-generalized global model on the central server. To solve these problems, we propose a novel model aggregation with the attention mechanism considering the contribution of clients models to the global model, together with an optimization technique during server aggregation. Our proposed attentive aggregation method minimizes the weighted distance between the server model and client models through iterative parameters updating while attends the distance between the server model and client models. Through experiments on two popular language modeling datasets and a social media dataset, our proposed method outperforms its counterparts in terms of perplexity and communication cost in most settings of comparison.

For agents

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

get_harvested_code_for_paper("1812.07108")
get_code_for_paper("1812.07108")
have("1812.07108")

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

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

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

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

Connect an agent — have() is free.