SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.01054 · 2024

Regularized Best-of-N Sampling with Minimum Bayes Risk Objective for Language Model Alignment

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 10 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
CyberAgentAILab/regularized-bon canonical 5 of 10
FunctionStatusWhere it lives
compute_probability_lm Ran CyberAgentAILab/regularized-bon/mbr/sample.py
code served (permissive licence) · get_code("2f471e4ae87cabfe")
compute_score_matrix Ran CyberAgentAILab/regularized-bon/mbr/policy/mbr.py
code served (permissive licence) · get_code("f2562be9fc8bf800")
get_sample_file_pattern Ran CyberAgentAILab/regularized-bon/experiments/get_sample_names.py
code served (permissive licence) · get_code("a1a9d6bb45118d21")
get_texts Ran CyberAgentAILab/regularized-bon/mbr/sample.py
code served (permissive licence) · get_code("03305d741386ebfc")
load_kwargs Ran CyberAgentAILab/regularized-bon/mbr/utils.py
code served (permissive licence) · get_code("b1c9862a514d30da")
compute_logprob Not yet run CyberAgentAILab/regularized-bon/mbr/compute_logprob.py
code served (permissive licence) · get_code("5f18d24b8f81d632")
compute_mbr Not yet run CyberAgentAILab/regularized-bon/mbr/policy/mbr.py
code served (permissive licence) · get_code("de665fbeba8102ec")
compute_probability_s2s Not yet run CyberAgentAILab/regularized-bon/mbr/sample.py
code served (permissive licence) · get_code("4e4c9f273c11c32a")
load_dataset Not yet run CyberAgentAILab/regularized-bon/mbr/utils.py
code served (permissive licence) · get_code("39372e4fabc574c3")
load_model Not yet run CyberAgentAILab/regularized-bon/mbr/utils.py
code served (permissive licence) · get_code("6a28c6520702b745")

Repositories linked to this paper

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

Abstract

Best-of-N (BoN) sampling with a reward model has been shown to be an effective strategy for aligning Large Language Models (LLMs) to human preferences at the time of decoding. BoN sampling is susceptible to a problem known as reward hacking when the accuracy of the reward model is not high enough due to the quality or the quantity of the preference dataset. Because the reward model is an imperfect proxy for the true objective, over-optimizing its value can compromise its performance on the true objective. In this research, we propose MBR-BoN, a variant of BoN that aims to mitigate reward hacking at inference time by incorporating the Minimum Bayes Risk (MBR) objective as a proximity regularization term. We show empirically and analytically that the MBR objective quantifies the proximity of the response to the reference policy, serving as a proximity regularizer. We evaluate MBR-BoN on the AlpacaFarm and Anthropic's hh-rlhf datasets and show that it outperforms both BoN sampling and MBR decoding. We also evaluate MBR-BoN to generate a pairwise preference learning dataset for Direct Preference Optimization (DPO). Empirical results show that models trained on a dataset generated with MBR-BoN outperform those with vanilla BoN. Our code is available at https://github.com/CyberAgentAILab/regularized-bon

For agents

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

get_harvested_code_for_paper("2404.01054")
get_code_for_paper("2404.01054")
have("2404.01054")

Connect an agent — have() is free.