Best-of-Better-N: Generating Pre-Aligned Responses with In-Context Learning
On the map: LLM alignment / RLHF / preference optimisation → LLM preference optimization methods
Abstract (arXiv)
Inference-time alignment methods, such as Best-of-N, offer a flexible alternative to training-based alignment by using reward models to select high-quality responses generated by a reference LLM. However, the efficacy of these methods is inherently limited by the response quality: if the reference LLM assigns negligible probability to high-reward responses, no selection strategy will succeed in finding aligned outputs. In this work, we propose Best-of-Better-N (BoBN), an in context learning-based generation framework to address this challenge. Our method utilizes retrieval from high-reward examples relevant to the input query and task. Crucially, we introduce a restyling step where retrieved responses are rewritten by the reference LLM to align with the target task's format and style. These restyled examples are used in-context to shift the sampling distribution toward the high-reward region. We analytically characterize how in-context learning shifts the output distribution of pretrained transformers toward the high-reward region, resulting in provable benefits on the target task. We then evaluate BoBN on safety alignment and mathematical reasoning benchmarks across several reference LLMs. BoBN's higher-quality responses enable better performance to be achieved when the number of responses N is fixed, and smaller N required to achieve a target performance.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in LLM preference optimization methods, one of 10 directions in LLM alignment / RLHF / preference optimisation. Builds on 35 of its 42 references that are in the map. First posted on arXiv 3 Jul 2026.
Builds on
35 of 42 references.
Closest ancestors · 14
Same direction, newest first
- 2025Inference-Time Reward Hacking in Large Language Models24 Jun
- 2025Soft Best-of-n Sampling for Model Alignment6 May
- 2025Sample, Don't Search: Rethinking Test-Time Alignment for Language Models4 Apr
- 2025Is Best-of-N the Best of Them? Coverage, Scaling, and Optimality in Inference-Time Alignment27 Mar
- 2025Test-Time Preference Optimization: On-the-Fly Alignment via Iterative Textual Feedback22 Jan
- 2024InfAlign: Inference-aware language model alignment27 Dec
- 2024GenARM: Reward Guided Generation with Autoregressive Reward Model for Test-time Alignment10 Oct
- 2024Variational Best-of-N Alignment8 Jul
- 2024Cascade Reward Sampling for Efficient Decoding-Time Alignment24 Jun
- 2024ARGS: Alignment as Reward-Guided Search23 Jan
- 2023The Unlocking Spell on Base LLMs: Rethinking Alignment via In-Context Learning4 Dec
- 2023Statistical Rejection Sampling Improves Preference Optimization13 Sep
2 more
Other references · 21
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2021Training Verifiers to Solve Math Word Problemscited by 10,109
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 8,065
- 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,371
- 2022Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedbackcited by 3,720
- 2020Learning to summarize from human feedbackcited by 2,588
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
- 2024Tulu 3: Pushing Frontiers in Open Language Model Post-Trainingcited by 1,053
- 2022In-context Learning and Induction Headscited by 964
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
9 more
- 2022Transformers learn in-context by gradient descentcited by 732
- 2021Linear Transformers Are Secretly Fast Weight Programmerscited by 502
- 2024A StrongREJECT for Empty Jailbreakscited by 385
- 2024Interpretable Preferences via Multi-Objective Reward Modeling and Mixture-of-Expertscited by 376
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 279
- 2024Step-DPO: Step-wise Preference Optimization for Long-chain Reasoning of LLMscited by 273
- 2024SORRY-Bench: Systematically Evaluating Large Language Model Safety Refusalcited by 240
- 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 170
- 2023Self-ICL: Zero-Shot In-Context Learning with Self-Generated Demonstrationscited by 42
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Revisiting the (Sub)Optimality of Best-of-N for Inference-Time Alignment
- 2025AdaBoN: Adaptive Best-of-N Alignment
- 2026Towards a theory of inference-time alignment with unknown rewards
- 2025Best of mini-N in-loop Sampling: A Contextual Quality Reward Model for Reliable and Efficient Best-of-N Sampling
- 2026Best-of-Tails: Bridging Optimism and Pessimism in Inference-Time Alignment
- 2025Inference-time Alignment in Continuous Space
- 2026Gradient-Guided Reward Optimization for Inference-time Alignment
- 2024Fast Best-of-N Decoding via Speculative Rejection