"매 known-best 의 exploit 의 unknown 의 explore 의 fundamental tradeoff". Exploration-exploitation dilemma 매 RL · bandits · A/B testing 의 core — 매 current best action 의 only 의 take 시 매 better unknown 의 miss, 매 too much explore 시 매 reward 의 burn. Optimal balance 매 horizon, prior, regret budget 의 function.
매 핵심
매 Spectrum
Pure exploit (greedy): 매 always 매 argmax Q(a) — 매 local optimum trap.
Pure explore (random): 매 always uniform — 매 expected regret O(T).
ε-greedy: 매 prob ε 매 explore, 매 prob 1−ε 매 exploit.
UCB: 매 confidence-bounded 매 deterministic explore.
Thompson Sampling: 매 posterior sampling 매 Bayesian optimal.
매 Regret bounds
매 ε-greedy(static): O(T).
매 ε-greedy(decaying 1/t): O(log T).
매 UCB1: O(log T) — provably tight for stochastic bandit.
매 Thompson Sampling: matches Lai-Robbins lower bound.
classUCB1:def__init__(self,k):self.k,self.t=k,0self.Q=np.zeros(k)self.N=np.zeros(k)defselect(self):self.t+=1forainrange(self.k):ifself.N[a]==0:returna# cold-start each arm onceucb=self.Q+np.sqrt(2*np.log(self.t)/self.N)returnint(np.argmax(ucb))defupdate(self,a,r):self.N[a]+=1self.Q[a]+=(r-self.Q[a])/self.N[a]
언제: 매 sequential decision 매 reward feedback. Cold-start recommender. A/B 의 multi-arm 의 generalize.
언제 X: 매 known reward distribution + horizon→∞ — 매 closed-form optimal. Single-shot decision.
어려운 점 (안티패턴)
Static ε too high: 매 ε=0.5 forever — 매 final 50% traffic 의 random arm 의 burn. Decay 의 use.
No cold-start arms: 매 UCB 의 N[a]=0 의 not-handled — 매 inf 의 produce, 매 each arm 의 1 초기 pull 의 require.
Non-stationarity ignored: 매 reward drift 의 discount 없이 의 stale Q value 의 trust.
Reward leakage: 매 future info 매 leak — 매 fake "exploit" 매 actually 의 cheat.
🧪 검증 / 중복
Verified (Sutton & Barto Ch. 2; Lai-Robbins 1985; Russo et al. "Tutorial on Thompson Sampling" 2018).