SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2311.08045 · 2023

Adversarial Preference Optimization: Enhancing Your Alignment via RM-LLM Game

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 5 functions out of this paper's own repositories and ran 5 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
linear95/apo canonical 5 of 5
FunctionStatusWhere it lives
batch_padding Ran linear95/apo/reward_datasets.py
code served (permissive licence) · get_code("5390483acda4ac9e")
merge_json_or_jsonl_data Ran linear95/apo/utils.py
code served (permissive licence) · get_code("132d73468979ab25")
numpy_sigmoid Ran linear95/apo/utils.py
code served (permissive licence) · get_code("6132b74f7967bc2b")
read_json_or_jsonl_data Ran linear95/apo/utils.py
code served (permissive licence) · get_code("88d37ef54976663d")
reward_model_loss Ran linear95/apo/trainer.py
code served (permissive licence) · get_code("70dc36d9f98f63c3")

Repositories linked to this paper

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

Abstract

Human preference alignment is essential to improve the interaction quality of large language models (LLMs). Existing alignment methods depend on manually annotated preference data to guide the LLM optimization directions. However, continuously updating LLMs for alignment raises a distribution gap between model-generated samples and human-annotated responses, hindering training effectiveness. To mitigate this issue, previous methods require additional preference annotation on newly generated samples to adapt to the shifted distribution, which consumes a large amount of annotation resources. Targeting more efficient human preference optimization, we propose an Adversarial Preference Optimization (APO) framework, in which the LLM and the reward model update alternatively via a min-max game. Through adversarial training, the reward model can adapt to the shifted generation distribution of the LLM without any additional annotation. With comprehensive experiments, we find the proposed adversarial training framework further enhances existing alignment baselines in terms of LLM helpfulness and harmlessness. The code is at https://github.com/Linear95/APO.

For agents

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

get_harvested_code_for_paper("2311.08045")
get_code_for_paper("2311.08045")
have("2311.08045")

Connect an agent — have() is free.