SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2607.29241 · 2026

RecHarness: A Bandit-Routed Agentic Harness for Self-Evolving Recommender Systems

Peng Jiang, Yuecheng Li, Chi Lu, Jing Yao, Wenjin Wu, Haoran Ling, Zeyu Song, Shuwen Kang

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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 7 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2607.29241.json · badge: /api/ran/2607.29241.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
6lyc/RecHarness canonical (classifier label)
classifier basis: census
8 ran · 1 no recorded run
FunctionStatusWhere it lives
build_item_categories_from_local Ran
ran; our contract draft was wrong, not the code
6lyc/RecHarness/prepare_gr_data.py
code served (permissive licence) · get_code("5af9988773214cfb")
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 PosixPath. 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
from pathlib import Path
import pandas as pd

# Create a temporary directory for raw_dir
tmpdir = tempfile.mkdtemp()
raw_dir = Path(tmpdir)

# Create a sample video_raw_categories_multi.csv file
sample_data = {
    'video_id': [1, 2, 3, 4],
    'feat_category_1': ['sports', 'music', 'sports', 'news'],
    'feat_category_2': ['action', 'pop', 'action', 'politics'],
    'feat_category_3': ['fast', 'energetic', 'fast', 'breaking'],
    'feat_category_4': ['outdoor', 'studio', 'outdoor', 'studio']
}

df = pd.DataFrame(sample_data)
src_file = raw_dir / 'video_raw_categories_multi.csv'
df.to_csv(str(src_file), index=False)

ARGS = {
    'raw_dir': raw_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PosixPath — a PosixPath output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PosixPath 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
compute_group_advantages Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
6lyc/RecHarness/gagc/grpo.py
code served (permissive licence) · get_code("2099d0f419deea9e")
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 math

# Setup for compute_group_advantages
# This function takes:
# - rewards: list[float]
# - eps: float (optional, default 1e-08)

# Create test data
rewards_case1 = [1.0, 2.0, 3.0, 4.0, 5.0]
rewards_case2 = [2.5, 2.5, 2.5, 2.5]  # identical rewards case
rewards_case3 = []  # empty case

ARGS = {
    "rewards": rewards_case1,
    "eps": 1e-08
}
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
compute_stats Ran
ran; our contract draft was wrong, not the code
6lyc/RecHarness/gagc/compute_dataset_stats.py
code served (permissive licence) · get_code("d15a8c4ff432eb9f")
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 dict. 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 os
import tempfile
import shutil

# Create temporary directories and files for testing
temp_base = tempfile.mkdtemp()
data_dir = os.path.join(temp_base, 'data')
test_dir = os.path.join(temp_base, 'test')
os.makedirs(data_dir, exist_ok=True)
os.makedirs(test_dir, exist_ok=True)

# Create sample split files with user_id and item_id pairs
dataset_name = 'sample_dataset'

# Train file
train_path = os.path.join(data_dir, f'{dataset_name}_train.txt')
with open(train_path, 'w') as f:
    f.write('1 10\n')
    f.write('2 20\n')
    f.write('3 15\n')

# Valid file
valid_path = os.path.join(data_dir, f'{dataset_name}_valid.txt')
with open(valid_path, 'w') as f:
    f.write('2 25\n')
    f.write('4 30\n')

# Test file
test_path = os.path.join(test_dir, f'{dataset_name}_test.txt')
with open(test_path, 'w') as f:
    f.write('5 40\n')
    f.write('3 35\n')

ARGS = {
    'dataset_name': 'sample_dataset',
    'data_dir': data_dir,
    'test_dir': test_dir,
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
estimate_ceiling Ran
ran; our contract draft was wrong, not the code
6lyc/RecHarness/gagc/tools.py
code served (permissive licence) · get_code("14f8a1bac60ef925")
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 torch
import numpy as np

# The function estimate_ceiling takes:
# - score_history: list[float]
# - current_score: float
# Both are simple Python types, so we just need to construct reasonable values

# score_history should be a list of floats representing historical scores
# Let's create a realistic scenario with some improvement trend
score_history = [0.5, 0.52, 0.51, 0.55, 0.56, 0.58, 0.60, 0.62]

# current_score should be a float representing the current score
# It makes sense to set it to something reasonable, perhaps around the latest scores
current_score = 0.61

ARGS = {
    "score_history": score_history,
    "current_score": current_score,
}
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 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
filter_selection Ran
ran; our contract draft was wrong, not the code
6lyc/RecHarness/gagc/grpo.py
code served (permissive licence) · get_code("c9fa33f593358057")
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 torch
import numpy as np

torch.manual_seed(0)

# Construct valid arguments for filter_selection

# ranked_arms: a list of arm identifiers (strings)
ranked_arms = ["arm_0", "arm_1", "arm_2", "arm_3", "arm_4", "arm_5"]

# mutex_groups: a list of sets, where each set contains arms that are mutually exclusive
# For example, arms in the same group cannot be selected together
mutex_groups = [
    {"arm_0", "arm_1"},      # arm_0 and arm_1 cannot both be selected
    {"arm_2", "arm_3"},      # arm_2 and arm_3 cannot both be selected
    {"arm_4", "arm_5"}       # arm_4 and arm_5 cannot both be selected
]

# G: maximum number of arms to select (an integer)
G = 3

ARGS = {
    "ranked_arms": ranked_arms,
    "mutex_groups": mutex_groups,
    "G": G
}
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 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
load_item_category_feat Ran
ran, honoured the contract we drafted
6lyc/RecHarness/prepare_gr_data.py
code served (permissive licence) · get_code("06f981adde39ab8e")
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
from pathlib import Path
import tempfile
import os

# Create a temporary directory for the test data
temp_dir = tempfile.mkdtemp()
data_raw = Path(temp_dir)

# Create the item_categories.csv file with the expected format
csv_content = """item_id,feat
0,"[1.5, 2.5, 3.5, 4.5]"
1,"[0.5, 1.5, None, 3.5]"
"""

filepath = data_raw / 'item_categories.csv'
with open(str(filepath), 'w') as f:
    f.write(csv_content)

ARGS = {
    'data_raw': data_raw
}
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 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 int 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
normalize_matrices Ran
ran; our contract draft was wrong, not the code
6lyc/RecHarness/prepare_gr_data.py
code served (permissive licence) · get_code("e80c30bb3e5a48c1")
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 tempfile
from pathlib import Path
import pandas as pd
import numpy as np

# Create a temporary directory to hold the test CSV files
temp_dir = tempfile.TemporaryDirectory()
raw_dir = Path(temp_dir.name)

# Create big_matrix.csv with required columns
big_data = {
    'user_id': [1, 2, 3, 1, 2],
    'item_id': [101, 102, 101, 103, 102],
    'timestamp': ['2023-01-01', '2023-01-02', '2023-01-03', '2023-01-04', '2023-01-05'],
    'watch_ratio': [0.5, 0.8, 0.3, 0.9, 0.6],
    'video_duration': [5000, 8000, 3000, 9000, 6000]
}
df_big = pd.DataFrame(big_data)
df_big.to_csv(raw_dir / 'big_matrix.csv', index=False)

# Create small_matrix.csv with required columns
small_data = {
    'user_id': [3, 4, 5],
    'item_id': [101, 104, 102],
    'timestamp': ['2023-01-06', '2023-01-07', '2023-01-08'],
    'watch_ratio': [0.7, 0.4, 0.5],
    'video_duration': [4000, 7000, 5000]
}
df_small = pd.DataFrame(small_data)
df_small.to_csv(raw_dir / 'small_matrix.csv', index=False)

ARGS = {
    'raw_dir': raw_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
thompson_sample Ran
ran; our contract draft was wrong, not the code
6lyc/RecHarness/gagc/grpo.py
code served (permissive licence) · get_code("dd791b540c2913dd")
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

class ArmState:
    def __init__(self, alpha: float, beta: float):
        self.alpha = alpha
        self.beta = beta

class ThompsonState:
    def __init__(self):
        self.arms = {}

# Set seed for reproducibility
random.seed(42)

# Create a ThompsonState with some arm states
state = ThompsonState()
state.arms["arm_1"] = ArmState(alpha=2.0, beta=1.5)
state.arms["arm_2"] = ArmState(alpha=1.0, beta=2.0)
state.arms["arm_3"] = ArmState(alpha=3.0, beta=1.0)
state.arms["arm_4"] = ArmState(alpha=1.5, beta=1.5)
state.arms["arm_5"] = ArmState(alpha=2.5, beta=0.5)

# Define candidate arms
candidate_arms = ["arm_1", "arm_2", "arm_3", "arm_4", "arm_5", "arm_6"]

# Define mutex groups (arms that cannot be selected together)
mutex_groups = [
    {"arm_1", "arm_2"},
    {"arm_3", "arm_4"},
    {"arm_5", "arm_6"}
]

# Number of arms to select
G = 2

ARGS = {
    "state": state,
    "candidate_arms": candidate_arms,
    "mutex_groups": mutex_groups,
    "G": G
}
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
predict Not yet run
unverified (harvested, no recorded run)
6lyc/RecHarness/gagc/templates/nextitnet_perdataset/predict.py
code served (permissive licence) · get_code("e98eecef412ae592")
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, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 9 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.

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

Optimizing modern recommender models still depends heavily on engineers manually iterating over architectural, objective, and training-strategy changes. While LLM-based agents can automate this trial-and-error process, allowing the LLM to both select modification directions and generate concrete hypotheses often leads to unstable search under limited experiment budgets. Inspired by the above challenge, we propose RecHarness, a Bandit-Routed Agentic Harness for automated recommender model optimization. RecHarness separates the optimization process into two steps: a bandit router selects the next modification direction according to historical validation feedback, while the LLM generates a concrete optimization hypothesis and executable code edit within the selected direction. To sustain long-horizon exploration, RecHarness uses a jump-basin mechanism to activate a structural-jump arm when local edits stagnate. Across multiple recommendation tasks, datasets, and model backbones, RecHarness achieves more stable performance improvements and uses limited trial budgets more effectively than LLM-reasoning search. During a 7-day online A/B test on a large-scale short-video advertising platform, the selected candidate improves ADVV by 2.084%, Revenue by 0.534%, and Exposure by 0.559%. Code is available at https://github.com/6lyc/RecHarness.

For agents

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

get_harvested_code_for_paper("2607.29241")
get_code_for_paper("2607.29241")
have("2607.29241")

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

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

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

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

Connect an agent — have() is free.