多臂老虎机 · The Multi-Armed Bandit

每一次选择,要么在收集信息,要么在兑现已知价值——这就是探索与利用

想象面前一排老虎机(这就是"多臂老虎机"),每台中奖率不同,而你并不知道。每拉一次杆,你都在做同一个根本抉择:拉那台目前看着最好的(利用,把已知价值变现),还是拉一台吃不准的(探索,花一次机会去收集信息)。生活里几乎所有重复选择都是老虎机:吃哪家餐厅、读哪类书、押哪个方向。

非平凡点:① 探索的价值不在当下那一次,而在未来——你这次学到的信息,能让此后无数次选择更准。所以最优的探索量取决于你还剩多少次机会,也就是时间视界。机会还多,多探索是理性的;机会快用完,就该收割已知最优。② 这把一个看似性格的问题("我爱不爱尝鲜")变成了数学问题:年轻时该多探索,临近收尾该多利用——不是心态变保守,是视界在缩短。③ 衡量好坏的标尺是后悔(regret):相比"一开始就知道最优"你损失了多少;好策略让长期后悔增长得越来越慢。

实践:做选择前先问"这类选择我还要做多少次"。视界长 → 给探索更高权重,偶尔踩雷是在付学费;视界短 → 别再试新的,押注已验证的最优。

经典例子

新药临床试验是最揪心的老虎机:把更多病人分到当前看着更有效的疗法(利用,对眼前病人好),还是分一些去测试新疗法(探索,对未来病人好)?每一次分组,都是拿当下确定的善去赌未来更大的善——这正是实验伦理如此艰难的根源。

场景 · BigCat

推荐系统与 A/B 测试是工程版老虎机:永远只推已知点击率最高的内容(纯利用),系统会僵死、错过新爆款;留一部分流量去探索新内容,才能持续进化。RLHF 同理——模型若只利用已知高分回答,就永远学不到更好的策略。把它用到职业上:每年留一块探索预算去碰陌生领域,当视界还长,这不是分心,而是复利最高的投资。


The Multi-Armed Bandit — a row of slot machines with unknown payout rates frames every repeated choice: pull the arm that currently looks best (exploit — cash in known value) or pull an uncertain one (explore — spend a turn to gather information). The value of exploration lies not in the current turn but in the future: what you learn sharpens countless later choices, so the optimal amount of exploration depends on your time horizon. Long horizon → explore more; short horizon → harvest the known best. This turns a seeming personality trait ("do I like novelty?") into math: explore young, exploit late — not from growing timid, but from a shrinking horizon. The yardstick is regret: how much you lost versus knowing the best option from the start.

中文提示词
我在 [情境:职业方向 / 产品策略 / 学习领域] 面临"继续深耕已知最优 vs 尝试新选项"的反复抉择。我目前的选项和已知表现是 [列出]。请用探索-利用框架帮我: ① 估计我大致还剩多长的"时间视界"; ② 据此判断现在该偏探索还是偏利用; ③ 给出一个具体的探索预算比例和下一步动作。
English Prompt
In [context: career direction / product strategy / learning area] I keep facing the choice "keep deepening the known best vs try new options." My current options and their known performance: [list]. Using the explore–exploit framework, please: 1. Estimate how much "time horizon" I likely have left. 2. Judge whether I should now lean toward exploration or exploitation. 3. Give a concrete exploration-budget ratio and a next action.

最优停止与秘书问题 · Optimal Stopping

看一个决定一个、错过不回头时,何时该停下来出手?

有一类选择必须按顺序做、看一个定一个、错过不能回头:租房、面试招人、找伴侣。看得太少,怕错过后面更好的;看得太多,怕好的早被你放走了。数学给出惊人干净的答案——"37% 法则":先纯观察前 37% 的候选只看不选,用他们设一条标准线,之后遇到第一个超过这条线的,就果断拿下。

非平凡点:① 这个 37%(精确是 1/e)同时是你"该看的比例"和"选到最优的成功概率"——即便用上最优策略,也只有约 37% 的概率真抓到第一名,但这已是无法再被超越的上限,宇宙就这么吝啬。② 关键前提是不可回头:不能挑了又反悔,也不能召回错过的人。条件一变(允许回头、可以反复出价),门槛就随之改变——所以用之前先确认你的处境真的不可逆。③ 它精确刻画了"看够了没"这个直觉难题:阶段一只为校准眼光、绝不出手,阶段二只认标准、绝不犹豫——把探索与利用在时间上干净地切成两段。

实践:面对序贯且不可回头的选择,先估候选总数,前约三分之一只看不定、心里记下其中最好的当门槛,之后第一个超过门槛的立刻拍板,别再幻想"后面也许更好"。

前 37% 只看不选 设定门槛 之后 第一个超过门槛者 → 果断拿下 候选按时间先后依次到来 →
把探索(设门槛)与利用(出手)在时间轴上切成两段
经典例子

经典版叫"秘书问题":依次面试应聘者,每见完一个必须当场决定要不要,拒了就没了。直觉总让人看太多,错过早期出现的好苗子;37% 法则告诉你:用前三分之一定标尺,然后果断。租房同理——头几天到处看而不下定,是在为后面的果断攒判断力。

场景 · BigCat

给团队招一个关键岗位,简历与面试是序贯的,强候选人不会一直等你。与其无止境地"再多看几个",不如明确:前约三分之一只用来校准"什么叫好",之后第一个明显超过这条线的就发 offer。技术选型也是它的变体——评估架构方案时,先快速扫一批建立基准,再遇到显著更优的就锁定,避免陷进"会不会还有更好的"无限比较。


Optimal Stopping (the Secretary Problem) — when choices come one at a time, must be decided on the spot, and can't be recalled, math gives a clean answer: the 37% rule. Observe the first 37% of candidates without picking, use them to set a bar, then take the first one that beats the bar. The 37% (precisely 1/e) is both how much to look at and the probability of landing the best — even the optimal strategy succeeds only ~37% of the time, an unbeatable ceiling. The crucial precondition is no recall, no backtracking; change that (allow returns or repeated bids) and the threshold shifts, so confirm your situation is truly irreversible first. It splits explore (calibrate, never act) and exploit (only act on the bar, never hesitate) cleanly along the time axis.

中文提示词
我要在一串"看一个决定一个、错过不回头"的选项里做选择:[描述:招人 / 租房 / 选方案,并估计候选总数]。请帮我用最优停止法则: ① 确认我的处境是否真的不可回头(37% 法则是否适用); ② 算出我该先观察多少个来设门槛; ③ 给我一句可执行的"何时该停、立刻拍板"的判据。
English Prompt
I must choose from a stream of "decide-on-the-spot, no going back" options: [describe: hiring / apartment / picking a design, and estimate the total number]. Using optimal stopping, please: 1. Confirm whether my situation is truly irreversible (does the 37% rule apply). 2. Compute how many I should observe to set the bar. 3. Give me one actionable criterion for "when to stop and commit immediately."

乐观面对不确定 · UCB 与汤普森采样

比"凭感觉"更聪明的解法:把不确定性本身当成值得下注的价值

老虎机难题有没有比凭感觉更聪明的解法?有两个优雅算法。上置信界(UCB):给每个选项算一个"乐观估计"——它的平均表现加上一个随不确定性增大的加成,然后永远选这个乐观值最高的。汤普森采样:依你对每个选项的概率信念各采一个样,谁的样本最高就选谁。

非平凡点:① 两者共享一句深刻口号——"面对不确定时保持乐观"。为什么乐观是对的?因为不确定本身有价值:去试一个吃不准的选项,坏了顶多确认它差、以后不再选(下行有底),好了则可能发现一座金矿(上行无限)。这种不对称让"赌不确定"在数学上占优。② UCB 是显式乐观:不确定越大、加成越高,逼你去试没把握的;试多了不确定收窄,加成自然消退。汤普森是隐式乐观:用随机采样,让一个选项被选中的概率,正好等于它"其实是最优"的概率——优雅地按可能性分配探索。③ 这正是贝叶斯思维的行动版:信念是后验分布,行动就是从分布里采样、或取它的乐观上界。

实践:别只用"当前平均最好"来选,要给"样本还少、吃不准"的选项一个明确加成;当一个新选项可能很好、而你又赔不起太多时,正是该乐观下注的时刻。

经典例子

这两套算法是现代 A/B 测试、广告与新闻推荐的引擎:与其把流量平均浪费在已知很差的版本上,不如让系统自动把探索集中到"可能更好、但还没测够"的版本,既快速收敛,又不漏掉黑马。

场景 · BigCat

围棋 AI 的蒙特卡洛树搜索用的正是 UCB 思想(UCT)——优先探索那些"胜率不确定但有潜力"的走法,而非只走当前看着最好的。生产级推荐系统则大量用汤普森采样做在线学习。迁移到研究与职业判断:在多个方向里下注时,别只挑已被验证的安全方向,给"高不确定、但上限极高"的方向留注码——因为押错的损失有限,押对的回报无限。


UCB & Thompson Sampling — two elegant bandit algorithms sharing one motto: optimism in the face of uncertainty. UCB picks the option with the highest mean plus a bonus that grows with uncertainty (explicit optimism), so it tries options it's unsure about until the bonus shrinks. Thompson sampling draws one sample from your belief about each option and picks the highest (implicit optimism), making an option's selection probability equal to its probability of actually being best. Optimism is justified because uncertainty has value: trying an unsure option has bounded downside (confirm it's bad, stop) but unbounded upside (find a gold mine), an asymmetry that makes betting on uncertainty mathematically favorable. It is Bayesian thinking in action: belief is the posterior, and acting means sampling from it or taking its optimistic upper bound.

中文提示词
我在 [情境] 有几个可下注的选项:[列出每个的已知表现 + 我有多确定]。请用"面对不确定时保持乐观"(UCB / 汤普森采样)的思路帮我: ① 给每个选项标出"平均表现"和"不确定性加成"; ② 指出哪个是当前最值得探索的(高潜力但还没测够); ③ 提醒我哪些选项的下行有限、上行很大,值得乐观下注。
English Prompt
In [context] I have several options to bet on: [list each one's known performance + how sure I am]. Using "optimism in the face of uncertainty" (UCB / Thompson sampling), please: 1. Tag each option with its mean performance and an uncertainty bonus. 2. Identify which is most worth exploring now (high potential, under-tested). 3. Flag which options have limited downside and large upside, worth an optimistic bet.

ε-贪心与退火 · ε-Greedy & Annealing

最朴素的平衡旋钮,以及一条永不归零的好奇心缝隙

最朴素也最常用的平衡旋钮叫 ε-贪心:绝大多数时候(以 1−ε 的概率)选已知最优(贪心地利用),留一个小概率 ε 随机试别的(探索)。它简单、稳健,所以无处不在。

非平凡点:① 固定的 ε 有个毛病:哪怕你早已确信某选项很烂,你还会永远以固定概率去试它,白白浪费。优雅的修正是退火——让 ε 随时间衰减:早期大胆探索,证据积累、信心增长后逐步收敛到利用。这条衰减曲线,正是模拟退火、学习率调度背后的同一思想。② 与 UCB/汤普森相比,ε-贪心的探索是"无差别撒网",会把宝贵的尝试浪费在明显很差的选项上;聪明算法则只定向探索最有希望的。所以 ε-贪心是便宜的基线,用一点低效换极简。③ 它精确对应一种人生节律:年轻多探索、广撒网,随阅历增长逐步聚焦——但关键是别把 ε 退到零,留一条永不关闭的小缝。世界会变,全然停止探索就是慢性僵化。

实践:给自己设一个明确的探索预算(比如 10–20% 的时间/资源)专门试新东西;让它随领域成熟而递减,但永远别归零。

早期:高 ε,大胆探索 后期:低 ε,多利用 但永不触零 → 时间 / 经验 → 探索率 ε →
退火:ε 随经验衰减,但留一条永不关闭的好奇缝隙
经典例子

强化学习训练里 ε-贪心是标配:训练初期高 ε,让智能体大量乱试以认识环境;后期调低 ε,让它稳定收割学到的最优策略——几乎所有教科书里的智能体都这么长大。

场景 · BigCat

深度学习的学习率与采样温度调度是同一逻辑:先大步探索参数空间,再逐步降温精修。搬到时间管理上,就是著名的"留一成时间做探索性项目"——用固定预算对冲僵化风险。育儿与自我成长也契合:给孩子(和自己)保留一块允许试错、不计 KPI 的探索区,但主体仍是巩固已被证明有效的习惯。退火的智慧是:随成熟而收敛,却永不彻底关掉好奇。


ε-Greedy & Annealing — the simplest balance knob: most of the time (probability 1−ε) pick the known best (greedily exploit), with small probability ε try something random (explore). Simple and robust, so it's everywhere. A fixed ε wastes effort forever on options you already know are bad; the elegant fix is annealing — decay ε over time: explore boldly early, converge to exploitation as evidence and confidence grow. That decay curve is the same idea behind simulated annealing and learning-rate schedules. Versus UCB/Thompson, ε-greedy explores indiscriminately (wasting tries on clearly bad options) rather than targeting the promising ones, so it's a cheap baseline trading a little inefficiency for simplicity. The life lesson: converge with maturity, but never anneal ε to zero — keep a never-closing slit of curiosity, because the world changes and fully stopping exploration is slow ossification.

中文提示词
我想给 [领域:学习 / 工作 / 投入方向] 设一个探索-利用的预算并随时间调整。我目前的状态是 [描述:新手还是成熟、已知最优是什么]。请用 ε-贪心与退火的思路帮我: ① 建议我现在的探索率 ε 该设多高; ② 给一条随经验递减的退火节奏; ③ 提醒我那条"永不归零"的最低探索缝隙该留多大。
English Prompt
I want to set an explore–exploit budget for [area: learning / work / where I invest] and adjust it over time. My current state is [describe: novice vs mature, what the known best is]. Using ε-greedy with annealing, please: 1. Suggest how high my exploration rate ε should be now. 2. Give an annealing schedule that decays with experience. 3. Remind me how large to keep the "never-zero" minimum exploration slit.