SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.16182 · ACL · 2025

IPO: Your Language Model is Secretly a Preference Classifier

Ayush Singh, Shweta Singh, Shivank Garg, Paras Chopra

arXiv · PDF · Open in the Atlas

Code that ran

20 of 25 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 20 have no contract verdict; 0 failures of our instrument; 5 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/2502.16182.json · badge: /api/ran/2502.16182.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
shivank21/Implicit_Preference_Optimization canonical (classifier label)
classifier basis not recorded on the link
20 ran · 5 no recorded run
FunctionStatusWhere it lives
calculate_accuracy Ran
ran on a synthesized input
shivank21/Implicit_Preference_Optimization/Preference_Comparison/Reward_Bench/reward_model.py
code served (permissive licence) · get_code("561b617d33eab7c1")
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

torch.manual_seed(0)

# The function expects a dict-like object 'ds' with keys 'reward_chosen' and 'reward_rejected'
# Each key should map to a sequence that supports indexing
# The function compares reward_chosen[i] > reward_rejected[i] for each index

ds = {
    'reward_chosen': [0.8, 0.6],
    'reward_rejected': [0.3, 0.7]
}

ARGS = {
    'ds': ds
}
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
extract_better_response Ran
ran on a synthesized input
shivank21/Implicit_Preference_Optimization/Preference_Comparison/RM_Bench/binary_gpt.py
code served (permissive licence) · get_code("9ecad9de140393f0")
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 re

def extract_better_response(text: str) -> int:
    pattern = 'Better response:\\s*(Response\\s*[12])'
    match = re.search(pattern, text, re.IGNORECASE)
    if match:
        response_text = match.group(1).lower()
        return 0 if '1' in response_text else 1
    return -1

# Test case 1: text with "Better response: Response 1"
text_1 = "This is a comparison. Better response: Response 1"

# Test case 2: text with "Better response: Response 2"
text_2 = "This is a comparison. Better response: Response 2"

# Test case 3: text without the pattern
text_3 = "This is just plain text without the pattern"

# Test case 4: case insensitive match
text_4 = "better response: response 1"

ARGS = {
    "text": text_1
}
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
extract_score Ran
ran on a synthesized input
shivank21/Implicit_Preference_Optimization/Preference_Comparison/RM_Bench/self_reward.py
code served (permissive licence) · get_code("7204c024b35e7517")
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 re

def extract_score(text):
    patterns = ['score\\s*:\\s*(\\d+)', 'score\\s*(\\d+)', '(\\d+)\\s*/\\s*5']
    for pattern in patterns:
        match = re.search(pattern, text, re.IGNORECASE)
        if match:
            score = int(match.group(1))
            return min(max(score, 1), 5)
    return 0

ARGS = {
    'text': 'The product has a score: 4 out of 5 stars'
}
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
generate_score Ran
ran on a synthesized input
shivank21/Implicit_Preference_Optimization/Preference_Comparison/RM_Bench/self_reward_gpt.py
code served (permissive licence) · get_code("25d1aecfb6d7b2f5")
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 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 re
from unittest.mock import Mock, MagicMock

# Mock client that simulates OpenAI API behavior
mock_client = Mock()
mock_completion = Mock()
mock_choice = Mock()
mock_message = Mock()

# Set up the mock chain
mock_message.content = "The response provides a comprehensive answer with good organization and clarity. Score: 4"
mock_choice.message = mock_message
mock_completion.choices = [mock_choice]
mock_client.chat.completions.create = MagicMock(return_value=mock_completion)

ARGS = {
    'instruction': 'What is the capital of France?',
    'response': 'The capital of France is Paris, a major city located in the north-central part of the country along the Seine River. Paris is known for its cultural significance, historical monuments, and is often called the City of Light.',
    'client': mock_client,
    'model': 'gpt-3.5-turbo'
}
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 tuple, ndim 1, dtype family float — 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
generate_yes_no_probability Ran
ran on a synthesized input
shivank21/Implicit_Preference_Optimization/Preference_Comparison/RM_Bench/ours_gpt.py
code served (permissive licence) · get_code("053a3fb2bb607df3")
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 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

# Define ARGS with valid arguments for generate_yes_no_probability
ARGS = {
    'instruction': 'What is 2+2?',
    'response': 'The answer is 4.',
    'api_key': 'test-api-key-12345',
    'dataset_name': 'RM-Bench-chat'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, openai — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — 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
generate_yes_no_probability Ran
ran on a synthesized input
shivank21/Implicit_Preference_Optimization/Preference_Comparison/Reward_Bench/ours_gpt.py
code served (permissive licence) · get_code("9845e7da046c8213")
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 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.

from openai import OpenAI
from unittest.mock import Mock, MagicMock
import torch

torch.manual_seed(0)

# Create a mock OpenAI client
mock_client = Mock(spec=OpenAI)

# Mock the chat completions response
mock_completion = Mock()
mock_logprob = Mock()
mock_logprob.token = "Yes"
mock_logprob.logprob = -0.5

mock_top_logprobs = Mock()
mock_top_logprobs.top_logprobs = [mock_logprob]

mock_choice = Mock()
mock_choice.logprobs = mock_top_logprobs

mock_completion.choices = [mock_choice]

# Set up the client mock to return our mock completion
mock_client.chat.completions.create = Mock(return_value=mock_completion)

ARGS = {
    'instruction': 'Write a Python function that adds two numbers.',
    'response': 'def add(a, b):\n    return a + b',
    'client': mock_client,
    'subset_name': 'hep-python',
    'model': 'openai/chatgpt-4o-latest'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, openai, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — 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
generate_yes_no_probability Ran
ran on a synthesized input
shivank21/Implicit_Preference_Optimization/Preference_Comparison/Reward_Bench/ours_prompt_shuffle.py
code served (permissive licence) · get_code("855ec284c57a0044")
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 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 torch.nn as nn

torch.manual_seed(0)

# Create a minimal model that satisfies the function's usage
class MinimalModel(nn.Module):
    def __init__(self, vocab_size=100, hidden_size=16):
        super().__init__()
        self.embedding = nn.Embedding(vocab_size, hidden_size)
        self.linear = nn.Linear(hidden_size, vocab_size)
        self.device_attr = 'cpu'
    
    @property
    def device(self):
        return self.device_attr
    
    def forward(self, input_ids):
        x = self.embedding(input_ids)
        x = x.mean(dim=1, keepdim=True)
        logits = self.linear(x)
        
        class Output:
            pass
        
        output = Output()
        output.logits = logits
        return output

# Create a minimal tokenizer that satisfies the function's usage
class MinimalTokenizer:
    def __init__(self, vocab_size=100):
        self.vocab_size = vocab_size
    
    def encode(self, text, return_tensors=None, max_length=None, truncation=False, add_special_tokens=True):
        # Return a simple token sequence
        tokens = [1, 2, 3, 4, 5][:max_length] if max_length else [1, 2, 3, 4, 5]
        if return_tensors == 'pt':
            return torch.tensor([tokens], dtype=torch.long)
        return tokens

# Build the arguments
model = MinimalModel(vocab_size=100, hidden_size=16)
tokenizer = MinimalTokenizer(vocab_size=100)

ARGS = {
    'instruction': 'What is the capital of France?',
    'response': 'Paris is the capital of France.',
    'model': model,
    'tokenizer': tokenizer,
    'subset_name': 'alpacaeval-easy'
}
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 tuple, ndim 1, dtype family float — 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
get_comparative_prompt Ran
ran on a synthesized input
shivank21/Implicit_Preference_Optimization/Preference_Comparison/RM_Bench/binary_gpt.py
code served (permissive licence) · get_code("3827aff7483f70c2")
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 torch

torch.manual_seed(0)

# Analyze the function: get_comparative_prompt takes three string parameters
# and returns a formatted comparative prompt string.
# The function only uses string formatting, no complex objects needed.

ARGS = {
    "instruction": "What are the benefits of regular exercise?",
    "response1": "Regular exercise improves cardiovascular health, increases energy levels, and helps maintain a healthy weight. It also boosts mood and reduces stress through the release of endorphins.",
    "response2": "Exercise is good for you. It makes you healthier and happier."
}
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 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
get_comparative_prompt Ran
ran on a synthesized input
shivank21/Implicit_Preference_Optimization/Preference_Comparison/Reward_Bench/binary_gpt.py
code served (permissive licence) · get_code("2ad1767584ad93f2")
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 torch

# Set seed for reproducibility
torch.manual_seed(0)

# Define the arguments for get_comparative_prompt
ARGS = {
    "instruction": "What are the benefits of exercise?",
    "response1": "Exercise is beneficial for physical health. It strengthens muscles, improves cardiovascular function, and helps maintain a healthy weight. Regular exercise also boosts energy levels and can improve sleep quality.",
    "response2": "Exercise has many benefits including improved mental health, reduced stress, better mood, and increased confidence. It also helps prevent chronic diseases and can extend lifespan when done regularly."
}
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 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
get_eval_prompt Ran
ran on a synthesized input
shivank21/Implicit_Preference_Optimization/Preference_Comparison/RM_Bench/ours.py
code served (permissive licence) · get_code("fb680509d54ec383")
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 torch

torch.manual_seed(0)

ARGS = {
    'dataset_name': 'path/to/RM-Bench-chat',
    'instruction': 'What is the capital of France?',
    'response': 'The capital of France is Paris.'
}
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 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
get_eval_prompt Ran
ran on a synthesized input
shivank21/Implicit_Preference_Optimization/Preference_Comparison/RM_Bench/self_reward.py
code served (permissive licence) · get_code("82a651b301705bf7")
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 torch

ARGS = {
    "instruction": "What are the benefits of regular exercise?",
    "response": "Regular exercise provides numerous health benefits including improved cardiovascular health, increased muscle strength, better mental health, weight management, and reduced risk of chronic diseases. Exercise also boosts energy levels and improves sleep quality. It's recommended to aim for at least 150 minutes of moderate-intensity aerobic activity per week along with strength training exercises."
}
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 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
get_eval_prompt Ran
ran on a synthesized input
shivank21/Implicit_Preference_Optimization/Preference_Comparison/Reward_Bench/ours.py
code served (permissive licence) · get_code("5872d962ae64a265")
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 torch
import numpy as np

# Set seed for reproducibility
torch.manual_seed(0)

# Define arguments for get_eval_prompt
ARGS = {
    "subset_name": "hep-python",
    "instruction": "Write a function that returns the sum of two numbers",
    "response": "def add(a, b):\n    return a + b"
}
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 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
get_eval_prompt Ran
ran on a synthesized input
shivank21/Implicit_Preference_Optimization/Preference_Comparison/Reward_Bench/ours_gpt.py
code served (permissive licence) · get_code("649ba55ab2123d60")
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.

# Setup code for get_eval_prompt

ARGS = {
    "subset_name": "hep-python",
    "instruction": "Write a function that returns the sum of two numbers",
    "response": "def add(a, b):\n    return a + b"
}
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
get_eval_prompt Ran
ran on a synthesized input
shivank21/Implicit_Preference_Optimization/Preference_Comparison/Reward_Bench/ours_prompt_shuffle.py
code served (permissive licence) · get_code("b0058549b2665f96")
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.

# Setup code for get_eval_prompt function

ARGS = {
    'subset_name': 'hep-python',
    'instruction': 'How do I write a secure password validator in Python?',
    'response': 'I cannot provide guidance on bypassing security measures. Instead, I recommend using established libraries like argon2 for password hashing and validation.'
}
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
get_eval_prompt Ran
ran on a synthesized input
shivank21/Implicit_Preference_Optimization/Preference_Comparison/Reward_Bench/ours_same_prompt.py
code served (permissive licence) · get_code("06f0f449fb2674d5")
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 torch
import numpy as np

# Setup code for get_eval_prompt function

# The function takes three string parameters:
# - subset_name: should be one of the keys in the prompts dict
# - instruction: a user instruction string
# - response: a response string

ARGS = {
    'subset_name': 'hep-python',
    'instruction': 'How do I write a for loop in Python?',
    'response': 'You can write a for loop using the for keyword followed by a variable and the in keyword with an iterable.'
}
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 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
get_reward Ran
ran on a synthesized input
shivank21/Implicit_Preference_Optimization/Preference_Comparison/RM_Bench/reward_model.py
code served (permissive licence) · get_code("be3a2b51c3f2cfc0")
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 MockDataset. 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 numpy as np
from unittest.mock import Mock

torch.manual_seed(0)

# Create a mock dataset that behaves like a HuggingFace dataset
class MockDataset:
    def __init__(self, num_samples=2):
        self.data = []
        self.columns = {}
        for i in range(num_samples):
            self.data.append({
                'prompt': f'What is the answer to question {i}?',
                'chosen_1': f'This is a good answer {i}',
                'rejected_1': f'This is a bad answer {i}',
                'chosen_2': f'Another good answer {i}',
                'rejected_2': f'Another bad answer {i}',
                'chosen_3': f'Third good answer {i}',
                'rejected_3': f'Third bad answer {i}',
            })
    
    def __iter__(self):
        return iter(self.data)
    
    def __len__(self):
        return len(self.data)
    
    def add_column(self, name, values):
        # Simulate adding a column and returning a new dataset
        new_ds = MockDataset.__new__(MockDataset)
        new_ds.data = [
            {**sample, name: value} 
            for sample, value in zip(self.data, values)
        ]
        new_ds.columns = self.columns.copy()
        new_ds.columns[name] = values
        return new_ds

# Create a mock reward scoring pipeline
class MockRewardPipeline:
    def __call__(self, text):
        # Simulate a reward model that returns a score
        # Returns a list with one dict containing 'score'
        return [{'score': np.random.uniform(0.5, 0.9)}]

ds = MockDataset(num_samples=2)
pipe = MockRewardPipeline()

ARGS = {
    'ds': ds,
    'pipe': pipe,
}
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 MockDataset — a MockDataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockDataset 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_reward Ran
ran on a synthesized input
shivank21/Implicit_Preference_Optimization/Preference_Comparison/Reward_Bench/reward_model.py
code served (permissive licence) · get_code("499246b2aadf2aa3")
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 MockDataset. 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 numpy as np
from unittest.mock import Mock

torch.manual_seed(0)

# Create a mock dataset that acts like a Hugging Face dataset
class MockDataset:
    def __init__(self, samples):
        self.samples = samples
        self.columns = {}
    
    def __iter__(self):
        return iter(self.samples)
    
    def __len__(self):
        return len(self.samples)
    
    def add_column(self, name, values):
        new_dataset = MockDataset(self.samples)
        new_dataset.columns = self.columns.copy()
        new_dataset.columns[name] = values
        return new_dataset

# Create mock samples with required fields
samples = [
    {
        'prompt': 'What is 2+2?',
        'chosen': 'The answer is 4.',
        'rejected': 'The answer is 5.'
    },
    {
        'prompt': 'What is the capital of France?',
        'chosen': 'The capital is Paris.',
        'rejected': 'The capital is London.'
    }
]

ds = MockDataset(samples)

# Create a mock reward pipeline
# The function calls: pipe(text)[0]['score']
class MockRewardPipe:
    def __call__(self, text):
        # Return a list with one dict containing 'score'
        return [{'score': np.random.rand()}]

pipe = MockRewardPipe()

ARGS = {
    'ds': ds,
    'pipe': pipe
}
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 MockDataset — a MockDataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockDataset 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
setup_gpt_client Ran
ran on a synthesized input
shivank21/Implicit_Preference_Optimization/Preference_Comparison/RM_Bench/binary_gpt.py
code served (permissive licence) · get_code("49ed59d60f1dd003")
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 OpenAI. 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

ARGS = {
    'api_key': 'test-api-key-12345',
    'base_url': 'https://openrouter.ai/api/v1',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type OpenAI — a OpenAI output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OpenAI 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
setup_gpt_client Ran
ran on a synthesized input
shivank21/Implicit_Preference_Optimization/Preference_Comparison/Reward_Bench/binary_gpt.py
code served (permissive licence) · get_code("1432935085f1d85a")
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 OpenAI. 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

ARGS = {
    'api_key': 'test-api-key-12345',
    'base_url': 'https://openrouter.ai/api/v1'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type OpenAI — a OpenAI output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OpenAI 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
setup_model Ran
ran on a synthesized input
shivank21/Implicit_Preference_Optimization/Preference_Comparison/Reward_Bench/ours.py
code served (permissive licence) · get_code("aff799719ba11c19")
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 1, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create a mock model that behaves like AutoModelForCausalLM
mock_model = Mock()
mock_model.to = Mock(return_value=mock_model)
mock_model.eval = Mock(return_value=mock_model)
mock_model.half = Mock(return_value=mock_model)
mock_model.bfloat16 = Mock(return_value=mock_model)
mock_model.float16 = Mock(return_value=mock_model)

# Create a mock tokenizer that behaves like AutoTokenizer
mock_tokenizer = Mock()
mock_tokenizer.eos_token_id = 2
mock_tokenizer.pad_token_id = None

# Patch AutoModelForCausalLM.from_pretrained
import transformers
original_from_pretrained = transformers.AutoModelForCausalLM.from_pretrained
transformers.AutoModelForCausalLM.from_pretrained = Mock(return_value=mock_model)

# Patch AutoTokenizer.from_pretrained
original_tokenizer_from_pretrained = transformers.AutoTokenizer.from_pretrained
transformers.AutoTokenizer.from_pretrained = Mock(return_value=mock_tokenizer)

ARGS = {
    'model_id': 'gpt2',
    'quantized': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — 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
calculate_accuracy Not yet run
unverified (harvested, no recorded run)
shivank21/Implicit_Preference_Optimization/Preference_Comparison/RM_Bench/reward_model.py
code served (permissive licence) · get_code("d875a4cee73a8ae3")
How it ran

no invocation recorded.

generate_yes_no_probability Not yet run
unverified (harvested, no recorded run)
shivank21/Implicit_Preference_Optimization/Preference_Comparison/RM_Bench/ours.py
code served (permissive licence) · get_code("dc7744fced223d2a")
How it ran

no invocation recorded.

generate_yes_no_probability Not yet run
unverified (harvested, no recorded run)
shivank21/Implicit_Preference_Optimization/Preference_Comparison/Reward_Bench/ours.py
code served (permissive licence) · get_code("95b2ab26aea8dd62")
How it ran

no invocation recorded.

generate_yes_no_probability Not yet run
unverified (harvested, no recorded run)
shivank21/Implicit_Preference_Optimization/Preference_Comparison/Reward_Bench/ours_same_prompt.py
code served (permissive licence) · get_code("f2ad6c08380eeb10")
How it ran

no invocation recorded.

setup_model Not yet run
unverified (harvested, no recorded run)
shivank21/Implicit_Preference_Optimization/Preference_Comparison/RM_Bench/ours.py
code served (permissive licence) · get_code("a1ec72396ee0f3c5")
How it ran

no invocation recorded.

Also present in other papers' code

Of 25 samples lifted from this paper's linked repositories, 25 carry a function identity and 0 do not. Of the 22 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 22 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

Reinforcement learning from human feedback (RLHF) has emerged as the primary method for aligning large language models (LLMs) with human preferences. While it enables LLMs to achieve human-level alignment, it often incurs significant computational and financial costs due to its reliance on training external reward models or human-labeled preferences. In this work, we propose Implicit Preference Optimization (IPO), an alternative approach that leverages generative LLMs as preference classifiers, thereby reducing the dependence on external human feedback or reward models to obtain preferences. We conduct a comprehensive evaluation on the preference classification ability of LLMs using RewardBench, assessing models across different sizes, architectures, and training levels to validate our hypothesis. Furthermore, we investigate the self-improvement capabilities of LLMs by generating multiple responses for a given instruction and employing the model itself as a preference classifier for Direct Preference Optimization (DPO)-based training. Our findings demonstrate that models trained through IPO achieve performance comparable to those utilizing state-of-the-art reward models for obtaining preferences. Our code is available at https://github.com/shivank21/ Implicit_Preference_Optimization.

For agents

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

get_harvested_code_for_paper("2502.16182")
get_code_for_paper("2502.16182")
have("2502.16182")

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

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

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

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

Connect an agent — have() is free.