liveBook · Manning

Multi-armed bandit

As explained in Delivering Machine Learning Projects: From design to deployment

A multi-armed bandit is an adaptive sequential decision method that allocates trials among alternatives while balancing exploration and reward.

A multi-armed bandit (MAB) is an adaptive way to test alternatives while balancing exploration—learning which option works—and exploitation—using the option currently producing the best reward. It can evaluate models with real users in production or in a controlled test, often gathering useful evidence more efficiently than a fixed A/B test. section 8.2.6 section 8.2.5

Use a bandit evaluation to make model testing an explicit operational decision:

  • Define the reward signal before deployment. Explicit feedback can include a recommended item being purchased; implicit feedback can also indicate model performance. section 8.2.6
  • Allocate trials among candidate models, then reduce exposure to an option that repeatedly produces weak rewards instead of continuing to spend live traffic on it. section 8.2.6
  • Record the performance measures, costs, trade-offs, and decision basis. Live testing can expose people to experimental behavior, so evaluation constraints belong in the selection record. section 8.6
  • Use the approach when rapid learning matters more than the slower, statistically strong evidence associated with a conventional A/B test. section 8.2.5

Three machines, six pulls

Three machines represent candidate processes: A pays frequently, B pays occasionally, and C never pays. After C fails to reward two pulls, attention shifts to A and B. By the sixth pull, B has failed four times out of six while A has failed twice, so trials stop favoring B; A continues paying. section 8.2.6

Figure 8.2 Three one-arm bandits with pay-out records, where each block represents one pull. A light record indicates a zero reward, and a dark one indicates a positive reward. Machine A pays frequently, Machine B pays occasionally, and Machine C never pays.

Inspect the payout record to see how repeated rewards and failures guide the balance between exploration and exploitation. section 8.2.6

How Delivering Machine Learning Projects: From design to deployment covers it

How deep it goes
Explains reward allocation through a machine analogy and live-feedback examples, without detailing an algorithmic implementation.
Examples
Uses three payout machines and recommended-item purchases as concrete reward examples.
What it assumes
Assumes model-testing concerns and introduces the exploration–exploitation trade-off through concrete payout behavior.
What you can do after
Apply it via live or controlled testing to allocate trials and reduce exposure to weak models.
How it connects
Connects exploration–exploitation with A/B testing, feedback signals, model performance measures, and model selection.

Also explained in

Compare how 5 books explain multi-armed bandit →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Delivering Machine Learning Projects: From design to deployment. The section links point to the parts of the book it draws on.