SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2306.02239 · 2023

Generative Flow Network for Listwise Recommendation

arXiv · PDF · Open in the Atlas

Code that ran

8 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; 0 honoured the contract we drafted, 0 violated it and 5 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/2306.02239.json · badge: /api/ran/2306.02239.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
charliemat/gfn4rec canonical (classifier label)
classifier basis: census
8 ran · 1 no recorded run
FunctionStatusWhere it lives
dot_scorer Ran
ran; our contract draft was wrong, not the code
charliemat/gfn4rec/model/score_func.py
code served (permissive licence) · get_code("45b46ab38b9745cc")
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 Tensor, ndim 2, dtype family float, shape (2, 3) 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

torch.manual_seed(0)

# Parameters for dot_scorer
batch_size = 2
item_dim = 4
num_items = 3

# action_emb: (B, i_dim)
action_emb = torch.randn(batch_size, item_dim)

# item_emb: (B, L, i_dim) or (1, L, i_dim)
# Using (B, L, i_dim) shape
item_emb = torch.randn(batch_size, num_items, item_dim)

# item_dim: scalar integer
item_dim_param = item_dim

ARGS = {
    "action_emb": action_emb,
    "item_emb": item_emb,
    "item_dim": item_dim_param,
}
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 Tensor, ndim 2, dtype family float, shape (2, 3) — shape (2, 3) 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
get_offline_test_info Ran
ran on a synthesized input
charliemat/gfn4rec/plot_utils.py
code served (permissive licence) · get_code("c02c764b1d7c397b")
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 tempfile
import os

# Create a temporary file with test result content
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_file.write("Test passed: accuracy=0.95")
temp_file.close()

log_path = temp_file.name

ARGS = {
    'log_path': log_path
}
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 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
linear_scorer Ran
ran; our contract draft was wrong, not the code
charliemat/gfn4rec/model/score_func.py
code served (permissive licence) · get_code("4cc3922a7108033d")
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 Tensor, ndim 2, dtype family float, shape (2, 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 torch

torch.manual_seed(0)

# Parameters:
# - action_emb: (B, (i_dim+1)) - batch of action embeddings
# - item_emb: (B, L, i_dim) or (1, L, i_dim) - batch of item embeddings
# - item_dim: int - dimension of items

B = 2  # batch size
L = 5  # number of items (sequence length)
item_dim = 4  # item embedding dimension

# action_emb should be (B, item_dim+1)
# It contains weights of shape (item_dim,) and a bias (1,)
action_emb = torch.randn(B, item_dim + 1)

# item_emb should be (B, L, item_dim) or (1, L, item_dim)
item_emb = torch.randn(B, L, item_dim)

ARGS = {
    "action_emb": action_emb,
    "item_emb": item_emb,
    "item_dim": item_dim,
}
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 Tensor, ndim 2, dtype family float, shape (2, 5) — shape (2, 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
padding_and_clip Ran
ran on a synthesized input
charliemat/gfn4rec/utils.py
code served (permissive licence) · get_code("f2696e8a58ea7774")
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 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)

# Analyze the function:
# - sequence: a list that can be padded/clipped
# - max_len: an integer representing maximum length
# - padding_direction: a string, either 'left' or 'right'

# The function operates on a list, pads it with zeros, and clips it
# We need to provide a sequence (list), a max_len (int), and padding_direction (str)

sequence = [1, 2, 3, 4, 5]
max_len = 8
padding_direction = 'left'

ARGS = {
    'sequence': sequence,
    'max_len': max_len,
    'padding_direction': padding_direction
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm — 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 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
repeat_n_core Ran
ran on a synthesized input
charliemat/gfn4rec/utils.py
code served (permissive licence) · get_code("f6ec0627446022ae")
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 DataFrame. 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 numpy as np

# Create a small sample dataframe with user and item interactions
data = {
    'UserID': [1, 1, 2, 2, 3, 3, 4, 4, 5, 5],
    'ItemID': [10, 11, 10, 12, 11, 12, 13, 14, 13, 14],
    'rating': [5, 4, 3, 2, 5, 1, 4, 3, 2, 5]
}
df = pd.DataFrame(data)

# Create user and item count dictionaries
user_counts = {1: 2, 2: 2, 3: 2, 4: 2, 5: 2}
item_counts = {10: 2, 11: 2, 12: 2, 13: 2, 14: 2}

ARGS = {
    'df': df,
    'user_col_id': 0,
    'item_col_id': 1,
    'n_core': 2,
    'user_counts': user_counts,
    'item_counts': item_counts
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
run_multicore Ran
ran on a synthesized input
charliemat/gfn4rec/utils.py
code served (permissive licence) · get_code("4bed611d96ced604")
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 DataFrame. 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 numpy as np

# Create a small sample DataFrame with user and item interactions
np.random.seed(0)
n_rows = 50

user_ids = np.random.randint(0, 10, n_rows)
item_ids = np.random.randint(0, 8, n_rows)

df = pd.DataFrame({
    'user_id': user_ids,
    'item_id': item_ids,
    'rating': np.random.rand(n_rows),
    'timestamp': np.arange(n_rows)
})

ARGS = {
    'df': df,
    'user_key': 'user_id',
    'item_key': 'item_id',
    'n_core': 2,
    'auto_core': False,
    'filter_rate': 0.2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
smooth Ran
ran on a synthesized input
charliemat/gfn4rec/plot_utils.py
code served (permissive licence) · get_code("680ad28283743d53")
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 numpy as np

# The function smooth() expects:
# - values: a list or array-like of numeric values
# - window: an integer specifying the smoothing window size

# Construct test data
values = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]
window = 3

ARGS = {
    "values": values,
    "window": window,
}
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 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
two_layer_mlp_scorer Ran
ran; our contract draft was wrong, not the code
charliemat/gfn4rec/model/score_func.py
code served (permissive licence) · get_code("8c19396be7b460b1")
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 Tensor, ndim 2, dtype family float, shape (2, 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 torch
import torch.nn.functional as F

torch.manual_seed(0)

# Analyze the function signature and body:
# - action_emb: (B, (i_dim+1)*f_dim+f_dim+1) - packed embedding containing weights and biases
# - item_emb: (B, L, i_dim) or (1, L, i_dim) - item embeddings
# - item_dim: int - dimension of items (i_dim)
# - hidden_dim: int - hidden dimension (f_dim)

# The function uses:
# - action_emb slicing and view operations
# - item_emb in matmul with reshaped tensors
# - F.leaky_relu, torch.sum, torch.matmul

# Let's work backwards from the expected shapes:
# action_emb needs shape: (B, item_dim * hidden_dim + hidden_dim + hidden_dim + 1)
#                      = (B, (item_dim + 2) * hidden_dim + 1)

item_dim = 4
hidden_dim = 3
batch_size = 2
num_items = 5  # L dimension

# action_emb shape: (B, (item_dim + 2) * hidden_dim + 1)
action_emb_size = (item_dim + 2) * hidden_dim + 1
action_emb = torch.randn(batch_size, action_emb_size)

# item_emb shape: (B, L, item_dim)
item_emb = torch.randn(batch_size, num_items, item_dim)

ARGS = {
    "action_emb": action_emb,
    "item_emb": item_emb,
    "item_dim": item_dim,
    "hidden_dim": hidden_dim,
}
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 Tensor, ndim 2, dtype family float, shape (2, 5) — shape (2, 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
get_online_training_info Not yet run
unverified (harvested, no recorded run)
charliemat/gfn4rec/plot_utils.py
code served (permissive licence) · get_code("3f560279ba1b8a62")
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, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 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
dot_scorer 3 other papers
3 later
2309.12645 (2023-09)
KuaiSim: A Comprehensive Simulator for Recommender Systems
2401.16108 (2024-01)
Future Impact Decomposition in Request-level Recommendations
2406.06043 (2024-06)
Modeling User Retention through Generative Flow Networks
linear_scorer 3 other papers
3 later
2309.12645 (2023-09)
KuaiSim: A Comprehensive Simulator for Recommender Systems
2401.16108 (2024-01)
Future Impact Decomposition in Request-level Recommendations
2406.06043 (2024-06)
Modeling User Retention through Generative Flow Networks
two_layer_mlp_scorer 3 other papers
3 later
2309.12645 (2023-09)
KuaiSim: A Comprehensive Simulator for Recommender Systems
2401.16108 (2024-01)
Future Impact Decomposition in Request-level Recommendations
2406.06043 (2024-06)
Modeling User Retention through Generative Flow Networks

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

Personalized recommender systems fulfill the daily demands of customers and boost online businesses. The goal is to learn a policy that can generate a list of items that matches the user's demand or interest. While most existing methods learn a pointwise scoring model that predicts the ranking score of each individual item, recent research shows that the listwise approach can further improve the recommendation quality by modeling the intra-list correlations of items that are exposed together. This has motivated the recent list reranking and generative recommendation approaches that optimize the overall utility of the entire list. However, it is challenging to explore the combinatorial space of list actions and existing methods that use cross-entropy loss may suffer from low diversity issues. In this work, we aim to learn a policy that can generate sufficiently diverse item lists for users while maintaining high recommendation quality. The proposed solution, GFN4Rec, is a generative method that takes the insight of the flow network to ensure the alignment between list generation probability and its reward. The key advantages of our solution are the log scale reward matching loss that intrinsically improves the generation diversity and the autoregressive item selection model that captures the item mutual influences while capturing future reward of the list. As validation of our method's effectiveness and its superior diversity during active exploration, we conduct experiments on simulated online environments as well as an offline evaluation framework for two real-world datasets.

For agents

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

get_harvested_code_for_paper("2306.02239")
get_code_for_paper("2306.02239")
have("2306.02239")

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

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

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

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

Connect an agent — have() is free.