Best-of-N
Best-of-N is a technique that generates or evaluates multiple candidates and selects one according to a scoring or quality criterion.
LLM Evaluation and Alignment, The Foundational Ideas
Best-of-N reranking is a selection method that scores multiple candidate solutions and retains the highest-scoring candidate.
- How it is used
- Uses a trained reward model to improve inference outputs or substitute more cheaply for a full PPO run.
- How deep it goes
- Explains sampling, scoring, selection, linear compute cost, KL drift, and reward-model calibration risk.
- Examples
- Uses BoN@4 and BoN@64 comparisons, plus MATH reranking with process and outcome reward models.
- What you can do after
- Apply it via a trained reward model by sampling, scoring, and selecting candidates under a chosen N budget.
Read how LLM Evaluation and Alignment, The Foundational Ideas explains best-of-N →
Prompt Engineering in Practice
Best-of-N is a sampling technique that generates multiple complete candidate responses and selects the strongest candidate.
- How it is used
- Selects one complete response when meaningful quality differences justify rubric-based comparison.
- How deep it goes
- Generates complete candidates under identical requirements, scores them against predefined criteria, selects one, and archives the rubric; it does not average or vote.
- Examples
- Uses three candidate executive updates about a failed checkout deployment, constrained by length, audience, tone, and required content.
- What you can do after
- Evaluate complete candidates against predefined criteria and select one final response.
Read how Prompt Engineering in Practice explains best-of-N →
Also covered in
- LLM Customization and Fine-TuningIn early access (MEAP)
- Reinforcement Learning from Human Feedback
What to know first
- fine-tuningFine-tuning is the continued training of a pretrained model on targeted data or objectives to adapt its parameters or behavior to a task, domain, or use.
- Kullback–Leibler divergenceKullback–Leibler divergence is a nonnegative, generally asymmetric measure of the difference between probability distributions, defined as the expected log probability ratio under one distribution.
- reward modelA reward model is a learned model that assigns scores to outputs, actions, or outcomes to represent their desirability according to preferences or evaluation criteria.
- Proximal Policy OptimizationProximal Policy Optimization is a policy-gradient reinforcement-learning algorithm that limits policy updates to keep successive policies close and promote stable learning.
Related concepts
- training datasetproduces · A training dataset is a collection of examples supplied to a learning procedure to fit or adapt a model’s parameters or behavior.
- modealternative to · The statistical mode is the value or category occurring most frequently in a set of observations or outcomes.
- reward modeluses · A reward model is a learned model that assigns scores to outputs, actions, or outcomes to represent their desirability according to preferences or evaluation criteria.
- samplingused by · Sampling is a procedure for selecting items from a collection or generating outcomes from a probability distribution according to a specified rule.
- self-consistencyalternative to · Self-consistency is a technique that generates multiple reasoning paths or responses for the same input and selects or combines results based on their agreement.
Questions about best-of-N
What is best-of-N?
Best-of-N is a technique that generates or evaluates multiple candidates and selects one according to a scoring or quality criterion.
Which Manning books explain best-of-N?
LLM Evaluation and Alignment, The Foundational Ideas and Prompt Engineering in Practice.
What should I know before learning best-of-N?
Manning books that teach best-of-N usually introduce fine-tuning, Kullback–Leibler divergence, reward model and Proximal Policy Optimization first.
What is the difference between best-of-N and mode?
Best-of-N is a technique that generates or evaluates multiple candidates and selects one according to a scoring or quality criterion. The statistical mode is the value or category occurring most frequently in a set of observations or outcomes.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

