Greedy vs beam search decoding: greedy picks best token, beam maintains k candidates

Ever wondered why Google Search sometimes shows you the top results first?

Image: Szaaman, Public domain, via Wikimedia Commons

Greedy vs beam search decoding: greedy picks best token, beam maintains k candidates

Ever wondered why Google Search sometimes shows you the top results first?

Imagine you're searching for recipes online and want to find the best one quickly without scrolling endlessly.

Think of it like picking the tastiest-looking fruit from a bunch to try first, instead of trying every single one. In this case, Google uses a method called "beam search" to quickly find the best results without checking every single option.

Example

If you have 100 recipes and Google only checks the top 10 based on your search, it saves time and energy.

Remember this

Beam search keeps only the top 10 promising results, making it faster than checking every single recipe.

Related concepts

Swipe through 100 ML concepts daily

Open Pocket Polymath