SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2505.10940 · NeurIPS · 2025

Who You Are Matters: Bridging Topics and Social Roles via LLM-Enhanced Logical Recommendation

Fan Yang, Han Li, Kun Gai, Shanshan Wu, Xiang Li, Qing Yu, Shuchang Liu, Xiaoyu Yang, Bin Wen, Xiaobei Wang, Yandong Bai, Xueliang Wang, and 6 more

arXiv · PDF · Open in the Atlas

Code that ran

4 of 5 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, 1 violated it and 0 have no contract verdict; 3 failures of our instrument; 1 no recorded run), measured 2026-11-24; 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/2505.10940.json · badge: /api/ran/2505.10940.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
Code2Q/TagCF canonical (classifier label)
classifier basis not recorded on the link
4 ran · 1 no recorded run
FunctionStatusWhere it lives
activation_layer Ran
ran; our contract draft was wrong, not the code
Code2Q/TagCF/recbole/model/layers.py
code served (permissive licence) · get_code("b5b0bb176f34b7a4")
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 ReLU. 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)

class Dice(nn.Module):
    """Dice activation function

    .. math::
        f(s)=p(s) \\cdot s+(1-p(s)) \\cdot \\alpha s

    .. math::
        p(s)=\\frac{1} {1 + e^{-\\frac{s-E[s]} {\\sqrt {Var[s] + \\epsilon}}}}
    """

    def __init__(self, emb_size):
        super(Dice, self).__init__()
        self.sigmoid = nn.Sigmoid()
        self.alpha = torch.zeros((emb_size,))

    def forward(self, score):
        self.alpha = self.alpha.to(score.device)
        score_p = self.sigmoid(score)
        return self.alpha * (1 - score_p) * score + score_p * score

def activation_layer(activation_name='relu', emb_dim=None):
    """Construct activation layers

    Args:
        activation_name: str, name of activation function
        emb_dim: int, used for Dice activation

    Return:
        activation: activation layer
    """
    if activation_name is None:
        activation = None
    elif isinstance(activation_name, str):
        if activation_name.lower() == 'sigmoid':
            activation = nn.Sigmoid()
        elif activation_name.lower() == 'tanh':
            activation = nn.Tanh()
        elif activation_name.lower() == 'relu':
            activation = nn.ReLU()
        elif activation_name.lower() == 'leakyrelu':
            activation = nn.LeakyReLU()
        elif activation_name.lower() == 'dice':
            activation = Dice(emb_dim)
        elif activation_name.lower() == 'none':
            activation = None
    elif issubclass(activation_name, nn.Module):
        activation = activation_name()
    else:
        raise NotImplementedError('activation function {} is not implemented'.format(activation_name))
    return activation

ARGS = {
    'activation_name': 'relu',
    'emb_dim': 8
}
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 ReLU — a ReLU output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ReLU 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
cluster_info Ran
ran; our contract draft was wrong, not the code
Code2Q/TagCF/recbole/evaluator/register.py
code served (permissive licence) · get_code("5a832e04227e57b2")
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 inspect
import sys

# Create a mock metrics module with metric classes
class MockMetric1:
    metric_need = "rec.items, rec.topk"
    metric_type = "RANKING"
    smaller = False

class MockMetric2:
    metric_need = "rec.score, data.num_items"
    metric_type = "VALUE"
    smaller = True

class MockMetric3:
    metric_need = "rec.meanrank, data.num_users"
    metric_type = "RANKING"
    smaller = True

# Create a mock module
import types
mock_module = types.ModuleType("test_metrics_module")
mock_module.MockMetric1 = MockMetric1
mock_module.MockMetric2 = MockMetric2
mock_module.MockMetric3 = MockMetric3

# Set the module's __module__ attribute on each class so they appear to be from this module
MockMetric1.__module__ = "test_metrics_module"
MockMetric2.__module__ = "test_metrics_module"
MockMetric3.__module__ = "test_metrics_module"

# Register the module in sys.modules
sys.modules["test_metrics_module"] = mock_module

ARGS = {
    "module_name": "test_metrics_module"
}
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
cutoff Ran
ran, violated the contract we drafted
Code2Q/TagCF/recbole/evaluator/utils.py
code served (permissive licence) · get_code("613c33a07699d085")
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 ndarray, ndim 1, dtype family int, shape (6,) 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

# Create a small numpy array of scores between 0 and 1
scores = np.array([0.1, 0.5, 0.8, 0.3, 0.9, 0.2])

# Create a threshold value between 0 and 1
threshold = 0.5

ARGS = {
    "scores": scores,
    "threshold": threshold
}
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 ndarray, ndim 1, dtype family int, shape (6,) — shape (6,) 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
trunc Ran
ran; our contract draft was wrong, not the code
Code2Q/TagCF/recbole/evaluator/utils.py
code served (permissive licence) · get_code("27b14a758e6ddd4c")
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 ndarray, ndim 1, dtype family float, shape (5,) 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

# Create a small numpy array with some floating point values
scores = np.array([1.2, 2.7, 3.4, 4.9, 5.1])

# Create arguments dict with valid method names from numpy
ARGS = {
    "scores": scores,
    "method": "around"  # one of ['ceil', 'floor', 'around']
}
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 ndarray, ndim 1, dtype family float, shape (5,) — shape (5,) 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
pad_sequence Not yet run
unverified (harvested, no recorded run)
Code2Q/TagCF/recbole/evaluator/utils.py
code served (permissive licence) · get_code("d8e614998207a6ea")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 5 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
activation_layer 18 other papers
16 dated earlier, 2 later
2110.05730 (2021-10)
Contrastive Learning for Representation Degeneration Problem in Sequential Recommendation
2204.11046 (2022-04)
Decoupled Side Information Fusion for Sequential Recommendation
2205.08776 (2022-05)
AdaMCT: Adaptive Mixture of CNN-Transformer for Sequential Recommendation
and 15 more not named here
cluster_info 5 other papers
3 dated earlier, 2 later
2204.11046 (2022-04)
Decoupled Side Information Fusion for Sequential Recommendation
2308.09419 (2023-08)
Attention Calibration for Transformer-based Sequential Recommendation
2309.06789 (2023-09)
An Image Dataset for Benchmarking Recommender Systems with Raw Pixels
and 2 more not named here
cutoff 3 other papers
2 dated earlier, 1 later
2204.11046 (2022-04)
Decoupled Side Information Fusion for Sequential Recommendation
2309.06789 (2023-09)
An Image Dataset for Benchmarking Recommender Systems with Raw Pixels
2605.27374 (2026-05)
ICG: Improving Cover Image Generation via MLLM-based Prompting and Personalized Preference Alignment
pad_sequence 3 other papers
2 dated earlier, 1 later
2204.11046 (2022-04)
Decoupled Side Information Fusion for Sequential Recommendation
2309.06789 (2023-09)
An Image Dataset for Benchmarking Recommender Systems with Raw Pixels
2605.27374 (2026-05)
ICG: Improving Cover Image Generation via MLLM-based Prompting and Personalized Preference Alignment
trunc 3 other papers
2 dated earlier, 1 later
2204.11046 (2022-04)
Decoupled Side Information Fusion for Sequential Recommendation
2309.06789 (2023-09)
An Image Dataset for Benchmarking Recommender Systems with Raw Pixels
2605.27374 (2026-05)
ICG: Improving Cover Image Generation via MLLM-based Prompting and Personalized Preference Alignment

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-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Recommender systems filter contents/items valuable to users by inferring preferences from user features and historical behaviors. Mainstream approaches follow the learning-to-rank paradigm, which focuses on discovering and modeling item topics (e.g., categories) and capturing user preferences for these topics based on historical interactions. However, this paradigm often neglects the modeling of user characteristics and their social roles, which are logical confounders influencing the correlated interests and user preference transition. To bridge this gap, we introduce the user role identification task and the behavioral logic modeling task that aim to explicitly model user roles and learn the logical relations between item topics and user social roles. We show that it is possible to explicitly solve these tasks through an efficient integration framework of Large Language Model (LLM) and recommendation systems, for which we propose TagCF. On the one hand, TagCF exploits the (Multi-modal) LLM's world knowledge and logic inference ability to extract realistic tag-based virtual logic graphs that reveal dynamic and expressive knowledge of users, refining our understanding of user behaviors. On the other hand, TagCF presents empirically effective integration modules that take advantage of the extracted tag-logic information, augmenting the recommendation performance. We conduct both online experiments with an industrial environment and offline experiments on public datasets to verify TagCF's effectiveness, and we empirically show that the user role modeling strategy is potentially a better choice than the modeling of item topics. Additionally, we provide evidence that the extracted logic graphs are empirically a general and transferable knowledge that can benefit a wide range of recommendation tasks. Our code is available in https://github.com/Code2Q/TagCF.

For agents

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

get_harvested_code_for_paper("2505.10940")
get_code_for_paper("2505.10940")
have("2505.10940")

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

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

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

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

Connect an agent — have() is free.