SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2109.05446 · EMNLP · 2021

Efficient-FedRec: Efficient Federated Learning Framework for Privacy-Preserving News Recommendation

Xing Xie, Ruixuan Liu, Fangzhao Wu, Chuhan Wu, Jingwei Yi, Guangzhong Sun

arXiv · PDF · Open in the Atlas

Code that ran

10 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 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; 2 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/2109.05446.json · badge: /api/ran/2109.05446.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
yjw1029/efficient-fedrec canonical (classifier label)
classifier basis: census
5 ran · 1 no recorded run
yjw1029/Efficient-FedRec community
Papers with Code archive
5 ran · 0 no recorded run
FunctionStatusWhere it lives
AdditiveAttention Ran
ran on a synthesized input
yjw1029/Efficient-FedRec/src/model.py
code served (permissive licence) · get_code("310a5ec45864d3e6")
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
from torch import nn

class AdditiveAttention(nn.Module):

    def __init__(self, d_h, hidden_size=200):
        super(AdditiveAttention, self).__init__()
        self.att_fc1 = nn.Linear(d_h, hidden_size)
        self.att_fc2 = nn.Linear(hidden_size, 1)

    def forward(self, x, attn_mask=None):
        bz = x.shape[0]
        e = self.att_fc1(x)
        e = nn.Tanh()(e)
        alpha = self.att_fc2(e)
        alpha = torch.exp(alpha)
        if attn_mask is not None:
            alpha = alpha * attn_mask.unsqueeze(2)
        alpha = alpha / (torch.sum(alpha, dim=1, keepdim=True) + 1e-08)
        x = torch.bmm(x.permute(0, 2, 1), alpha)
        x = torch.reshape(x, (bz, -1))
        return x


INIT_ARGS = {
    'd_h': 4,
    'hidden_size': 16
}

ARGS = {
    'x': torch.randn(2, 3, 4),
    'attn_mask': torch.ones(2, 3)
}

if __name__ == '__main__':
    model = AdditiveAttention(**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)
Model Ran
ran on a synthesized input
yjw1029/Efficient-FedRec/src/model.py
code served (permissive licence) · get_code("604e71e4f92b0a6e")
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 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 torch
from torch import nn
import torch.nn.functional as F
import numpy as np

# Copy the classes from the specification
class AdditiveAttention(nn.Module):

    def __init__(self, d_h, hidden_size=200):
        super(AdditiveAttention, self).__init__()
        self.att_fc1 = nn.Linear(d_h, hidden_size)
        self.att_fc2 = nn.Linear(hidden_size, 1)

    def forward(self, x, attn_mask=None):
        bz = x.shape[0]
        e = self.att_fc1(x)
        e = nn.Tanh()(e)
        alpha = self.att_fc2(e)
        alpha = torch.exp(alpha)
        if attn_mask is not None:
            alpha = alpha * attn_mask.unsqueeze(2)
        alpha = alpha / (torch.sum(alpha, dim=1, keepdim=True) + 1e-08)
        x = torch.bmm(x.permute(0, 2, 1), alpha)
        x = torch.reshape(x, (bz, -1))
        return x

class MultiHeadAttention(nn.Module):

    def __init__(self, d_model, n_heads, d_k, d_v):
        super(MultiHeadAttention, self).__init__()
        self.d_model = d_model
        self.n_heads = n_heads
        self.d_k = d_k
        self.d_v = d_v
        self.W_Q = nn.Linear(d_model, d_k * n_heads)
        self.W_K = nn.Linear(d_model, d_k * n_heads)
        self.W_V = nn.Linear(d_model, d_v * n_heads)
        self._initialize_weights()

    def _initialize_weights(self):
        for m in self.modules():
            if isinstance(m, nn.Linear):
                nn.init.xavier_uniform_(m.weight, gain=1)

    def forward(self, Q, K, V, attn_mask=None):
        batch_size, seq_len, _ = Q.size()
        q_s = self.W_Q(Q).view(batch_size, -1, self.n_heads, self.d_k).transpose(1, 2)
        k_s = self.W_K(K).view(batch_size, -1, self.n_heads, self.d_k).transpose(1, 2)
        v_s = self.W_V(V).view(batch_size, -1, self.n_heads, self.d_v).transpose(1, 2)
        if attn_mask is not None:
            attn_mask = attn_mask.unsqueeze(1).expand(batch_size, seq_len, seq_len)
            attn_mask = attn_mask.unsqueeze(1).repeat(1, self.n_heads, 1, 1)
        context, attn = ScaledDotProductAttention(self.d_k)(q_s, k_s, v_s, attn_mask)
        context = context.transpose(1, 2).contiguous().view(batch_size, -1, self.n_heads * self.d_v)
        return context

class ScaledDotProductAttention(nn.Module):

    def __init__(self, d_k):
        super(ScaledDotProductAttention, self).__init__()
        self.d_k = d_k

    def forward(self, Q, K, V, attn_mask=None):
        scores = torch.matmul(Q, K.transpose(-1, -2)) / np.sqrt(self.d_k)
        scores = torch.exp(scores)
        if attn_mask is not None:
            scores = scores * attn_mask
        attn = scores / (torch.sum(scores, dim=-1, keepdim=True) + 1e-08)
        context = torch.matmul(attn, V)
        return (context, attn)

class UserEncoder(nn.Module):

    def __init__(self, news_embedding_dim=400, num_attention_heads=20, query_vector_dim=200):
        super(UserEncoder, self).__init__()
        self.dropout_rate = 0.2
        self.multihead_attention = MultiHeadAttention(news_embedding_dim, num_attention_heads, 20, 20)
        self.additive_attention = AdditiveAttention(news_embedding_dim, query_vector_dim)

    def forward(self, clicked_news_vecs):
        clicked_news_vecs = F.dropout(clicked_news_vecs, p=self.dropout_rate, training=self.training)
        multi_clicked_vectors = self.multihead_attention(clicked_news_vecs, clicked_news_vecs, clicked_news_vecs)
        pos_user_vector = self.additive_attention(multi_clicked_vectors)
        user_vector = pos_user_vector
        return user_vector

class Model(nn.Module):

    def __init__(self):
        super(Model, self).__init__()
        self.user_encoder = UserEncoder()
        self.criterion = nn.CrossEntropyLoss()

    def forward(self, candidate_vecs, clicked_news_vecs, targets, compute_loss=True):
        user_vector = self.user_encoder(clicked_news_vecs)
        score = torch.bmm(candidate_vecs, user_vector.unsqueeze(-1)).squeeze(dim=-1)
        if compute_loss:
            loss = self.criterion(score, targets)
            return (loss, score)
        else:
            return score

INIT_ARGS = {}

ARGS = {
    'candidate_vecs': torch.randn(2, 3, 400),
    'clicked_news_vecs': torch.randn(2, 4, 400),
    'targets': torch.tensor([0, 1]),
    'compute_loss': True
}

if __name__ == '__main__':
    model = Model(**INIT_ARGS)
    model.eval()
    result = model(**ARGS)
    print("Result:", result)
    print("Loss shape:", result[0].shape)
    print("Score shape:", result[1].shape)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch — 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
MultiHeadAttention Ran
ran on a synthesized input · constructed an object; no result was computed
yjw1029/Efficient-FedRec/src/model.py
code served (permissive licence) · get_code("dcee9ec72e705723")
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, MultiHeadAttention: 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 numpy as np

torch.manual_seed(0)

# Define the model classes first
class ScaledDotProductAttention(nn.Module):
    def __init__(self, d_k):
        super(ScaledDotProductAttention, self).__init__()
        self.d_k = d_k

    def forward(self, Q, K, V, attn_mask=None):
        scores = torch.matmul(Q, K.transpose(-1, -2)) / np.sqrt(self.d_k)
        scores = torch.exp(scores)
        if attn_mask is not None:
            scores = scores * attn_mask
        attn = scores / (torch.sum(scores, dim=-1, keepdim=True) + 1e-08)
        context = torch.matmul(attn, V)
        return (context, attn)

class MultiHeadAttention(nn.Module):
    def __init__(self, d_model, n_heads, d_k, d_v):
        super(MultiHeadAttention, self).__init__()
        self.d_model = d_model
        self.n_heads = n_heads
        self.d_k = d_k
        self.d_v = d_v
        self.W_Q = nn.Linear(d_model, d_k * n_heads)
        self.W_K = nn.Linear(d_model, d_k * n_heads)
        self.W_V = nn.Linear(d_model, d_v * n_heads)
        self._initialize_weights()

    def _initialize_weights(self):
        for m in self.modules():
            if isinstance(m, nn.Linear):
                nn.init.xavier_uniform_(m.weight, gain=1)

    def forward(self, Q, K, V, attn_mask=None):
        batch_size, seq_len, _ = Q.size()
        q_s = self.W_Q(Q).view(batch_size, -1, self.n_heads, self.d_k).transpose(1, 2)
        k_s = self.W_K(K).view(batch_size, -1, self.n_heads, self.d_k).transpose(1, 2)
        v_s = self.W_V(V).view(batch_size, -1, self.n_heads, self.d_v).transpose(1, 2)
        if attn_mask is not None:
            attn_mask = attn_mask.unsqueeze(1).expand(batch_size, seq_len, seq_len)
            attn_mask = attn_mask.unsqueeze(1).repeat(1, self.n_heads, 1, 1)
        context, attn = ScaledDotProductAttention(self.d_k)(q_s, k_s, v_s, attn_mask)
        context = context.transpose(1, 2).contiguous().view(batch_size, -1, self.n_heads * self.d_v)
        return context

# Setup parameters for MultiHeadAttention
d_model = 8
n_heads = 2
d_k = 4
d_v = 3

# Create input tensors
batch_size = 2
seq_len = 3
Q = torch.randn(batch_size, seq_len, d_model)
K = torch.randn(batch_size, seq_len, d_model)
V = torch.randn(batch_size, seq_len, d_model)

# Create attention mask (optional)
attn_mask = torch.ones(batch_size, seq_len, seq_len)

ARGS = {
    'd_model': d_model,
    'n_heads': n_heads,
    'd_k': d_k,
    'd_v': d_v,
}
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 MultiHeadAttention — 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 MultiHeadAttention 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
ScaledDotProductAttention Ran
ran on a synthesized input
yjw1029/Efficient-FedRec/src/model.py
code served (permissive licence) · get_code("3ebcb23875c37434")
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 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 torch
from torch import nn
import numpy as np

class ScaledDotProductAttention(nn.Module):

    def __init__(self, d_k):
        super(ScaledDotProductAttention, self).__init__()
        self.d_k = d_k

    def forward(self, Q, K, V, attn_mask=None):
        scores = torch.matmul(Q, K.transpose(-1, -2)) / np.sqrt(self.d_k)
        scores = torch.exp(scores)
        if attn_mask is not None:
            scores = scores * attn_mask
        attn = scores / (torch.sum(scores, dim=-1, keepdim=True) + 1e-08)
        context = torch.matmul(attn, V)
        return (context, attn)


INIT_ARGS = {
    'd_k': 4
}

ARGS = {
    'Q': torch.randn(2, 3, 4),
    'K': torch.randn(2, 3, 4),
    'V': torch.randn(2, 3, 5),
    'attn_mask': None
}

if __name__ == '__main__':
    model = ScaledDotProductAttention(**INIT_ARGS)
    context, attn = model(**ARGS)
    print(f"Context shape: {context.shape}")
    print(f"Attention shape: {attn.shape}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch — 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
UserEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
yjw1029/Efficient-FedRec/src/model.py
code served (permissive licence) · get_code("22afc11538def1e4")
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, UserEncoder: 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 numpy as np

torch.manual_seed(0)

# The UserEncoder.forward() takes clicked_news_vecs as input
# Looking at the forward method:
# - clicked_news_vecs is passed to multihead_attention as Q, K, V
# - multihead_attention expects input shape: (batch_size, seq_len, d_model)
# - d_model = news_embedding_dim (400 by default)
# - The output is passed to additive_attention which expects (batch_size, seq_len, d_h)
# - d_h = news_embedding_dim (400)

# Create a small input tensor for testing
# Shape: (batch_size=2, seq_len=3, embedding_dim=400)
batch_size = 2
seq_len = 3
embedding_dim = 400

clicked_news_vecs = torch.randn(batch_size, seq_len, embedding_dim)

ARGS = {
    'news_embedding_dim': 400,
    'num_attention_heads': 20,
    'query_vector_dim': 200,
}
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 UserEncoder — 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 UserEncoder 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
dcg_score Ran
ran; our contract draft was wrong, not the code
yjw1029/efficient-fedrec/src/metrics.py
code served (permissive licence) · get_code("43e79e8e0904d5d8")
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 float64, 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 numpy as np

# Construct valid arguments for dcg_score function
# The function expects:
# - y_true: array of true relevance labels (binary or graded)
# - y_score: array of predicted scores
# - k: number of top results to consider (default 10)

# Create small sample data
np.random.seed(0)

# y_true: binary relevance labels (0 or 1), shape (15,)
y_true = np.array([1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0])

# y_score: predicted scores, shape (15,)
y_score = np.array([0.9, 0.2, 0.8, 0.7, 0.3, 0.85, 0.1, 0.15, 0.75, 0.95, 0.05, 0.88, 0.12, 0.92, 0.08])

# k: number of top results to evaluate
k = 10

ARGS = {
    "y_true": y_true,
    "y_score": y_score,
    "k": k
}
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 float64, 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
mrr_score Ran
ran, honoured the contract we drafted
yjw1029/efficient-fedrec/src/metrics.py
pointer only (licence: MIT); the stored copy get_code serves, from xuan-zw/lkpnr, is pointer only (licence: NONE) · get_code("47a7b89c55c76c60")
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 xuan-zw/lkpnr, 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.

ndcg_score Ran
ran; our contract draft was wrong, not the code
yjw1029/efficient-fedrec/src/metrics.py
pointer only (licence: MIT); the stored copy get_code serves, from xuan-zw/lkpnr, is pointer only (licence: NONE) · get_code("aaa4cece9f41ea15")
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 xuan-zw/lkpnr, 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.

newsample Ran
ran on a synthesized input
yjw1029/efficient-fedrec/src/data.py
code served (permissive licence) · get_code("e0f74a777d9e24fa")
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 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 random

def newsample(nnn, ratio):
    if ratio > len(nnn):
        return nnn + ['<unk>'] * (ratio - len(nnn))
    else:
        return random.sample(nnn, ratio)

# Setup code
nnn = ['apple', 'banana', 'cherry', 'date']
ratio = 6

ARGS = {
    'nnn': nnn,
    'ratio': ratio
}
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 list, ndim 1, dtype family float — 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
process_news Ran
ran on a synthesized input
yjw1029/efficient-fedrec/preprocess/adressa_raw.py
code served (permissive licence) · get_code("558d0c9a902a60a9")
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, ndim 1, 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 tempfile
import json
from pathlib import Path

# Create a temporary directory with test data
temp_dir = tempfile.TemporaryDirectory()
temp_path = Path(temp_dir.name)

# Create test files with news data
test_data_1 = [
    json.dumps({'id': 'news_1', 'title': 'Breaking News 1', 'content': 'Some content'}),
    json.dumps({'id': 'news_2', 'title': 'Breaking News 2', 'content': 'More content'}),
    json.dumps({'id': 'news_3', 'title': 'Breaking News 3'}),
]

test_data_2 = [
    json.dumps({'id': 'news_4', 'title': 'Breaking News 4', 'content': 'Extra content'}),
    json.dumps({'id': 'news_1', 'title': 'Breaking News 1'}),  # duplicate id, same title
]

# Write test files
file_1 = temp_path / 'news_file_1.jsonl'
with open(file_1, 'w') as f:
    for line in test_data_1:
        f.write(line + '\n')

file_2 = temp_path / 'news_file_2.jsonl'
with open(file_2, 'w') as f:
    for line in test_data_2:
        f.write(line + '\n')

ARGS = {
    'adressa_path': temp_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
process_users Not yet run
unverified (harvested, no recorded run)
yjw1029/efficient-fedrec/preprocess/adressa_raw.py
code served (permissive licence) · get_code("e5d695c2647144a5")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 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 7 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
dcg_score 5 other papers
1 dated earlier, 4 later
2105.02605 (2021-05)
GraphFormers: GNN-nested Transformers for Representation Learning on Textual Graph
2205.10282 (2022-05)
Heterformer: Transformer-based Deep Node Representation Learning on Heterogeneous Text-Rich Networks
2302.11050 (2023-02)
Edgeformers: Graph-Empowered Transformers for Representation Learning on Textual-Edge Networks
and 2 more not named here
ndcg_score 2 other papers
2 later
2308.12028 (2023-08)
LKPNR: LLM and KG for Personalized News Recommendation Framework
2505.12260 (2025-05)
LightRetriever: A LLM-based Text Retrieval Architecture with Extremely Faster Query Inference
AdditiveAttention
brick of this paper's assembly: model
1 other paper
1 later
2204.04179 (2022-04)
GRAM: Fast Fine-tuning of Pre-trained Language Models for Content-based Collaborative Filtering
mrr_score 1 other paper
1 later
2308.12028 (2023-08)
LKPNR: LLM and KG for Personalized News Recommendation Framework

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

News recommendation is critical for personalized news access. Most existing news recommendation methods rely on centralized storage of users' historical news click behavior data, which may lead to privacy concerns and hazards. Federated Learning is a privacy-preserving framework for multiple clients to collaboratively train models without sharing their private data. However, the computation and communication cost of directly learning many existing news recommendation models in a federated way are unacceptable for user clients. In this paper, we propose an efficient federated learning framework for privacy-preserving news recommendation. Instead of training and communicating the whole model, we decompose the news recommendation model into a large news model maintained in the server and a light-weight user model shared on both server and clients, where news representations and user model are communicated between server and clients. More specifically, the clients request the user model and news representations from the server, and send their locally computed gradients to the server for aggregation. The server updates its global user model with the aggregated gradients, and further updates its news model to infer updated news representations. Since the local gradients may contain private information, we propose a secure aggregation method to aggregate gradients in a privacy-preserving way. Experiments on two real-world datasets show that our method can reduce the computation and communication cost on clients while keep promising model performance.

For agents

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

get_harvested_code_for_paper("2109.05446")
get_code_for_paper("2109.05446")
have("2109.05446")

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

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

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

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

Connect an agent — have() is free.