AI engineering glossary · Agents tools MCP

What is Best-of-N sampling?

Best-of-N sampling: Generating several candidate answers or action paths for one task and choosing the best using a scoring method such as a verifier or reward model. It trades extra compute for higher quality, and is often used with agents when checks are automatic.

Level: advancedTopic: Agents tools MCP

Best-of-N sampling: an example

An agent writes five candidate fixes, runs the tests on each, and submits the one that passes.

Related terms

More Agents tools MCP terms

Where you learn it

Best-of-N sampling is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.