SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.16871 · 2024

Multi-Behavior Generative Recommendation

arXiv · PDF · Open in the Atlas

Code that ran

6 of 9 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; 4 failures of our instrument; 3 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/2405.16871.json · badge: /api/ran/2405.16871.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
anananan116/MBGen canonical (classifier label)
classifier basis: census
6 ran · 3 no recorded run
FunctionStatusWhere it lives
count_lines Ran
ran, honoured the contract we drafted
anananan116/MBGen/tokenizer/utils.py
code served (permissive licence) · get_code("fce786d808bb6948")
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 int, ndim 0, dtype family int, 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 tempfile
import os

# Create a temporary file with known content
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test.txt")

# Write some lines to the file
with open(temp_file, 'w', encoding='utf-8') as f:
    f.write("line 1\n")
    f.write("line 2\n")
    f.write("line 3\n")
    f.write("line 4\n")
    f.write("line 5\n")

ARGS = {
    "file_path": temp_file
}
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 int, ndim 0, dtype family int, 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
custom_chunk Ran
ran; our contract draft was wrong, not the code
anananan116/MBGen/tokenizer/tokenizer.py
code served (permissive licence) · get_code("fc570f3118b2bfb2")
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 2, dtype family int; 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
import numpy as np

torch.manual_seed(0)

# The function custom_chunk takes:
# - data: something with len() and slicing support
# - num_chunks: an integer

# Looking at the function body:
# - len(data) is called
# - data[i:i + chunk_size] slicing is used
# - chunks is a list that supports append and indexing
# - len(chunks) is called
# - list concatenation with + is used

# We'll use a simple list of integers as data
data = list(range(20))  # A list of 20 elements
num_chunks = 4

ARGS = {
    "data": data,
    "num_chunks": num_chunks
}
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 list, ndim 2, dtype family int — 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
generate_random_map Ran
ran; our contract draft was wrong, not the code
anananan116/MBGen/tokenizer/utils.py
code served (permissive licence) · get_code("7855038adf3f8d9e")
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 random_map. 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 csv
import tempfile
import os

# Create temporary TSV files for testing
temp_files = []

# Create first temporary file
with tempfile.NamedTemporaryFile(mode='w', suffix='.tsv', delete=False, newline='', encoding='utf-8') as f:
    writer = csv.writer(f, delimiter='\t')
    writer.writerow(['id', 'items', 'label'])
    writer.writerow(['1', '1 2 3', '4'])
    writer.writerow(['2', '5 6', '7'])
    temp_files.append(f.name)

# Create second temporary file
with tempfile.NamedTemporaryFile(mode='w', suffix='.tsv', delete=False, newline='', encoding='utf-8') as f:
    writer = csv.writer(f, delimiter='\t')
    writer.writerow(['id', 'items', 'label'])
    writer.writerow(['3', '8 9 10', '11'])
    writer.writerow(['4', '2 5', '6'])
    temp_files.append(f.name)

ARGS = {
    'file_paths': temp_files,
    'random_seed': 2024
}
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 random_map — a random_map output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a random_map 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
identity Ran
ran, honoured the contract we drafted
anananan116/MBGen/tokenizer/tokenizer.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from dholzmueller/universal_double_descent, is pointer only (licence: NONE) · get_code("9910e2fc297f8665")
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 dholzmueller/universal_double_descent, 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.

process_chunk Ran
ran; our contract draft was wrong, not the code
anananan116/MBGen/tokenizer/tokenizer.py
code served (permissive licence) · get_code("85f71e5d0d97961f")
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 2, dtype family int; 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
import numpy as np

torch.manual_seed(0)

class MockSequenceGenerator:
    """Mock sequence generator that implements generate_training_sequence method."""
    def generate_training_sequence(self, user_id, sequence, behavior, behavior_token):
        """
        Returns input_ids, attention_mask, labels
        Each should be lists or arrays
        """
        # Create small mock outputs
        input_ids = [user_id, 1, 2]
        attention_mask = [1, 1, 1]
        labels = [0, 1, 0]
        return input_ids, attention_mask, labels

# Set up argument values
user_chunk = [5, 10]  # List of 2 user indices
sequence_chunk = [
    {"type": "sequence_a", "value": 1},
    {"type": "sequence_b", "value": 2}
]  # List of 2 sequence objects
behavior_chunk = [
    {"action": "click"},
    {"action": "purchase"}
]  # List of 2 behavior objects
num_user_tokens = 100  # Number of user tokens
id_offsets = [0, 50, 1000]  # List of ID offsets, will use id_offsets[-1]
sequence_generator = MockSequenceGenerator()  # Instance with generate_training_sequence method
behavior_token = True  # Boolean flag

ARGS = {
    "user_chunk": user_chunk,
    "sequence_chunk": sequence_chunk,
    "behavior_chunk": behavior_chunk,
    "num_user_tokens": num_user_tokens,
    "id_offsets": id_offsets,
    "sequence_generator": sequence_generator,
    "behavior_token": behavior_token
}
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 tuple, ndim 2, dtype family int — 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
read_tsv_data Ran
ran; our contract draft was wrong, not the code
anananan116/MBGen/tokenizer/utils.py
code served (permissive licence) · get_code("f47f0418dfe97a83")
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 csv
import tempfile
import os

# Create a temporary TSV file with sample data
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test_data.tsv")

# Write sample TSV data
with open(temp_file, 'w', newline='', encoding='utf-8') as f:
    writer = csv.writer(f, delimiter='\t')
    # Header row
    writer.writerow(['user_id', 'item_sequence', 'last_item', 'behavior_sequence'])
    # Data rows
    writer.writerow(['101', '1 2 3', '4', '0.5 0.7 0.9'])
    writer.writerow(['102', '5 6', '7', '0.3 0.6'])

ARGS = {
    'file_path': temp_file
}
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 — 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
calculate_metrics Not yet run
unverified (harvested, no recorded run)
anananan116/MBGen/trainer/evaluation.py
code served (permissive licence) · get_code("bdbd3b67520ae048")
How it ran

no invocation recorded.

dcg Not yet run
unverified (harvested, no recorded run)
anananan116/MBGen/trainer/evaluation.py
code served (permissive licence) · get_code("5ebb9e3fd5b4a503")
How it ran

no invocation recorded.

ndcg_at_k Not yet run
unverified (harvested, no recorded run)
anananan116/MBGen/trainer/evaluation.py
code served (permissive licence) · get_code("03b5c20db7051800")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 2 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 2 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
identity 69 other papers
51 dated earlier, 2 the same month, 16 later · 5 only as an assembly brick
1706.07296 (2017-06)
A Minimal Developmental Model Can Increase Evolvability in Soft Robots
1802.09419 (2018-02)
Stochastic Hyperparameter Optimization through Hypernetworks
1804.06055 (2018-04)
Co-occurrence Feature Learning from Skeleton Data for Action Recognition and Detection with Hierarchical Aggregation
and 66 more not named here
count_lines 1 other paper
1 later
2406.17419 (2024-06)
Leave No Document Behind: Benchmarking Long-Context LLMs with Extended Multi-Doc QA

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

Multi-behavior sequential recommendation (MBSR) aims to incorporate behavior types of interactions for better recommendations. Existing approaches focus on the next-item prediction objective, neglecting the value of integrating the target behavior type into the learning objective. In this paper, we propose MBGen, a novel Multi-Behavior sequential Generative recommendation framework. We formulate the MBSR task into a consecutive two-step process: (1) given item sequences, MBGen first predicts the next behavior type to frame the user intention, (2) given item sequences and a target behavior type, MBGen then predicts the next items. To model such a two-step process, we tokenize both behaviors and items into tokens and construct one single token sequence with both behaviors and items placed interleaved. Furthermore, MBGen learns to autoregressively generate the next behavior and item tokens in a unified generative recommendation paradigm, naturally enabling a multi-task capability. Additionally, we exploit the heterogeneous nature of token sequences in the generative recommendation and propose a position-routed sparse architecture to efficiently and effectively scale up models. Extensive experiments on public datasets demonstrate that MBGen significantly outperforms existing MBSR models across multiple tasks.

For agents

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

get_harvested_code_for_paper("2405.16871")
get_code_for_paper("2405.16871")
have("2405.16871")

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

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

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

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

Connect an agent — have() is free.