SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.10207 · ICML · 2024

Rewards-in-Context: Multi-objective Alignment of Foundation Models with Dynamic Preference Adjustment

Rui Yang, Feng Luo, Shuang Qiu, Han Zhong, Dong Yu, Jianshu Chen, Xiaoman Pan

arXiv · PDF · Open in the Atlas

Code that ran

4 of 10 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, 2 violated it and 0 have no contract verdict; 1 failure of our instrument; 6 no recorded run), measured 2026-11-22; 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/2402.10207.json · badge: /api/ran/2402.10207.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
yangrui2015/ric canonical (classifier label)
classifier basis not recorded on the link
3 ran · 3 no recorded run
srzer/mod community
Papers with Code archive
1 ran · 3 no recorded run
FunctionStatusWhere it lives
check_lora_in_model_path Ran
ran, violated the contract we drafted
srzer/mod/experiment-PPO/ric/multi_reward_models.py
code served (permissive licence) · get_code("6ae81097a2ef6cb3")
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
import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a temporary directory with adapter_config.json to test the path existence check
temp_dir = tempfile.mkdtemp()
adapter_config_path = os.path.join(temp_dir, 'adapter_config.json')
with open(adapter_config_path, 'w') as f:
    f.write('{}')

# Create a simple model with lora in state_dict keys
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
        # Add a parameter with 'lora' in its name
        self.register_parameter('lora_weight', nn.Parameter(torch.randn(2, 2)))
    
    def forward(self, x):
        return self.linear(x)

model = SimpleModel()

ARGS = {
    'model': model,
    'path': temp_dir
}
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
convert_binary_pil Ran
ran, honoured the contract we drafted
yangrui2015/ric/ric_txt2img/image_metric.py
pointer only (licence: NONE); the stored copy get_code serves, from YangRui2015/RiC, is pointer only (licence: NONE) · get_code("28d5e50dbbf83280")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, yangrui2015/ric when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

encode_jpeg Ran
ran; our contract draft was wrong, not the code
yangrui2015/ric/ric_txt2img/image_metric.py
pointer only (licence: NONE); the stored copy get_code serves, from YangRui2015/RiC, is pointer only (licence: NONE) · get_code("5dc2d5b477d36a34")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, yangrui2015/ric when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

find_pareto_points Ran
ran, violated the contract we drafted
yangrui2015/ric/ric_txt2img/visualize_pareto.py
pointer only (licence: NONE); the stored copy get_code serves, from YangRui2015/RiC, is pointer only (licence: NONE) · get_code("939f2e01fbf8d40d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, yangrui2015/ric when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

RewardModels Not yet run
unverified (harvested, no recorded run)
srzer/mod/experiment-PPO/ric/multi_reward_models.py
code served (permissive licence) · get_code("378dcc6d47672a1a")
How it ran

no invocation recorded.

build_dataset_with_preference Not yet run
unverified (harvested, no recorded run)
yangrui2015/ric/ric/utils.py
pointer only (licence: NONE); the stored copy get_code serves, from YangRui2015/RiC, is pointer only (licence: NONE) · get_code("406b59a243695a5f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, yangrui2015/ric when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

build_dataset_with_preference_n Not yet run
unverified (harvested, no recorded run)
yangrui2015/ric/ric/utils.py
pointer only (licence: NONE); the stored copy get_code serves, from YangRui2015/RiC, is pointer only (licence: NONE) · get_code("c2e52a32dd1f6431")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, yangrui2015/ric when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

build_summary_dataset_with_preference_n Not yet run
unverified (harvested, no recorded run)
yangrui2015/ric/ric/utils.py
pointer only (licence: NONE); the stored copy get_code serves, from YangRui2015/RiC, is pointer only (licence: NONE) · get_code("384dbf3efb62957c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, yangrui2015/ric when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

get_rewards Not yet run
unverified (harvested, no recorded run)
srzer/mod/experiment-PPO/ric/multi_reward_models.py
code served (permissive licence) · get_code("270fd803f1ce23ec")
How it ran

no invocation recorded.

load_reward_model Not yet run
unverified (harvested, no recorded run)
srzer/mod/experiment-PPO/ric/multi_reward_models.py
code served (permissive licence) · get_code("4f8a90a0fc59d399")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 6 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 6 later) and 4 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
build_dataset_with_preference 1 other paper
1 later
2410.04070 (2024-10)
Personalized Alignment of LLMs at Decoding-Time PAD: PERSONALIZED ALIGNMENT OF LLMS AT DECODING-TIME
build_dataset_with_preference_n 1 other paper
1 later
2410.04070 (2024-10)
Personalized Alignment of LLMs at Decoding-Time PAD: PERSONALIZED ALIGNMENT OF LLMS AT DECODING-TIME
build_summary_dataset_with_preference_n 1 other paper
1 later
2410.04070 (2024-10)
Personalized Alignment of LLMs at Decoding-Time PAD: PERSONALIZED ALIGNMENT OF LLMS AT DECODING-TIME
convert_binary_pil 1 other paper
1 later
2410.04070 (2024-10)
Personalized Alignment of LLMs at Decoding-Time PAD: PERSONALIZED ALIGNMENT OF LLMS AT DECODING-TIME
encode_jpeg 1 other paper
1 later
2410.04070 (2024-10)
Personalized Alignment of LLMs at Decoding-Time PAD: PERSONALIZED ALIGNMENT OF LLMS AT DECODING-TIME
find_pareto_points 1 other paper
1 later
2410.04070 (2024-10)
Personalized Alignment of LLMs at Decoding-Time PAD: PERSONALIZED ALIGNMENT OF LLMS AT DECODING-TIME

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

Repositories linked to this paper

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

Abstract

We consider the problem of multi-objective alignment of foundation models with human preferences, which is a critical step towards helpful and harmless AI systems. However, it is generally costly and unstable to fine-tune large foundation models using reinforcement learning (RL), and the multi-dimensionality, heterogeneity, and conflicting nature of human preferences further complicate the alignment process. In this paper, we introduce Rewards-in-Context (RiC), which conditions the response of a foundation model on multiple rewards in its prompt context and applies supervised fine-tuning for alignment. The salient features of RiC are simplicity and adaptivity, as it only requires supervised fine-tuning of a single foundation model and supports dynamic adjustment for user preferences during inference time. Inspired by the analytical solution of an abstracted convex optimization problem, our dynamic inference-time adjustment method approaches the Pareto-optimal solution for multiple objectives. Empirical evidence demonstrates the efficacy of our method in aligning both Large Language Models (LLMs) and diffusion models to accommodate diverse rewards with only around 10% GPU hours compared with multi-objective RL baseline.

For agents

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

get_harvested_code_for_paper("2402.10207")
get_code_for_paper("2402.10207")
have("2402.10207")

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

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

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

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

Connect an agent — have() is free.