Best-of-N

Best-of-N

Best-of-N is a method in which an AI model answers the same question multiple times and the best answer is then selected. The procedure improves the quality of the output without changing the model itself.

An AI model does not always give the same answer to the same question. Small random effects cause the output to come out slightly different each time. Best-of-N exploits exactly this: the model answers the same query N times — for example eight or twenty times. Then a second, evaluating system selects the best of these answers and passes it on. The model itself remains unchanged; the higher quality comes about solely through the selection.

More compute time instead of more training

Making a model smarter is expensive: new training, more data, weeks on costly hardware. Best-of-N is a different path. You give the same model more compute time when answering — and get better results in return. This is the core of so-called inference-time compute: quality through more effort at the moment of answering, not through more elaborate training.

This is especially valuable where mistakes are costly. If a model is supposed to produce a mathematical proof or write code without programming errors, a single answer is risky. Eight attempts, from which the best one is filtered out, are considerably more reliable. The price for this is eightfold compute effort — which, depending on the application, can still be cheaper than training a better model.

The role of the evaluator

The procedure stands or falls on one question: who or what decides which of the N answers is the best? For this, a so-called reward model is used — a specially trained model that scores answers with point values. It has been trained to imitate human judgments about quality. The answer with the highest score wins.

This is also where the most important weak point lies. If the reward model is poorly calibrated, i.e. systematically favors the wrong answers, Best-of-N reliably selects the wrong one. The procedure amplifies whatever the evaluator thinks — regardless of whether the evaluator is right or not. Researchers call this reward hacking: the model learns to achieve high scores, not necessarily to deliver good answers.

Another effect is scaling. If you increase N from 4 to 64, quality rises — but not linearly. The first additional attempts yield a lot, and at some point the gains level off. Beyond a certain point, it becomes more sensible to improve the model itself rather than simply generating more answers.

Best-of-N in current AI systems

Best-of-N is not a theoretical concept. In developing models like o1 and o3, OpenAI explicitly describes that more compute time at answer time improves performance — Best-of-N is one of the simplest forms of this. Google DeepMind’s AlphaCode, which solves programming competitions, also generates a large number of proposed solutions and then filters them.

In practice, one encounters Best-of-N even without knowing the name. When a coding tool like GitHub Copilot offers several code variants to choose from, a similar principle is at work behind it. The difference from Best-of-N in the narrower sense: there, a human selects; here, an automatic evaluation model does.

Best-of-N is also considered the foundation for more elaborate procedures. Methods such as Tree-of-Thoughts or Beam Search — in which the model pursues several solution paths simultaneously and expands on the most promising ones — build on the same idea: quality through parallel exploration, not through a single attempt.

Related Products

Latest News

Subscribe free. Unsubscribe the second it sucks.

High-signal news across AI, business, UX, and tech. Every morning.