SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.04612 · 2024

Regressing the Relative Future: Efficient Policy Optimization for Multi-turn RLHF

arXiv · PDF · Open in the Atlas

Code that ran

14 of 15 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, 4 violated it and 0 have no contract verdict; 9 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/2410.04612.json · badge: /api/ran/2410.04612.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
zhaolingao/refuel canonical (classifier label)
classifier basis: census
14 ran · 1 no recorded run
FunctionStatusWhere it lives
call_scripts Ran
ran, violated the contract we drafted
zhaolingao/refuel/setting_one/generate.py
code served (permissive licence) · get_code("a1d6a727a27a81c1")
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 os
import tempfile
from argparse import Namespace

# Create a temporary directory for output
temp_dir = tempfile.mkdtemp()

# Create the args object with all required attributes
args = Namespace(
    output_dir=temp_dir,
    temperature=0.7,
    maxlen=128,
    world_size=1,
    model='gpt2',
    user_model='gpt2',
    num_turns=5
)

# Define ARGS mapping for the function parameters
ARGS = {
    'args': args,
    'seed': 42,
    'gen_type': 'response'
}
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 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
change_format Ran
ran; our contract draft was wrong, not the code
zhaolingao/refuel/setting_one/generate.py
code served (permissive licence) · get_code("427eff22aa988903")
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 torch

torch.manual_seed(0)

def change_format(row):
    new_trajectory = []
    for i in row['trajectory']:
        new_trajectory.append({'role': i['from'], 'content': i['value']})
    row['trajectory'] = new_trajectory
    return row

ARGS = {
    'row': {
        'trajectory': [
            {'from': 'user', 'value': 'hello'},
            {'from': 'assistant', 'value': 'hi there'}
        ]
    }
}
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 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
check_order Ran
ran, violated the contract we drafted
zhaolingao/refuel/setting_two/anthropic_hh/preprocess_hh.py
code served (permissive licence) · get_code("a7609cfa0ca37c54")
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

torch.manual_seed(0)

# Construct a valid row that passes check_order
# The function checks:
# 1. 'chosen' list has even length
# 2. Even indices (0, 2, 4...) should have role != 'assistant'
# 3. Odd indices (1, 3, 5...) should have role != 'user'
# This means: even indices should be 'user', odd indices should be 'assistant'

row = {
    'chosen': [
        {'role': 'user', 'content': 'Hello'},
        {'role': 'assistant', 'content': 'Hi there'},
        {'role': 'user', 'content': 'How are you?'},
        {'role': 'assistant', 'content': 'I am doing well'}
    ]
}

ARGS = {
    'row': row
}
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 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
check_redundant Ran
ran, violated the contract we drafted
zhaolingao/refuel/setting_one/generate.py
code served (permissive licence) · get_code("07c2f6ab08f5ea7c")
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

class MockTokenizer:
    def apply_chat_template(self, trajectory, add_generation_prompt=False, tokenize=True):
        # Simple mock that converts trajectory to token ids
        # Trajectory is expected to be a list of dicts with message content
        tokens = []
        for msg in trajectory:
            if isinstance(msg, dict) and 'content' in msg:
                # Convert string content to simple token ids
                text = msg['content']
                tokens.extend([ord(c) % 256 for c in text[:10]])
        return tokens if tokens else [1, 2, 3]

torch.manual_seed(0)

tokenizer = MockTokenizer()

row = {
    'trajectory': [
        {'role': 'user', 'content': 'hello'},
        {'role': 'assistant', 'content': 'hi there'}
    ]
}

ARGS = {
    'tokenizer': tokenizer,
    'row': row
}
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
evaluate Ran
ran; our contract draft was wrong, not the code
zhaolingao/refuel/setting_one/refuel.py
code served (permissive licence) · get_code("52f5fd73e21e6108")
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 torch
import torch.nn as nn

torch.manual_seed(0)

# Define a minimal tokenizer stand-in
class MinimalTokenizer:
    def __init__(self):
        self.pad_token_id = 0
        self.eos_token_id = 1

# Define a minimal policy model
class MinimalPolicy(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding = nn.Embedding(10, 4)
        self.transformer = nn.TransformerEncoderLayer(
            d_model=4, nhead=2, dim_feedforward=8, batch_first=True
        )
        self.lm_head = nn.Linear(4, 10)
        self.device = torch.device('cpu')
    
    def forward(self, input_ids, attention_mask, return_dict=True, output_hidden_states=True):
        embeds = self.embedding(input_ids)
        hidden = self.transformer(embeds, src_key_padding_mask=~attention_mask.bool())
        logits = self.lm_head(hidden)
        
        class Output:
            pass
        
        output = Output()
        output.logits = logits
        output.hidden_states = hidden
        return output

# Define args configuration
class TaskConfig:
    def __init__(self):
        self.temperature = 0.7

class RefuelConfig:
    def __init__(self):
        self.eta = 0.5

class Args:
    def __init__(self):
        self.task = TaskConfig()
        self.refuel = RefuelConfig()
        self.per_device_eval_batch_size = 2

# Create a minimal dataloader with 2 batches
def create_dataloader():
    dataloader = []
    for _ in range(2):
        batch = {
            'chosen_token': torch.randint(2, 10, (2, 5)),
            'reject_token': torch.randint(2, 10, (2, 5)),
            'chosen_logprob': torch.randn(2),
            'reject_logprob': torch.randn(2),
            'chosen_mask': torch.ones(2, 5),
            'reject_mask': torch.ones(2, 5),
            'chosen_reward': torch.randn(2),
            'reject_reward': torch.randn(2),
        }
        dataloader.append(batch)
    return dataloader

# Build ARGS dict
ARGS = {
    'args': Args(),
    'policy': MinimalPolicy(),
    'tokenizer': MinimalTokenizer(),
    'dataloader': create_dataloader(),
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — 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
filter_length Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhaolingao/refuel/setting_one/tokenize_mask.py
code served (permissive licence) · get_code("df13ffc97bd4ecd8")
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 (2,) 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
from unittest.mock import Mock

torch.manual_seed(0)

# Create a mock tokenizer that implements apply_chat_template
class MockTokenizer:
    def apply_chat_template(self, messages, tokenize=True, add_generation_prompt=False):
        # Return a list of token IDs with length proportional to input
        if isinstance(messages, list):
            # For chat format: count messages and multiply by a factor
            token_count = len(messages) * 5
        else:
            # For non-list: count characters and convert to tokens
            token_count = len(str(messages)) // 2
        return list(range(token_count))

# Create mock dataset with 2 rows
# Each row has columns that might contain chat messages or text
dataset = [
    {
        'text_col': "This is a short text.",
        'chat_col': [
            {"role": "user", "content": "Hello"},
            {"role": "assistant", "content": "Hi there"}
        ],
        'turn_marker': 1
    },
    {
        'text_col': "Another short example.",
        'chat_col': [
            {"role": "user", "content": "Question"},
            {"role": "assistant", "content": "Answer"}
        ],
        'turn_marker': 0
    }
]

# Create tokenizer
tokenizer = MockTokenizer()

# Define columns to check
columns = ['chat_col', 'text_col']

# Max length threshold
max_len = 50

# Initial mask (1 = keep, 0 = filter out)
mask = np.array([1, 1], dtype=np.int32)

# Turn markers - for each column, either None or the column name that indicates turn count
turns = ['turn_marker', None]

ARGS = {
    'dataset': dataset,
    'tokenizer': tokenizer,
    'columns': columns,
    'max_len': max_len,
    'mask': mask,
    'turns': turns
}
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 ndarray, ndim 1, dtype family int, shape (2,) — shape (2,) 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_reward Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhaolingao/refuel/setting_one/tokenize_mask.py
code served (permissive licence) · get_code("377be3c3ea4bbe0c")
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 (4,) 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
from tqdm import tqdm

torch.manual_seed(0)

# Create a small dataset: list of dicts with rows containing columns
dataset = [
    {"text": "good job", "feedback": "great work"},
    {"text": "bad performance", "feedback": "needs improvement"},
    {"text": "excellent effort", "feedback": "well done"},
    {"text": "poor quality", "feedback": "try again"},
]

# Define columns to check
columns = ["text", "feedback"]

# Define reward_to_filter (a string to search for in the specified columns)
reward_to_filter = "bad"

# Create initial mask (1 means keep, 0 means filter out)
mask = np.array([1, 1, 1, 1], dtype=np.int32)

ARGS = {
    "dataset": dataset,
    "columns": columns,
    "reward_to_filter": reward_to_filter,
    "mask": mask,
}
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 ndarray, ndim 1, dtype family int, shape (4,) — shape (4,) 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_same_response Ran
ran, violated the contract we drafted
zhaolingao/refuel/setting_one/tokenize_mask.py
code served (permissive licence) · get_code("659e7652076f066a")
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 (2,) 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
from tqdm import tqdm

torch.manual_seed(0)

# The function expects:
# - dataset: iterable of rows where each row is dict-like with col_1, col_2, turn keys
# - col_1: string key to access first column
# - col_2: string key to access second column
# - turn: either str (column name) or int (index)
# - mask: array-like with same length as dataset, containing 0s and 1s

# Create a small dataset
dataset = [
    {
        'responses_1': ['resp0', 'resp1', 'resp2', 'resp3'],
        'responses_2': ['resp0', 'resp1_diff', 'resp2', 'resp3'],
        'turn_col': 0
    },
    {
        'responses_1': ['a', 'b', 'c', 'd'],
        'responses_2': ['a', 'b', 'c', 'd'],
        'turn_col': 1
    }
]

# Create mask (all entries initially valid)
mask = np.array([1, 1], dtype=np.int32)

ARGS = {
    'dataset': dataset,
    'col_1': 'responses_1',
    'col_2': 'responses_2',
    'turn': 'turn_col',
    'mask': mask
}
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 ndarray, ndim 1, dtype family int, shape (2,) — shape (2,) 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
first_true_indices Ran
ran, honoured the contract we drafted
zhaolingao/refuel/setting_two/anthropic_hh/refuel.py
code served (permissive licence) · get_code("579f0202bb30e003")
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 1, dtype family int, shape (2,) 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)

# Create a small 2D boolean tensor (batch_size=2, sequence_length=4)
# This will test the function's ability to find the first True in each row
bools = torch.tensor([
    [False, False, True, False],
    [False, True, False, False]
], dtype=torch.bool)

ARGS = {
    "bools": bools,
    "dtype": torch.long
}
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 1, dtype family int, shape (2,) — shape (2,) 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
gather_logprob Ran
ran; our contract draft was wrong, not the code
zhaolingao/refuel/setting_one/refuel.py
code served (permissive licence) · get_code("fe7316897fe8aa69")
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 torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# Small stand-in tokenizer with required attributes
class SimpleTokenizer:
    def __init__(self):
        self.pad_token_id = 0
        self.eos_token_id = 1

# Minimal model that returns logits
class SimpleModel(nn.Module):
    def __init__(self, vocab_size=10, hidden_dim=8):
        super().__init__()
        self.embedding = nn.Embedding(vocab_size, hidden_dim)
        self.linear = nn.Linear(hidden_dim, vocab_size)
    
    def forward(self, input_ids, attention_mask, return_dict=True):
        x = self.embedding(input_ids)
        logits = self.linear(x)
        
        class Output:
            pass
        
        output = Output()
        output.logits = logits
        return output

# Small stand-in args config with task.temperature
class TaskConfig:
    def __init__(self):
        self.temperature = 0.7

class ArgsConfig:
    def __init__(self):
        self.task = TaskConfig()

# Create instances
tokenizer = SimpleTokenizer()
model = SimpleModel(vocab_size=10, hidden_dim=8)
args = ArgsConfig()
device = 'cpu'

# Create token and mask tensors (sequence length 5)
# token: [vocab_id, vocab_id, ...]
token = torch.tensor([2, 3, 1, 4, 2], dtype=torch.long)
# mask: [1, 1, 1, 0, 0] to mask out some positions
mask = torch.tensor([1, 1, 1, 0, 0], dtype=torch.long)

ARGS = {
    'args': args,
    'model': model,
    'tokenizer': tokenizer,
    'token': token,
    'mask': mask,
    'device': device
}
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 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
get_cosine_schedule_with_warmup Ran
ran; our contract draft was wrong, not the code
zhaolingao/refuel/setting_one/refuel.py
code served (permissive licence) · get_code("70c923c8290a4fcc")
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 LambdaLR. 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
from torch.optim import SGD

torch.manual_seed(0)

# Create a minimal model
model = nn.Linear(4, 3)

# Create an optimizer
optimizer = SGD(model.parameters(), lr=0.1)

# Define arguments for get_cosine_schedule_with_warmup
ARGS = {
    "optimizer": optimizer,
    "num_warmup_steps": 100,
    "num_training_steps": 1000,
    "num_cycles": 0.5,
    "last_epoch": -1,
}
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 LambdaLR — a LambdaLR output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a LambdaLR 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
get_prompt Ran
ran; our contract draft was wrong, not the code
zhaolingao/refuel/setting_one/user_generator.py
code served (permissive licence) · get_code("fc0417f911166c83")
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

# Define ARGS with a valid trajectory parameter
ARGS = {
    'trajectory': [
        {
            'role': 'user',
            'content': 'What is the capital of France?'
        },
        {
            'role': 'assistant',
            'content': 'The capital of France is Paris.'
        },
        {
            'role': 'user',
            'content': 'How many people live there?'
        },
        {
            'role': 'assistant',
            'content': 'Paris has a population of approximately 2.2 million people in the city proper.'
        }
    ]
}
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
truncate_response Ran
ran; our contract draft was wrong, not the code
zhaolingao/refuel/setting_two/ultrainteract/refuel.py
code served (permissive licence) · get_code("567ccc4e93f0661b")
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 int, shape (2, 1024) 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)

# Create a minimal tokenizer stand-in with required attributes
class MinimalTokenizer:
    def __init__(self):
        self.eos_token_id = 2
        self.pad_token_id = 0

tokenizer = MinimalTokenizer()

# Create a responses tensor: (batch_size=2, sequence_length=6)
# Include some eos_token_id values to test truncation logic
responses = torch.tensor([
    [10, 11, 2, 0, 0, 0],  # eos at index 2
    [20, 21, 22, 23, 2, 0]  # eos at index 4
], dtype=torch.long)

ARGS = {
    "tokenizer": tokenizer,
    "responses": responses
}
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 int, shape (2, 1024) — shape (2, 1024) 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
whiten Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhaolingao/refuel/setting_two/anthropic_hh/refuel.py
code served (permissive licence) · get_code("e78dac11b89dad63")
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, 4) 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)

# Create a small tensor for testing
values = torch.randn(2, 4)

# Define all parameters
ARGS = {
    "values": values,
    "shift_mean": True,
}
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, 4) — shape (2, 4) 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
truncate_response Not yet run
unverified (harvested, no recorded run)
zhaolingao/refuel/setting_two/anthropic_hh/refuel.py
code served (permissive licence) · get_code("62ece7427179dea2")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 1 the same month, 1 later) and 11 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
first_true_indices 3 other papers
2 dated earlier, 1 later
2403.17031 (2024-03)
The N+ Implementation Details of RLHF with PPO: A Case Study on TL;DR Summarization
2404.16767 (2024-04)
REBEL: Reinforcement Learning via Regressing Relative Rewards
2503.13538 (2025-03)
From Demonstrations to Rewards: Alignment Without Explicit Human Preferences
whiten 3 other papers
2 dated earlier, 1 the same month
2404.08495 (2024-04)
Dataset Reset Policy Optimization for RLHF
2404.16767 (2024-04)
REBEL: Reinforcement Learning via Regressing Relative Rewards
2410.18870 (2024-10)
End-to-end Training for Recommendation with Language-based User Profiles
get_cosine_schedule_with_warmup 1 other paper
1 dated earlier
2404.16767 (2024-04)
REBEL: Reinforcement Learning via Regressing Relative Rewards
truncate_response 1 other paper
1 dated earlier
2404.16767 (2024-04)
REBEL: Reinforcement Learning via Regressing Relative Rewards

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

Large Language Models (LLMs) have achieved remarkable success at tasks like summarization that involve a single turn of interaction. However, they can still struggle with multi-turn tasks like dialogue that require long-term planning. Previous works on multi-turn dialogue extend single-turn reinforcement learning from human feedback (RLHF) methods to the multi-turn setting by treating all prior dialogue turns as a long context. Such approaches suffer from covariate shift: the conversations in the training set have previous turns generated by some reference policy, which means that low training error may not necessarily correspond to good performance when the learner is actually in the conversation loop. In response, we introduce REgressing the RELative FUture (REFUEL), an efficient policy optimization approach designed to address multi-turn RLHF in LLMs. REFUEL employs a single model to estimate $Q$-values and trains on self-generated data, addressing the covariate shift issue. REFUEL frames the multi-turn RLHF problem as a sequence of regression tasks on iteratively collected datasets, enabling ease of implementation. Theoretically, we prove that REFUEL can match the performance of any policy covered by the training set. Empirically, we evaluate our algorithm by using Llama-3.1-70B-it to simulate a user in conversation with our model. REFUEL consistently outperforms state-of-the-art methods such as DPO and REBEL across various settings. Furthermore, despite having only 8 billion parameters, Llama-3-8B-it fine-tuned with REFUEL outperforms Llama-3.1-70B-it on long multi-turn dialogues. Implementation of REFUEL can be found at https://github.com/ZhaolinGao/REFUEL/, and models trained by REFUEL can be found at https://huggingface.co/Cornell-AGI.

For agents

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

get_harvested_code_for_paper("2410.04612")
get_code_for_paper("2410.04612")
have("2410.04612")

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

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

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

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

Connect an agent — have() is free.