Best-of-N Sampling

Also known as: best-of-N decoding

Quick definition

Generating several candidate outputs and selecting the strongest using a scorer or verifier.

Generating several candidate outputs and selecting the strongest using a scorer or verifier.

Why it matters: More candidates raise compute cost and selection quality depends on the evaluator.

Practical example: A coding system generates eight patches and chooses the one passing most tests.

Common use cases: Code repair, reasoning, and response-quality optimization.

Examples

  • A coding system generates eight patches and chooses the one passing most tests.

Use cases

  • Code repair, reasoning, and response-quality optimization.

Frequently asked questions

What is Best-of-N Sampling?

Generating several candidate outputs and selecting the strongest using a scorer or verifier.

What should I know before using Best-of-N Sampling?

More candidates raise compute cost and selection quality depends on the evaluator. Example: A coding system generates eight patches and chooses the one passing most tests.

Categories and tags

Sources

  1. https://www.anthropic.com/engineering/building-effective-agents