SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2308.12241 · 2023

LLMRec: Benchmarking Large Language Models on Recommendation Task

arXiv · PDF · Open in the Atlas

Code that ran

9 of 12 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 7 failures of our instrument; 3 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.12241.json · badge: /api/ran/2308.12241.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
williamliujl/llmrec canonical (classifier label)
classifier basis: census
9 ran · 3 no recorded run
FunctionStatusWhere it lives
compute_bleu Ran
ran; our contract draft was wrong, not the code
williamliujl/llmrec/utils/evaluate/bleu.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from WangXFng/RDRec, is pointer only (licence: NONE) · get_code("49289a7f94c227bd")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from WangXFng/RDRec, 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.

evaluate_old Ran
ran; our contract draft was wrong, not the code
williamliujl/llmrec/utils/evaluate/metrics4rec.py
code served (permissive licence) · get_code("c66438d5f4a93e80")
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 math
import numpy as np

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

# Create small valid test data
predict = {
    'user_1': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
    'user_2': [5, 4, 3, 2, 1, 10, 9, 8, 7, 6],
    'user_3': [2, 4, 6, 8, 10, 1, 3, 5, 7, 9],
}

groundtruth = {
    'user_1': [1, 3, 5, 7],
    'user_2': [2, 4, 6],
    'user_3': [1, 2, 3, 4, 5],
}

topk = 10

ARGS = {
    'predict': predict,
    'groundtruth': groundtruth,
    'topk': topk,
}
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 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
hit_at_k Ran
ran; our contract draft was wrong, not the code
williamliujl/llmrec/utils/evaluate/metrics4rec.py
code served (permissive licence) · get_code("2fa27f253fa37d79")
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 numpy as np

# The function hit_at_k takes:
# - r: a sequence/array that will be converted to numpy array and sliced to [:k]
# - k: an integer for the slice length

# Creating test data:
# r should be an array-like where we can check if any elements are non-zero
# Let's create a simple list with at least one non-zero element
r = [0, 1, 0, 0, 1]  # Mixed zeros and ones for testing

# k should be an integer indicating how many elements to consider
k = 3

ARGS = {
    "r": r,
    "k": k
}
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 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
load_instruction Ran
ran; our contract draft was wrong, not the code
williamliujl/llmrec/infer_rec.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from godfire66666/llm_rec_explanation, is pointer only (licence: NONE) · get_code("cb6e8f7a5b600f81")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from godfire66666/llm_rec_explanation, 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.

load_instruction_from_csv Ran
ran; our contract draft was wrong, not the code
williamliujl/llmrec/infer_rec.py
code served (permissive licence) · get_code("74ce630ade2232fd")
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 pandas as pd
import tempfile
import os

# Create a temporary CSV file with the required columns
temp_dir = tempfile.mkdtemp()
csv_path = os.path.join(temp_dir, 'instructions.csv')

# Write sample data to CSV
csv_data = pd.DataFrame({
    'prompt': ['What is 2+2?', 'What is the capital of France?'],
    'target': ['The answer is 4', 'The capital is Paris'],
    'task': ['math', 'geography'],
    'few_zero': ['zero-shot', 'few-shot']
})
csv_data.to_csv(csv_path, index=False)

ARGS = {
    'instruct_dir': csv_path,
    'prompt_idx': 'all'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — 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
recall_at_k Ran
ran; our contract draft was wrong, not the code
williamliujl/llmrec/utils/evaluate/metrics4rec.py
code served (permissive licence) · get_code("86965fc714650816")
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 float64, ndim 0, 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 numpy as np

# recall_at_k expects:
# r: array-like, typically binary relevance scores (0 or 1)
# k: integer, cutoff position
# all_pos_num: integer, total number of positive items

# Create a small binary relevance array
# e.g., [1, 0, 1, 1, 0] means items at positions 0, 2, 3 are relevant
r = [1, 0, 1, 1, 0]

# k is the cutoff position
k = 3

# all_pos_num is the total count of positive items in the full ranking
all_pos_num = 3

ARGS = {
    "r": r,
    "k": k,
    "all_pos_num": all_pos_num,
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
rouge_l_sentence_level Ran
ran, honoured the contract we drafted
williamliujl/llmrec/utils/evaluate/rouge.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from WangXFng/RDRec, is pointer only (licence: NONE) · get_code("815c9f02431395eb")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from WangXFng/RDRec, 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.

rouge_n Ran
ran, honoured the contract we drafted
williamliujl/llmrec/utils/evaluate/rouge.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from WangXFng/RDRec, is pointer only (licence: NONE) · get_code("eb37c01f4067f842")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from WangXFng/RDRec, 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.

two_seq_same Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
williamliujl/llmrec/utils/evaluate/utils.py
code served (permissive licence) · get_code("b8d4a80a37d157bc")
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 bool, 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 numpy as np

torch.manual_seed(0)

# Analyzing the function:
# - two_seq_same takes two parameters: sa and sb
# - It checks if len(sa) == len(sb)
# - It iterates through zip(sa, sb) and compares elements with !=
# - So sa and sb should be sequences (lists, tuples, or similar) of comparable items

# Creating two identical sequences
sa = [1, 2, 3, 4]
sb = [1, 2, 3, 4]

ARGS = {
    "sa": sa,
    "sb": sb
}
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 bool, 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
bleu_score Not yet run
unverified (harvested, no recorded run)
williamliujl/llmrec/utils/evaluate/utils.py
code served (permissive licence) · get_code("c212cb768b5261af")
How it ran

no invocation recorded.

rouge_l_summary_level Not yet run
unverified (harvested, no recorded run)
williamliujl/llmrec/utils/evaluate/rouge.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from WangXFng/RDRec, is pointer only (licence: NONE) · get_code("67d8d100e11a6652")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from WangXFng/RDRec, 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. No invocation recorded.

rouge_score Not yet run
unverified (harvested, no recorded run)
williamliujl/llmrec/utils/evaluate/utils.py
code served (permissive licence) · get_code("e173835ad8f5c718")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 6 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 6 later) and 6 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
compute_bleu 10 other papers
5 dated earlier, 5 later
1909.09436 (2019-09)
CodeSearchNet Challenge: Evaluating the State of Semantic Code Search
aaai_6453 (2020 (year only))
Improving Knowledge-Aware Dialogue Generation via Knowledge Base Question Answering
2206.05239 (2022-06)
StructCoder: Structure-Aware Transformer for Code Generation
and 7 more not named here
rouge_n 5 other papers
4 dated earlier, 1 later
1805.09461 (2018-05)
Deep Reinforcement Learning For Sequence to Sequence Models
1905.10033 (2019-05)
Personalizing Dialogue Agents via Meta-Learning
1908.07687 (2019-08)
MoEL: Mixture of Empathetic Listeners
and 2 more not named here
rouge_l_sentence_level 3 other papers
2 dated earlier, 1 later
1805.09461 (2018-05)
Deep Reinforcement Learning For Sequence to Sequence Models
2020.findings-emnlp.289 (2020 (year only))
Towards Zero-Shot Conditional Summarization with Adaptive Multi-Task Fine-Tuning
2405.10587 (2024-05)
RDRec: Rationale Distillation for LLM-based Recommendation
rouge_l_summary_level 3 other papers
2 dated earlier, 1 later
1805.09461 (2018-05)
Deep Reinforcement Learning For Sequence to Sequence Models
2020.findings-emnlp.289 (2020 (year only))
Towards Zero-Shot Conditional Summarization with Adaptive Multi-Task Fine-Tuning
2405.10587 (2024-05)
RDRec: Rationale Distillation for LLM-based Recommendation
load_instruction 2 other papers
2 later
2309.04175 (2023-09)
Knowledge-tuning Large Language Models with Structured Medical Knowledge Bases for Reliable Response Generation in Chinese
2312.15661 (2023-12)
Unlocking the Potential of Large Language Models for Explainable Recommendations
two_seq_same 1 other paper
1 later
2024.findings-emnlp.22 (2024 (year only))
XRec: Large Language Models for Explainable Recommendation

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

Recently, the fast development of Large Language Models (LLMs) such as ChatGPT has significantly advanced NLP tasks by enhancing the capabilities of conversational models. However, the application of LLMs in the recommendation domain has not been thoroughly investigated. To bridge this gap, we propose LLMRec, a LLM-based recommender system designed for benchmarking LLMs on various recommendation tasks. Specifically, we benchmark several popular off-the-shelf LLMs, such as ChatGPT, LLaMA, ChatGLM, on five recommendation tasks, including rating prediction, sequential recommendation, direct recommendation, explanation generation, and review summarization. Furthermore, we investigate the effectiveness of supervised finetuning to improve LLMs' instruction compliance ability. The benchmark results indicate that LLMs displayed only moderate proficiency in accuracy-based tasks such as sequential and direct recommendation. However, they demonstrated comparable performance to state-of-the-art methods in explainability-based tasks. We also conduct qualitative evaluations to further evaluate the quality of contents generated by different models, and the results show that LLMs can truly understand the provided information and generate clearer and more reasonable results. We aspire that this benchmark will serve as an inspiration for researchers to delve deeper into the potential of LLMs in enhancing recommendation performance. Our codes, processed data and benchmark results are available at https://github.com/williamliujl/LLMRec.

For agents

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

get_harvested_code_for_paper("2308.12241")
get_code_for_paper("2308.12241")
have("2308.12241")

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

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

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

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

Connect an agent — have() is free.