mlsanityData to 14 Oct 2026

Best-of-Better-N: Generating Pre-Aligned Responses with In-Context Learning

arXiv 2607.03453 ↗First posted 3 Jul 2026cs.LG cs.AIcited by 0

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

  1. 2025Inference-Time Reward Hacking in Large Language Models24 Jun
  2. 2025Soft Best-of-n Sampling for Model Alignment6 May
  3. 2025Sample, Don't Search: Rethinking Test-Time Alignment for Language Models4 Apr
  4. 2025Is Best-of-N the Best of Them? Coverage, Scaling, and Optimality in Inference-Time Alignment27 Mar
  5. 2025Test-Time Preference Optimization: On-the-Fly Alignment via Iterative Textual Feedback22 Jan
  6. 2024InfAlign: Inference-aware language model alignment27 Dec
  7. 2024GenARM: Reward Guided Generation with Autoregressive Reward Model for Test-time Alignment10 Oct
  8. 2024Variational Best-of-N Alignment8 Jul
  9. 2024Cascade Reward Sampling for Efficient Decoding-Time Alignment24 Jun
  10. 2024ARGS: Alignment as Reward-Guided Search23 Jan
  11. 2023The Unlocking Spell on Base LLMs: Rethinking Alignment via In-Context Learning4 Dec
  12. 2023Statistical Rejection Sampling Improves Preference Optimization13 Sep
2 more
  1. 2023Mitigating the Alignment Tax of RLHF12 Sep
  2. 2022Training language models to follow instructions with human feedback4 Mar

Other references · 21

  1. 2020Language Models are Few-Shot Learnerscited by 32,419
  2. 2024The Llama 3 Herd of Modelscited by 14,715
  3. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
  4. 2021Training Verifiers to Solve Math Word Problemscited by 10,109
  5. 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 8,065
  6. 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,371
  7. 2022Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedbackcited by 3,720
  8. 2020Learning to summarize from human feedbackcited by 2,588
  9. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
  10. 2024Tulu 3: Pushing Frontiers in Open Language Model Post-Trainingcited by 1,053
  11. 2022In-context Learning and Induction Headscited by 964
  12. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
9 more
  1. 2022Transformers learn in-context by gradient descentcited by 732
  2. 2021Linear Transformers Are Secretly Fast Weight Programmerscited by 502
  3. 2024A StrongREJECT for Empty Jailbreakscited by 385
  4. 2024Interpretable Preferences via Multi-Objective Reward Modeling and Mixture-of-Expertscited by 376
  5. 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 279
  6. 2024Step-DPO: Step-wise Preference Optimization for Long-chain Reasoning of LLMscited by 273
  7. 2024SORRY-Bench: Systematically Evaluating Large Language Model Safety Refusalcited by 240
  8. 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 170
  9. 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

  1. 2026Revisiting the (Sub)Optimality of Best-of-N for Inference-Time Alignment
  2. 2025AdaBoN: Adaptive Best-of-N Alignment
  3. 2026Towards a theory of inference-time alignment with unknown rewards
  4. 2025Best of mini-N in-loop Sampling: A Contextual Quality Reward Model for Reliable and Efficient Best-of-N Sampling
  5. 2026Best-of-Tails: Bridging Optimism and Pessimism in Inference-Time Alignment
  6. 2025Inference-time Alignment in Continuous Space
  7. 2026Gradient-Guided Reward Optimization for Inference-time Alignment
  8. 2024Fast Best-of-N Decoding via Speculative Rejection