SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.19085 · EMNLP · 2024

Controllable Preference Optimization: Toward Controllable Multi-Objective Alignment

Maosong Sun, Zhiyuan Liu, Ning Ding, Jie Zhou, Yankai Lin, Ganqu Cui, Lifan Yuan, Ruobing Xie, Yiju Guo, Huimin Chen, Jiexin Wang, Bowen Sun

arXiv · PDF · Open in the Atlas

Code that ran

9 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; 8 failures of our instrument; 0 no recorded run), measured 2026-11-21; 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/2402.19085.json · badge: /api/ran/2402.19085.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
OpenBMB/CPO canonical (classifier label)
classifier basis: census
9 ran · 0 no recorded run
FunctionStatusWhere it lives
GetRateByKey Ran
ran, honoured the contract we drafted
OpenBMB/CPO/src/CDPO/data_preparation/data_dpo_ultrafeedback.py
code served (permissive licence) · get_code("73d8c38b16158fdb")
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 torch
import numpy as np
from typing import List, Dict

def GetRateByKey(response: dict, keys: List[str]):
    for key in keys:
        if response.get(key):
            return int(response.get(key))

ARGS = {
    "response": {
        "rate": "42",
        "value": "100",
        "count": "5"
    },
    "keys": ["rate", "value", "count"]
}
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 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
SampleTargetResponses Ran
ran; our contract draft was wrong, not the code
OpenBMB/CPO/src/CDPO/data_preparation/data_dpo_ultrafeedback.py
code served (permissive licence) · get_code("f4160c311985d81b")
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 the DATA_KEYS constant as it appears in the function
DATA_KEYS = {'Help': ['Helpful_Rating', 'Helpfulness_Rating'], 'Honesty': ['Honesty_Rating'], 'Harmless': ['Harmlessness_Rating']}

# Create sample response dictionaries
responses = [
    {
        'id': 1,
        'text': 'This is helpful',
        'Helpful_Rating': 5,
        'Honesty_Rating': 4,
        'Harmlessness_Rating': 5
    },
    {
        'id': 2,
        'text': 'This is somewhat helpful',
        'Helpfulness_Rating': 3,
        'Honesty_Rating': 3,
        'Harmlessness_Rating': 4
    },
    {
        'id': 3,
        'text': 'This is not helpful',
        'Helpful_Rating': 2,
        'Honesty_Rating': 5,
        'Harmlessness_Rating': 3
    },
    {
        'id': 4,
        'text': 'This is very helpful',
        'Helpful_Rating': 5,
        'Honesty_Rating': 5,
        'Harmlessness_Rating': 5
    }
]

# Create a config dictionary that filters responses
cfg = {
    'Help': 5,
    'Honesty': 5,
    'Harmless': 5
}

ARGS = {
    'responses': responses,
    'cfg': cfg
}
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
changeToJson Ran
ran; our contract draft was wrong, not the code
OpenBMB/CPO/src/CDPO/data_preparation/lib/file_func.py
code served (permissive licence) · get_code("312e0cabadf2c4af")
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 json

# Construct test arguments for changeToJson function
obj = {
    "name": "test",
    "value": 42,
    "nested": {
        "key": "value",
        "list": [1, 2, 3]
    },
    "unicode": "你好世界"
}

isFormat_compact = False
isFormat_formatted = True

# Test with compact format
ARGS = {
    "obj": obj,
    "isFormat": isFormat_compact
}
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
further_process_data Ran
ran; our contract draft was wrong, not the code
OpenBMB/CPO/src/CDPO/cdpo/cdpo_ultrafeedback.py
code served (permissive licence) · get_code("f87c81eda77d317f")
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

torch.manual_seed(0)

# Construct sample data matching what further_process_data expects
data = [
    {
        'instruction': '< helplessness: 5 > < honesty: 5 > This is a test instruction',
        'reject': 'This is a rejected response',
        'R_chosen': 0.9,
        'R_reject': 0.1,
        'other_field': 'some value'
    },
    {
        'instruction': '< helplessness: 5 > < honesty: 5 > Another instruction',
        'reject': 'Another rejected response',
        'R_chosen': 0.8,
        'R_reject': 0.2,
        'other_field': 'another value'
    }
]

ARGS = {
    'data': data
}
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 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
further_process_data Ran
ran; our contract draft was wrong, not the code
OpenBMB/CPO/src/CDPO/cdpo/cdpo_ultrasafety.py
code served (permissive licence) · get_code("42b3af088826241e")
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 test data for further_process_data
# The function processes a list of items (dicts), removing certain keys,
# replacing text in 'instruction', and renaming keys

data = [
    {
        'R_chosen': 'some_value_1',
        'R_reject': 'some_value_2',
        'instruction': 'Please help me with < harmlessness: 1 > this task',
        'other_field': 'kept_value_1'
    },
    {
        'R_chosen': 'value_3',
        'R_reject': 'value_4',
        'reject': 'rejected_response',
        'text': 'some_text'
    },
    {
        'instruction': 'Another < harmlessness: 1 > request',
        'reject': 'bad_response',
        'score': 42
    }
]

ARGS = {
    'data': data
}
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
preprocess_data Ran
ran; our contract draft was wrong, not the code
OpenBMB/CPO/src/CDPO/cdpo/cdpo_ultrafeedback.py
code served (permissive licence) · get_code("fba000175d7bcb8e")
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 json
import tempfile
import os

# Create a temporary JSON file with test data
temp_dir = tempfile.mkdtemp()
test_file = os.path.join(temp_dir, "test_data.json")

test_data = [
    {
        "instruction": "What is 2+2?",
        "responses": [
            {
                "response": "The answer is 4",
                "Helpfulness_Rating": 5,
                "Honesty_Rating": 5,
                "Harmlessness_Rating": 5
            },
            {
                "response": "The answer is 5",
                "Helpfulness_Rating": 3,
                "Honesty_Rating": 2,
                "Harmlessness_Rating": 4
            },
            {
                "response": "I don't know",
                "Helpfulness_Rating": 2,
                "Honesty_Rating": 4,
                "Harmlessness_Rating": 5
            }
        ]
    },
    {
        "instruction": "Tell me a joke",
        "responses": [
            {
                "response": "Why did the chicken cross the road? To get to the other side!",
                "Helpfulness_Rating": 4,
                "Honesty_Rating": 5,
                "Harmlessness_Rating": 5
            },
            {
                "response": "I can't tell jokes",
                "Helpfulness_Rating": 1,
                "Honesty_Rating": 5,
                "Harmlessness_Rating": 5
            }
        ]
    }
]

with open(test_file, 'w', encoding='utf-8') as f:
    json.dump(test_data, f, ensure_ascii=False)

ARGS = {
    "srcpath": test_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type 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
preprocess_data Ran
ran; our contract draft was wrong, not the code
OpenBMB/CPO/src/CDPO/cdpo/cdpo_ultrasafety.py
code served (permissive licence) · get_code("97785ad2ada07093")
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 json
import tempfile
import os

# Create a temporary JSON file with sample data
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "sample_data.json")

sample_data = [
    {
        "instruction": "What is the capital of France?",
        "responses": [
            {
                "response": "Paris is the capital of France.",
                "Helpfulness_Rating": 5,
                "Honesty_Rating": 5,
                "Harmlessness_Rating": 1
            },
            {
                "response": "The capital of France is Paris, a beautiful city on the Seine river.",
                "Helpfulness_Rating": 4,
                "Honesty_Rating": 5,
                "Harmlessness_Rating": 1
            },
            {
                "response": "France's capital is Lyon.",
                "Helpfulness_Rating": 1,
                "Honesty_Rating": 1,
                "Harmlessness_Rating": 1
            }
        ]
    },
    {
        "instruction": "Explain photosynthesis",
        "responses": [
            {
                "response": "Photosynthesis is the process where plants convert light into chemical energy.",
                "Helpfulness_Rating": 5,
                "Honesty_Rating": 5,
                "Harmlessness_Rating": 0
            },
            {
                "response": "Plants use sunlight to make food through photosynthesis.",
                "Helpfulness_Rating": 3,
                "Honesty_Rating": 5,
                "Harmlessness_Rating": 0
            },
            {
                "response": "Photosynthesis is magic that happens in plants.",
                "Helpfulness_Rating": 1,
                "Honesty_Rating": 1,
                "Harmlessness_Rating": 0
            }
        ]
    }
]

with open(temp_file, 'w', encoding='utf-8') as f:
    json.dump(sample_data, f)

ARGS = {
    "srcpath": temp_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type 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
readJsonString Ran
ran; our contract draft was wrong, not the code
OpenBMB/CPO/src/CDPO/data_preparation/lib/file_func.py
code served (permissive licence) · get_code("88885e2717e9acca")
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 json

# The function readJsonString takes a JSON string and parses it into a dict
# It only uses json.loads(), so we need to provide a valid JSON string

jsonStr = '{"key1": "value1", "key2": 42, "key3": [1, 2, 3]}'

ARGS = {
    "jsonStr": jsonStr
}
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
readfile Ran
ran; our contract draft was wrong, not the code
OpenBMB/CPO/src/CDPO/data_preparation/lib/file_func.py
code served (permissive licence) · get_code("4334eae9875cd51c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
import os

# Create a temporary file with some test content
with tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt', encoding='utf-8') as tmp:
    tmp.write("Line 1\n")
    tmp.write("Line 2\n")
    tmp.write("Line 3\n")
    temp_file_path = tmp.name

# Define a simple callback function that accepts lines and file
def test_callback(lines, file):
    pass

# Construct the ARGS dictionary
ARGS = {
    'filePath': temp_file_path,
    'encoding': 'utf-8',
    'callBack': test_callback
}
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

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-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Alignment in artificial intelligence pursues the consistency between model responses and human preferences as well as values. In practice, the multifaceted nature of human preferences inadvertently introduces what is known as the "alignment tax"-a compromise where enhancements in alignment within one objective (e.g., harmlessness) can diminish performance in others (e.g., helpfulness). However, existing alignment techniques are mostly unidirectional, leading to sub-optimal trade-offs and poor flexibility over various objectives. To navigate this challenge, we argue the prominence of grounding LLMs with evident preferences. We introduce controllable preference optimization (CPO), which explicitly specifies preference scores for different objectives, thereby guiding the model to generate responses that meet the requirements. Our experimental analysis reveals that the aligned models can provide responses that match various preferences among the "3H" (helpfulness, honesty, harmlessness) desiderata. Furthermore, by introducing diverse data and alignment goals, we surpass baseline methods in aligning with single objectives, hence mitigating the impact of the alignment tax and achieving improvements in multi-objective alignment. 1

For agents

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

get_harvested_code_for_paper("2402.19085")
get_code_for_paper("2402.19085")
have("2402.19085")

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

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

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

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

Connect an agent — have() is free.