Upper confidence bound (UCB) algorithms pick, at each step, the action whose value could plausibly be highest: its estimated mean plus a bonus that grows with uncertainty. This "optimism in the face of uncertainty" explores under-sampled actions automatically and stops exploring them once the data shows they are worse.
The UCB1 rule
For rewards in , UCB1 plays each arm once and then chooses
where is arm 's average reward so far, the number of times it has been pulled and the total number of pulls. The bonus comes from a Hoeffding concentration bound: it is the width of an interval that contains the true mean with high probability. Rarely pulled arms have wide intervals; as grows the term slowly reopens the question for arms that have been neglected.
Worked example
After 100 pulls, arm A has mean 0.6 from 80 pulls and arm B has mean 0.5 from 20 pulls. With , A's score is and B's is . UCB pulls B: its lower average is not yet convincing evidence that it is worse.
Guarantee
Auer, Cesa-Bianchi and Fischer showed that UCB1's expected regret after rounds is bounded by a sum over suboptimal arms of terms of order , where is the arm's gap to the best. Logarithmic regret matches the known lower bound up to constants, so UCB1 is near optimal in this setting, without any random exploration.
Variants and uses
- KL-UCB and UCB-V use tighter confidence intervals.
- LinUCB extends the idea to contextual bandits with linear rewards.
- UCT applies UCB at every node of a search tree, which is the selection rule behind Monte Carlo tree search in game-playing systems.
- In full RL, count-based exploration bonuses carry the same intuition to MDPs.
Why it matters
UCB is the clearest example of directed exploration: it explores because of uncertainty, not randomness, and its behaviour is deterministic and auditable. Compared with epsilon-greedy it wastes far fewer pulls on clearly bad options. Compared with Thompson sampling it needs no prior but is usually a little less efficient in practice, and it can over-explore when many arms are nearly tied.
Related terms
Sources
- Peter Auer, Nicolò Cesa-Bianchi, Paul Fischer. Finite-time Analysis of the Multiarmed Bandit Problem, 2002. doi.org
- Tor Lattimore, Csaba Szepesvári. Bandit Algorithms, 2020. tor-lattimore.com