冯 · 诺依曼小传

<blockquote>RSS readers may not support rendering advanced formatting like math formulas. Click to view the original page: <a href="https://dreams.plus/blog/2026/0002-brief-biography-of-von-neumann" target="_blank">https://dreams.plus/blog/2026/0002-brief-biography-of-von-neumann</a></blockquote><h2 id=布达佩斯>布达佩斯</h2><p>匈牙利,1903 年 12 月 28 日,布达佩斯的一户殷实人家添了第一个男孩。父亲马克斯·诺依曼是位银行家,母亲玛吉特·肯恩出身富商之家。家里人叫他「扬奇」——匈牙利名字扬诺什的昵称。他还有两个弟弟,米哈伊和米克洛什。</p><p>扬奇从小就不太寻常——别的小孩还在学数数,他已经能用古希腊语跟父亲互相打趣了。他后来懂六种以上语言:匈牙利语、德语、法语、英语、拉丁语、古希腊语,晚年还学一点西班牙语。乌拉姆回忆,他用英语写论文时,已经能写出比大多数美国数学家更地道的英文散文。他学新语言的路子,跟解数学题是同一个路数——有同事回忆,他拿到一本新语言的语法书,先翻动词变位表,自己把规则推演出来,再拿例句验证。<figure><img alt="童年时的约翰 · 冯 · 诺依曼" src="https://imgproxy.citrusreader.com/aD-sSvz5KfTBE1teRgWKEK8b4DlLcnySNt4PzqUFRI4/raw:1/aHR0cHM6Ly9pbWFnZS1hc3NldHMuZHJlYW1zLnBsdXMvMjAyNjA5MDIwMjQ4MTgyLnBuZw"><figcaption>童年时的约翰 · 冯 · 诺依曼</figcaption></figure></p><p>六岁那年,他在心里算两个八位数的除法,速度快得让在座的客人怀疑是提前排练的把戏。他母亲有一次在饭桌上一时兴起,随口考他:「你说,你要是盯着窗外看,脑子里能想什么?」扬奇想都没想地回答出一堆答案,逗得全家人哈哈大笑——这大概是他这辈子第一次在饭桌上「表演」,后来这种饭桌高谈阔论的习惯,他保持了一辈子。</p><p>一九一三年,皇帝弗朗茨·约瑟夫册封马克斯为贵族,授予世袭的「玛尔吉泰」头衔——大致相当于德语里的「冯」。父亲自己没把这个头衔当回事,倒是儿子后来在德文论文上署起了「冯·诺依曼」的名字,一路用到了美国。</p><p>十岁那年,家里给他请了数学家教。没多久,一位名叫费凯特的匈牙利数学家登门找他讨论高等数学——据说聊到后来,这位比他大十几岁的年轻人被眼前的少年感动得眼眶发热。费凯特后来成了他学术生涯的引路人之一,两人还合写了他最早的一篇论文。</p><p>也是在十来岁的年纪,他一头扎进家里一套四十八卷本的《世界历史》,几个月就啃完了,之后养成一个爱好:拿当下报纸上的新闻,跟历史上某场战役类比,一本正经地讨论两边的战术优劣,仿佛在分析一盘棋局。他的记性好得被家人和师长传成奇谈——据说他能背下一整本小说,能记住电话簿里连续好几页的号码,谁想考他,报个页码就行。多年以后,普林斯顿一位专攻拜占庭史的教授私下承认,聊起拜占庭历史的细节,三十多岁的诺依曼懂得比他这个专业教授还多——而这只是诺依曼的一个业余爱好。</p><p>不过,扬奇不是散养出来的神童。马克斯给儿子请的不是普通家教,而是布达佩斯大学的年轻数学家和科学家,让他们定期来家里上课;诺依曼的弟弟后来回忆,家里餐厅的椅子常常被拉到书房去,因为「上课的人太多了」。父亲自己没受过多少正规科学训练,但他知道什么值得花钱——他给儿子买的,是一整套经过设计的私人教育。</p><p>这样的家教安排,在那个年代的布达佩斯并不罕见。二十世纪初,布达佩斯的一批犹太中产家庭把数学和语言教育当成头等大事,舍得为下一代花钱;诺依曼、维格纳、西拉德、特勒、冯·卡门——这些后来跟原子弹、氢弹、航空这些词紧紧绑在一起的名字——都出自同一个城市、相近的阶层。这群人中间后来流传一个玩笑:火星上的侦察兵在布达佩斯落脚,跟当地人通婚,留下孩子,又回了火星,于是有了这批「不像地球人」的科学家。玩笑归玩笑,背景是实的:诺依曼和维格纳上的是同一所路德中学,教过他们数学的是同一位老师——拉茨·拉斯洛。诺依曼不是孤例,他只是这一批人里算得最快、路走得最宽的一个。</p><p>家里原本盘算让他子承父业,将来接银行的班,至少学门「正经手艺」。至于数学,父亲倒也不反对,只是觉得那门手艺养活不了人。<h2 id=从化学到量子力学>从化学到量子力学</h2></p><p>于是,他一边挂名在苏黎世联邦理工学院读化学工程,一边偷偷跑去旁听数学课,每学期还要跑回布达佩斯参加考试。两条腿走路,两头都没耽误:二十岁上下,他先后拿到了苏黎世的化学工程文凭和布达佩斯大学的数学博士学位,论文题目是《集合论的公理化》,那年他二十二岁。头一篇正式发表的论文,其实早在中学时代就出来了——一九二二年,还不满十八岁的他和费凯特合写了一篇文章,讨论一类极小多项式零点的位置,把切比雪夫多项式的一个经典结果往前推了一步。</p><p>父亲的心愿和儿子自己的兴趣,算是用一种曲线救国的方式两全了。那套化学工程的训练他后来几乎没再用过,倒是养成了他一辈子的习惯:把物理问题先翻译成数学,再拿数学去对付它。</p><p>博士毕业那年秋天,他拿了一笔洛克菲勒奖学金去了哥廷根,在大卫·希尔伯特身边做研究。那时候量子力学刚成形不过几年,海森堡的矩阵力学、薛定谔的波动力学、玻恩的概率诠释,各家表述五花八门,物理学家正吵得不可开交。诺依曼在哥廷根那几年,做的一桩费力的事:把量子力学翻译成严格的数学语言。他用希尔伯特空间搭起统一框架,讨论观测量的谱分解,还头一回把「测量」写成一个数学过程——一九三二年出版的德文专著《量子力学的数学基础》,成了这个领域绕不过去的一本书。这套「给年轻学科搭骨架」的本事,往后他还会用很多次。</p><p>一九三〇年九月,在哥尼斯堡的一场学术会议上,一位叫库尔特·哥德尔的年轻逻辑学家报告了一个令人不安的结果:任何足够强的一致公理系统里,都有既不能证明也不能证伪的命题——这就是后来著名的「不完备定理」。台下大多数听众没太当回事,诺依曼却当场就抓住了证明的要害。散会之后他顺着想下去,琢磨出一个哥德尔当时还没说透的推论:这样的系统连「自身是一致的」这件事都无法证明。他写了一封信给哥德尔,信里把这个结论完整地推了一遍。等哥德尔的回信到了,他才得知,哥德尔本人也已经发现了这个结果,正在把它写进次年发表的文章里。诺依曼没有争这个先后,后来还在公开场合把功劳归给哥德尔。</p><p>在柏林和汉堡当讲师的那些年,他一边教课一边写,算子理论、遍历理论、测度论,到处都有他插手的痕迹。<h2 id=研究院与博弈论>研究院与博弈论</h2></p><p>一九三〇年,他应普林斯顿大学的邀请跨过大西洋去讲学。一九三三年,新成立的普林斯顿高等研究院聘他做创始教授——第一批六位教授里,有爱因斯坦,有外尔,有刚从纳粹德国跑出来的哥德尔。诺依曼是最年轻的一个。</p><p>三十年代是他学术上最密集的一段时间。他跟弗朗西斯·默里合作,把「算子代数」这门学科从无到有地搭起来——后来这套东西被称作「冯·诺依曼代数」,至今仍是数学和量子物理交叉处的重要工具。他还把集合论里「序数」的定义做了现代化处理,证明了紧群上哈默测度的唯一性;一九三二年,他又证明了动力系统里一个关于时间平均的定理——后来被称作「平均遍历定理」,成了统计物理的基本工具。光是在普林斯顿的头十年,他横跨的领域多得让同行咋舌——但「咋舌」是我们这些后来的读者会用的词,当时他身边人的反应往往是:又来了。</p><p>一九二八年,他还在柏林时就发表过一篇讨论博弈的文章,研究两人零和博弈,证明了著名的「极小极大定理」——玩家在最坏情况下求最好结果的策略,跟对方的策略同时达成平衡。这篇论文当时在数学圈里没掀起多少波澜。真正让它出圈,要等他和一位经济学家奥卡·莫根施特恩的合作。莫根施特恩是奥地利人,一九三八年逃到普林斯顿,两人一拍即合,一九四四年出版了《博弈论与经济行为》——一本经济学史和数学史上都绕不过去的大书。把「博弈」变成一门有严格结构的学科,跟当年给量子力学搭骨架,是同一个路数。</p><p>研究院边上,他的生活渐渐固定下来。家里几乎每周都要开派对,客厅里高朋满座,他自己端着酒杯一圈一圈地敬酒讲笑话,笑话大多带点荤腥,气氛总能被他搅得热闹非凡。据好友乌拉姆回忆,他喜欢昂贵的西装、烈酒和跑车,是那种谁都愿意请去撑场面的座上宾。</p><p>他跟哥德尔的交情值得一提。哥德尔是出了名的孤僻,在研究院里少有人能跟他真正说上话,诺依曼是少数几个。两人常在普林斯顿的林间小道上一起散步,一聊就是很久——聊的什么,旁人很少知道,大约是逻辑与数学的底细。研究院里的气氛并不总是一团和气:他跟外尔能合作,跟爱因斯坦之间却谈不上热络,两人对许多事情的看法相去甚远,尤其是在战争与核武器的问题上。</p><p>还有一件后来才被翻出来的小事。一九三八年春天,一位名叫艾伦·图灵的英国青年在普林斯顿完成了他的博士论文——那篇论文后来被称为「图灵机」的构想。诺依曼读过之后,提出让他留在高等研究院给自己当助手,年薪一千五百美元。图灵谢绝了,他说剑桥国王学院的职位更合意,然后乘船回了英国。多年以后人们回头翻这段旧账,常常感叹:如果当时图灵留了下来,计算机的早期历史也许会换一副样子。</p><p>一九三七年,他入了美国籍。也是那段时间,他离了婚,娶了第二任妻子克拉拉·丹。第一段婚姻的另一位主角玛丽埃特是布达佩斯人,两人婚后有个女儿玛丽娜,生于一九三五年。离婚后,玛丽娜先在母亲身边长大,后来又回到父亲身边。分隔两地的时候,他给女儿写很长的信;玛丽娜在回忆录里写道,有一封信,头八页都在劝她别急着结婚,后面才转到她的论文,再扯到他自己对历史的看法,顺手引了几段法文史料。玛丽娜后来读了经济学,一九七二年被尼克松任命为总统经济顾问委员会成员——是头一个坐上那个位子的女性。她晚年给回忆录起名《火星人的女儿》,写的就是前面那批「火星人」里的她父亲。</p><p>战争还没打起来,他的顾问身份就先忙上了。一九三七年之后,他先后给陆军和海军当顾问,处理弹道、炸药和空气动力学的问题。他参与改进了「聚能装药」——一种把炸药能量聚焦成射流来击穿装甲的设计,后来成了反坦克武器的原理。这些事他做得不声不响,连研究院里的同事都未必清楚。同一时期,他那几个布达佩斯老同乡也在为同一件事奔走——一九三九年,西拉德、维格纳和特勒三个人起草了一封给罗斯福的信,借爱因斯坦的名字签了出去,提醒美国政府注意铀裂变的前景;诺依曼没有在这封信上署名,但布达佩斯这群人之间,消息向来是通的。<h2 id=原子弹的算盘>原子弹的算盘</h2></p><p>一九四三年,奥本海默把诺依曼请到了洛斯阿拉莫斯。名义上他是顾问,实际上他很快成了原子弹设计里「算」这一环的关键人物。</p><p>原子弹的临界质量怎么算?炸药怎么聚爆才对称?冲击波在水里、在空气里怎么传播?这些在诺依曼到来之前,许多还停留在估算阶段。他把流体力学和数值方法带进了洛斯阿拉莫斯,一起带进去的还有他那张出了名的「活计算器」。聚爆方案最初是另一位物理学家奈德迈耶提出的大胆设想,但把设想变成能用的设计,需要算清楚球面聚爆的流体力学细节——诺依曼接过这一摊,跟化学家基斯塔科夫斯基合作,把炸药透镜的配方和几何一点点调出来。他还算过另一种打法:把核弹在高空引爆,让冲击波在更大的面积上均匀压下来,造成的破坏比地面引爆大得多。广岛和长崎的投弹高度,就参考了这套计算。</p><p>一九四五年七月十六日凌晨,新墨西哥州阿拉莫戈多沙漠,人类第一次核爆试验——「三位一体」——在那里进行。诺依曼就站在观看的人群里,看着那颗以他的方程为基础的炸弹把自己烧成白光。他回去之后说了什么,没有可靠的记载;能确认的是,他给这次试验做过大量的计算,也为此吸收了不少辐射。在洛斯阿拉莫斯那段日子,他跟费米、费曼这些人在食堂里一桌吃饭、插科打诨,照样是那身讲究的打扮。原子弹的严肃和这些日常混在一起,在他身上并不显得矛盾。</p><p>战后他留在这个圈子里。氢弹的「超级」方案,他是最早的推动者之一;一九四六年他跟乌拉姆一起,在洛斯阿拉莫斯继续做数值计算。这些工作后来凝结成了他冷战幕僚生涯的一部分。<h2 id=从算数到思考>从算数到思考</h2></p><p>战争还没结束,另一条线索已经悄悄接上了。</p><p>一九四四年夏天,在阿伯丁的火车站台上,诺依曼碰上了陆军派到宾夕法尼亚大学的联络官赫曼·哥德斯坦。哥德斯坦随口说起,大学里正在建造一台叫 ENIAC 的电子计算机——一万八千个真空管,用来算火炮射表。诺依曼听完,没过多久就出现在摩尔学院的每次设计会上。那一年正是曼哈顿计划最紧的时候,他两头跑;他很快意识到,这种「机器自动算」的路子,正是洛斯阿拉莫斯需要的。<figure><img alt="埃尼阿克计算机" src="https://imgproxy.citrusreader.com/6Ora3gaNzBTpcBozXAtOCvf7hHjgVqXp-zP6TodWxxk/raw:1/aHR0cHM6Ly9pbWFnZS1hc3NldHMuZHJlYW1zLnBsdXMvMjAyNjA5MDIwMjQ5MTg2LnBuZw"><figcaption>埃尼阿克计算机</figcaption></figure></p><p>一九四五年六月,他起草了一份报告,题目叫《EDVAC 报告初稿》,把「存储程序」的思想写成白纸黑字——程序和数据一样放进内存,机器读一条执行一条,不必再靠插拔接线来「改程序」。</p><p>这份打印稿在圈子里私下流传,日后被称作「冯·诺依曼架构」的雏形。</p><p>严格说,「存储程序」是小组讨论的产物,不全是他的发明;但把它提炼成一份清晰的文件,又一路推动它付诸实现的,是他。这一步的关键不在算得快,而在想得远:机器从此不只是算数的工具,程序本身也成了可以被读写的东西。</p><p>战后他在高等研究院主持电子计算机项目,一九五二年,那台「IAS 机」正式跑了起来。这台机器的图纸流传出去,成了好几家机构机器的蓝本——兰德公司照着造的那台,直接被人叫作「约翰尼艾克」。</p><p>为了让机器有正经事干,他和乌拉姆、梅特罗波利斯一起,把一种用随机数抽样逼近复杂计算的「蒙特卡洛方法」搬上了机器,用来算中子的扩散。</p><p>他一边算,一边开玩笑:任何想用确定性办法产生随机数的人,都是「活在罪孽之中」。这句玩笑后来成了统计学家们的名言。顺带一提,他的第二任妻子克拉拉·丹也是这台机器背后的早期程序员之一,替蒙特卡洛计算写过代码。</p><p>他还惦记着用机器预报天气。四十年代他就反复对人说,天气预报是计算机最有价值的用途之一,甚至把人工造雨、控制气候也算进计算的版图。一九五二年前后,他拉了几位气象学家,真的在 IAS 机上跑起了数值天气预报——那台机器算一次要用很久,但方向算是立住了。</p><p>从「机器能算什么」到「机器到底是什么」,这条路他一路走到了底。他琢磨「自动机」能不能自我复制,设计过一个理论上能复制自身的自动机,还在一次研讨会上做过一场题为《自动机的逻辑理论》的演讲,讨论机器与人脑的关系。</p><p>一九五二年一月,他在加州理工连讲五讲,题目是《概率逻辑与由不可靠元件合成可靠有机体》。灵感来自脑子:神经元单个来看并不牢靠,可整颗脑子照样运转稳定——问题是,怎么用一堆不可靠的零件,拼出一台可靠到能算能记的机器。</p><p>这份讲稿后来在《自动机研究》上刊出,成了后世「容错计算」最早的理论基础之一。他一辈子都在跟「系统内部的不可靠」打交道,从集合论里的不完备,到神经元的不稳定,说到底像是同一件事。</p><p>这些想法他生前没有写完,身后被整理成《自复制自动机理论》一书。他给耶鲁预备的最后一份讲稿,题目就叫《计算机与人脑》,讲的还是同一个执念:机器和脑子,到底谁跟谁学。</p><p>有一次,记者问他正在想什么。他说:「我在想一件比炸弹重要得多的事——我在想计算机。」这话流传得很广,因为说这话的人,炸弹和计算机两样都参与得很深。<h2 id=冷战幕僚>冷战幕僚</h2></p><p>同一时期,他的另一副面孔也在忙碌。</p><p>学术这边,他把博弈论从桌上的游戏推向对人类决策的一般描述。跟莫根施特恩合著的《博弈论与经济行为》一九四四年出版,一开始读者寥寥——经济学家嫌它太数学,数学家嫌它太经济学。</p><p>诺依曼没太在意,照样在各种场合宣传这套东西「能描述一切有利益冲突的人类活动」。一九四七年十月,一个叫乔治·丹齐格的年轻人带着一道卡了自己很久的线性规划题来见他。</p><p>诺依曼看了一眼,说了句「哦,这个啊」,然后当场在黑板前面讲了一个多小时,把线性规划的「对偶性」从头推到尾——这个结论,丹齐格之前翻遍了文献也没找到。丹齐格后来回忆,自己当场就学会了法卡斯引理和对偶理论。而这场即兴讲座的另一个副产品,是把博弈论和线性规划这两种此前不搭界的数学连到了一起。</p><p>公共事务这边,他越来越深地卷进冷战。他是空军科学顾问委员会的成员,是兰德公司的顾问——兰德公司在加州的圣莫尼卡,他战后常去那边——还替原子能委员会出谋划策。</p><p>博弈论在这里找到了最严肃的用武之地:核威慑,本质上被他说成一场玩家之间不停盘算对方底牌的博弈。他的政治立场之强硬,在当时的科学家里也属于突出的那一档——一九五〇年,他私下对不少人讲过,美国应该趁苏联还没造出氢弹,先发制人。</p><p>这个主张在研究院的同僚里并不讨喜,研究院里也有不少人跟他观点相左,但在白宫和五角大楼的走廊里,他的话很受用。</p><p>一九五四年,奥本海默的安全听证会开庭。诺依曼和奥本海默在氢弹问题上站得正相反,可他还是去做了证人。听证官问他对奥本海默的忠诚怎么看,他说:毫无疑问,没有任何怀疑。他又当着听证官的面把两件事分开——反对氢弹是一回事,忠诚是另一回事;他还提醒,这套安全体系有个危险,就是把技术上的不同意见,误当成政治上的异心。听证会的结果没有因为他的证词而改变:奥本海默还是被吊销了安全许可,从此离开了决策圈。</p><p>同年,他主持的一个委员会(因为代号而被称为「茶壶委员会」)向空军提交了一份报告,建议美国大力发展洲际弹道导弹——后来美国的第一代洲际导弹,多少都算这份报告的产物。一九五五年,艾森豪威尔把他任命为原子能委员会委员——委员会里像他这样以科学家身份直接坐进决策层的,并不多见。</p><p>他经手的事务,大多与核武器的设计和导弹的部署有关:他那个委员会算过一笔账,一枚能装进洲际导弹的一兆吨氢弹,足以把两英里内的一切抹平;于是氢弹的小型化跟洲际导弹一起,成了他这边推进的两件事。</p><p>一九五六年,比基尼环礁上进行了新的一轮核试验,第一枚「袖珍氢弹」就是在那轮试验里炸响的——那时候,他坐在委员会里,离权力中心很近。据说不管对面坐着的是将军还是总统,他都能一样谈笑风生、自信从容;艾森豪威尔后来回忆过,给他颁发总统自由勋章那次,这位科学家的风趣谈吐给自己留下了很深的印象。<h2 id=灵感>灵感</h2></p><p>工作之外,穿着讲究到有点固执:常年穿着马甲,口袋里插一块手绢,外套的扣子永远扣得整整齐齐——即便是在新墨西哥沙漠里搞原子弹的洛斯阿拉莫斯,别人穿着短袖短裤在酷热里晃悠,他也照样西装革履。他喜欢精巧的小玩意,复杂的机械玩具、稀奇古怪的小装置,只要摆在他面前,他都要摆弄一番。</p><p>工作起来他是不折不扣的工作狂,一个问题不解决,他能一直死磕下去,半夜里灵感一来,翻身就爬起来接着算。可一旦离开书桌,他对生活琐事的粗心大意也是出了名的。据说有一次,他生病卧床的妻子想让他倒杯水,诺依曼却愣是想不起杯子放在哪儿——而那时候他已经在那栋房子里住了整整十七年。</p><p>开车对他来说更是一场持续多年的灾难。他几乎每年都要报废一辆车,熟人们甚至专门给他反复出事故的那个路口起了个外号,叫「冯·诺依曼转角」。他喜欢把车开得飞快,据他身边人的说法,那是把拥挤的路段当成一道多体问题,边开边在心里算最优路线——至于算得好不好,看事故率就知道。</p><p>他其实从没考下过驾照,连着几次没过之后,还是在妻子的建议下使了点手段,才拿到执照。他开的是凯迪拉克,问他为什么挑这个牌子,他说:因为没人肯卖给我坦克。据说他跟保险公司解释事故经过时说过一句流传很广的话:路边的树本来排得整整齐齐地朝我迎面而来,一直都挺好的,直到有一棵没躲开。</p><p>他食量也惊人。在洛斯阿拉莫斯搞原子弹那几年,他常常开车一百二十英里,专程跑去一家墨西哥餐馆撮一顿,吃完再开一百二十英里回来——对他而言,这大概不算什么特别麻烦的事。</p><p>他的算术快到经常让身边人下不来台。他上课喜欢直接在黑板上写答案,中间的推导过程一概省略,学生们常常一脸茫然。有一回一个学生不死心,追问他这道题是不是还有别的解法,诺依曼愣了一下,一本正经地点头说:「有。」然后就没了下文——那个所谓「另一种解法」,大概永远留在他自己脑子里了。</p><p>还有一次,麻省理工的一个学生在走廊里拦住他,请教一道积分题。诺依曼瞄了一眼题目,脱口而出答案。学生说,教授,我知道书后面写的答案就是这个,我是想请您讲讲怎么算出来的。诺依曼又看了一眼题目,想了想,把答案又报了一遍。学生急了,反复解释自己要的是过程。诺依曼摊摊手,一脸无辜地说:「你还想怎样,我可是用了两种不同的方法才验算出这个答案的。」</p><p>他的心算速度还成就了一个流传很广的派对段子:一次晚宴上,女主人出了道题考他——两列火车相距一英里,各以每小时三十英里的速度迎面开来,一只苍蝇栖在其中一列车头,以每小时六十英里的速度朝对面飞去,碰到之后立刻折返,如此来回,直到两车相撞,问苍蝇一共飞了多少英里。</p><p>大多数懂点数学的人,第一反应是去算一个无穷级数求和,麻烦但也不难;诺依曼几乎没停顿就报出了正确答案。提问的人有点失望地说,其实有个巧办法——先算出两车相撞要多久(正好一分钟),再乘以苍蝇的速度就行,用不着算级数。诺依曼有点意外地反问:「可是我刚才算的就是级数啊。」</p><p>还有个流传更广的故事:福特汽车厂里一台发电机坏了,工程师们查了半天也没找出毛病,慕名请诺依曼来看。他围着机器转了一圈,用粉笔在外壳上画了一条线,让工人从那儿拆开检查——问题果然就出在那儿。福特问他要多少钱,诺依曼开了一张五千美元的账单,还附上明细:「画一条线,一美元;知道该画在哪儿,四千九百九十九美元。」(这则轶事在另一位工程师身上也有相似的版本,流传得久了,人们总爱把它安在算得最快的人头上。)</p><p>还有一件小事。象棋这件事,他其实也早就想过了。他一九二八年的极小极大定理,写的是两个人如何在博弈里各取最优;后来计算机下棋所用的那套搜索方法,追根溯源,都是从那棵博弈树长出来的。一九五六年,洛斯阿拉莫斯的一台机器第一次用它下赢了业余棋手。他连这个都已经想过了。</p><p>战后,一位在洛斯阿拉莫斯工作的物理学家碰到一道棘手的题,跑去请教这位顾问。诺依曼说:简单,用特征线法就能解。物理学家老老实实说,我不懂特征线法。诺依曼看着他:「年轻人,在数学里,你不需要理解什么,你只需要习惯它们。」这句话后来被记了下来,成了许多数学系学生自我安慰的箴言。<h2 id=病床上的最后一年>病床上的最后一年</h2></p><p>一九五五年,诺依曼被查出癌症——多半是骨癌,具体是什么,各种说法都有,但大家普遍认为,跟他这些年没少亲临核试验现场、接触辐射脱不了关系。</p><p>诊断没有让他停下来。他坐着轮椅照常去五角大楼开会,担任的原子能委员会委员一直当到生命的最后,躺在病床上还在口述那部没写完的手稿。</p><p>病床边的一些细节,是身边人后来才慢慢讲出来的。一向对宗教毫不在意的他,主动请来一位天主教神父,安排了临终仪式——不过那位神父私下说,自己也说不准这场仪式究竟有没有真的抚慰到这位科学家。</p><p>这件事让很多老朋友意外——他这辈子对宗教既不信,也不讨论,更不反对,只是像对待一套不感兴趣的数学公理一样,敬而远之。</p><p>诺依曼对仪式的配合,更像是完成一项程序:到了这个阶段,该走的步骤走一遍。他问过诺依曼是否想谈谈上帝。诺依曼的回答很短,大意是:如果有一种更高级的存在,它大概不会用我们这种语言说话。</p><p>这话既是拒绝,也没有完全关上。像他晚年的很多判断一样——保留可能性,不给出承诺。</p><p>乌拉姆后来回忆,诺依曼在病中有一阵子确实表现出对死亡的恐惧,那种恐惧比周围人预想的更具体,也更不「体面」。他会长时间地计算自己还剩多少时间,问医生每种治疗方案的概率,像在评估一个项目的失败风险。死亡对他而言不是哲学问题,是一道突然摆在面前的、信息不完备的决策题。</p><p>而宗教能提供的,恰恰是他一生都在绕开的那种东西:不确定、不可验证、不要求算清楚。他的理性是他最锋利的工具,也是他的边界。临终前他愿意走一遍仪式,却无法交出那个「信任的跳跃」。</p><p>这大概是一个一生都在把世界翻译成数学的人,最后发现,有些东西翻译不过去。这个人太理性了,一生理性的他,宗教抚慰很难走进他的内心。</p><p>因为他脑子里装着太多国防机密,弥留之际,军方甚至派了警卫守在病房门口,生怕他意识模糊时无意间说漏了嘴。</p><p>乌拉姆在他去世后写的纪念文章里,回忆了一次谈话:诺依曼谈到技术的加速进步,说人类的处境正在逼近某种「本质上的奇点」——越过那个点之后,按我们熟悉的方式运转的人类事务,恐怕难以继续下去。这话经由乌拉姆的笔传下来,成了「技术奇点」这个概念最早的出处之一。</p><p>一九五七年二月八日,诺依曼在华盛顿的沃尔特·里德陆军医院去世,享年五十三岁,葬在新泽西州普林斯顿。他女儿玛丽娜后来在回忆录里写道,父亲弥留之际说过一句话:「没有人真正理解另一个人。」——这是那种让人没法反驳、也让人没法安心的句子。</p><p>去世六年后,同样来自匈牙利的诺贝尔物理学奖得主尤金·维格纳在一次演讲后被人问:匈牙利怎么在同一个年代冒出这么多天才?维格纳想都没想地回答——只有冯·诺依曼一个人是天才,别人不过是脑子比较好使的普通人罢了。据说在场没人反驳这句话,尽管诺依曼这辈子从没拿过什么重量级的科学奖章。</p>

2026/9/1
阅读更多

高维非凸优化的「鞍点主导」

<blockquote>RSS readers may not support rendering advanced formatting like math formulas. Click to view the original page: <a href="https://dreams.plus/blog/2026/2026-08-22-are-local-minima-rare-in-high-dimensions" target="_blank">https://dreams.plus/blog/2026/2026-08-22-are-local-minima-rare-in-high-dimensions</a></blockquote><p>深度学习中,Roon 说过一句话,被很多人当作信条:最大的 whitepill 是:局部极小值在高维空间中很罕见。也就是说,你的模型很难卡在局部最优里。但它到底有没有道理?如果有道理,道理又在哪里?<p>这句观点并非对每个光滑函数都字面成立。比如凸函数可能只有一个全局极小值,压根没有鞍点。它的精确版本需要一个「景观的概率模型」,以及退化与非退化临界点之间的区分。这篇文章会把这句直觉,分三步严格化:<ol><li>对 Morse 函数而言,临界点是孤立的,因此在所处区域中占据零体积。<li>在非退化临界点的条件下,局部极小值要求 Hessian <strong>正定</strong>,即所有 N 个独立曲率方向都为正。<li>在 Hessian 表现得像大型中心化随机对称矩阵的随机景观模型中,正定是指数级罕见的事件,鞍点则压倒性地常见。</ol><p>Kac–Rice 公式为这一现象在高斯随机场中提供了严格的计数框架,Morse 理论则解释了为什么「指数」是临界点的自然拓扑不变量。下面我们一步步把这条链路走完。<h2 id=高维的地形景观>高维的地形景观</h2><p>我们习惯把优化问题想象成一幅二维或三维的地形图:有山峰(极大值)、山谷(极小值)、还有山口(鞍点,像马鞍一样一边上一边下)。这种直觉在低维时很管用。<p>但当维度 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>N</mi></mrow><annotation encoding=application/x-tex>N</annotation></semantics></math></span> 变得很大——几千、几百万,甚至更多——这幅图景就开始「失真」。想象你站在高维空间的一个点上:此时脚下不再只有「前后左右」两个方向,而是有 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>N</mi></mrow><annotation encoding=application/x-tex>N</annotation></semantics></math></span> 个相互独立的方向可以移动。要说这个点是一个真正的谷底(局部极小值),你必须保证:<strong>无论往哪个方向迈一小步,海拔都会升高。</strong><p>这个直觉在数学上如何精确化?我们从最基础的定义开始。<h2 id=临界点梯度与-hessian>临界点、梯度与 Hessian</h2><p>设 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo>:</mo><msup><mi mathvariant=double-struck>R</mi><mi>N</mi></msup><mo>→</mo><mi mathvariant=double-struck>R</mi></mrow><annotation encoding=application/x-tex>f: \mathbb{R}^N \to \mathbb{R}</annotation></semantics></math></span> 是二阶连续可微函数,记作 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo>∈</mo><msup><mi>C</mi><mn>2</mn></msup><mo stretchy=false>(</mo><msup><mi mathvariant=double-struck>R</mi><mi>N</mi></msup><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>f \in C^2(\mathbb{R}^N)</annotation></semantics></math></span>。<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msup><mi>C</mi><mn>2</mn></msup></mrow><annotation encoding=application/x-tex>C^2</annotation></semantics></math></span> 假设保证了 Hessian 良定义且对称。<blockquote><p><strong>定义 2.1(梯度)</strong>。函数 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi></mrow><annotation encoding=application/x-tex>f</annotation></semantics></math></span> 在 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>x</mi><mo>=</mo><mo stretchy=false>(</mo><msub><mi>x</mi><mn>1</mn></msub><mo separator=true>,</mo><mo>…</mo><mo separator=true>,</mo><msub><mi>x</mi><mi>N</mi></msub><mo stretchy=false>)</mo><mo>∈</mo><msup><mi mathvariant=double-struck>R</mi><mi>N</mi></msup></mrow><annotation encoding=application/x-tex>x=(x_1,\dots,x_N)\in\mathbb{R}^N</annotation></semantics></math></span> 处的梯度是向量</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>∇</mi><mi>f</mi><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mo>:</mo><mo>=</mo><mrow><mo fence=true>(</mo><mtable columnalign=center columnspacing=1em rowspacing=0.16em><mtr><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mstyle displaystyle=true scriptlevel=0><mfrac><mrow><mi mathvariant=normal>∂</mi><mi>f</mi></mrow><mrow><mi mathvariant=normal>∂</mi><msub><mi>x</mi><mn>1</mn></msub></mrow></mfrac></mstyle><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mi mathvariant=normal>⋮</mi><mpadded height=0em voffset=0em><mspace height=1.5em mathbackground=black width=0em></mspace></mpadded></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mstyle displaystyle=true scriptlevel=0><mfrac><mrow><mi mathvariant=normal>∂</mi><mi>f</mi></mrow><mrow><mi mathvariant=normal>∂</mi><msub><mi>x</mi><mi>N</mi></msub></mrow></mfrac></mstyle><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo></mrow></mstyle></mtd></mtr></mtable><mo fence=true>)</mo></mrow><mo>∈</mo><msup><mi mathvariant=double-struck>R</mi><mi>N</mi></msup><mi mathvariant=normal>.</mi></mrow><annotation encoding=application/x-tex>\nabla f(x) := \left(\begin{array}{c}\dfrac{\partial f}{\partial x_1}(x)\\ \vdots \\ \dfrac{\partial f}{\partial x_N}(x)\end{array}\right)\in\mathbb{R}^N.</annotation></semantics></math></span></blockquote><blockquote><p><strong>定义 2.2(临界点)</strong>。若 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>x</mi><mi>c</mi></msub><mo>∈</mo><msup><mi mathvariant=double-struck>R</mi><mi>N</mi></msup></mrow><annotation encoding=application/x-tex>x_c \in \mathbb{R}^N</annotation></semantics></math></span> 满足</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>∇</mi><mi>f</mi><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo stretchy=false>)</mo><mo>=</mo><mn>0</mn><mo separator=true>,</mo></mrow><annotation encoding=application/x-tex>\nabla f(x_c) = 0,</annotation></semantics></math></span><p>则称该点为 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi></mrow><annotation encoding=application/x-tex>f</annotation></semantics></math></span> 的临界点。对开区域上的光滑函数,内部的局部极小值与局部极大值都必然是临界点。</blockquote><blockquote><p><strong>定义 2.3(Hessian)</strong>。<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi></mrow><annotation encoding=application/x-tex>f</annotation></semantics></math></span> 在 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>x</mi><mo>∈</mo><msup><mi mathvariant=double-struck>R</mi><mi>N</mi></msup></mrow><annotation encoding=application/x-tex>x\in\mathbb{R}^N</annotation></semantics></math></span> 处的 Hessian 是 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>N</mi><mo>×</mo><mi>N</mi></mrow><annotation encoding=application/x-tex>N\times N</annotation></semantics></math></span> 矩阵</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mo>=</mo><msup><mi mathvariant=normal>∇</mi><mn>2</mn></msup><mi>f</mi><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mo>:</mo><mo>=</mo><msubsup><mrow><mo fence=true>[</mo><mfrac><mrow><msup><mi mathvariant=normal>∂</mi><mn>2</mn></msup><mi>f</mi></mrow><mrow><mi mathvariant=normal>∂</mi><msub><mi>x</mi><mi>i</mi></msub><mi mathvariant=normal>∂</mi><msub><mi>x</mi><mi>j</mi></msub></mrow></mfrac><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mo fence=true>]</mo></mrow><mrow><mi>i</mi><mo separator=true>,</mo><mi>j</mi><mo>=</mo><mn>1</mn></mrow><mi>N</mi></msubsup><mi mathvariant=normal>.</mi></mrow><annotation encoding=application/x-tex>H_f(x) = \nabla^2 f(x) := \left[\frac{\partial^2 f}{\partial x_i \partial x_j}(x)\right]_{i,j=1}^N.</annotation></semantics></math></span><p>由于 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo>∈</mo><msup><mi>C</mi><mn>2</mn></msup></mrow><annotation encoding=application/x-tex>f\in C^2</annotation></semantics></math></span>,由 Clairaut 定理可得</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mfrac><mrow><msup><mi mathvariant=normal>∂</mi><mn>2</mn></msup><mi>f</mi></mrow><mrow><mi mathvariant=normal>∂</mi><msub><mi>x</mi><mi>i</mi></msub><mi mathvariant=normal>∂</mi><msub><mi>x</mi><mi>j</mi></msub></mrow></mfrac><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mo>=</mo><mfrac><mrow><msup><mi mathvariant=normal>∂</mi><mn>2</mn></msup><mi>f</mi></mrow><mrow><mi mathvariant=normal>∂</mi><msub><mi>x</mi><mi>j</mi></msub><mi mathvariant=normal>∂</mi><msub><mi>x</mi><mi>i</mi></msub></mrow></mfrac><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mo separator=true>,</mo></mrow><annotation encoding=application/x-tex>\frac{\partial^2 f}{\partial x_i \partial x_j}(x) = \frac{\partial^2 f}{\partial x_j \partial x_i}(x),</annotation></semantics></math></span><p>因此 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>H_f(x)</annotation></semantics></math></span> 是实对称矩阵。</blockquote><p>Hessian 之所以重要,因为它是泰勒展开中的二次项。设 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>h</mi><mo>=</mo><mi>x</mi><mo>−</mo><msub><mi>x</mi><mn>0</mn></msub></mrow><annotation encoding=application/x-tex>h = x - x_0</annotation></semantics></math></span>,则</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mtable width=100%><mtr><mtd width=50%></mtd><mtd><mrow><mi>f</mi><mo stretchy=false>(</mo><msub><mi>x</mi><mn>0</mn></msub><mo>+</mo><mi>h</mi><mo stretchy=false>)</mo><mo>=</mo><mi>f</mi><mo stretchy=false>(</mo><msub><mi>x</mi><mn>0</mn></msub><mo stretchy=false>)</mo><mo>+</mo><mi mathvariant=normal>∇</mi><mi>f</mi><mo stretchy=false>(</mo><msub><mi>x</mi><mn>0</mn></msub><msup><mo stretchy=false>)</mo><mi>T</mi></msup><mi>h</mi><mo>+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msup><mi>h</mi><mi>T</mi></msup><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><msub><mi>x</mi><mn>0</mn></msub><mo stretchy=false>)</mo><mi>h</mi><mo>+</mo><mi>o</mi><mo stretchy=false>(</mo><mi mathvariant=normal>∥</mi><mi>h</mi><msup><mi mathvariant=normal>∥</mi><mn>2</mn></msup><mo stretchy=false>)</mo><mi mathvariant=normal>.</mi></mrow></mtd><mtd width=50%></mtd><mtd><mtext>(1)</mtext></mtd></mtr></mtable><annotation encoding=application/x-tex>f(x_0+h) = f(x_0) + \nabla f(x_0)^T h + \frac{1}{2}h^T H_f(x_0) h + o(\|h\|^2). \tag{1}</annotation></semantics></math></span><p>在临界点 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>x</mi><mi>c</mi></msub></mrow><annotation encoding=application/x-tex>x_c</annotation></semantics></math></span> 处,线性项消失,因此局部几何由下式决定到二阶:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo>+</mo><mi>h</mi><mo stretchy=false>)</mo><mo>−</mo><mi>f</mi><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo stretchy=false>)</mo><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msup><mi>h</mi><mi>T</mi></msup><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo stretchy=false>)</mo><mi>h</mi><mo>+</mo><mi>o</mi><mo stretchy=false>(</mo><mi mathvariant=normal>∥</mi><mi>h</mi><msup><mi mathvariant=normal>∥</mi><mn>2</mn></msup><mo stretchy=false>)</mo><mi mathvariant=normal>.</mi></mrow><annotation encoding=application/x-tex>f(x_c+h) - f(x_c) = \frac{1}{2}h^T H_f(x_c)h + o(\|h\|^2).</annotation></semantics></math></span><p>由于 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>H_f(x_c)</annotation></semantics></math></span> 是实对称矩阵,谱定理给出由特征向量 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>v</mi><mn>1</mn></msub><mo separator=true>,</mo><mo>…</mo><mo separator=true>,</mo><msub><mi>v</mi><mi>N</mi></msub></mrow><annotation encoding=application/x-tex>v_1,\dots,v_N</annotation></semantics></math></span> 组成的标准正交基,对应的实特征值为 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>λ</mi><mn>1</mn></msub><mo separator=true>,</mo><mo>…</mo><mo separator=true>,</mo><msub><mi>λ</mi><mi>N</mi></msub></mrow><annotation encoding=application/x-tex>\lambda_1,\dots,\lambda_N</annotation></semantics></math></span>。若</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>h</mi><mo>=</mo><munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>N</mi></munderover><msub><mi>a</mi><mi>i</mi></msub><msub><mi>v</mi><mi>i</mi></msub><mo separator=true>,</mo></mrow><annotation encoding=application/x-tex>h = \sum_{i=1}^N a_i v_i,</annotation></semantics></math></span><p>则</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mtable width=100%><mtr><mtd width=50%></mtd><mtd><mrow><msup><mi>h</mi><mi>T</mi></msup><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo stretchy=false>)</mo><mi>h</mi><mo>=</mo><munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>N</mi></munderover><msub><mi>λ</mi><mi>i</mi></msub><msubsup><mi>a</mi><mi>i</mi><mn>2</mn></msubsup><mi mathvariant=normal>.</mi></mrow></mtd><mtd width=50%></mtd><mtd><mtext>(2)</mtext></mtd></mtr></mtable><annotation encoding=application/x-tex>h^T H_f(x_c) h = \sum_{i=1}^N \lambda_i a_i^2. \tag{2}</annotation></semantics></math></span><p>因此,<strong>Hessian 的特征值就是 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi></mrow><annotation encoding=application/x-tex>f</annotation></semantics></math></span> 在临界点处的主二阶曲率</strong>——每个特征值的符号,直接告诉我们函数沿对应方向「向上弯」还是「向下弯」。<blockquote><p><strong>定义 2.4(非退化极小值、极大值与鞍点)</strong>。设 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>x</mi><mi>c</mi></msub></mrow><annotation encoding=application/x-tex>x_c</annotation></semantics></math></span> 是非退化临界点,即 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>H_f(x_c)</annotation></semantics></math></span> 没有零特征值。<ul><li>若 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>H_f(x_c)</annotation></semantics></math></span> 的所有特征值都为正,则 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>x</mi><mi>c</mi></msub></mrow><annotation encoding=application/x-tex>x_c</annotation></semantics></math></span> 是非退化局部极小值。<li>若 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>H_f(x_c)</annotation></semantics></math></span> 的所有特征值都为负,则 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>x</mi><mi>c</mi></msub></mrow><annotation encoding=application/x-tex>x_c</annotation></semantics></math></span> 是非退化局部极大值。<li>若 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>H_f(x_c)</annotation></semantics></math></span> 至少有一个正特征值和至少一个负特征值,则 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>x</mi><mi>c</mi></msub></mrow><annotation encoding=application/x-tex>x_c</annotation></semantics></math></span> 是鞍点。</ul><p><strong>定义 2.5(Morse 指数)</strong>。非退化临界点 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>x</mi><mi>c</mi></msub></mrow><annotation encoding=application/x-tex>x_c</annotation></semantics></math></span> 的 Morse 指数是 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>H_f(x_c)</annotation></semantics></math></span> 的负特征值个数</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>index</mi><mo>⁡</mo><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo stretchy=false>)</mo><mo>:</mo><mo>=</mo><mi mathvariant=normal>#</mi><mo stretchy=false>{</mo><mi>i</mi><mo>:</mo><msub><mi>λ</mi><mi>i</mi></msub><mo>&lt;</mo><mn>0</mn><mo stretchy=false>}</mo><mi mathvariant=normal>.</mi></mrow><annotation encoding=application/x-tex>\operatorname{index}(x_c) := \#\{i : \lambda_i &lt; 0\}.</annotation></semantics></math></span><p>非退化局部极小值的指数为 0,非退化局部极大值的指数为 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>N</mi></mrow><annotation encoding=application/x-tex>N</annotation></semantics></math></span>,鞍点的指数在 1 到 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>N</mi><mo>−</mo><mn>1</mn></mrow><annotation encoding=application/x-tex>N-1</annotation></semantics></math></span> 之间。</blockquote><p>高维的困难此刻清晰可见。在 1 维中,非退化极小值只要求一个正的二阶导数。在 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>N</mi></mrow><annotation encoding=application/x-tex>N</annotation></semantics></math></span> 维中,非退化局部极小值要求 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>N</mi></mrow><annotation encoding=application/x-tex>N</annotation></semantics></math></span> 个同时成立的正曲率条件:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>λ</mi><mn>1</mn></msub><mo>></mo><mn>0</mn><mo separator=true>,</mo><mtext></mtext><msub><mi>λ</mi><mn>2</mn></msub><mo>></mo><mn>0</mn><mo separator=true>,</mo><mtext></mtext><mo>…</mo><mo separator=true>,</mo><mtext></mtext><msub><mi>λ</mi><mi>N</mi></msub><mo>></mo><mn>0.</mn></mrow><annotation encoding=application/x-tex>\lambda_1 > 0,\ \lambda_2 > 0,\ \dots,\ \lambda_N > 0.</annotation></semantics></math></span><p>相比之下,鞍点只要求至少一个正特征值和至少一个负特征值。当 Hessian 是随机的、且对正曲率没有强偏好时,后者显然容易满足得多。<h2 id=临界点本身就稀少>临界点本身就稀少</h2><p>在讨论「临界点是不是极小值」之前,先确认一个更基础、但常被忽视的事实:临界点本身在空间中就是「测度为零」的稀疏集合。这个结论不难证明,但它还不是本文要讲的高维现象——它对一维函数同样成立。<blockquote><p><strong>定义 3.1(Morse 函数)</strong>。若 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msup><mi>C</mi><mn>2</mn></msup></mrow><annotation encoding=application/x-tex>C^2</annotation></semantics></math></span> 函数 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo>:</mo><msup><mi mathvariant=double-struck>R</mi><mi>N</mi></msup><mo>→</mo><mi mathvariant=double-struck>R</mi></mrow><annotation encoding=application/x-tex>f:\mathbb{R}^N\to\mathbb{R}</annotation></semantics></math></span> 的每个临界点都是非退化的,即对每个临界点 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>x</mi><mi>c</mi></msub></mrow><annotation encoding=application/x-tex>x_c</annotation></semantics></math></span> 有</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>det</mi><mo>⁡</mo><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo stretchy=false>)</mo><mo mathvariant=normal>≠</mo><mn>0</mn><mo separator=true>,</mo></mrow><annotation encoding=application/x-tex>\det H_f(x_c) \neq 0,</annotation></semantics></math></span><p>则称 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi></mrow><annotation encoding=application/x-tex>f</annotation></semantics></math></span> 为 Morse 函数。<p><strong>命题 3.2</strong>。若 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi></mrow><annotation encoding=application/x-tex>f</annotation></semantics></math></span> 是 Morse 函数,则其临界点是孤立的。特别地,在 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msup><mi mathvariant=double-struck>R</mi><mi>N</mi></msup></mrow><annotation encoding=application/x-tex>\mathbb{R}^N</annotation></semantics></math></span> 的每个紧子集中,只有有限多个临界点,因此临界点集具有 Lebesgue 测度零。</blockquote><p><em>证明</em>:临界点是梯度映射 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>∇</mi><mi>f</mi><mo>:</mo><msup><mi mathvariant=double-struck>R</mi><mi>N</mi></msup><mo>→</mo><msup><mi mathvariant=double-struck>R</mi><mi>N</mi></msup></mrow><annotation encoding=application/x-tex>\nabla f: \mathbb{R}^N \to \mathbb{R}^N</annotation></semantics></math></span> 的零点。该映射在 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>x</mi><mi>c</mi></msub></mrow><annotation encoding=application/x-tex>x_c</annotation></semantics></math></span> 处的导数就是 Hessian <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>H_f(x_c)</annotation></semantics></math></span>。若 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>x</mi><mi>c</mi></msub></mrow><annotation encoding=application/x-tex>x_c</annotation></semantics></math></span> 非退化,则 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>H_f(x_c)</annotation></semantics></math></span> 可逆。由反函数定理,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>∇</mi><mi>f</mi></mrow><annotation encoding=application/x-tex>\nabla f</annotation></semantics></math></span> 在 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>x</mi><mi>c</mi></msub></mrow><annotation encoding=application/x-tex>x_c</annotation></semantics></math></span> 附近局部可逆,因此 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>x</mi><mi>c</mi></msub></mrow><annotation encoding=application/x-tex>x_c</annotation></semantics></math></span> 是 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>∇</mi><mi>f</mi></mrow><annotation encoding=application/x-tex>\nabla f</annotation></semantics></math></span> 在某个邻域内的唯一零点。于是每个临界点都是孤立的。由于临界点集是闭集,紧区域内若有无限多个临界点,就会有一个同样为临界的聚点,这与孤立性矛盾。因此任何紧区域中只有有限多个临界点。有限集具有 Lebesgue 测度零。<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>■</mi></mrow><annotation encoding=application/x-tex>\blacksquare</annotation></semantics></math></span><p>这说明:如果从 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msup><mi mathvariant=double-struck>R</mi><mi>N</mi></msup></mrow><annotation encoding=application/x-tex>\mathbb{R}^N</annotation></semantics></math></span> 中的一个盒子里均匀采样一点,恰好落在临界点上的概率为零。但真正有趣的问题是<strong>条件性的</strong>:<blockquote><p>既然我们已经身处某个高维随机函数的临界点,那么这个临界点是非退化局部极小值的概率是多少?</blockquote><p>这个问题的答案,由 Hessian 特征值的符号来回答。<h2 id=马鞍面>马鞍面</h2><p>在进入随机矩阵论证之前,先看一个最简单的鞍点例子,建立手感。<p>函数 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo stretchy=false>(</mo><mi>x</mi><mo separator=true>,</mo><mi>y</mi><mo stretchy=false>)</mo><mo>=</mo><mi>x</mi><mi>y</mi></mrow><annotation encoding=application/x-tex>f(x,y) = xy</annotation></semantics></math></span> 在 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo stretchy=false>(</mo><mn>0</mn><mo separator=true>,</mo><mn>0</mn><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>(0,0)</annotation></semantics></math></span> 处有一个临界点,因为</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>∇</mi><mi>f</mi><mo stretchy=false>(</mo><mi>x</mi><mo separator=true>,</mo><mi>y</mi><mo stretchy=false>)</mo><mo>=</mo><mrow><mo fence=true>(</mo><mfrac linethickness=0px><mi>y</mi><mi>x</mi></mfrac><mo fence=true>)</mo></mrow><mo separator=true>,</mo></mrow><annotation encoding=application/x-tex>\nabla f(x,y) = \binom{y}{x},</annotation></semantics></math></span><p>所以 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>∇</mi><mi>f</mi><mo stretchy=false>(</mo><mn>0</mn><mo separator=true>,</mo><mn>0</mn><mo stretchy=false>)</mo><mo>=</mo><mn>0</mn></mrow><annotation encoding=application/x-tex>\nabla f(0,0) = 0</annotation></semantics></math></span>。它的 Hessian 是</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><mn>0</mn><mo separator=true>,</mo><mn>0</mn><mo stretchy=false>)</mo><mo>=</mo><mrow><mo fence=true>(</mo><mtable columnalign="center center" columnspacing=1em rowspacing=0.16em><mtr><mtd><mstyle displaystyle=false scriptlevel=0><mn>0</mn></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mn>1</mn></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=false scriptlevel=0><mn>1</mn></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mn>0</mn></mstyle></mtd></mtr></mtable><mo fence=true>)</mo></mrow><mi mathvariant=normal>.</mi></mrow><annotation encoding=application/x-tex>H_f(0,0) = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}.</annotation></semantics></math></span><p>特征值为 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mn>1</mn></mrow><annotation encoding=application/x-tex>1</annotation></semantics></math></span> 和 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo>−</mo><mn>1</mn></mrow><annotation encoding=application/x-tex>-1</annotation></semantics></math></span>,因此原点是一个鞍点。<p>这个例子也说明了为什么混合偏导数项会遮蔽几何。在 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo stretchy=false>(</mo><mi>x</mi><mo separator=true>,</mo><mi>y</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>(x,y)</annotation></semantics></math></span> 坐标中,二阶导数 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>f</mi><mrow><mi>x</mi><mi>x</mi></mrow></msub></mrow><annotation encoding=application/x-tex>f_{xx}</annotation></semantics></math></span> 与 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>f</mi><mrow><mi>y</mi><mi>y</mi></mrow></msub></mrow><annotation encoding=application/x-tex>f_{yy}</annotation></semantics></math></span> 都为零,而混合导数 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>f</mi><mrow><mi>x</mi><mi>y</mi></mrow></msub></mrow><annotation encoding=application/x-tex>f_{xy}</annotation></semantics></math></span> 非零——主曲率方向并不是坐标轴。定义旋转后的坐标</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>u</mi><mo>=</mo><mfrac><mrow><mi>x</mi><mo>+</mo><mi>y</mi></mrow><msqrt><mn>2</mn></msqrt></mfrac><mo separator=true>,</mo><mspace width=2em></mspace><mi>v</mi><mo>=</mo><mfrac><mrow><mi>x</mi><mo>−</mo><mi>y</mi></mrow><msqrt><mn>2</mn></msqrt></mfrac><mo separator=true>,</mo></mrow><annotation encoding=application/x-tex>u = \frac{x+y}{\sqrt2}, \qquad v = \frac{x-y}{\sqrt2},</annotation></semantics></math></span><p>等价地</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>x</mi><mo>=</mo><mfrac><mrow><mi>u</mi><mo>+</mo><mi>v</mi></mrow><msqrt><mn>2</mn></msqrt></mfrac><mo separator=true>,</mo><mspace width=2em></mspace><mi>y</mi><mo>=</mo><mfrac><mrow><mi>u</mi><mo>−</mo><mi>v</mi></mrow><msqrt><mn>2</mn></msqrt></mfrac><mi mathvariant=normal>.</mi></mrow><annotation encoding=application/x-tex>x = \frac{u+v}{\sqrt2}, \qquad y = \frac{u-v}{\sqrt2}.</annotation></semantics></math></span><p>则</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>x</mi><mi>y</mi><mo>=</mo><mfrac><mrow><mi>u</mi><mo>+</mo><mi>v</mi></mrow><msqrt><mn>2</mn></msqrt></mfrac><mo>⋅</mo><mfrac><mrow><mi>u</mi><mo>−</mo><mi>v</mi></mrow><msqrt><mn>2</mn></msqrt></mfrac><mo>=</mo><mfrac><mrow><msup><mi>u</mi><mn>2</mn></msup><mo>−</mo><msup><mi>v</mi><mn>2</mn></msup></mrow><mn>2</mn></mfrac><mi mathvariant=normal>.</mi></mrow><annotation encoding=application/x-tex>xy = \frac{u+v}{\sqrt2}\cdot\frac{u-v}{\sqrt2} = \frac{u^2-v^2}{2}.</annotation></semantics></math></span><p>在旋转后的坐标中,Hessian 是对角的:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>H</mi><mo>=</mo><mrow><mo fence=true>(</mo><mtable columnalign="center center" columnspacing=1em rowspacing=0.16em><mtr><mtd><mstyle displaystyle=false scriptlevel=0><mn>1</mn></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mn>0</mn></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=false scriptlevel=0><mn>0</mn></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mo>−</mo><mn>1</mn></mrow></mstyle></mtd></mtr></mtable><mo fence=true>)</mo></mrow><mi mathvariant=normal>.</mi></mrow><annotation encoding=application/x-tex>H = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}.</annotation></semantics></math></span><p>此刻鞍点结构一目了然:函数在 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>u</mi></mrow><annotation encoding=application/x-tex>u</annotation></semantics></math></span> 方向向上弯曲,在 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>v</mi></mrow><annotation encoding=application/x-tex>v</annotation></semantics></math></span> 方向向下弯曲。<p>不变的事实并不是 Hessian 在某个选定坐标系中的具体矩阵元素,而是它的<strong>符号分布</strong>:一个正特征值、一个负特征值。这是<strong>西尔维斯特惯性定律(Sylvester's law of inertia)</strong> 的一个特例——该定律说,实二次型的正、负、零方向的数目,在可逆线性坐标变换下保持不变。<h2 id=随机矩阵的视角>随机矩阵的视角</h2><p>现在回到主线问题:假设我们随机站在高维景观的某个临界点上,它是局部极小值的概率有多大?<p>第一个启发式是把典型临界点处的 Hessian 建模为一个随机实对称矩阵。这个模型对每个随机函数并非字面上都正确——Hessian 可能与函数值、梯度或问题中其它结构相关——但它抓住了核心机制:如果 Hessian 没有强的正偏向,它的特征值谱就应当同时含有正负号。<h3 id=简化启发>简化启发</h3><p>仅仅出于直觉,假设每个 Hessian 特征值取正的概率为 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mn>1</mn><mi mathvariant=normal>/</mi><mn>2</mn></mrow><annotation encoding=application/x-tex>1/2</annotation></semantics></math></span>,且这些符号相互独立。那么</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=double-struck>P</mi><mo stretchy=false>(</mo><mtext>非退化局部极小值</mtext><mo stretchy=false>)</mo><mo>=</mo><mi mathvariant=double-struck>P</mi><mo stretchy=false>(</mo><msub><mi>λ</mi><mn>1</mn></msub><mo>></mo><mn>0</mn><mo separator=true>,</mo><mo>…</mo><mo separator=true>,</mo><msub><mi>λ</mi><mi>N</mi></msub><mo>></mo><mn>0</mn><mo stretchy=false>)</mo><mo>=</mo><msup><mn>2</mn><mrow><mo>−</mo><mi>N</mi></mrow></msup><mi mathvariant=normal>.</mi></mrow><annotation encoding=application/x-tex>\mathbb{P}(\text{非退化局部极小值}) = \mathbb{P}(\lambda_1>0,\dots,\lambda_N>0) = 2^{-N}.</annotation></semantics></math></span><p>这已经在 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>N</mi></mrow><annotation encoding=application/x-tex>N</annotation></semantics></math></span> 上指数衰减。独立性假设对对称随机矩阵的特征值并不成立——特征值彼此强烈排斥——但「正定很罕见」这一结论仍然正确,而且真正的随机矩阵估计还要更尖锐。<h3 id=goe-hessian-与半圆律>GOE Hessian 与半圆律</h3><p><strong>高斯正交系综(GOE)</strong> 是中心化随机实对称矩阵的标准模型。非正式地说,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>N</mi><mo>×</mo><mi>N</mi></mrow><annotation encoding=application/x-tex>N\times N</annotation></semantics></math></span> 的 GOE 矩阵是其独立元素为高斯的对称矩阵,归一化方式使得特征值在 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>N</mi><mo>→</mo><mi mathvariant=normal>∞</mi></mrow><annotation encoding=application/x-tex>N\to\infty</annotation></semantics></math></span> 时保持在 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>O</mi><mo stretchy=false>(</mo><mn>1</mn><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>O(1)</annotation></semantics></math></span> 量级。<p><strong>维格纳半圆律(Wigner's semicircle law)</strong> 表明,中心化 GOE 矩阵的经验特征值分布在 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>N</mi><mo>→</mo><mi mathvariant=normal>∞</mi></mrow><annotation encoding=application/x-tex>N\to\infty</annotation></semantics></math></span> 时收敛到关于零点对称的确定性半圆分布。因此,典型的大 GOE 矩阵有大量正特征值和大量负特征值,它的指数通常接近 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>N</mi><mi mathvariant=normal>/</mi><mn>2</mn></mrow><annotation encoding=application/x-tex>N/2</annotation></semantics></math></span>,而不是接近 0 或 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>N</mi></mrow><annotation encoding=application/x-tex>N</annotation></semantics></math></span>。<p>然而,一个临界点要成为非退化局部极小值,Hessian 必须正定。在 GOE 模型中,这就是事件</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>λ</mi><mi>min</mi><mo>⁡</mo></msub><mo stretchy=false>(</mo><mi>H</mi><mo stretchy=false>)</mo><mo>></mo><mn>0.</mn></mrow><annotation encoding=application/x-tex>\lambda_{\min}(H) > 0.</annotation></semantics></math></span><p>这个事件迫使整个特征值谱——其自然的极限形状以零为中心——平移到正的一侧。这是一个大偏差事件。<blockquote><p><strong>定理 4.1(GOE 正定呈指数级罕见)</strong>。设 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>H</mi><mi>N</mi></msub></mrow><annotation encoding=application/x-tex>H_N</annotation></semantics></math></span> 是 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>N</mi><mo>×</mo><mi>N</mi></mrow><annotation encoding=application/x-tex>N\times N</annotation></semantics></math></span> 中心化 GOE 矩阵,采用通常的随机矩阵标度。则存在常数 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>c</mi><mo>></mo><mn>0</mn></mrow><annotation encoding=application/x-tex>c>0</annotation></semantics></math></span>,使得在 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>N</mi><mo>→</mo><mi mathvariant=normal>∞</mi></mrow><annotation encoding=application/x-tex>N\to\infty</annotation></semantics></math></span> 时</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=double-struck>P</mi><mo stretchy=false>(</mo><msub><mi>H</mi><mi>N</mi></msub><mtext>正定</mtext><mo stretchy=false>)</mo><mo>=</mo><mi mathvariant=double-struck>P</mi><mo stretchy=false>(</mo><msub><mi>λ</mi><mi>min</mi><mo>⁡</mo></msub><mo stretchy=false>(</mo><msub><mi>H</mi><mi>N</mi></msub><mo stretchy=false>)</mo><mo>></mo><mn>0</mn><mo stretchy=false>)</mo><mo>=</mo><mi>exp</mi><mo>⁡</mo><mo stretchy=false>{</mo><mo>−</mo><mi>c</mi><msup><mi>N</mi><mn>2</mn></msup><mo>+</mo><mi>o</mi><mo stretchy=false>(</mo><msup><mi>N</mi><mn>2</mn></msup><mo stretchy=false>)</mo><mo stretchy=false>}</mo><mi mathvariant=normal>.</mi></mrow><annotation encoding=application/x-tex>\mathbb{P}(H_N \text{正定}) = \mathbb{P}(\lambda_{\min}(H_N)>0) = \exp\{-cN^2 + o(N^2)\}.</annotation></semantics></math></span><p>更精确地说,对高斯 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>β</mi></mrow><annotation encoding=application/x-tex>\beta</annotation></semantics></math></span> 系综,指数具有 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>β</mi><mtext></mtext><mi>θ</mi><mo stretchy=false>(</mo><mn>0</mn><mo stretchy=false>)</mo><mtext></mtext><msup><mi>N</mi><mn>2</mn></msup></mrow><annotation encoding=application/x-tex>\beta\,\theta(0)\,N^2</annotation></semantics></math></span> 的形式,其中 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>θ</mi><mo stretchy=false>(</mo><mn>0</mn><mo stretchy=false>)</mo><mo>=</mo><mo stretchy=false>(</mo><mi>log</mi><mo>⁡</mo><mn>3</mn><mo stretchy=false>)</mo><mi mathvariant=normal>/</mi><mn>4</mn></mrow><annotation encoding=application/x-tex>\theta(0) = (\log 3)/4</annotation></semantics></math></span>(Dean & Majumdar 的结果与约定)。</blockquote><p>精确常数不如标度重要。要点在于:正定不仅是「不太可能」,对中心化 GOE 矩阵而言,它在 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msup><mi>N</mi><mn>2</mn></msup></mrow><annotation encoding=application/x-tex>N^2</annotation></semantics></math></span> 上呈<strong>指数级</strong>不可能——比前面粗糙估计里的 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msup><mn>2</mn><mrow><mo>−</mo><mi>N</mi></mrow></msup></mrow><annotation encoding=application/x-tex>2^{-N}</annotation></semantics></math></span> 还要猛烈。于是,在随机 Hessian 模型中,</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=double-struck>P</mi><mo stretchy=false>(</mo><mtext>临界点是鞍点</mtext><mo stretchy=false>)</mo><mo>⟶</mo><mn>1</mn><mo separator=true>,</mo><mspace width=2em></mspace><mi mathvariant=double-struck>P</mi><mo stretchy=false>(</mo><mtext>临界点是非退化局部极小值</mtext><mo stretchy=false>)</mo><mo>⟶</mo><mn>0.</mn></mrow><annotation encoding=application/x-tex>\mathbb{P}(\text{临界点是鞍点}) \longrightarrow 1, \qquad \mathbb{P}(\text{临界点是非退化局部极小值}) \longrightarrow 0.</annotation></semantics></math></span><h3 id=更明确的几何诠释>更明确的几何诠释</h3><p>在临界点 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>x</mi><mi>c</mi></msub></mrow><annotation encoding=application/x-tex>x_c</annotation></semantics></math></span> 处,二阶近似为</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo>+</mo><mi>h</mi><mo stretchy=false>)</mo><mo>−</mo><mi>f</mi><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo stretchy=false>)</mo><mo>≈</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msup><mi>h</mi><mi>T</mi></msup><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo stretchy=false>)</mo><mi>h</mi><mi mathvariant=normal>.</mi></mrow><annotation encoding=application/x-tex>f(x_c+h) - f(x_c) \approx \frac{1}{2}h^T H_f(x_c) h.</annotation></semantics></math></span><p>若 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>H_f(x_c)</annotation></semantics></math></span> 只要有一个负特征值 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>λ</mi></mrow><annotation encoding=application/x-tex>\lambda</annotation></semantics></math></span>,对应特征向量 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>v</mi></mrow><annotation encoding=application/x-tex>v</annotation></semantics></math></span>,那么</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msup><mi>v</mi><mi>T</mi></msup><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo stretchy=false>)</mo><mi>v</mi><mo>&lt;</mo><mn>0</mn><mo separator=true>,</mo></mrow><annotation encoding=application/x-tex>v^T H_f(x_c) v &lt; 0,</annotation></semantics></math></span><p>沿 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>v</mi></mrow><annotation encoding=application/x-tex>v</annotation></semantics></math></span> 移动一小段距离会使 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi></mrow><annotation encoding=application/x-tex>f</annotation></semantics></math></span> 在二阶意义上减小:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo>+</mo><mi>t</mi><mi>v</mi><mo stretchy=false>)</mo><mo>−</mo><mi>f</mi><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo stretchy=false>)</mo><mo>≈</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msup><mi>t</mi><mn>2</mn></msup><mtext></mtext><msup><mi>v</mi><mi>T</mi></msup><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><msub><mi>x</mi><mi>c</mi></msub><mo stretchy=false>)</mo><mi>v</mi><mo>&lt;</mo><mn>0.</mn></mrow><annotation encoding=application/x-tex>f(x_c+tv) - f(x_c) \approx \frac{1}{2}t^2\, v^T H_f(x_c) v &lt; 0.</annotation></semantics></math></span><p>因此,<strong>单个负特征值就摧毁了非退化局部极小值的可能性</strong>。在高维中,随机 Hessian 有很多机会获得这样的负方向。只有当这些方向都不向下弯曲时,非退化局部极小值才能存活。<h2 id=kacrice-公式>Kac–Rice 公式</h2><p>随机矩阵论证解释了为什么随机 Hessian 不太可能正定。要把这一论证与实际随机函数联系起来,需要一种计数临界点并按指数分类的方法。标准工具是 <strong>Kac–Rice 公式</strong>。<p>设 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi></mrow><annotation encoding=application/x-tex>f</annotation></semantics></math></span> 是区域 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi><mo>⊂</mo><msup><mi mathvariant=double-struck>R</mi><mi>N</mi></msup></mrow><annotation encoding=application/x-tex>D\subset\mathbb{R}^N</annotation></semantics></math></span> 上足够正则的随机场。对 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mn>0</mn><mo>≤</mo><mi>k</mi><mo>≤</mo><mi>N</mi></mrow><annotation encoding=application/x-tex>0\le k\le N</annotation></semantics></math></span>,定义</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>C</mi><mi>k</mi></msub><mo stretchy=false>(</mo><mi>D</mi><mo stretchy=false>)</mo><mo>:</mo><mo>=</mo><mi mathvariant=normal>#</mi><mo stretchy=false>{</mo><mi>x</mi><mo>∈</mo><mi>D</mi><mo>:</mo><mi mathvariant=normal>∇</mi><mi>f</mi><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mo>=</mo><mn>0</mn><mo separator=true>,</mo><mtext></mtext><mi mathvariant=normal>index</mi><mo>⁡</mo><mo stretchy=false>(</mo><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mo stretchy=false>)</mo><mo>=</mo><mi>k</mi><mo stretchy=false>}</mo><mo separator=true>,</mo></mrow><annotation encoding=application/x-tex>C_k(D) := \#\{x\in D : \nabla f(x)=0,\ \operatorname{index}(H_f(x))=k\},</annotation></semantics></math></span><p>即 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi></mrow><annotation encoding=application/x-tex>D</annotation></semantics></math></span> 中指数为 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>k</mi></mrow><annotation encoding=application/x-tex>k</annotation></semantics></math></span> 的临界点个数。在正则性与非退化性假设下,Kac–Rice 给出</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mtable width=100%><mtr><mtd width=50%></mtd><mtd><mrow><mi mathvariant=double-struck>E</mi><mtext></mtext><msub><mi>C</mi><mi>k</mi></msub><mo stretchy=false>(</mo><mi>D</mi><mo stretchy=false>)</mo><mo>=</mo><mspace linebreak=newline></mspace><msub><mo>∫</mo><mi>D</mi></msub><mi mathvariant=double-struck>E</mi><mo fence=false maxsize=1.8em minsize=1.8em stretchy=true>[</mo><mi mathvariant=normal>∣</mi><mi>det</mi><mo>⁡</mo><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mi mathvariant=normal>∣</mi><mtext></mtext><mn mathvariant=bold>1</mn><mo stretchy=false>{</mo><mi mathvariant=normal>index</mi><mo>⁡</mo><mo stretchy=false>(</mo><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mo stretchy=false>)</mo><mo>=</mo><mi>k</mi><mo stretchy=false>}</mo><mtext></mtext><mo fence=false maxsize=1.8em minsize=1.8em stretchy=true>∣</mo><mtext></mtext><mi mathvariant=normal>∇</mi><mi>f</mi><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mo>=</mo><mn>0</mn><mo fence=false maxsize=1.8em minsize=1.8em stretchy=true>]</mo><mtext></mtext><msub><mi>p</mi><mrow><mi mathvariant=normal>∇</mi><mi>f</mi><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo></mrow></msub><mo stretchy=false>(</mo><mn>0</mn><mo stretchy=false>)</mo><mtext></mtext><mi>d</mi><mi>x</mi><mi mathvariant=normal>.</mi></mrow></mtd><mtd width=50%></mtd><mtd><mtext>(3)</mtext></mtd></mtr></mtable><annotation encoding=application/x-tex>\mathbb{E}\,C_k(D) = \\ \int_D \mathbb{E}\Big[|\det H_f(x)|\,\mathbf{1}\{\operatorname{index}(H_f(x))=k\}\ \Big|\ \nabla f(x)=0\Big]\, p_{\nabla f(x)}(0)\, dx. \tag{3}</annotation></semantics></math></span><p>这里 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>p</mi><mrow><mi mathvariant=normal>∇</mi><mi>f</mi><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo></mrow></msub><mo stretchy=false>(</mo><mn>0</mn><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>p_{\nabla f(x)}(0)</annotation></semantics></math></span> 是梯度在零处的密度。行列式因子的出现,是因为梯度映射的零点要按局部雅可比体积变化来计数。指示函数则选出所需的指数。<p>方程 (3) 使问题变得精确。计数非退化局部极小值就是取 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding=application/x-tex>k=0</annotation></semantics></math></span>:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>C</mi><mn>0</mn></msub><mo stretchy=false>(</mo><mi>D</mi><mo stretchy=false>)</mo><mo>=</mo><mi mathvariant=normal>#</mi><mo stretchy=false>{</mo><mi>x</mi><mo>∈</mo><mi>D</mi><mo>:</mo><mi mathvariant=normal>∇</mi><mi>f</mi><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mo>=</mo><mn>0</mn><mo separator=true>,</mo><mtext></mtext><msub><mi>H</mi><mi>f</mi></msub><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mo>≻</mo><mn>0</mn><mo stretchy=false>}</mo><mi mathvariant=normal>.</mi></mrow><annotation encoding=application/x-tex>C_0(D) = \#\{x\in D : \nabla f(x)=0,\ H_f(x)\succ 0\}.</annotation></semantics></math></span><p>计数鞍点则是对 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mn>1</mn><mo>≤</mo><mi>k</mi><mo>≤</mo><mi>N</mi><mo>−</mo><mn>1</mn></mrow><annotation encoding=application/x-tex>1\le k\le N-1</annotation></semantics></math></span> 求和。<p>对许多高斯随机场,在 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>∇</mi><mi>f</mi><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mo>=</mo><mn>0</mn></mrow><annotation encoding=application/x-tex>\nabla f(x)=0</annotation></semantics></math></span> 条件下,Hessian 的条件分布是一个正交不变的高斯矩阵,通常是 GOE 型矩阵加上一个依赖于场值的标量平移——这正是随机矩阵理论严格介入之处,Hessian 的指数分布控制着每一类临界点的期望个数。<p>在自旋玻璃模型中,这一方案已被详细执行。Bray 与 Dean 计算了大维空间上高斯场的平均临界点个数,把它作为能量与指数的函数。Aufinger、Ben Arous 与 Černý 利用 Kac–Rice 与 GOE 特征值渐近,对球面 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>p</mi></mrow><annotation encoding=application/x-tex>p</annotation></semantics></math></span>-自旋自旋玻璃哈密顿量的复杂度给出了严格的渐近分析。这些工作展示了一种典型模式:临界点可能是指数级众多的,但主导指数通常不是 0——相反,在景观的大部分区域,占主导的临界点具有正比例的负特征值,即它们是鞍点。<p>因此,严格的概率陈述不是「每个高维函数都只有很少的局部极小值」,而是更接近:<blockquote><p>在广泛的高维随机景观模型中,期望的临界点计数以鞍点为主,而指数为零的临界点只构成一个趋于消失或指数级更小的比例,除非处于特殊的低能区域。</blockquote><h2 id=morse-理论>Morse 理论</h2><p>Morse 理论为指数提供了拓扑诠释。它本身并不证明极小值是罕见的,而是解释为什么指数是应当追踪的正确不变量。<p>设 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo>:</mo><mi>M</mi><mo>→</mo><mi mathvariant=double-struck>R</mi></mrow><annotation encoding=application/x-tex>f: M\to\mathbb{R}</annotation></semantics></math></span> 是紧光滑流形 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>M</mi></mrow><annotation encoding=application/x-tex>M</annotation></semantics></math></span> 上的 Morse 函数。当抬高阈值 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>a</mi></mrow><annotation encoding=application/x-tex>a</annotation></semantics></math></span> 并考察下水平集</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>M</mi><mi>a</mi></msub><mo>:</mo><mo>=</mo><mo stretchy=false>{</mo><mi>x</mi><mo>∈</mo><mi>M</mi><mo>:</mo><mi>f</mi><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mo>≤</mo><mi>a</mi><mo stretchy=false>}</mo></mrow><annotation encoding=application/x-tex>M_a := \{x\in M : f(x)\le a\}</annotation></semantics></math></span><p>时,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>M</mi><mi>a</mi></msub></mrow><annotation encoding=application/x-tex>M_a</annotation></semantics></math></span> 的拓扑只在 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>a</mi></mrow><annotation encoding=application/x-tex>a</annotation></semantics></math></span> 经过临界值时改变。若临界点的指数为 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>k</mi></mrow><annotation encoding=application/x-tex>k</annotation></semantics></math></span>,那么粗略地说,穿过该水平会连接一个 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>k</mi></mrow><annotation encoding=application/x-tex>k</annotation></semantics></math></span> 维手柄:局部极小值的指数为 0,因此它会为下水平集创造出新的连通分支。指数为 1 的鞍点可以把分支合并。更高指数的鞍点则创造出更高维的隧道与空洞。<p>一个推论是欧拉示性数的 <strong>Morse 关系</strong>:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mtable width=100%><mtr><mtd width=50%></mtd><mtd><mrow><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi>N</mi></munderover><mo stretchy=false>(</mo><mo>−</mo><mn>1</mn><msup><mo stretchy=false>)</mo><mi>k</mi></msup><msub><mi>C</mi><mi>k</mi></msub><mo>=</mo><mi>χ</mi><mo stretchy=false>(</mo><mi>M</mi><mo stretchy=false>)</mo><mo separator=true>,</mo></mrow></mtd><mtd width=50%></mtd><mtd><mtext>(4)</mtext></mtd></mtr></mtable><annotation encoding=application/x-tex>\sum_{k=0}^{N} (-1)^k C_k = \chi(M), \tag{4}</annotation></semantics></math></span><p>其中 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>C</mi><mi>k</mi></msub></mrow><annotation encoding=application/x-tex>C_k</annotation></semantics></math></span> 是指数为 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>k</mi></mrow><annotation encoding=application/x-tex>k</annotation></semantics></math></span> 的临界点个数,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>χ</mi><mo stretchy=false>(</mo><mi>M</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>\chi(M)</annotation></semantics></math></span> 是 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>M</mi></mrow><annotation encoding=application/x-tex>M</annotation></semantics></math></span> 的欧拉示性数。由于在复杂的随机景观中,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>χ</mi><mo stretchy=false>(</mo><mi>M</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>\chi(M)</annotation></semantics></math></span> 通常相对于临界点总数很小,许多临界点必须在这个交错求和中相互抵消——相邻指数的鞍点天然适合这种抵消。<p>这一拓扑图景与概率图景一致:随机高维景观常常含有大量散布在各个指数上的鞍点。但重要的是不要夸大拓扑论证:球面上的函数可以只有一个极小值和一个极大值。Morse 理论约束着可能的临界点计数。随机矩阵理论与 Kac–Rice 则解释了为什么在随机高维模型中,计数的绝大部分通常是鞍点式的。<h3 id=坐标不变性morse-引理>坐标不变性:Morse 引理</h3><p>在非退化临界点附近,经过光滑坐标变换后,每个光滑函数都看起来像它的 Hessian 标准形——这正是 <strong>Morse 引理</strong> 的内容。<blockquote><p><strong>定理 B.1(Morse 引理)</strong>。设 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo>:</mo><mi>M</mi><mo>→</mo><mi mathvariant=double-struck>R</mi></mrow><annotation encoding=application/x-tex>f: M\to\mathbb{R}</annotation></semantics></math></span> 光滑,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>p</mi><mo>∈</mo><mi>M</mi></mrow><annotation encoding=application/x-tex>p\in M</annotation></semantics></math></span> 是指数为 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>k</mi></mrow><annotation encoding=application/x-tex>k</annotation></semantics></math></span> 的非退化临界点。则以 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>p</mi></mrow><annotation encoding=application/x-tex>p</annotation></semantics></math></span> 为中心存在局部坐标 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo stretchy=false>(</mo><msub><mi>u</mi><mn>1</mn></msub><mo separator=true>,</mo><mo>…</mo><mo separator=true>,</mo><msub><mi>u</mi><mi>N</mi></msub><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>(u_1,\dots,u_N)</annotation></semantics></math></span>,使得</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo stretchy=false>(</mo><mi>u</mi><mo stretchy=false>)</mo><mo>=</mo><mi>f</mi><mo stretchy=false>(</mo><mi>p</mi><mo stretchy=false>)</mo><mo>−</mo><msubsup><mi>u</mi><mn>1</mn><mn>2</mn></msubsup><mo>−</mo><mo>⋯</mo><mo>−</mo><msubsup><mi>u</mi><mi>k</mi><mn>2</mn></msubsup><mo>+</mo><msubsup><mi>u</mi><mrow><mi>k</mi><mo>+</mo><mn>1</mn></mrow><mn>2</mn></msubsup><mo>+</mo><mo>⋯</mo><mo>+</mo><msubsup><mi>u</mi><mi>N</mi><mn>2</mn></msubsup><mi mathvariant=normal>.</mi></mrow><annotation encoding=application/x-tex>f(u) = f(p) - u_1^2 - \dots - u_k^2 + u_{k+1}^2 + \dots + u_N^2.</annotation></semantics></math></span></blockquote><p>因此,在光滑局部坐标变换意义下,非退化临界点完全由其指数分类。非退化局部极小值的标准形为</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo stretchy=false>(</mo><mi>p</mi><mo stretchy=false>)</mo><mo>+</mo><msubsup><mi>u</mi><mn>1</mn><mn>2</mn></msubsup><mo>+</mo><mo>⋯</mo><mo>+</mo><msubsup><mi>u</mi><mi>N</mi><mn>2</mn></msubsup><mo separator=true>,</mo></mrow><annotation encoding=application/x-tex>f(p) + u_1^2 + \dots + u_N^2,</annotation></semantics></math></span><p>非退化局部极大值的标准形为</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo stretchy=false>(</mo><mi>p</mi><mo stretchy=false>)</mo><mo>−</mo><msubsup><mi>u</mi><mn>1</mn><mn>2</mn></msubsup><mo>−</mo><mo>⋯</mo><mo>−</mo><msubsup><mi>u</mi><mi>N</mi><mn>2</mn></msubsup><mo separator=true>,</mo></mrow><annotation encoding=application/x-tex>f(p) - u_1^2 - \dots - u_N^2,</annotation></semantics></math></span><p>而指数为 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>k</mi></mrow><annotation encoding=application/x-tex>k</annotation></semantics></math></span> 的鞍点有 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>k</mi></mrow><annotation encoding=application/x-tex>k</annotation></semantics></math></span> 个向下的方向和 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>N</mi><mo>−</mo><mi>k</mi></mrow><annotation encoding=application/x-tex>N-k</annotation></semantics></math></span> 个向上的方向。这正是「指数」成为高维临界点自然语言的原因。<h2 id=局限性>局限性</h2><p>任何听起来很「美」的结论都需要打上补丁,这个也不例外。<ol><li><p><strong>不是所有函数都适用。</strong><span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msup><mi mathvariant=double-struck>R</mi><mi>N</mi></msup></mrow><annotation encoding=application/x-tex>\mathbb{R}^N</annotation></semantics></math></span> 上的强凸函数,例如 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mo>=</mo><mi mathvariant=normal>∥</mi><mi>x</mi><msup><mi mathvariant=normal>∥</mi><mn>2</mn></msup></mrow><annotation encoding=application/x-tex>f(x)=\|x\|^2</annotation></semantics></math></span>,只有一个临界点,而且它是严格的全局极小值,没有鞍点。因此,仅仅高维并不意味着极小值稀缺——起决定作用的是 Hessian 有没有系统性地偏向正定。</p><li><p><strong>正定是严格极小值的充分条件,而非必要条件。</strong> 退化的严格极小值是存在的:一维函数 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mo>=</mo><msup><mi>x</mi><mn>4</mn></msup></mrow><annotation encoding=application/x-tex>f(x)=x^4</annotation></semantics></math></span> 在 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>x</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding=application/x-tex>x=0</annotation></semantics></math></span> 处有严格局部极小值,但其 Hessian 在那里为零。因此,Hessian 符号论证针对的是非退化的、即 Morse 的临界点。</p><li><p><strong>结论依赖于随机景观系综。</strong> 中心化、类 GOE 的 Hessian 导致鞍点主导。Hessian 强烈向正方向平移的模型可以有许多极小值。在高斯场模型中,以极低函数值为条件,可以把 Hessian 谱向上平移,使极小值在景观底部附近更可能出现。</p><li><p><strong>罕见并不意味着不存在。</strong> 即使极小值在所有临界点中的占比趋于零,在某些模型中极小值的绝对数目仍可能随 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>N</mi></mrow><annotation encoding=application/x-tex>N</annotation></semantics></math></span> 增长。变得罕见的只是「随机选出的临界点是极小值」这一概率。</p></ol><p>有了这些限定,可以更准确地表述为:<strong>在许多 Hessian 谱近似无偏的高维随机景观中,一个典型的非退化临界点压倒性地倾向于成为鞍点。</strong> Morse 临界点中的局部极小值要求所有 Hessian 特征值为正,而这一正定事件随维度增长呈指数级罕见。<h2 id=优化实践的启发>优化实践的启发</h2><p>这有助于解释为什么高维优化常被描述为「鞍点逃逸问题」,而非单纯的「坏局部极小值问题」。这一陈述不应被过度解读:它并不证明梯度下降总是有效,也不是说所有实际目标都表现得像 GOE 随机矩阵——真实的损失函数具有架构、数据、对称性、退化与约束,远比理想化模型复杂。<p>尽管如此,几何上的教训是有用的:<ol><li>高维中,绝大多数临界点是鞍点,其负特征值方向提供了逃离的「出口」(负曲率方向)。<li>因此,优化卡住的主因不是「掉进局部极小值的陷阱」,而是在高原或鞍点附近「停滞」。<li>算法如 SGD(随机梯度下降)自带的噪声,恰好能高效地把优化过程推离这些鞍点。而二阶算法(如牛顿法)反而需要谨慎处理负曲率方向,否则容易被带偏。</ol><p>最后提醒一点:上述结论适用于随机、无结构化的景观。在深度学习中,由于对称性(如神经元置换)和平坦极小值的存在,景观结构更加复杂,但「鞍点主导」这一高维几何直觉依然成立。<h2 id=结论>结论</h2><p><span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>N</mi></mrow><annotation encoding=application/x-tex>N</annotation></semantics></math></span> 维中的非退化局部极小值必须通过 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>N</mi></mrow><annotation encoding=application/x-tex>N</annotation></semantics></math></span> 个同时成立的曲率检验——在临界点处,每个 Hessian 特征值都必须为正。鞍点只需要正负号的混合。随机矩阵理论表明,大型中心化对称矩阵天然具有这样的混合:它们的谱散布在零附近,有大量正、负特征值。「所有特征值都落在正侧」这一事件是一个大偏差。<p>这解释了高维的直觉。临界点本身是光滑景观中体积为零的特征,但在临界点之中,决定性的问题是 Hessian 的符号。在随机模型中,典型的符号其指数靠近中间,而不是极端:非退化局部极小值指数为 0,非退化局部极大值指数为 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>N</mi></mrow><annotation encoding=application/x-tex>N</annotation></semantics></math></span>,鞍点占据两者之间的所有指数。随着 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>N</mi></mrow><annotation encoding=application/x-tex>N</annotation></semantics></math></span> 增长,中间压倒了极端。<p>因此,最好把这一观点理解为一条稳健的概率原则,而非关于每个高维函数的定理:<blockquote><p>在高维随机景观中,指数为零的 Morse 临界点是例外,而鞍点才是默认。</blockquote><p>这正是深度学习等现代优化能够成功的理论基石之一:绝大多数临界点是鞍点,其负曲率方向提供了逃离的出口。带噪声的一阶方法能高效地把优化过程推开这些鞍点。<h4 id=参考>参考</h4><p>参考来源:<a href=https://www.grantstenger.com/local-minima>《Why Local Minima Are Rare in High-Dimensional Landscapes》</a>,Grant Stenger.

2026/8/22
阅读更多

研究关系的三种视角

<blockquote>RSS readers may not support rendering advanced formatting like math formulas. Click to view the original page: <a href="https://dreams.plus/blog/2026/2026-08-19-yan-jiu-guan-xi-de-san-zhong-shi-jiao" target="_blank">https://dreams.plus/blog/2026/2026-08-19-yan-jiu-guan-xi-de-san-zhong-shi-jiao</a></blockquote><p>哲学里有一种命题:「存在即关系」,在数理研究中同样也有很深的体现。听起来很抽象,但它其实是对世界本质是什么的一种深刻回答。理解事物不是先存在、再去建立关系,而是事物在建立关系的过程中,才得以成为事物。它最著名的提出者是 20 世纪法国哲学家怀特海(过程哲学),但其思想渊源可以追溯到德国哲学家莱布尼茨(单子论)和古希腊的赫拉克利特(万物流动)。<p>所以,研究「存在」也是研究「关系」。而关系通常有三种视角:几何、拓扑和因果。<p>拓扑提供稳健的骨架,几何赋予精细的尺度,因果指明干预的方向。三者共同构成智能系统理解世界的先验地基。更准确的说法或许是:几何和拓扑是关于「关系的静态结构」(分别是度量化的和非度量化的),而因果是关于「关系的动态/生成机制」,它回答的不是「这两者如何关联」,而是「如果我改变一个,另一个会怎样」。<h2 id=几何度量结构>几何(度量结构)</h2><p>几何关注的是「测量」。基本问题是多接近、多相似,或者一个具体的度量数值。——它需要一个度量结构(距离、内积、相似度函数),通常要求满足对称性、三角不等式等公理。典型例子:嵌入空间里两个向量的余弦相似度、社会心理学里的「亲密度量表」。研究的是关系的强度。几何关系是最重的——信息量最大,但也最脆弱,度量方式一变,结论可能就变。<p>一个度量空间是二元组 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo stretchy=false>(</mo><mi>X</mi><mo separator=true>,</mo><mi>d</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>(X, d)</annotation></semantics></math></span>,其中 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>d</mi><mo>:</mo><mi>X</mi><mo>×</mo><mi>X</mi><mo>→</mo><msub><mi mathvariant=double-struck>R</mi><mrow><mo>≥</mo><mn>0</mn></mrow></msub></mrow><annotation encoding=application/x-tex>d: X \times X \to \mathbb{R}_{\geq 0}</annotation></semantics></math></span> 满足:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo fence=true>{</mo><mtable columnalign="left left" columnspacing=1em rowspacing=0.36em><mtr><mtd><mstyle displaystyle=false scriptlevel=0><mtable columnalign="right left" columnspacing=0em rowspacing=0.25em><mtr><mtd><mstyle displaystyle=true scriptlevel=0><mrow></mrow></mstyle></mtd><mtd><mstyle displaystyle=true scriptlevel=0><mrow><mrow></mrow><mi>d</mi><mo stretchy=false>(</mo><mi>x</mi><mo separator=true>,</mo><mi>y</mi><mo stretchy=false>)</mo><mo>=</mo><mn>0</mn><mtext></mtext><mo>⟺</mo><mtext></mtext><mi>x</mi><mo>=</mo><mi>y</mi><mo separator=true>,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=true scriptlevel=0><mrow></mrow></mstyle></mtd><mtd><mstyle displaystyle=true scriptlevel=0><mrow><mrow></mrow><mi>d</mi><mo stretchy=false>(</mo><mi>x</mi><mo separator=true>,</mo><mi>y</mi><mo stretchy=false>)</mo><mo>=</mo><mi>d</mi><mo stretchy=false>(</mo><mi>y</mi><mo separator=true>,</mo><mi>x</mi><mo stretchy=false>)</mo><mo separator=true>,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=true scriptlevel=0><mrow></mrow></mstyle></mtd><mtd><mstyle displaystyle=true scriptlevel=0><mrow><mrow></mrow><mi>d</mi><mo stretchy=false>(</mo><mi>x</mi><mo separator=true>,</mo><mi>z</mi><mo stretchy=false>)</mo><mo>≤</mo><mi>d</mi><mo stretchy=false>(</mo><mi>x</mi><mo separator=true>,</mo><mi>y</mi><mo stretchy=false>)</mo><mo>+</mo><mi>d</mi><mo stretchy=false>(</mo><mi>y</mi><mo separator=true>,</mo><mi>z</mi><mo stretchy=false>)</mo></mrow></mstyle></mtd></mtr></mtable></mstyle></mtd></mtr></mtable></mrow><annotation encoding=application/x-tex>\begin{cases} \begin{aligned} &d(x,y) = 0 \iff x = y,\\ &d(x,y) = d(y,x),\\ &d(x,z) \leq d(x,y) + d(y,z) \end{aligned} \end{cases}</annotation></semantics></math></span><p>三条公理分别对应「可分辨性」「对称性」「三角不等式」。注意对称性是内嵌在定义里的——这一点后面会成为几何/拓扑与因果的分水岭。在 ML 里,我们常用的是更强的结构:内积空间 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo stretchy=false>(</mo><mi>X</mi><mo separator=true>,</mo><mo stretchy=false>⟨</mo><mo>⋅</mo><mo separator=true>,</mo><mo>⋅</mo><mo stretchy=false>⟩</mo><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>(X, \langle \cdot,\cdot\rangle)</annotation></semantics></math></span>,度量由内积诱导 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>d</mi><mo stretchy=false>(</mo><mi>x</mi><mo separator=true>,</mo><mi>y</mi><mo stretchy=false>)</mo><mo>=</mo><mi mathvariant=normal>∥</mi><mi>x</mi><mo>−</mo><mi>y</mi><mi mathvariant=normal>∥</mi></mrow><annotation encoding=application/x-tex>d(x,y) = \|x-y\|</annotation></semantics></math></span>,这才有了余弦相似度、点积注意力这些操作。度量结构的信息量最大,因为它不仅告诉你「是否有关系」,还告诉你「关系有多强」——但代价是它对表示方式极度敏感:换一个嵌入模型、换一个归一化方式,同一批数据算出来的相似度可以完全不同。<h2 id=拓扑连通结构>拓扑(连通结构)</h2><p>拓扑关注的是「连通」。把度量忘掉,只问是否有路径可达、结构是否连通、是否存在环/洞。在同胚变换(连续拉伸、不撕裂)下不变的东西才算拓扑性质。典型例子:社交网络里的连通分量、图的最短路径存在性(而非具体长度)。拓扑关系比几何轻,研究的是关系的骨架,但换来的是更强的稳健性——不在乎具体尺度,只在乎结构骨架。<p>一个拓扑空间是二元组 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo stretchy=false>(</mo><mi>X</mi><mo separator=true>,</mo><mi>τ</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>(X, \tau)</annotation></semantics></math></span>,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>τ</mi></mrow><annotation encoding=application/x-tex>\tau</annotation></semantics></math></span> 是 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>X</mi></mrow><annotation encoding=application/x-tex>X</annotation></semantics></math></span> 的一族「开集」,满足对任意并、有限交封闭,且 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>∅</mi><mo separator=true>,</mo><mi>X</mi><mo>∈</mo><mi>τ</mi></mrow><annotation encoding=application/x-tex>\emptyset, X \in \tau</annotation></semantics></math></span>。拓扑结构不需要度量:任何度量空间都能诱导出一个拓扑(用开球生成开集),但反过来不成立——拓扑空间不一定可度量化。关键的不变量是在<strong>同胚</strong>(连续双射且逆映射也连续)下保持不变的性质,比如连通性、紧致性、亏格(洞的个数)。用代数拓扑的语言,贝蒂数 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>b</mi><mi>k</mi></msub></mrow><annotation encoding=application/x-tex>b_k</annotation></semantics></math></span> 数的是 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>k</mi></mrow><annotation encoding=application/x-tex>k</annotation></semantics></math></span> 维「洞」的个数,这是持久同调(persistent homology)在数据分析里常用的工具——它告诉你数据云的「形状骨架」,而完全不关心具体的尺度参数。这解释了为什么拓扑比几何「轻」:它是几何结构经过遗忘函子 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>U</mi><mo>:</mo><mrow><mi mathvariant=bold>M</mi><mi mathvariant=bold>e</mi><mi mathvariant=bold>t</mi></mrow><mo>→</mo><mrow><mi mathvariant=bold>T</mi><mi mathvariant=bold>o</mi><mi mathvariant=bold>p</mi></mrow></mrow><annotation encoding=application/x-tex>U: \mathbf{Met} \to \mathbf{Top}</annotation></semantics></math></span> 投影之后剩下的东西。<h2 id=因果约束结构>因果(约束结构)</h2><p>因果关注的是「约束」。这一支和前两支有本质区别:几何和拓扑通常是对称的(A 到 B 的距离=B 到 A 的距离;A 连着 B 等价于 B 连着 A),而因果关系本质上是非对称的——「X 决定/限制 Y 的取值范围」不等于反过来成立。因果结构需要额外的信息才能识别(干预、反事实、时间先后),单纯的相关性数据(哪怕是几何或拓扑意义上完整的)不足以确定因果方向。这也是 Pearl 那套 do-calculus 要解决的问题。在 ML 中,几何/拓扑模型在独立同分布(i.i.d.)下表现很好,但只要测试分布变了(协变量偏移),它们就会崩。而因果结构(比如有向无环图 DAG)告诉你的是「机制」——只要干预机制不变,哪怕输入分布变了,模型依然能泛化。这也是为什么说因果是稳健性的终极来源。<p>结构因果模型(SCM)是一个三元组 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>M</mi><mo>=</mo><mo stretchy=false>⟨</mo><mi>U</mi><mo separator=true>,</mo><mi>V</mi><mo separator=true>,</mo><mi>F</mi><mo stretchy=false>⟩</mo></mrow><annotation encoding=application/x-tex>M = \langle U, V, F \rangle</annotation></semantics></math></span>,其中 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>U</mi></mrow><annotation encoding=application/x-tex>U</annotation></semantics></math></span> 是外生变量,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>V</mi><mo>=</mo><mo stretchy=false>{</mo><msub><mi>V</mi><mn>1</mn></msub><mo separator=true>,</mo><mo>…</mo><mo separator=true>,</mo><msub><mi>V</mi><mi>n</mi></msub><mo stretchy=false>}</mo></mrow><annotation encoding=application/x-tex>V = \{V_1, \dots, V_n\}</annotation></semantics></math></span> 是内生变量,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>F</mi><mo>=</mo><mo stretchy=false>{</mo><msub><mi>f</mi><mn>1</mn></msub><mo separator=true>,</mo><mo>…</mo><mo separator=true>,</mo><msub><mi>f</mi><mi>n</mi></msub><mo stretchy=false>}</mo></mrow><annotation encoding=application/x-tex>F = \{f_1, \dots, f_n\}</annotation></semantics></math></span> 是一组函数,满足</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>V</mi><mi>i</mi></msub><mo>:</mo><mo>=</mo><msub><mi>f</mi><mi>i</mi></msub><mo stretchy=false>(</mo><mrow><mi mathvariant=normal>P</mi><mi mathvariant=normal>a</mi></mrow><mo stretchy=false>(</mo><msub><mi>V</mi><mi>i</mi></msub><mo stretchy=false>)</mo><mo separator=true>,</mo><msub><mi>U</mi><mi>i</mi></msub><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>V_i := f_i(\mathrm{Pa}(V_i), U_i)</annotation></semantics></math></span><p>赋值符号 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo>:</mo><mo>=</mo></mrow><annotation encoding=application/x-tex>:=</annotation></semantics></math></span>(而非 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo>=</mo></mrow><annotation encoding=application/x-tex>=</annotation></semantics></math></span>)是关键——它表示这是一个<strong>机制</strong>,不是一个可逆的代数等式。这组机制天然诱导一张有向无环图(DAG)<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>G</mi></mrow><annotation encoding=application/x-tex>G</annotation></semantics></math></span>,边 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>V</mi><mi>j</mi></msub><mo>→</mo><msub><mi>V</mi><mi>i</mi></msub></mrow><annotation encoding=application/x-tex>V_j \to V_i</annotation></semantics></math></span> 存在当且仅当 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>V</mi><mi>j</mi></msub><mo>∈</mo><mrow><mi mathvariant=normal>P</mi><mi mathvariant=normal>a</mi></mrow><mo stretchy=false>(</mo><msub><mi>V</mi><mi>i</mi></msub><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>V_j \in \mathrm{Pa}(V_i)</annotation></semantics></math></span>。因果推断的核心操作是 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mrow><mi mathvariant=normal>d</mi><mi mathvariant=normal>o</mi></mrow><mo stretchy=false>(</mo><mo>⋅</mo><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>\mathrm{do}(\cdot)</annotation></semantics></math></span> 算子:<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>P</mi><mo stretchy=false>(</mo><mi>Y</mi><mo>∣</mo><mrow><mi mathvariant=normal>d</mi><mi mathvariant=normal>o</mi></mrow><mo stretchy=false>(</mo><mi>X</mi><mo>=</mo><mi>x</mi><mo stretchy=false>)</mo><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>P(Y \mid \mathrm{do}(X=x))</annotation></semantics></math></span> 表示「把 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>X</mi></mrow><annotation encoding=application/x-tex>X</annotation></semantics></math></span> 的赋值机制替换为常数 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>x</mi></mrow><annotation encoding=application/x-tex>x</annotation></semantics></math></span>,切断它与所有父节点的连接」之后 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>Y</mi></mrow><annotation encoding=application/x-tex>Y</annotation></semantics></math></span> 的分布,这与条件概率 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>P</mi><mo stretchy=false>(</mo><mi>Y</mi><mo>∣</mo><mi>X</mi><mo>=</mo><mi>x</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>P(Y \mid X=x)</annotation></semantics></math></span>——「观察到 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>X</mi><mo>=</mo><mi>x</mi></mrow><annotation encoding=application/x-tex>X=x</annotation></semantics></math></span> 之后 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>Y</mi></mrow><annotation encoding=application/x-tex>Y</annotation></semantics></math></span> 的分布」——一般是不相等的。两者的差异,正是相关不等于因果的形式化版本。<h2 id=因果与拓扑>因果与拓扑</h2><p>一个自然的问题是:几何遗忘度量得到拓扑,那因果是不是遗忘更多东西之后剩下的更轻的骨架?答案是否定的。<p>几何到拓扑的「变轻」是<strong>同一个信息维度上的压缩</strong>——都是对称关系,只是分辨率从「连续的数值」降到了「是否连通」的二值/离散判断。但因果结构引入了一个几何和拓扑都没有的新维度:<strong>方向性/非对称性</strong>,并且这个方向性原则上<strong>不能</strong>从纯观测的联合分布 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>P</mi><mo stretchy=false>(</mo><mi>V</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>P(V)</annotation></semantics></math></span> 中单独用几何或拓扑手段识别出来。这就是可识别性问题(identifiability):<blockquote><p><strong>命题(因果不可从观测唯一识别)。</strong> 对于两个变量 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>X</mi><mo separator=true>,</mo><mi>Y</mi></mrow><annotation encoding=application/x-tex>X, Y</annotation></semantics></math></span>,仅凭观测联合分布 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>P</mi><mo stretchy=false>(</mo><mi>X</mi><mo separator=true>,</mo><mi>Y</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>P(X,Y)</annotation></semantics></math></span>,一般无法在 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>X</mi><mo>→</mo><mi>Y</mi></mrow><annotation encoding=application/x-tex>X \to Y</annotation></semantics></math></span>、<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>Y</mi><mo>→</mo><mi>X</mi></mrow><annotation encoding=application/x-tex>Y \to X</annotation></semantics></math></span>、<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>X</mi><mo>←</mo><mi>Z</mi><mo>→</mo><mi>Y</mi></mrow><annotation encoding=application/x-tex>X \leftarrow Z \to Y</annotation></semantics></math></span>(混杂)等因果结构之间做出唯一判定——它们可以诱导出完全相同的 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>P</mi><mo stretchy=false>(</mo><mi>X</mi><mo separator=true>,</mo><mi>Y</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>P(X,Y)</annotation></semantics></math></span>。</blockquote><p>要打破这种不可识别性,需要额外的信息源:随机对照实验(真正的 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>d</mi><mi mathvariant=normal>o</mi></mrow><annotation encoding=application/x-tex>\mathrm{do}</annotation></semantics></math></span>)、时间先后顺序、结构假设(如可加噪声模型、非高斯性,如 LiNGAM 方法利用非高斯噪声打破对称性)。这说明因果结构不是几何/拓扑那条压缩链上的下一站,而是一个正交的轴——即便你拥有关于系统的完整几何信息(所有点对的精确距离)和完整拓扑信息(所有连通关系),你依然可能无法回答「如果我强行改变 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>X</mi></mrow><annotation encoding=application/x-tex>X</annotation></semantics></math></span>,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>Y</mi></mrow><annotation encoding=application/x-tex>Y</annotation></semantics></math></span> 会怎样」这个问题。这正是 Pearl 提出因果之梯(Ladder of Causation)的意义所在:<table><thead><tr><th>层级<th>问题类型<th>例子<th>所需信息<tbody><tr><td>1. 关联<td>看见(seeing)<td><span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>P</mi><mo stretchy=false>(</mo><mi>Y</mi><mo>∣</mo><mi>X</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>P(Y\mid X)</annotation></semantics></math></span><td>观测数据即可,几何/拓扑视角覆盖此层<tr><td>2. 干预<td>行动(doing)<td><span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>P</mi><mo stretchy=false>(</mo><mi>Y</mi><mo>∣</mo><mrow><mi mathvariant=normal>d</mi><mi mathvariant=normal>o</mi></mrow><mo stretchy=false>(</mo><mi>X</mi><mo stretchy=false>)</mo><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>P(Y\mid \mathrm{do}(X))</annotation></semantics></math></span><td>需要实验或因果图假设<tr><td>3. 反事实<td>想象(imagining)<td>若 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>X</mi></mrow><annotation encoding=application/x-tex>X</annotation></semantics></math></span> 不同,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>Y</mi></mrow><annotation encoding=application/x-tex>Y</annotation></semantics></math></span> 会怎样<td>需要完整 SCM,包括外生噪声的联合分布</table><p>几何和拓扑视角,本质上被限制在第一层;只有引入因果结构,才能爬上第二、第三层。这也是为什么「因果关系需要额外信息才能识别」这句话不是技术细节,而是三种视角在存在论意义上的分界线。<h2 id=机器学习视角>机器学习视角</h2><p>回到机器学习的语境,三种视角之间的差异直接决定了模型在分布偏移下的表现。可以按「随分布变化保持不变的程度」给三者排一个序:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mtext>Geometry</mtext><mtext></mtext><mo>≺</mo><mtext></mtext><mtext>Topology Invariance</mtext><mtext></mtext><mo>≺</mo><mtext></mtext><mtext>Causality</mtext></mrow><annotation encoding=application/x-tex>\text{Geometry} \;\prec\; \text{Topology Invariance} \;\prec\; \text{Causality}</annotation></semantics></math></span><ul><li><strong>几何层面的失败</strong>:训练集和测试集哪怕只是特征做了不同的归一化,相似度排序就可能整体偏移——这是最脆弱的一层,任何非本质的表示变化都会渗透进度量数值本身。<li><strong>拓扑层面的稳健性</strong>:持久同调等方法对噪声、尺度变化天然不敏感,因为它们本来就是在滤除度量细节之后提取「形状」。但拓扑结构依然是观测分布 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>P</mi><mo stretchy=false>(</mo><mi>V</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>P(V)</annotation></semantics></math></span> 的函数——一旦分布本身发生结构性改变(不只是尺度变化,而是变量间依赖关系变了),拓扑不变量也会随之改变,因为它仍然停留在因果之梯的第一层。<li><strong>因果层面的稳健性</strong>:如果 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>X</mi><mo>→</mo><mi>Y</mi></mrow><annotation encoding=application/x-tex>X \to Y</annotation></semantics></math></span> 的机制 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>f</mi><mi>Y</mi></msub><mo stretchy=false>(</mo><mi>X</mi><mo separator=true>,</mo><msub><mi>U</mi><mi>Y</mi></msub><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>f_Y(X, U_Y)</annotation></semantics></math></span> 本身不随环境改变(这是很多领域里的物理假设——比如「重力加速度与颜色无关」),那么哪怕 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>P</mi><mo stretchy=false>(</mo><mi>X</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>P(X)</annotation></semantics></math></span> 的边际分布因为采样环境不同而剧烈变化,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>P</mi><mo stretchy=false>(</mo><mi>Y</mi><mo>∣</mo><mrow><mi mathvariant=normal>d</mi><mi mathvariant=normal>o</mi></mrow><mo stretchy=false>(</mo><mi>X</mi><mo stretchy=false>)</mo><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>P(Y\mid \mathrm{do}(X))</annotation></semantics></math></span> 这个机制仍然成立,模型依然可以泛化。这正是 Arjovsky 等人提出不变风险最小化方法的出发点:不去拟合在各个环境里都表现最好的相关性,而是寻找在所有环境下都保持不变的预测机制——本质上是把学习目标从「几何/统计上的最优拟合」换成「因果机制上的不变性」。</ul><p>用一句话概括:几何模型学的是「数据长什么样」,拓扑模型学的是「数据的骨架怎么连」,而因果模型学的是「数据为什么会长成这样、什么力量在背后生成它」。前两者是对现象的描述,后者试图逼近生成现象的机制——这也是为什么协变量偏移能摧毁前两者,却不一定能摧毁后者。<h2 id=递进的先验>递进的先验</h2><p>如果用范畴论的语言简单勾勒一下三者的关系:存在遗忘函子 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mrow><mi mathvariant=bold>M</mi><mi mathvariant=bold>e</mi><mi mathvariant=bold>t</mi></mrow><mo>→</mo><mrow><mi mathvariant=bold>T</mi><mi mathvariant=bold>o</mi><mi mathvariant=bold>p</mi></mrow></mrow><annotation encoding=application/x-tex>\mathbf{Met} \to \mathbf{Top}</annotation></semantics></math></span>,把度量空间的态射(等距同构)松弛成拓扑空间的态射(同胚),信息在这一步单调减少,但依然停留在「对称关系」的范畴里。因果结构则不在这条链上——它是在对象上额外加了一层有向、非对称的生成机制,这层机制无法通过对已有对称结构做进一步遗忘得到,只能通过引入新的认识论工具(干预、时间、结构假设)来「添加」。<p>所以更准确的图景不是一条线性的「由重到轻」的链条,而是:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mtable columnalign=center columnspacing=1em rowspacing=0.16em><mtr><mtd><mstyle displaystyle=false scriptlevel=0><munder><munder><mtext>几何</mtext><mo stretchy=true>⏟</mo></munder><mtext>对称,度量化,最重</mtext></munder></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mo fence=false maxsize=1.8em minsize=1.8em stretchy=true>↓</mo><mstyle displaystyle=false scriptlevel=1><mtext>遗忘度量</mtext></mstyle></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=false scriptlevel=0><munder><munder><mtext>拓扑</mtext><mo stretchy=true>⏟</mo></munder><mtext>对称,非度量化,中等</mtext></munder></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mo fence=false maxsize=1.8em minsize=1.8em stretchy=true>↓</mo><mstyle displaystyle=false scriptlevel=1><mtext>额外的干预/时序信息</mtext></mstyle></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=false scriptlevel=0><munder><munder><mtext>因果</mtext><mo stretchy=true>⏟</mo></munder><mtext>非对称,机制化,最稳健</mtext></munder></mstyle></mtd></mtr></mtable><annotation encoding=application/x-tex>\begin{array}{c} \underbrace{\text{几何}}_{\text{对称,度量化,最重}} \\[8pt] \Big\downarrow \scriptstyle \text{遗忘度量} \\[8pt] \underbrace{\text{拓扑}}_{\text{对称,非度量化,中等}} \\[8pt] \Big\downarrow \scriptstyle \text{额外的干预/时序信息} \\[8pt] \underbrace{\text{因果}}_{\text{非对称,机制化,最稳健}} \end{array}</annotation></semantics></math></span><p>前两步是同一维度上的信息压缩,第三步是维度的跃迁——从「关系是否存在/多强」跃迁到「关系为什么存在、能否被操控」。这三层构成了一个智能系统理解世界所需的最小先验地基:先要有度量才能比较,有了比较才能抽象出结构骨架,而只有抽出骨架背后的生成机制,系统才能真正做到举一反三——在没见过的分布上依然可靠地行动,而不只是在训练分布的邻域里插值。<p>这或许也是当前很多「表示学习」范式的天花板所在:无论嵌入空间做得多精细(几何)、图结构建模得多完备(拓扑),只要模型学到的始终是观测层面的关联,它就永远停留在因果之梯的第一级。因果表征学习(causal representation learning)想做的事情,正是把几何/拓扑意义上学到的表示,进一步「提纯」出背后满足机制不变性的潜变量和因果图——这也是几何、拓扑、因果这三种视角在方法论上真正会师的地方。

2026/8/18
阅读更多

祛魅科研,每个研究生的必修课

<blockquote>RSS readers may not support rendering advanced formatting like math formulas. Click to view the original page: <a href="https://dreams.plus/blog/2026/2026-08-14-demystification-research" target="_blank">https://dreams.plus/blog/2026/2026-08-14-demystification-research</a></blockquote><p>从 2025 年开始入学读研,到现在已经有一个年头了,不知不觉已经研二了。在过去的一年的研究生学习中,我发现我的心态、世界观经历了一次完整的、打击性的重塑。如果说之前我的心态是中规中矩,那么现在则是满心失落。自从经历过完整的科研训练,调研课题、找 idea,做实验、处理数据、撰写论文、修改文章、等投稿、写 Rebuttal、拒稿再转投、论文改版等一系列流程完整经历过后,只剩下满心苦涩。一度怀疑,我们搞的这个所谓的「科研」的价值和意义。😇</p><p>因为笔者读的研究生是计算机工程类专业,对于其他理工科领域、文科领域,笔者不是很熟悉,所以以下观点体验仅适用于该专业。<h2 id=草台班子>草台班子</h2></p><p>第一个对我的改变就是对学术成果的怀疑。学术圈的科研,其实并没有那么高端,可以说是草台班子。</p><p>在读研之前,我一直认为学术论文其实是非常高端的东西,至少是可信度很高的参考。但是读研之后,这个想法被改变了:绝大多数论文,他们的观点、数据、实验,看看就好,不必认真。</p><p>一篇论文的结论,往往只有作者自己的机器上成立。审稿人不会复现,编辑不会复现,引用者也不会复现。大家都默认了这个不可验证的游戏潜规则。论文并不是经过验证的知识,而是一个经过美化的故事。</p><p>有人专门对被 ICML 收录的 Oral 论文进行了复现,并给出了<a href=https://x.com/ChenhaoTan/status/2079969545629118737>论文的报告信息</a>。结果发现,在 105 篇完整的复现论文中,只有 27 篇复现了超过 40% 的声称效果,剩余的几乎无法复现,要么效果不达标。原因包括代码无法运行、文件缺失以及模型已弃用等等。</p><p>复现困难确实是机器学习领域长期存在的问题。因为,CUDA 版本、显卡型号、CPU 型号、PyTorch 框架版本,可能都有大量隐蔽的细节差异,如果再组合起来,那么效果就完全无法验证。实验中的很多关键 Hack(比如特定的随机种子、数据预处理的微妙顺序、超参数的精细调节)可能只存在于作者的实验笔记或潜意识里。这些隐性经验很难通过文字传递,导致复现者像在黑暗中摸索。</p><p>甚至如果作者的代码里有 Bug,也很可能会造成完全错误的结论。我曾经跑过前人的基线实验,发现一篇论文,他的某个指标又非常虚高。最后才发现,作者对数据集根本没有清洗干净,也就是说,这份成绩是假的。</p><p>但问题是,这个论文已经被大量后人引用且作为基线了,后人想要再投稿,那么他的成绩必须要比这个假成绩更高,但是你根本比不过这假成绩,怎么办呢?你只能偷偷摸摸用点魔法手段,万不可认真,否则反而会显得像是你做错了,审稿人不接受。后来的研究者反而成了受害者。这不就是难为后人么?</p><p>所以,后人也只能不得不逼着也参与这种数字游戏,偷偷使用手段。结果就是,学术论文逐渐沦为一场“数字通胀”。每一篇新论文都在前人的数字泡沫上再吹一层泡沫,直到某个数据集上的准确率达到 99.9%,然后这个方向就“死掉”了——因为没人能再超越了,而大家都知道那个 99.9% 是假的,但谁都不想捅破。</p><p>这已经超出了学术不端的范畴,演变成了一种系统性的「囚徒困境」,很遗憾,这种困境,在学术圈里几乎无解。</p><p>无法复现不一定是作者故意有造假意向,而是因为深度学习本身就是一个巨大的黑盒,可验证性、可解释性非常差。很多错误,作者不一定能及时发现,审稿人也不一定能发现,于是,“只要能 work 就能发文”。当审稿人面对一篇充满“惊艳”实验数据的论文时,他既没有算力去复现,也没有理论工具去证伪其内部的混沌过程。于是,审稿的标准退化为:“只要故事逻辑自洽,且结果看起来比 SOTA(当前最优)高,我就信。”这就给出了巨大的浑水摸鱼的空间。</p><p>这种无法复现的现象,也会给自己带来很多的麻烦:如果你的文章需要依赖前人的工作,但是前人的工作本身就有问题,那么你的工作就几乎不可能顺利下去。你只能花大把时间来反思、调试,最后还很可能一无所获。</p><p>最后被浪费大把的时间和精力。这种消耗是精神凌迟。后续工作往往不得不替它买单。</p><p>有时候,我也甚至怀疑作者是故意在开源里缺斤少两,删减关键代码和文件或者埋入 Bug,或者论文被 Accept 后立即下架数据集,极力避免复现。😇要知道,审稿人通常只有 2-3 位,他们在几周内免费审稿,不可能复现你的实验,也无法验证你的原始数据。他们主要检查的是逻辑是否顺畅和方法是否看起来合理,而不是结论是否绝对正确。</p><p>学术论文它的首要目标是发表,而不是传世。为了发表,作者必须讲一个完整且自洽的故事。他们会突出最漂亮的数据,而弱化不支持的“噪音”结果。所以,他们会在讨论部分夹带私货,把故事讲得更有吸引力。它也确实是痛苦的。因为这意味着你失去了一个可以无条件信任的知识权威。<h2 id=ai-审稿危机>AI 审稿危机</h2></p><p>读研起到现在,我已经投稿了三篇文章,这点我是有亲身体会的。</p><p>另一种尴尬是 AI 时代的审稿危机。AI 时代的恶果就是,论文灌水越来越容易。往常,写一篇论文很可能需要一学期、大半年的时间,要辛辛苦苦做实验、分析结果、画图表、斟酌写作。但是现在不一样了,利用自动化学术 Agent 如 AutoResearch,只要输入合适的提示词和模糊的想法再交给 Agent,它两天时间就可以编出一篇像模像样的论文,自动编写程序做实验,自动画图表,一个人一个月就能编写出 10 篇论文,直接投到顶会轰炸。</p><p>AAAI 在 2026 年收到了五万多份取号,几乎是 2025 年的两倍。而前年 2024 年才不过九千多份,短短两年时间就增长了五倍!其实不止 AAAI,其他的计算机会议的投稿量也是几乎翻倍增长。假设每篇论文标准配备 3 名审稿人,组委会将需要管理 120,000 份独立审稿意见:<figure><img alt="计算机顶会近五年投稿量。自从 2025 年后,大多数投稿量都是翻倍式增长" src="https://imgproxy.citrusreader.com/RL5C0G0WC-XyCYoqwqIr78J_CIKuNY9M_yNCG3NcJBA/raw:1/aHR0cHM6Ly9pbWFnZS1hc3NldHMuZHJlYW1zLnBsdXMvMjAyNjA4MTExMjE5NzIxLmpwZw"><figcaption>计算机顶会近五年投稿量。自从 2025 年后,大多数投稿量都是翻倍式增长</figcaption></figure></p><p>这就会导致一个后果:劣币驱逐良币。审稿体系正在加速崩溃。就算你辛辛苦苦完成了心血,设计实验,写好文章,<strong>审稿人也几乎不会认真看你的文章,而是直接交给 LLM 敷衍。</strong> 因为审稿人压根无法区分哪篇论文是 AI 写得,哪篇不是。更糟糕的是,学术领域是高度分化的,审稿人极有可能也不熟悉、也不理解你的研究领域。所以,他也只能同样一股脑交给 AI 审稿。</p><p>在这种情况下,灌水零成本,中间大量灌水的作者和敷衍的审稿人占多数。认真的审稿人和认真的作者只能被动深受其害。受害的永远只是认真搞学术的你。在这种情况下,审稿工作还能正常进行下去吗?</p><p>而 LLM 审稿本身就有很大的问题,AI 并不会理解你的文章,LLM 的幻觉问题众所周知。它会用非常刁钻的角度在你的文章里挑刺,哪怕是没有问题也会制造出一些问题。这是因为 LLM 在训练、SFT 偏好微调的时候,天生就倾向于给你打低分。LLM 并不真正拥有论文作者的研究上下文。它尤其容易犯一种很危险的错误:把“我没理解”转换成“作者的方法存在问题”。</p><p>LLM 模型学习到的统计规律是:“审稿”这个动作的语义空间,几乎完全由“批评性词汇”构成。因此,即使一篇论文毫无瑕疵,模型根据概率分布生成的“审稿风格”文本,天然就带有负面倾向。SFT 微调的时候,宽松的论文意见并不受欢迎,为了要尽可能压榨 LLM 能力,在微调的时候会特意设计出非常严苛的训练案例。这种奖惩机制直接塑造了模型的“人格”:它必须“生产批评”来证明自己的价值。哪怕没有真实缺陷,它也会启动“防御性挑刺”模式,利用模式匹配强行构造出看似合理的问题。</p><p>我的文章被拒稿过一次,三个 Reviewer 里两人给出的意见,明显就是 AI 复制粘贴的。😅 但是你不能抗议,你还要捏着鼻子忍着恶心,在 rebuttal 里面假模假样地感谢审稿人,再假模假样地写 rebuttal,跪求他赏赐一口饭吃。😅</p><p>审稿体系存在一个非常明显的权力不对称。Reviewer 可以随意评价“The novelty is insufficient.”而作者很难说:“你根本没读懂我的论文。”因为作者没有证据。另外,Reviewer 可以洋洋洒洒写出几千字的审稿意见,没有字数限制,而作者给的 Rebuttal 却严格限制在几百字以内。这也是最恶心的一点😅<figure><img alt="如图,是几个 LLM 在审稿 ArXiv 计算机学科论文时给出的平均得分(10 分制)" src="https://imgproxy.citrusreader.com/V7-iv7XoZNyrw-5ig55t9hXTM0SNbT-KNBygT_CKw_c/raw:1/aHR0cHM6Ly9pbWFnZS1hc3NldHMuZHJlYW1zLnBsdXMvMjAyNjA4MTExMjEwNTkxLnBuZw"><figcaption>如图,是几个 LLM 在审稿 ArXiv 计算机学科论文时给出的平均得分(10 分制)</figcaption></figure></p><p>试过把 21-23 年,GPT 出来以前的三大顶会里,已经发表收录的论文随机爬下来,投给 AI 审,50 篇里 30 多个 weak reject,10 多个 weak accept,剩下的全部都是 reject。一篇 accept 都没有。后 AI 时代所谓的顶会论文已经变成笑话哩。</p><p>审稿人因为反驳文太长而疲惫,作者因为审稿人固执而绝望。当作者知道审稿人是 AI,审稿人知道作者用了 AI 时,作者 - 审稿人 - 编辑三方之间的这场学术对话,就彻底沦为了一场荒诞剧。这就造成了非常滑稽的景象,AI 写 AI 审:</p><p>用 AI 写论文、写代码,再用 AI 初审,根据 AI 的意见修改,完成初稿。审稿人拿到初稿,再交给 AI 审稿,用 AI 的意见给出 review 意见,作者拿到 AI 写的意见后再交给 AI 写 rebuttal。审稿人再用 AI 根据 rebuttal 做出决定。堪称学术出版领域正在逼近的赛博朋克式奇观。</p><p>在三方中,编辑/主席的地位最为尴尬。当所有文字意见如审稿、反驳都由 AI 生成时,编辑失去了判断学术创新性的任何抓手。他唯一能做的,就是检查流程是否走完:AI 是否提了 3 个问题?作者是否逐条回复?回复长度是否达标?只要格式合规,就可以按下接受键。学术判断的权力,在此刻已完全让渡给了硅基算法。</p><p><strong>所以,能否发顶会、顶刊,实际上已经越来越像摸彩票中奖的运气、概率问题,跟你的文章质量、工作效果已经几乎没有什么关系了。</strong><h2 id=手艺人>手艺人</h2></p><p>硕博生这个身份曾经是不少人引以为傲的根本。但是真正体验过他们的生活,也会发现他们本质上和流水线的螺丝工人相差无几,这种生活状态其实是非常压抑的,如果过这种日子,那只能用「熬」来形容。</p><p>硕博生本质上也是出卖高强度脑力劳动换取生存资格的劳动者。跟工地上抗水泥的农民工、顶着大太阳湿透衣服的清洁工没有本质区别。</p><p>对于理工科研究生,996 是常态,实验室的灯永远亮着。每天睁眼闭眼就是要面对屏幕上密密麻麻的实验数据、代码和仪器。高强度脑力劳动后,带给身心的除了疲劳还是疲劳。日子久了,精气神会被消磨掉,慢慢丧失对这个世界的好奇心和一切欲望,不想谈恋爱,不想出去旅游,哪怕是手里的游戏,日子久了玩起来也没意思。<blockquote><p>到周末后,只想在床上躺着,啥也不干。脑一旦被单一的高强度任务长期占据,负责发散思维、感受情绪、产生欲望的脑区就会被持续抑制。只像一个漂浮在数据海洋里的意识,拖着一具沉重而麻木的肉体,犹如冢中枯骨而已。</p></blockquote></p><p>这是最致命的。当你看清你所做的研究可能只是学术游戏里的一个废棋,对外部世界毫无影响时,熬就变成了一种精神上的凌迟。不禁会问,「我做的这一切,受了那么多折磨,到底有什么意义?」</p><p>工人进厂时,起码能自知之明、清醒地知道这是出卖身体,用劳动换生存。但硕博生被社会、被家人、被曾经的自己赋予了天子骄子、知识精英的光环。当现实变成日复一日地跑数据、伺候仪器时,日子久了你会有这样一种感觉:自己并不是一个人,而是一个庞大机器中的一颗零件。</p><p>硕士生(Master)也不是大师。博士生也不博学。他的知识广度,甚至还可能不如一个高中生。<strong>读研后,你的视角只会被限制在高度狭窄且专业的小领域里。</strong> 在自己的学术孤岛里自娱自乐。</p><p>中世纪的经院哲学家热衷于争论「一个针尖上能站几个天使」,而今天的学术圈,大量精力被消耗在维护主流范式上。正如前文所提到的,学术论文本身也是高度固定化的、范式的。有时候你不会感觉自己「在创造一个想法」,而是「完成一个八股文」。</p><p>如果要比喻硕博生这个群体的身份,它更像是一个高度程序化的手艺人、螺丝工。搞科研的流程本身就是高度固定化、流水线化的。调研、idea、实验、写作、改稿、Rebuttal。这一圈下来,恭喜你,你已经是一名合格的劳工!<h2 id=学术圈>学术圈</h2></p><p>曾经对学术圈的浪漫想象,至少代表了知识的前沿、先进的生产力和思想文化,具有进步性。我其实对科研领域内的学者,高校里的教授、教师等群体,长期是存在敬仰的,认为他们或多或少都是代表了人类开拓认知知识、征服星辰大海的一批人,在心里也会敬三分。</p><p>现在才知道,学术圈其实是高度封闭的。因为知识本身就有很强的入门壁垒,当人类认知突破到一定边界时,工具、术语和范式的复杂度必然形成门槛,学术方向往往会走向高度分化、隔行如隔山的细碎分支,各个分支又会高度壁垒。这就造成了学术圈的高度封闭性。</p><p>其实,越是高度封闭的圈子,越容易产生高度固化的权力结构,行事作风越是封建化、越是讲政治。😅其实现在的学术圈其实跟欧洲中世纪的经学院教派之争、西藏喇嘛们的辩经并没有什么区别。那些专家,领域学者,头衔看得是挺唬人,但做的无非在极度封闭的圈子里,用只有内部人能懂的黑话,争论着对外部世界影响甚微的问题,而决定胜负的常常不是真理,而是资历、人脉和对经典的诠释权。</p><p><strong>学术圈,其实比大多数人想象的还要小。</strong> 因为现代学科已经进入高度分化、高度专业化的时代了。如果细分下去,全中国十四亿人里,同一个领域的研究同行很可能不超过百人,甚至十几人。在一个村落里,任何小动作,全落在这几十个低头不见抬头见的人手里。这里没法对事不对人,因为在结构上,所有的事,最终都是人的事。</p><p>然而,现在的学术圈是零和博弈,资源是极其有限的。这个在申请基金、文章版面、学术交流等等活动中,只要有人胜出,必然会有人落选。这也就意味着,你的小圈子里,可能到处都在「树敌」。这并不意味着本人有错,而是你的存在,本身就是威胁。</p><p>所以遇到同行暗中使绊子,也是常见的事。你的审稿人很可能跟你的导师有竞争或者过节,就直接轻松 Reject 你的心血。即使现在的审稿制度大多是双盲制,在一个领域只有几十上百人的圈子里,根本不存在真正的双向匿名。看研究问题、看方法、看引用的文献,审稿人闭着眼都能猜到这篇稿子出自哪个课题组。</p><p>对一个埋头苦干的学生来说,这是最深的打击。你相信公正,相信学术质量至上。然后,一堵由学派、人情、资源争夺构成的墙,悄无声息地挡在你面前,将你的心血轻松驳回。你甚至没有一个明确的敌人去质问抗争,你甚至不知道你的敌人是谁,又得罪了谁,只剩下无尽的无力感和被戏弄的愤怒。这种被暗算的体验会深刻腐蚀对学术共同体的信任。</p><p>像中世纪的领主分封土地一样,大牛导师和顶尖实验室把持着顶级期刊的版面、重大项目的经费和学阀圈子的话语权。你想在他的领地上发文章,就得遵循他的范式、引他的文章、甚至拜他的码头。学术圈的游戏规则是,正确不等于接受。投稿像一场赌博,审稿人的口味、当期版面、甚至运气,都比你那篇精心打磨的论文权重更高。<h2 id=事业意义>事业意义</h2></p><p>虽然小时候有「长大要当科学家」这种理想,但是,个人认为「学术」这条路并不适合像我这样的平民子弟。没有充裕的家底和财力作为后盾,吃学术这碗饭,也是一种高风险职业。</p><p>我觉得那些在学术圈里搞研究的人,其实也挺可悲的。自己把大量的青春,时间,精力投入到自己的课题里,勉强能讨得经费,靠这个饭碗。因为,选择某个研究领域,在初期往往带有偶然性。但一旦投入,就成了无法回头的豪赌。赌的是这个方向在几十年内不被证伪、不被超越、不被认为是死胡同、不会没落。他用的是几十年的青春和精力做赌注,用最严谨的头脑,从事着一项本质上充满不确定性的高风险事业。</p><p>如果有人突然跳出来用新理论、新范式挑战他,或者推翻了他的观点课题,这无异于把他降维打击成了一块废品,弃之如敝履,这不是嘲讽,而是真实的悲剧。在高度职业化的学术圈里,一个人的身份、地位、自尊,都深深扎根于他那一亩三分地的研究课题。</p><p>当他的理论被推翻,在外人看来不过是一个观点被证伪。但对他而言,无异于整个学术人格被判处了死刑,在这个圈子里,会被迅速边缘化,从而判了死刑。他毕生构建的意义大厦,瞬间崩塌为一座废墟。这就是一种存在主义危机。</p><p>大多数普通人活下去本身就很难。因为 <strong>他们的人生,还有其他责任</strong> 。若压制住七情六欲,寒窗几十年,去碰学术圈,也未免太委屈了。如果一个人 25 岁读博士,30 岁左右博士毕业,然后经历博士后、非升即走、青年项目竞争,他可能在四十岁前都处于高度竞争状态。而同期进入工业界的人,可能已经积累了财富、住房和职业资本。<h2 id=破局功利化读研>破局:功利化读研</h2></p><p>在中国,虽然知识分子往往被冠以社会期待的光环,但是这也是一种负担和枷锁。请记住:我们是普通人尤其是出身平民家庭,我们首要目标是生存。在生存生计成为问题的时候,我们 <strong>没有义务背负太多期待</strong>。<blockquote><p>沧浪之水清兮,可以濯吾缨;沧浪之水浊兮,可以濯吾足。</p></blockquote></p><p>请卸下你的「学术羞耻感」。把研究生学历视为一份职业准入资格证,而非学术朝圣。学术职业是一种高风险选择,而不是所有人都必须承担的使命。</p><p>如何破局——功利化读研不失为一种出路。研究生必须思考:我读研的目的是为了什么?获得更好的就业门槛,暂时避开竞争激烈的就业市场,获得更多选择权。这完全是一种合理的人生规划。</p><p>首要的当然是毕业、混文凭,获得硕博的身份————这也是最现实、也最重要的一条。所以,在读研前期,你的一切目标是,必须以尽可能短的时间,完成最低毕业要求。大量水论文、蹭项目就足矣,不需要尽善尽美。科研嘛,也就那样,随便搞搞就行。</p><p>这是功利化读研真正的溢价所在。既然科研只求及格,那你必须把多出来的精力毫无愧疚地投入生存技能的构建。</p><p>在当前的环境下,「包装」比「做事」更重要,「数量」比「质量」更重要。不要把自己的全部人生价值绑定在学术成果上。科研如此,创业如此,艺术如此,很多长期主义事业都是如此。我不需要证明自己是英雄,我只需要把自己的人生过好。知识值得敬畏,但人的生命也值得敬畏。学术可以是人生的一部分,但不必成为人生的全部。</p><p>希望研究生们,不必神化科研、不必自我内耗、不必绑定学术理想,认清行业真相后,依然可以清醒活着、务实成长。</p><p>到最后,这种「虽千万人,吾往矣」,本身就有壮士断腕的秋风式悲凉,不是吗?😮‍💨</p>

2026/8/13
阅读更多

写作语言的转变

<blockquote>RSS readers may not support rendering advanced formatting like math formulas. Click to view the original page: <a href="https://dreams.plus/blog/2026/2026-08-13-xie-zuo-yu-yan-de-zhuan-bian" target="_blank">https://dreams.plus/blog/2026/2026-08-13-xie-zuo-yu-yan-de-zhuan-bian</a></blockquote><p>长期以来,我对自己的博客定位从来不是分享,而更多是给自己看的「笔记」。很多情况是:记录一个刚刚搞懂的东西 → 写下来 → 以后自己查 → 写完就结束。我的博客基本都很短,基本三分钟以内就能读完。大约在 2023 年开始,同时为了学习英语,锻炼技术写作能力,我在疯狂背单词的同时,也可以保持用英语进行技术写作。现在坚持了快两年。所以长期以来,利用英语写作,对我来说压力并不大。写作时不需要追求完整论证,只需要把自己的思路编码下来。哪怕句子稍微生硬一点,只要自己以后能看懂,就已经达成目的。<p>过去两年的英语写作之所以轻松,是因为它服务于「笔记」功能——短、线性、结论明确。这种写作不需要复杂的逻辑嵌套,不需要反复回看和修改结构,英语的线性特征反而成了一种约束,帮你把想法压缩成清晰的短句。<p>但是后来,情况发生了变化,我的博客从「给自己看的笔记」的定位,开始转移到了「表达与推演」。当写作从记录变成表达与推演,语言就从工具变成了负担。写作负荷不是恒定的,它会随着结构复杂度和语言熟练度的乘积而非线性增长。<p>文章越来越长,关于技术写作的部分,有的文章我需要插入大量的 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mtext>LaTeX</mtext></mrow><annotation encoding=application/x-tex>\LaTeX</annotation></semantics></math></span> 公式、推导和演绎过程。此时再使用非母语进行技术写作时心智负担显著增大。短文里,一句话如果不知道怎么写,一般情况可以用简单句子绕一下,问题不大。但是到了长篇技术文章,可能连续几页都在描述一个复杂的思想。这时候需要同时控制数学符号、技术概念、论证结构、前后术语一致性、句法,还有段落之间的衔接。于是工作记忆里面同时跑着很多东西。<p>而且,长篇博客并不是一次写完的,很可能需要花上几个星期慢慢打磨,或者经常回顾我自己的博客的思想。写作的时候,我大多数时间都在思考:「这个理论到底应该怎么解释?」。但是,结果脑子里却不断出现:「这里应该用 which 还是 that?」、「这个东西应该叫 representation 还是 formulation?」、「这个词性是否合适,有没有对应的名词形式?」之类细枝末节的语法问题。久而久之,写作起来会非常累。在短文本写作里,这种差异几乎感觉不到。但当文本从几百字增长到几千、几万字以后,语言的视觉结构、信息密度、词法形态、定位效率和工作记忆负担都会开始成为写作系统的一部分。<p>另外一种原因,英文是线形文字,阅读效率天然就很低:想在长文中定位到某一块位置,必须要从每一段从头开始逐行扫过,无法像汉字那样逐块扫描。很多时候我在长文写作中,需要不断地往回头看。而英语的语法线性强,从句嵌套多了以后,读者和作者都容易迷失。因为汉字同时包含视觉图像和声音两种信息,它信息密度和视觉辨识特征,使中文文本非常适合视觉扫描。而英文单词之间存在大量空格,真正有语义重量的东西被拆成了很多视觉单元。所以当文章达到几千甚至上万字以后,回来看自己几周前写的东西,会出现一种很奇怪的体验:中文是在「看结构」,英文更容易变成「读句子」。所以,就导致语义单元和视觉单元不对齐——一个概念可能要三四个单词才能表达,视觉上要扫过更长的距离才能抓住一个完整意群。<p>其实不止是我,很多技术写作者都会遇到一个问题:语言不是中性的容器,它会反过来塑造你思考的形状。<p>笔记型写作的特点,思维已经完成。只是在编码一个已经清晰的结论,供未来的自己检索。表达与推演型写作则不同,写作本身就是思维过程。你在写的过程中推演、发现、修正。文字不是思维的镜像,而是思维的工具。当写作成为思考工具时,语言就不再只是输出端的问题,而是输入端的问题。非常需要语言来帮助你组织尚未成形的想法,来试探逻辑的边界,来连接不同的概念。<p>从此以后,我的博客功能,从以前的博客 externalized memory(外部记忆),到现在逐渐变成了 externalized thinking(外部化思考)。<p>也许从英语写作到中文写作,是在为思维本身让路。让认知资源从语言操作中解放出来,还给真正的思考。

2026/8/12
阅读更多

大语言模型中的表征流形

<blockquote>RSS readers may not support rendering advanced formatting like math formulas. Click to view the original page: <a href="https://dreams.plus/blog/2026/2026-08-04-the-representations-in-llm" target="_blank">https://dreams.plus/blog/2026/2026-08-04-the-representations-in-llm</a></blockquote><p>如果你关注了过去两年机制可解释性研究的进展,很可能见过这样一类图:把大语言模型某一层神经元的激活向量投影到二维或三维空间并作图,会发现「月份」「星期几」「年份」「颜色」等概念的表示并不是杂乱无章地散布在空间中,而是沿着一条优美的曲线排列——有时甚至是闭合的圆圈或环面。Chris Olah、Anthropic 的 Josh Batson 以及 Engels 等人,都在包括 <a href=https://arxiv.org/abs/2405.14860>并非所有语言模型特征都是一维线性的</a> 在内的研究中展示了这一现象。<p>这些发现引人入胜,却也留下了一个令人不安的空白:我们看到了流形,却无法精确地说出这个流形与它所表征的「概念」之间究竟是什么关系。为什么「年份」这样一个本该是直线的东西,会在模型内部被扭曲成一条在高维空间中蜿蜒盘绕的曲线?「颜色」排列成圆形是巧合还是必然?向量之间的余弦相似度,真的能告诉我们两个概念在语义上有多接近吗?<p>三位数学家——分别来自帝国理工学院、爱丁堡大学和布里斯托大学的 Alexander Modell、Patrick Rubin-Delanchy 与 Nick Whiteley——在他们的论文 <a href=https://arxiv.org/pdf/2505.18235>《大语言模型中表征流形的起源》</a> 中,首次尝试为这些问题提供一个「最小可用」的数学理论。本文梳理他们论证的脉络,并给出我个人的一些思考。<h2 id=线性表征假说>线性表征假说</h2><p>机制可解释性领域长期以来由一个核心信念所锚定,即线性表征假说(LRH):模型将人类可解释的「特征」——例如「长着毛茸茸的耳朵」「提到了埃菲尔铁塔」「使用阿拉伯语」——编码为表征空间中一组近似正交的方向向量。给定输入的表示,则是这些方向向量的稀疏线性组合,权重由各特征是否存在及其程度决定。如今被广泛采用的可解释性工具稀疏自编码器(SAE),正是直接建立在这一假说之上:训练一个带有稀疏性惩罚的自编码器,去逼近这些「字典向量」。<p>然而,越来越多的证据表明,这种「非黑即白、一特征一方向」的模型无法解释某些现象。作者引用了大量的文献:模加任务中的数字被编码为圆;多语言模型中出现了环状结构;「日期」与「星期几」呈现出扭曲的环面几何;甚至在模拟的隐马尔可夫模型中涌现出分形几何。这些例子有一个共同点:特征不再是一条直线,而是一个完整、连续、可能非线性弯曲的流形。<p>因此,该领域提出了 LRH 的推广版本——多维线性表征假说:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>Ψ</mi><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mo>=</mo><munder><mo>∑</mo><mrow><mi>f</mi><mo>∈</mo><mi>F</mi><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo></mrow></munder><msub><mi>ρ</mi><mi>f</mi></msub><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><msub><mi>v</mi><mi>f</mi></msub><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>\Psi(x) = \sum_{f \in F(x)} \rho_f(x) v_f(x)</annotation></semantics></math></span><p>其中 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>v</mi><mi>f</mi></msub><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>v_f(x)</annotation></semantics></math></span> 不再是固定方向,而是可以在某个子空间 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>V</mi><mi>f</mi></msub></mrow><annotation encoding=application/x-tex>V_f</annotation></semantics></math></span> 内随输入 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>x</mi></mrow><annotation encoding=application/x-tex>x</annotation></semantics></math></span> 连续变化。标准的 LRH 只是 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>v</mi><mi>f</mi></msub><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>v_f(x)</annotation></semantics></math></span> 恒定且 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>V</mi><mi>f</mi></msub></mrow><annotation encoding=application/x-tex>V_f</annotation></semantics></math></span> 一维的特例。<p>这篇论文想要处理的,恰恰是这个推广假说中最核心也最含糊的部分:特征 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi></mrow><annotation encoding=application/x-tex>f</annotation></semantics></math></span> 在子空间 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>V</mi><mi>f</mi></msub></mrow><annotation encoding=application/x-tex>V_f</annotation></semantics></math></span> 中以何种流形形态呈现,这个流形与「特征」本身之间又是什么关系?<h2 id=特征即度量空间>「特征」即度量空间</h2><p>论文中最优雅的一步,是先解决一个听起来有些哲学、实际上至关重要的问题:「特征」究竟是什么?<p>作者给出的答案出人意料地简洁:特征是一个度量空间 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo stretchy=false>(</mo><msub><mi>Z</mi><mi>f</mi></msub><mo separator=true>,</mo><msub><mi>d</mi><mi>f</mi></msub><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>(Z_f, d_f)</annotation></semantics></math></span>——一个集合连同定义在该集合上的某种「距离」概念。这个定义看似平淡,实则表现力极强:<ul><li>原子特征(是否有猫):<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>Z</mi><mi>f</mi></msub></mrow><annotation encoding=application/x-tex>Z_f</annotation></semantics></math></span> 是单元素集合;<li>层次特征(动物的分类学树):<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>Z</mi><mi>f</mi></msub></mrow><annotation encoding=application/x-tex>Z_f</annotation></semantics></math></span> 是离散集合,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>d</mi><mi>f</mi></msub></mrow><annotation encoding=application/x-tex>d_f</annotation></semantics></math></span> 是其上的树距离;<li>连续特征(颜色色相、一年中的第几天、日历年):<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>Z</mi><mi>f</mi></msub></mrow><annotation encoding=application/x-tex>Z_f</annotation></semantics></math></span> 可以是区间、圆或更高维的欧几里得空间。</ul><p>这一框架比学习理论中常见的「欧几里得空间」或「超球面」假设更灵活,又比解耦文献中带群结构的黎曼流形简单得多、也更易于处理。这是典型的数学家式选择:在表达力与可处理性之间取得恰当的平衡。<p>在「特征即度量空间」这一定义就位后,作者提出了论文的第一个核心假说:<blockquote><p>假说 1(连续对应假说)。特征值 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>z</mi><mi>f</mi></msub><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>z_f(x)</annotation></semantics></math></span> 与表示方向 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>v</mi><mi>f</mi></msub><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>v_f(x)</annotation></semantics></math></span> 之间存在连续、可逆的一一对应;即存在连续映射 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>ϕ</mi><mi>f</mi></msub><mo>:</mo><msub><mi>Z</mi><mi>f</mi></msub><mo>→</mo><msup><mi>S</mi><mrow><mi>D</mi><mo>−</mo><mn>1</mn></mrow></msup></mrow><annotation encoding=application/x-tex>\phi_f: Z_f \to S^{D-1}</annotation></semantics></math></span>(映到单位超球面),使得 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>v</mi><mi>f</mi></msub><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mo>=</mo><msub><mi>ϕ</mi><mi>f</mi></msub><mo stretchy=false>(</mo><msub><mi>z</mi><mi>f</mi></msub><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>v_f(x) = \phi_f(z_f(x))</annotation></semantics></math></span>。</blockquote><p>结合 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>Z</mi><mi>f</mi></msub></mrow><annotation encoding=application/x-tex>Z_f</annotation></semantics></math></span> 是紧空间的这一技术前提,该假说立即导出一个干净的推论(命题 1):<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>ϕ</mi><mi>f</mi></msub></mrow><annotation encoding=application/x-tex>\phi_f</annotation></semantics></math></span> 是一个同胚。换言之,表征流形 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>M</mi><mi>f</mi></msub></mrow><annotation encoding=application/x-tex>M_f</annotation></semantics></math></span>(即 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>ϕ</mi><mi>f</mi></msub></mrow><annotation encoding=application/x-tex>\phi_f</annotation></semantics></math></span> 的像)与原始特征空间 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>Z</mi><mi>f</mi></msub></mrow><annotation encoding=application/x-tex>Z_f</annotation></semantics></math></span> 在拓扑上「形状相同」:若 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>Z</mi><mi>f</mi></msub></mrow><annotation encoding=application/x-tex>Z_f</annotation></semantics></math></span> 是区间,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>M</mi><mi>f</mi></msub></mrow><annotation encoding=application/x-tex>M_f</annotation></semantics></math></span> 就是一条曲线;若 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>Z</mi><mi>f</mi></msub></mrow><annotation encoding=application/x-tex>Z_f</annotation></semantics></math></span> 是圆,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>M</mi><mi>f</mi></msub></mrow><annotation encoding=application/x-tex>M_f</annotation></semantics></math></span> 就是一个圈;连通分量、孔洞、分叉点——所有这些拓扑性质都被忠实地保留下来。<p>这一步的意义在于,它第一次用严格的数学语言把「流形长什么样」与「概念本身的结构」联系起来,而不再停留在「看起来像个圆」这种直观描述上。<h2 id=实证验证>实证验证</h2><p>再优雅的理论也必须接受数据的检验。作者选取了三个有代表性的案例:<ol><li>颜色:用 OpenAI 的 <code>text-embedding-large-3</code> 从英文颜色名称生成 3072 维嵌入,再用 PCA 降到三维用于可视化;<li>年份:沿用 Engels 等(2025)的做法,用 SAE 从 GPT-2-small 的第 7 层提取「20 世纪年份」特征;<li>日期:用「1 月 1 日」到「12 月 31 日」等提示词生成嵌入,同样使用 OpenAI 的嵌入模型。</ol><p>结果令人瞩目:颜色嵌入沿一个圆环排列,色相次序(红→紫→蓝→绿→黄→橙→红)与标准色环完全吻合。年份的 token 激活在三维空间中描出一条蜿蜒的曲线,隐约唤起人类对「时间线」的直觉。作者进一步用 k-近邻图估计了流形上的序结构,并与真实年份计算秩相关,得到肯德尔相关系数 0.97、斯皮尔曼相关系数超过 0.99——近乎完美的单调对应,为同胚预测提供了有力支持。<p>论文里还有一个特别耐人寻味的「陷阱」细节:在 Engels 等人的原始工作中,「星期几」和「月份」的表示投影到前两个主成分上时,呈现出整齐的圆。作者指出,一旦考察第三个主成分就会发现,这个「圆」其实在第三维上持续地扭曲缠绕;被压进二维平面的整齐圆是一种视觉假象(见其图 2)。这一观察是一个告诫:低维投影作为可解释性研究不可或缺的可视化工具,同时也可能误导人。<h2 id=计算表达能力角度>计算表达能力角度</h2><p>至此一个自然的问题浮现出来:既然「年份」本质上是一维的量,模型为什么不在表征空间中直接把它编码成一条直线段,而要扭曲成一条穿过高维空间的曲线呢?<p>作者给出的答案既直观又带着数学家的典型气质:表达能力。如果目标仅仅是通过线性投影「读出」 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>z</mi></mrow><annotation encoding=application/x-tex>z</annotation></semantics></math></span> 本身(即让恒等函数 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mrow><mi mathvariant=normal>i</mi><mi mathvariant=normal>d</mi></mrow><mo stretchy=false>(</mo><mi>z</mi><mo stretchy=false>)</mo><mo>=</mo><mi>z</mi></mrow><annotation encoding=application/x-tex>\mathrm{id}(z) = z</annotation></semantics></math></span> 能通过一次线性运算算出),那么两个正交方向 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>v</mi><mn>0</mn></msub><mo separator=true>,</mo><msub><mi>v</mi><mn>1</mn></msub></mrow><annotation encoding=application/x-tex>v_0, v_1</annotation></semantics></math></span> 就足够了。但如果还希望让 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>z</mi></mrow><annotation encoding=application/x-tex>z</annotation></semantics></math></span> 的高阶多项式(如 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msup><mi>z</mi><mn>2</mn></msup></mrow><annotation encoding=application/x-tex>z^2</annotation></semantics></math></span>)也能被线性读出,就需要更多的正交方向 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>v</mi><mn>0</mn></msub><mo separator=true>,</mo><mo>…</mo><mo separator=true>,</mo><msub><mi>v</mi><mrow><mi>p</mi><mo>+</mo><mn>1</mn></mrow></msub></mrow><annotation encoding=application/x-tex>v_0, \dots, v_{p+1}</annotation></semantics></math></span>,相应地 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>ϕ</mi><mo stretchy=false>(</mo><mi>z</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>\phi(z)</annotation></semantics></math></span> 描出的路径就必须在一个 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo stretchy=false>(</mo><mi>p</mi><mo>+</mo><mn>2</mn><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>(p+2)</annotation></semantics></math></span> 维子空间中弯曲。<p>换言之:流形在高维空间中「扭曲」的程度,在某种意义上编码了后续网络层能够通过简单线性投影直接读出多少种关于该特征的不同(非线性)函数。这为「模型为何把简单的一维概念编码成复杂的高维流形」提供了一种功能主义解释——不是因为模型「迫不得已」,而是因为这样做有利于下游计算。<p>作者随后把这一视角与叠加假说联系起来:由于表征维度远小于潜在特征的数量,模型几乎别无选择,只能让大多数特征在同一个表征空间中稀疏地、近似正交地共享。在这种约束下,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>ϕ</mi><mi>f</mi></msub></mrow><annotation encoding=application/x-tex>\phi_f</annotation></semantics></math></span>——即某个特征对应的编码方向——确实包含恒等函数的「线性可读」成分这一事实,也在一定程度上解释了为何在实际中,简单的线性探针往往出奇地擅长从叠加的表征中「钓出」某个特定特征。<h2 id=余弦相似度>余弦相似度</h2><p>如果说前面的章节是脚手架,那么这一节就是论文真正的「硬核」贡献,在我看来也是最值得记住的部分。<p>作者提出了假说 2(余弦相似度反映距离):局部来看,表示之间的余弦相似度是特征值之间距离平方的某个递减函数:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mrow><mi mathvariant=normal>C</mi><mi mathvariant=normal>o</mi><mi mathvariant=normal>s</mi><mi mathvariant=normal>S</mi><mi mathvariant=normal>i</mi><mi mathvariant=normal>m</mi></mrow><mo stretchy=false>(</mo><msub><mi>ϕ</mi><mi>f</mi></msub><mo stretchy=false>(</mo><mi>z</mi><mo stretchy=false>)</mo><mo separator=true>,</mo><msub><mi>ϕ</mi><mi>f</mi></msub><mo stretchy=false>(</mo><msup><mi>z</mi><mo lspace=0em mathvariant=normal rspace=0em>′</mo></msup><mo stretchy=false>)</mo><mo stretchy=false>)</mo><mo>=</mo><msub><mi>g</mi><mi>f</mi></msub><mo stretchy=false>(</mo><msub><mi>d</mi><mi>f</mi></msub><mo stretchy=false>(</mo><mi>z</mi><mo separator=true>,</mo><msup><mi>z</mi><mo lspace=0em mathvariant=normal rspace=0em>′</mo></msup><msup><mo stretchy=false>)</mo><mn>2</mn></msup><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>\mathrm{CosSim}(\phi_f(z), \phi_f(z')) = g_f(d_f(z, z')^2)</annotation></semantics></math></span><p>对 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>g</mi><mi>f</mi></msub></mrow><annotation encoding=application/x-tex>g_f</annotation></semantics></math></span> 的唯一要求是在 0 附近二次可微且满足 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msubsup><mi>g</mi><mi>f</mi><mo lspace=0em mathvariant=normal rspace=0em>′</mo></msubsup><mo stretchy=false>(</mo><mn>0</mn><mo stretchy=false>)</mo><mo>&lt;</mo><mn>0</mn></mrow><annotation encoding=application/x-tex>g_f'(0) &lt; 0</annotation></semantics></math></span>;除此之外不再施加任何限制。<p>在假说 1 与假说 2 同时成立的前提下,作者证明了论文的核心结果定理 1:设 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>η</mi></mrow><annotation encoding=application/x-tex>\eta</annotation></semantics></math></span> 是特征空间 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>Z</mi><mi>f</mi></msub></mrow><annotation encoding=application/x-tex>Z_f</annotation></semantics></math></span> 中的一条有限长路径,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>γ</mi></mrow><annotation encoding=application/x-tex>\gamma</annotation></semantics></math></span> 是它在流形 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>M</mi><mi>f</mi></msub></mrow><annotation encoding=application/x-tex>M_f</annotation></semantics></math></span> 上的对应路径,则</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>L</mi><mo stretchy=false>(</mo><mi>γ</mi><mo stretchy=false>)</mo><mo>=</mo><msqrt><mrow><mo>−</mo><mn>2</mn><msubsup><mi>g</mi><mi>f</mi><mo lspace=0em mathvariant=normal rspace=0em>′</mo></msubsup><mo stretchy=false>(</mo><mn>0</mn><mo stretchy=false>)</mo></mrow></msqrt><mo>⋅</mo><mi>L</mi><mo stretchy=false>(</mo><mi>η</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>L(\gamma) = \sqrt{-2g_f'(0)} \cdot L(\eta)</annotation></semantics></math></span><p>用大白话说:流形上最短路径(测地线)的长度与特征空间中对应最短路径的长度严格成正比。也就是说,即使不知道 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>g</mi><mi>f</mi></msub></mrow><annotation encoding=application/x-tex>g_f</annotation></semantics></math></span> 的具体形式,只要局部余弦相似度是距离平方的某个光滑递减函数,「沿着表征流形本身行进」的测地距离,就能精确地——只差一个统一的缩放常数——恢复概念空间中的真实距离。<p>这一结果回应了 Olah 和 Batson 在 2024 年提出的一个悬而未决的猜想:他们曾写道,「特征流形以超出其拓扑所要求的更复杂方式嵌入,其目的或许正是为了实现某个特定的距离度量,这个想法可能相当深刻而重要。」这篇论文实际上用度量几何的严格语言,把这个直觉性的猜想结晶成一个既可证明也可证伪的定理。<p>证明本身采用了度量几何中「路径长度」的经典定义(多边形逼近和的上确界),核心技巧是对余弦相似度在零点附近做泰勒展开,随后用一系列仔细的三角不等式论证来界定误差项——一段扎实的解析推理(详见附录)。<h2 id=同胚容易等距困难>同胚容易等距困难</h2><p>理论就位之后,作者回到颜色、年份、日期三个实证案例,检验假说 2 与定理 1。他们设计了两种诊断方法:<ol><li>直接方法:以散点图绘制「余弦相似度 vs. 距离平方」,观察是否出现局部递减趋势,并用查特吉相关系数 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>ξ</mi></mrow><annotation encoding=application/x-tex>\xi</annotation></semantics></math></span> 量化整体的函数依赖程度;<li>间接方法:检验定理 1 本身——用 k-近邻图估计流形上的测地距离,检查它们是否与特征空间中的测地距离成正比,并用皮尔逊相关系数衡量线性程度。</ol><p>结果耐人寻味。对于「颜色」和「日期」——两者都天然具有周期结构——一个简单的圆形度量(色相角;一年中的第几天)就能为等距性提供相当有力的支持(日期的皮尔逊相关系数达 0.97)。「年份」却栽了跟头:如果假设年份之间的距离就是 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>∣</mi><mi>x</mi><mo>−</mo><mi>y</mi><mi mathvariant=normal>∣</mi></mrow><annotation encoding=application/x-tex>|x-y|</annotation></semantics></math></span>(例如 1990 与 2000 相距 10 个单位),经验数据完全不支持这一假说。图 4 显示,越接近「当下」的年份(论文以 GPT-2 的发布年份 2019 为参考点)在流形上被拉得越开——它们的距离被「放大」了。<p>于是作者做了一个非常优雅的修正:把年份的度量空间换成 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>log</mi><mo>⁡</mo><mo stretchy=false>(</mo><mn>2019</mn><mo>−</mo><mtext>year</mtext><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>\log(2019 - \text{year})</annotation></semantics></math></span> 上的欧几里得距离——也就是说,模型编码的或许并不是「日历年」本身,而是对数尺度上的「多久以前」。这个新的度量空间与原年份区间拓扑等价(同胚保持,秩相关仍接近 1),但在这一新度量下检验等距性时,结果从「不支持」翻转为「强烈支持」(查特吉系数 0.84,皮尔逊相关系数 0.99)。<p>我认为这一节是整篇论文最见洞察力的实证部分:它清晰地表明「同胚」与「等距」是两个完全不同的几何保真度层级。前者只问「形状对不对」;后者问「数值上的距离关系对不对」。一个流形可以与你设想的某个概念空间在拓扑上完全一致,在几何上(距离的具体函数形式)却截然不同。而破解「距离究竟是如何被编码的」这一过程,本身就是对模型如何「理解」时间概念的一次侦察。GPT-2 把「较近的年份」彼此拉得更远,在某种意义上暗示:越接近模型训练截止时间的年份,承载的语义纹理越稠密——新闻和事件挤得更紧——因此被分配了更大的「表征空间预算」。这是一个相当迷人的猜想,尽管论文本身并未深入探讨这一现象背后的因果解释。<h2 id=柏拉图假说>柏拉图假说</h2><p>读这篇论文时,我忍不住要把它和另一篇同样是 2024 年发表、在机器学习社区引发大量讨论的立场性论文放在一起比较——Huh、Cheung、Wang 与 Isola 提出的柏拉图式表征假说(PRH)(ICML 2024)。虽然两篇论文的具体研究对象和方法几乎完全不同,但把它们对照起来读,会发现它们是在同一个大问题的两个不同尺度上工作,而且彼此互补——甚至可以视为一条因果链条上的两个相继环节。<p>PRH 的核心主张是:架构不同、模态不同(视觉、语言)、训练目标不同的深度网络,随着规模和任务多样性的增大,其内部表征会趋向收敛到一个共享的几何结构。作者把这个被越来越多的模型逐步逼近的假想表征空间,类比为柏拉图式的「理想实在」(理念界)——独立于任何具体实体而存在并超越它们:每个具体模型学到的表征,只是对这个「柏拉图式表征」的一个带有噪声和偏差的投影。其实证证据包括:在处理配对的图文数据时,随着模型变大,图像模型与语言模型测量数据点间距离的方式变得越来越相似;在一批架构和训练方式各异的视觉模型中,两两间的表征相似性系统地上升。他们还提出了一个解释性猜想:这种收敛的驱动力在于,模型在学习过程中被迫逼近数据生成过程所共有的真实统计结构(即「实在」本身)——任务越多样,这种收敛压力就越强。<p>如果说 PRH 关心的是「在不同模型之间,整个表征空间是否正收敛到一个统一的几何」,那么 Modell、Rubin-Delanchy 和 Whiteley 的这篇论文关心的则是更小、更具体的尺度:在单个模型内部,为什么对应于单个特征(颜色、年份、日期)的子流形会呈现特定的几何形状,这个形状与它所对应的「概念」之间精确的数学关系又是什么?<p>把两篇论文放在一起,可以读出相当连贯的一条逻辑链:<ol><li>PRH 提出了一个宏观猜想——不同模型的表征空间正在收敛到一个反映「世界的真实统计结构」的共同几何,而这种收敛的程度可以用「模型间测量数据点距离的一致性」来量化(PRH 论文恰恰使用了核对齐、表征相似性等评估两两距离模式一致性的工具)。但 PRH 本身停留在「存在性」和「收敛趋势」层面,并没有深入一个更基础的问题:在单个模型的表征空间内部,距离本身是如何与概念空间中的「真实」距离相对应的?<li>本文《大语言模型中表征流形的起源》回答的恰恰是这个更基础、更微观的问题。定理 1 告诉我们:只要局部余弦相似度与特征距离之间存在某种光滑的函数关系(假说 2),表征流形上的测地距离就能精确地——只差一个比例常数——恢复概念空间中的「真实」距离。这就为 PRH 所声称的「模型以某种一致的方式学会测量数据点之间的距离」提供了一个几何机制层面的解释:模型并不是简单地「记住」距离,而是通过把特征映射到特定形状和曲率的流形上,借助该流形上的测地路径隐式地编码了距离结构。<li>反过来,本文观察到的颜色和日期呈现的圆形结构——以及「颜色按标准色环的色相次序排列」这一具体发现——可以看作对 PRH 的微观印证:色相本身是客观存在于物理世界中的周期结构(可见光的连续光谱,连同人类视网膜三类视锥细胞的响应曲线,共同决定了颜色空间)。如果不同的图像模型和不同的语言模型,互不协调、各自独立地都学到「色相是一个圆」,这恰恰是 PRH 所描述的「不同模型收敛到反映世界真实统计结构的共享表征」的一个具体、可分离、可检验的实例。换言之,PRH 提供了「为什么会收敛」的宏观叙事;本文提供了「收敛之后几何长什么样,这个几何又是如何精确编码语义距离」的微观刻画。</ol><p>当然,两篇工作之间也存在明显的张力,值得坦诚地指出。PRH 的收敛主张在很大程度上依赖跨模型比较——用典型相关分析、核对齐等工具比较不同模型对同一组数据点两两距离模式的测量方式,这属于「表征之间的关系」的统计范畴。而《大语言模型中表征流形的起源》则从头到尾讨论的是单个模型内部、单个特征子空间内的几何结构,几乎不涉及不同模型的表征是否可比较的问题。也就是说,即便「余弦相似度与测地距离之间的定理」对某个特定模型(例如 GPT-2)成立,也不能直接推出另一个架构完全不同的模型会用同样的方式——同样的度量空间、同样的对数尺度——编码「年份」这个特征。事实上,「年份以对数尺度编码,距离随接近参考年份而不断拉伸」这一具体发现,本身就带有相当程度的模型特异性。GPT-2 的参考点天然设定为其自身的发布年份(2019),这表明这种编码方式很可能与这个特定模型训练语料的时间分布强相关,而不是所有语言模型都收敛到的、普遍的「柏拉图式」距离编码。如果在训练截止时间和语料分布都不同的模型上重复同样的实验,对数尺度和参考点会相应地偏移吗?这其实是一个非常值得后续工作直接研究的问题——而且在某种意义上,它构成了对 PRH 收敛主张在「单个特征的特定几何参数」这一更细粒度上进行经验检验的天然实验设计。<p>依我之见,把这两篇论文放在一起读,比单独读任何一篇都更有启发:PRH 告诉我们「所有人都在朝同一个方向收敛」,而本文则为刻画「收敛到底收敛到什么、这种收敛如何被严格度量与证伪」提供了数学语言。如果未来有人想在具体特征层面真正检验 PRH 是否成立——例如色相的圆形结构、时间的对数编码,是否会在架构和训练数据各不相同的模型中一致地重现——那么《大语言模型中表征流形的起源》中提出的同胚检验、等距检验(查特吉系数、基于 KNN 的测地距离的皮尔逊相关)就构成一套几乎现成的、标准化的工具箱。这或许正是这篇论文除了自身数学结论之外,最具有普遍可复用性的「副产品」。<h2 id=结语>结语</h2><p>读完这篇论文,我想从几个角度给出我的评价。<p>首先,这是一次难得的把模糊直觉严格化的努力,其主要价值在于提供了语言和工具,而非一个终极答案。机制可解释性领域目前充斥着「看图说话」式的发现——「哦,这个特征看起来像个圆」「这个看起来像树形结构」——却缺少一种统一的数学语言来组织这些观察。把特征定义为度量空间,并把「同胚」与「等距」这两个概念干净地区分开来,本身就是一件重要的概念工具:它迫使研究者把「我觉得这个流形对应那个概念」这种模糊直觉,翻译成具体、可证伪的假说(「这是不是正确的度量空间?」),并提供具体的统计检验程序(查特吉系数、基于 k-近邻图的测地距离)。这种严谨性目前在领域内相对稀缺。<p>其次,定理 1 是漂亮的数学,但其「证明力」在相当程度上依赖一个相当强的前提——余弦相似度与距离之间存在光滑的函数关系。这一假说本身并非从模型训练动力学或架构设计推导而来,而是作为一个「合理的猜测」被摆上桌面,再加以经验验证。换言之,这篇论文读起来更像「如果这个假说成立,会有哪些漂亮的推论?」,而非「为什么表征空间必然呈现这种结构」(正是在这个意义上,标题中「起源」一词多少有些一厢情愿——论文并没有从优化目标或梯度下降动力学推导出流形为何「涌现」,它在很大程度上是在「流形已经存在」的前提之下,转而刻画它们应当呈现什么样子)。不过这也并非完全是批评:机制可解释性作为一个整体仍处于「观察现象、构建描述性理论」的阶段,真正从第一性原理推导表征几何的工作少之又少。这篇论文至少把「描述性理论」这一步做得比大多数同类工作更严谨。<p>第三,年份的对数尺度发现是全篇最令人印象深刻、也最引人深思的实证结果。它暗示了一个值得警惕的方法论陷阱:同胚检验(拓扑对不对?)的门槛非常低,很容易得到「看起来对」的东西,但这远不足以说明我们真正理解了模型的编码方式。如果作者止步于「年份沿一条曲线排列,顺序与真实时间顺序一致,秩相关 0.97,说明模型学会了年份的次序」,这个结论将相当空洞——几乎任何单调映射都能做到这一点。真正携带信息量的是等距检验揭示的距离非均匀拉伸,以及它背后的具体假说:以对数尺度编码「距参考点的时间」。这提醒我们,未来类似的可解释性研究不应止步于「形状看起来像不像?」,而应当像本文一样继续追问「距离度量对不对?」——因为只有如此,才能挖掘出模型真正编码的隐含假设。<p>第四,从应用的角度看,这篇论文对表征引导(steering)研究具有直接的方法论启示,但距离真正可操作的工具还有一段距离。论文在结尾指出,如果能够学习到 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>ϕ</mi><mi>f</mi></msub></mrow><annotation encoding=application/x-tex>\phi_f</annotation></semantics></math></span>(从特征到流形的映射),原则上就可以进行更精细、尊重概念内在几何结构的表征编辑——例如要让「日期」特征向前平移半年,应该沿流形的测地线行进,而不是在欧几里得空间中简单加一个向量。这是一个有前景的方向,也与作者呼吁的「流形感知的 SAE」相呼应。但目前这仍停留在概念层面:如何稳健地估计一个高维、带噪声的流形,仍然是一个尚未解决的统计问题——作者在局限部分也坦诚地承认了这一点。<p>第五,一个可能被低估的贡献,是论文对文本嵌入服务的启示。许多从事 RAG、语义检索和推荐系统的从业者,不加思索地把余弦相似度当作「语义接近度」的度量,很少停下来追问这个数值相似度背后究竟潜藏着什么样的几何结构。这篇论文是一个提醒:余弦相似度确实能忠实地反映「沿着概念空间内在几何路径的距离」——但这是一个局部性质,依赖于假说 2 成立,而且不同特征的几何形状截然不同(圆、线段、对数线段)。把它当作跨特征的、普遍的「语义距离」度量,可能会掩盖大量重要的非线性结构(如颜色例子所示,「大距离下的余弦相似度明显偏离等距关系」)。对于调优基于嵌入的检索系统和异常检测管道的工程师来说,这是一个值得牢记的告诫。<p>这篇论文并不试图解释所有表征几何现象,也没有交付一个可以投入生产部署的工具。它只是做了一份「数学家的活」:对于一个被广泛观察却缺乏精确定义的现象,搭建一个最小但严格的理论框架,并诚实地把它拿到数据面前,检验它的边界在哪里。在一个日益依赖「炼金术式」经验观察的领域,这种回归第一性原理、愿意清晰陈述假设、完整写出证明、并坦诚承认自身局限的工作,本身就很值得被更多人看到。<p>如果要我说这篇论文给我留下的最深刻印象,大概就是「年份以对数时间距离编码」这一具体发现。它通过一个极小的例子表明,在向量空间看似平淡的几何背后,或许真的存在着某种接近人类认知直觉的东西:越近的事件越清晰、越可精细区分;遥远的事件则在记忆中被压缩。这或许是机制可解释性研究最迷人的地方:不是证明模型是一块会魔法的黑箱,而是把它内部真正在「思考」的东西,一点一点翻译成我们能够读懂的语言。

2026/8/3
阅读更多

对角线论证:改变数学与计算机的证明方法

<blockquote>RSS readers may not support rendering advanced formatting like math formulas. Click to view the original page: <a href="https://dreams.plus/blog/2026/2026-07-31-the-diagonal-argument-en" target="_blank">https://dreams.plus/blog/2026/2026-07-31-the-diagonal-argument-en</a></blockquote><p>1891 年,德国数学家格奥尔格·康托尔发表了一篇仅几页的论文,证明了一个在当时看来有悖直觉的结论:存在不同「大小」的无穷。他所采用的证明技巧——对角线论证——不仅解决了手头的问题,更在此后一个多世纪里,成为数理逻辑、可计算性理论乃至哲学武器库中最强大的武器之一。<p>从「实数比自然数多」,到图灵证明「停机问题不可判定」,再到哥德尔证明「任何足够强的形式系统都包含不可判定命题」——这些看似主题各异的结论,本质上都是同一个想法的变体。本文将带领读者从集合论最基础的出发点开始,一步步推导对角线论证的完整过程,阐明它为何拥有如此强大的力量,并把抽象的证明转化为可以通过代码执行、观察的具体过程。<h2 id=等势>等势</h2><p>在讨论无穷集之前,必须先澄清一个预备问题:如何比较两个集合的大小?<p>对于有限集,答案很简单:数元素个数即可。但自然数集 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=double-struck>N</mi><mo>=</mo><mo stretchy=false>{</mo><mn>0</mn><mo separator=true>,</mo><mn>1</mn><mo separator=true>,</mo><mn>2</mn><mo separator=true>,</mo><mn>3</mn><mo separator=true>,</mo><mo>…</mo><mtext></mtext><mo stretchy=false>}</mo></mrow><annotation encoding=application/x-tex>\mathbb{N} = \{0, 1, 2, 3, \dots\}</annotation></semantics></math></span> 是无穷的,无法「数到底」;因此我们需要一种新的工具。<p>定义(双射)。给定两个集合 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>A</mi></mrow><annotation encoding=application/x-tex>A</annotation></semantics></math></span> 与 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>B</mi></mrow><annotation encoding=application/x-tex>B</annotation></semantics></math></span>,若存在函数 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo>:</mo><mi>A</mi><mo>→</mo><mi>B</mi></mrow><annotation encoding=application/x-tex>f: A \to B</annotation></semantics></math></span> 满足:<ul><li>单射:<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>a</mi><mn>1</mn></msub><mo mathvariant=normal>≠</mo><msub><mi>a</mi><mn>2</mn></msub><mo>⇒</mo><mi>f</mi><mo stretchy=false>(</mo><msub><mi>a</mi><mn>1</mn></msub><mo stretchy=false>)</mo><mo mathvariant=normal>≠</mo><mi>f</mi><mo stretchy=false>(</mo><msub><mi>a</mi><mn>2</mn></msub><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>a_1 \neq a_2 \Rightarrow f(a_1) \neq f(a_2)</annotation></semantics></math></span>(不同的输入产生不同的输出)<li>满射:对每个 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>b</mi><mo>∈</mo><mi>B</mi></mrow><annotation encoding=application/x-tex>b \in B</annotation></semantics></math></span>,都存在 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>a</mi><mo>∈</mo><mi>A</mi></mrow><annotation encoding=application/x-tex>a \in A</annotation></semantics></math></span> 使得 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo stretchy=false>(</mo><mi>a</mi><mo stretchy=false>)</mo><mo>=</mo><mi>b</mi></mrow><annotation encoding=application/x-tex>f(a) = b</annotation></semantics></math></span>(每个输出都被覆盖)</ul><p>则称 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi></mrow><annotation encoding=application/x-tex>f</annotation></semantics></math></span> 为双射,并称 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>A</mi></mrow><annotation encoding=application/x-tex>A</annotation></semantics></math></span> 与 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>B</mi></mrow><annotation encoding=application/x-tex>B</annotation></semantics></math></span> 等势(记为 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>∣</mi><mi>A</mi><mi mathvariant=normal>∣</mi><mo>=</mo><mi mathvariant=normal>∣</mi><mi>B</mi><mi mathvariant=normal>∣</mi></mrow><annotation encoding=application/x-tex>|A| = |B|</annotation></semantics></math></span>)——即两者「大小相等」。<p>定义(可数集)。若集合 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>A</mi></mrow><annotation encoding=application/x-tex>A</annotation></semantics></math></span> 能与自然数集 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=double-struck>N</mi></mrow><annotation encoding=application/x-tex>\mathbb{N}</annotation></semantics></math></span> 建立双射(或 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>A</mi></mrow><annotation encoding=application/x-tex>A</annotation></semantics></math></span> 为有限集),则称 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>A</mi></mrow><annotation encoding=application/x-tex>A</annotation></semantics></math></span> 为可数集。<p>下面几个例子会揭示,「可数」这个概念远比直觉所认为的更加宽松:<ul><li>偶数集 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo stretchy=false>{</mo><mn>0</mn><mo separator=true>,</mo><mn>2</mn><mo separator=true>,</mo><mn>4</mn><mo separator=true>,</mo><mn>6</mn><mo separator=true>,</mo><mo>…</mo><mtext></mtext><mo stretchy=false>}</mo></mrow><annotation encoding=application/x-tex>\{0, 2, 4, 6, \dots\}</annotation></semantics></math></span> 可数:双射为 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo stretchy=false>(</mo><mi>n</mi><mo stretchy=false>)</mo><mo>=</mo><mn>2</mn><mi>n</mi></mrow><annotation encoding=application/x-tex>f(n) = 2n</annotation></semantics></math></span>。<li>整数集 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=double-struck>Z</mi><mo>=</mo><mo stretchy=false>{</mo><mo>…</mo><mo separator=true>,</mo><mo>−</mo><mn>2</mn><mo separator=true>,</mo><mo>−</mo><mn>1</mn><mo separator=true>,</mo><mn>0</mn><mo separator=true>,</mo><mn>1</mn><mo separator=true>,</mo><mn>2</mn><mo separator=true>,</mo><mo>…</mo><mtext></mtext><mo stretchy=false>}</mo></mrow><annotation encoding=application/x-tex>\mathbb{Z} = \{\dots, -2, -1, 0, 1, 2, \dots\}</annotation></semantics></math></span> 可数:可以用 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo stretchy=false>(</mo><mi>n</mi><mo stretchy=false>)</mo><mo>=</mo><mrow><mo fence=true>{</mo><mtable columnalign="left left" columnspacing=1em rowspacing=0.36em><mtr><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mi>n</mi><mi mathvariant=normal>/</mi><mn>2</mn></mrow></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mi>n</mi><mtext> 为偶数</mtext></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mo>−</mo><mo stretchy=false>(</mo><mi>n</mi><mo>+</mo><mn>1</mn><mo stretchy=false>)</mo><mi mathvariant=normal>/</mi><mn>2</mn></mrow></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mi>n</mi><mtext> 为奇数</mtext></mrow></mstyle></mtd></mtr></mtable></mrow></mrow><annotation encoding=application/x-tex>f(n) = \begin{cases} n/2 & n \text{ 为偶数} \\ -(n+1)/2 & n \text{ 为奇数} \end{cases}</annotation></semantics></math></span> 把 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mn>0</mn><mo separator=true>,</mo><mn>1</mn><mo separator=true>,</mo><mn>2</mn><mo separator=true>,</mo><mn>3</mn><mo separator=true>,</mo><mn>4</mn><mo separator=true>,</mo><mo>…</mo></mrow><annotation encoding=application/x-tex>0,1,2,3,4,\dots</annotation></semantics></math></span> 映射到 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mn>0</mn><mo separator=true>,</mo><mo>−</mo><mn>1</mn><mo separator=true>,</mo><mn>1</mn><mo separator=true>,</mo><mo>−</mo><mn>2</mn><mo separator=true>,</mo><mn>2</mn><mo separator=true>,</mo><mo>…</mo></mrow><annotation encoding=application/x-tex>0,-1,1,-2,2,\dots</annotation></semantics></math></span>。<li>有理数集 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=double-struck>Q</mi></mrow><annotation encoding=application/x-tex>\mathbb{Q}</annotation></semantics></math></span> 同样可数(可以用「对角线枚举法」把所有分数 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>p</mi><mi mathvariant=normal>/</mi><mi>q</mi></mrow><annotation encoding=application/x-tex>p/q</annotation></semantics></math></span> 排成一个序列——这是康托尔的另一个经典成果,与本文讨论的论证共享「对角线」之名,但用法不同;请读者注意不要把两者混淆)。</ul><p>看上去,似乎所有无穷集都能被装进自然数的框架之内——直到我们遇到实数。<h2 id=实数的不可数>实数的不可数</h2><blockquote><p>定理(康托尔,1891)。区间 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo stretchy=false>(</mo><mn>0</mn><mo separator=true>,</mo><mn>1</mn><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>(0,1)</annotation></semantics></math></span> 中的实数是不可数的。</blockquote><p>这意味着:不存在任何方法能把 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo stretchy=false>(</mo><mn>0</mn><mo separator=true>,</mo><mn>1</mn><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>(0,1)</annotation></semantics></math></span> 中的实数与自然数一一对应。换言之,实数的无穷「大于」自然数的无穷。<p>我们采用反证法。<p>假设:<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo stretchy=false>(</mo><mn>0</mn><mo separator=true>,</mo><mn>1</mn><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>(0,1)</annotation></semantics></math></span> 中的实数可数。即存在双射 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo>:</mo><mi mathvariant=double-struck>N</mi><mo>→</mo><mo stretchy=false>(</mo><mn>0</mn><mo separator=true>,</mo><mn>1</mn><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>f: \mathbb{N} \to (0,1)</annotation></semantics></math></span>,使得我们可以把这些实数全部排成一个无穷列表:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mtable columnalign="right left" columnspacing=0em rowspacing=0.25em><mtr><mtd><mstyle displaystyle=true scriptlevel=0><msub><mi>x</mi><mn>1</mn></msub></mstyle></mtd><mtd><mstyle displaystyle=true scriptlevel=0><mrow><mrow></mrow><mo>=</mo><mn>0.</mn><msub><mi>d</mi><mn>11</mn></msub><mtext></mtext><msub><mi>d</mi><mn>12</mn></msub><mtext></mtext><msub><mi>d</mi><mn>13</mn></msub><mtext></mtext><msub><mi>d</mi><mn>14</mn></msub><mo>…</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=true scriptlevel=0><msub><mi>x</mi><mn>2</mn></msub></mstyle></mtd><mtd><mstyle displaystyle=true scriptlevel=0><mrow><mrow></mrow><mo>=</mo><mn>0.</mn><msub><mi>d</mi><mn>21</mn></msub><mtext></mtext><msub><mi>d</mi><mn>22</mn></msub><mtext></mtext><msub><mi>d</mi><mn>23</mn></msub><mtext></mtext><msub><mi>d</mi><mn>24</mn></msub><mo>…</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=true scriptlevel=0><msub><mi>x</mi><mn>3</mn></msub></mstyle></mtd><mtd><mstyle displaystyle=true scriptlevel=0><mrow><mrow></mrow><mo>=</mo><mn>0.</mn><msub><mi>d</mi><mn>31</mn></msub><mtext></mtext><msub><mi>d</mi><mn>32</mn></msub><mtext></mtext><msub><mi>d</mi><mn>33</mn></msub><mtext></mtext><msub><mi>d</mi><mn>34</mn></msub><mo>…</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=true scriptlevel=0><msub><mi>x</mi><mn>4</mn></msub></mstyle></mtd><mtd><mstyle displaystyle=true scriptlevel=0><mrow><mrow></mrow><mo>=</mo><mn>0.</mn><msub><mi>d</mi><mn>41</mn></msub><mtext></mtext><msub><mi>d</mi><mn>42</mn></msub><mtext></mtext><msub><mi>d</mi><mn>43</mn></msub><mtext></mtext><msub><mi>d</mi><mn>44</mn></msub><mo>…</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=true scriptlevel=0><mrow></mrow></mstyle></mtd><mtd><mstyle displaystyle=true scriptlevel=0><mrow><mrow></mrow><mtext></mtext><mrow><mi mathvariant=normal>⋮</mi><mpadded height=0em voffset=0em><mspace height=1.5em mathbackground=black width=0em></mspace></mpadded></mrow></mrow></mstyle></mtd></mtr></mtable><annotation encoding=application/x-tex>\begin{aligned} x_1 &= 0.d_{11}\, d_{12}\, d_{13}\, d_{14} \dots \\ x_2 &= 0.d_{21}\, d_{22}\, d_{23}\, d_{24} \dots \\ x_3 &= 0.d_{31}\, d_{32}\, d_{33}\, d_{34} \dots \\ x_4 &= 0.d_{41}\, d_{42}\, d_{43}\, d_{44} \dots \\ &\ \ \vdots \end{aligned}</annotation></semantics></math></span><p>其中 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>d</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub></mrow><annotation encoding=application/x-tex>d_{ij}</annotation></semantics></math></span> 表示第 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>i</mi></mrow><annotation encoding=application/x-tex>i</annotation></semantics></math></span> 个数的第 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>j</mi></mrow><annotation encoding=application/x-tex>j</annotation></semantics></math></span> 位小数(取值 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mn>0</mn></mrow><annotation encoding=application/x-tex>0</annotation></semantics></math></span> 到 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mn>9</mn></mrow><annotation encoding=application/x-tex>9</annotation></semantics></math></span>)。<p>构造对角数。现在我们沿着「对角线」走——即取出第 1 个数的第 1 位、第 2 个数的第 2 位、第 3 个数的第 3 位,依此类推——并根据以下规则,用这些数字构造一个新数 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>y</mi><mo>=</mo><mn>0.</mn><msub><mi>e</mi><mn>1</mn></msub><msub><mi>e</mi><mn>2</mn></msub><msub><mi>e</mi><mn>3</mn></msub><msub><mi>e</mi><mn>4</mn></msub><mo>…</mo></mrow><annotation encoding=application/x-tex>y = 0.e_1 e_2 e_3 e_4 \dots</annotation></semantics></math></span>:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>e</mi><mi>n</mi></msub><mo>=</mo><mrow><mo fence=true>{</mo><mtable columnalign="left left" columnspacing=1em rowspacing=0.36em><mtr><mtd><mstyle displaystyle=false scriptlevel=0><mn>5</mn></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mtext>若 </mtext><msub><mi>d</mi><mrow><mi>n</mi><mi>n</mi></mrow></msub><mo mathvariant=normal>≠</mo><mn>5</mn></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=false scriptlevel=0><mn>6</mn></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mtext>若 </mtext><msub><mi>d</mi><mrow><mi>n</mi><mi>n</mi></mrow></msub><mo>=</mo><mn>5</mn></mrow></mstyle></mtd></mtr></mtable></mrow></mrow><annotation encoding=application/x-tex>e_n = \begin{cases} 5 & \text{若 } d_{nn} \neq 5 \\ 6 & \text{若 } d_{nn} = 5 \end{cases}</annotation></semantics></math></span><p>(这条规则的唯一目的是保证 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>e</mi><mi>n</mi></msub><mo mathvariant=normal>≠</mo><msub><mi>d</mi><mrow><mi>n</mi><mi>n</mi></mrow></msub></mrow><annotation encoding=application/x-tex>e_n \neq d_{nn}</annotation></semantics></math></span>;具体选哪两个数字无关紧要,只要每位数字刻意「避开」相应的对角线数字,同时避免出现全 0 或全 9 的小数表示——那会在十进制记法中引入歧义。)<p>现在关键问题出现了:<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>y</mi></mrow><annotation encoding=application/x-tex>y</annotation></semantics></math></span> 会出现在原来的列表里吗?<p>假设 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>y</mi></mrow><annotation encoding=application/x-tex>y</annotation></semantics></math></span> 出现在列表中,那么 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>y</mi></mrow><annotation encoding=application/x-tex>y</annotation></semantics></math></span> 必定等于被枚举的某个数,不妨设 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>y</mi><mo>=</mo><msub><mi>x</mi><mi>k</mi></msub></mrow><annotation encoding=application/x-tex>y = x_k</annotation></semantics></math></span>(对某个确定的指标 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>k</mi></mrow><annotation encoding=application/x-tex>k</annotation></semantics></math></span>)。<p>但根据我们的构造规则,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>y</mi></mrow><annotation encoding=application/x-tex>y</annotation></semantics></math></span> 的第 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>k</mi></mrow><annotation encoding=application/x-tex>k</annotation></semantics></math></span> 位小数是 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>e</mi><mi>k</mi></msub></mrow><annotation encoding=application/x-tex>e_k</annotation></semantics></math></span>,而 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>e</mi><mi>k</mi></msub></mrow><annotation encoding=application/x-tex>e_k</annotation></semantics></math></span> 被刻意构造得与 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>d</mi><mrow><mi>k</mi><mi>k</mi></mrow></msub></mrow><annotation encoding=application/x-tex>d_{kk}</annotation></semantics></math></span>(即 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>x</mi><mi>k</mi></msub></mrow><annotation encoding=application/x-tex>x_k</annotation></semantics></math></span> 的第 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>k</mi></mrow><annotation encoding=application/x-tex>k</annotation></semantics></math></span> 位小数)不同:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>e</mi><mi>k</mi></msub><mo mathvariant=normal>≠</mo><msub><mi>d</mi><mrow><mi>k</mi><mi>k</mi></mrow></msub><mtext></mtext><mo>⟹</mo><mtext></mtext><mi>y</mi><mo mathvariant=normal>≠</mo><msub><mi>x</mi><mi>k</mi></msub></mrow><annotation encoding=application/x-tex>e_k \neq d_{kk} \implies y \neq x_k</annotation></semantics></math></span><p>这与 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>y</mi><mo>=</mo><msub><mi>x</mi><mi>k</mi></msub></mrow><annotation encoding=application/x-tex>y = x_k</annotation></semantics></math></span> 的假设矛盾!<p>而且,这一矛盾对每一个 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>k</mi></mrow><annotation encoding=application/x-tex>k</annotation></semantics></math></span> 都成立——<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>y</mi></mrow><annotation encoding=application/x-tex>y</annotation></semantics></math></span> 在第 1 位与第 1 个数不同,在第 2 位与第 2 个数不同,在第 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>n</mi></mrow><annotation encoding=application/x-tex>n</annotation></semantics></math></span> 位与第 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>n</mi></mrow><annotation encoding=application/x-tex>n</annotation></semantics></math></span> 个数不同……因此 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>y</mi></mrow><annotation encoding=application/x-tex>y</annotation></semantics></math></span> 与列表中的每一个数都不同。<p>然而 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>y</mi></mrow><annotation encoding=application/x-tex>y</annotation></semantics></math></span> 无疑是 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo stretchy=false>(</mo><mn>0</mn><mo separator=true>,</mo><mn>1</mn><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>(0,1)</annotation></semantics></math></span> 中的实数(它的每一位都是合法的十进制数字)。<p>结论:无论你如何构造这份「实数大全列表」,总能构造出一个逃脱列表的实数 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>y</mi></mrow><annotation encoding=application/x-tex>y</annotation></semantics></math></span>。这就说明最初的假设——存在双射 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo>:</mo><mi mathvariant=double-struck>N</mi><mo>→</mo><mo stretchy=false>(</mo><mn>0</mn><mo separator=true>,</mo><mn>1</mn><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>f: \mathbb{N} \to (0,1)</annotation></semantics></math></span>——是假的。<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo stretchy=false>(</mo><mn>0</mn><mo separator=true>,</mo><mn>1</mn><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>(0,1)</annotation></semantics></math></span> 中的实数不可数。<p>为什么叫「对角线」?这个名称源于证明中选取数字 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>d</mi><mn>11</mn></msub><mo separator=true>,</mo><msub><mi>d</mi><mn>22</mn></msub><mo separator=true>,</mo><msub><mi>d</mi><mn>33</mn></msub><mo separator=true>,</mo><mo>…</mo></mrow><annotation encoding=application/x-tex>d_{11}, d_{22}, d_{33}, \dots</annotation></semantics></math></span> 的方式——若把所有 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>x</mi><mi>i</mi></msub></mrow><annotation encoding=application/x-tex>x_i</annotation></semantics></math></span> 纵向排成无穷矩阵,这些位置恰好构成矩阵的主对角线:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo fence=true>(</mo><mtable columnalign="center center center center" columnspacing=1em rowspacing=0.16em><mtr><mtd><mstyle displaystyle=false scriptlevel=0><menclose notation=box><mstyle displaystyle=false scriptlevel=0><mstyle displaystyle=false scriptlevel=0><mstyle displaystyle=true scriptlevel=0><msub><mi>d</mi><mn>11</mn></msub></mstyle></mstyle></mstyle></menclose></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><msub><mi>d</mi><mn>12</mn></msub></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><msub><mi>d</mi><mn>13</mn></msub></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mo lspace=0em rspace=0em>⋯</mo></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=false scriptlevel=0><msub><mi>d</mi><mn>21</mn></msub></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><menclose notation=box><mstyle displaystyle=false scriptlevel=0><mstyle displaystyle=false scriptlevel=0><mstyle displaystyle=true scriptlevel=0><msub><mi>d</mi><mn>22</mn></msub></mstyle></mstyle></mstyle></menclose></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><msub><mi>d</mi><mn>23</mn></msub></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mo lspace=0em rspace=0em>⋯</mo></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=false scriptlevel=0><msub><mi>d</mi><mn>31</mn></msub></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><msub><mi>d</mi><mn>32</mn></msub></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><menclose notation=box><mstyle displaystyle=false scriptlevel=0><mstyle displaystyle=false scriptlevel=0><mstyle displaystyle=true scriptlevel=0><msub><mi>d</mi><mn>33</mn></msub></mstyle></mstyle></mstyle></menclose></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mo lspace=0em rspace=0em>⋯</mo></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mi mathvariant=normal>⋮</mi><mpadded height=0em voffset=0em><mspace height=1.5em mathbackground=black width=0em></mspace></mpadded></mrow></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mi mathvariant=normal>⋮</mi><mpadded height=0em voffset=0em><mspace height=1.5em mathbackground=black width=0em></mspace></mpadded></mrow></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mi mathvariant=normal>⋮</mi><mpadded height=0em voffset=0em><mspace height=1.5em mathbackground=black width=0em></mspace></mpadded></mrow></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mo lspace=0em rspace=0em>⋱</mo></mstyle></mtd></mtr></mtable><mo fence=true>)</mo></mrow><annotation encoding=application/x-tex>\begin{pmatrix} \boxed{d_{11}} & d_{12} & d_{13} & \cdots \\ d_{21} & \boxed{d_{22}} & d_{23} & \cdots \\ d_{31} & d_{32} & \boxed{d_{33}} & \cdots \\ \vdots & \vdots & \vdots & \ddots \end{pmatrix}</annotation></semantics></math></span><p>我们「翻转」对角线上的每一位数字,构造出一个必然逃脱整个列表的新元素。<h2 id=构造逃逸者>构造逃逸者</h2><p>仅凭公式可能仍有几分抽象;让我们通过代码把这一过程具体化。下面的程序取十个「实数」作为示例列表,真正执行一次对角线构造,让读者清楚地看到新数如何「避开」原来的每一个数。<pre><code class="hljs language-python"><span class=hljs-keyword>def</span><span class="hljs-title function_">diagonal_construct</span>(<span class=hljs-params>number_list, digits=<span class=hljs-number>10</span></span>): <span class=hljs-string>""" number_list:字符串列表,每个形如 "0.d1d2d3..." 返回:通过对角线方法构造出的新数字字符串 """</span> new_digits = [] <span class=hljs-keyword>for</span> i, num_str <span class=hljs-keyword>in</span><span class=hljs-built_in>enumerate</span>(number_list): decimal_part = num_str.split(<span class=hljs-string>'.'</span>)[<span class=hljs-number>1</span>].ljust(digits, <span class=hljs-string>'0'</span>) d = <span class=hljs-built_in>int</span>(decimal_part[i]) <span class=hljs-comment># 第 i 个数的第 i 位(对角线数字)</span> new_d = (d + <span class=hljs-number>5</span>) % <span class=hljs-number>10</span><span class=hljs-comment># 规则:使新数字与原数字不同</span> new_digits.append(<span class=hljs-built_in>str</span>(new_d)) <span class=hljs-keyword>return</span><span class=hljs-string>"0."</span> + <span class=hljs-string>""</span>.join(new_digits) sample_list = [ <span class=hljs-string>"0.1234567890"</span>, <span class=hljs-string>"0.9876543210"</span>, <span class=hljs-string>"0.5555555555"</span>, <span class=hljs-string>"0.1111111111"</span>, <span class=hljs-string>"0.3141592653"</span>, <span class=hljs-string>"0.2718281828"</span>, <span class=hljs-string>"0.0000000001"</span>, <span class=hljs-string>"0.9999999998"</span>, <span class=hljs-string>"0.4242424242"</span>, <span class=hljs-string>"0.6180339887"</span>, ] new_number = diagonal_construct(sample_list) <span class=hljs-built_in>print</span>(<span class=hljs-string>"对角线构造出的新数:"</span>, new_number) </code></pre><p>输出:<pre><code class="hljs language-graphql">原始列表: 第 <span class=hljs-number>1</span> 个:<span class=hljs-number>0.1234567890</span> (第 <span class=hljs-number>1</span> 位对角线数字:<span class=hljs-number>1</span>) 第 <span class=hljs-number>2</span> 个:<span class=hljs-number>0.9876543210</span> (第 <span class=hljs-number>2</span> 位对角线数字:<span class=hljs-number>8</span>) 第 <span class=hljs-number>3</span> 个:<span class=hljs-number>0.5555555555</span> (第 <span class=hljs-number>3</span> 位对角线数字:<span class=hljs-number>5</span>) 第 <span class=hljs-number>4</span> 个:<span class=hljs-number>0.1111111111</span> (第 <span class=hljs-number>4</span> 位对角线数字:<span class=hljs-number>1</span>) 第 <span class=hljs-number>5</span> 个:<span class=hljs-number>0.3141592653</span> (第 <span class=hljs-number>5</span> 位对角线数字:<span class=hljs-number>5</span>) 第 <span class=hljs-number>6</span> 个:<span class=hljs-number>0.2718281828</span> (第 <span class=hljs-number>6</span> 位对角线数字:<span class=hljs-number>8</span>) 第 <span class=hljs-number>7</span> 个:<span class=hljs-number>0.0000000001</span> (第 <span class=hljs-number>7</span> 位对角线数字:<span class=hljs-number>0</span>) 第 <span class=hljs-number>8</span> 个:<span class=hljs-number>0.9999999998</span> (第 <span class=hljs-number>8</span> 位对角线数字:<span class=hljs-number>9</span>) 第 <span class=hljs-number>9</span> 个:<span class=hljs-number>0.4242424242</span> (第 <span class=hljs-number>9</span> 位对角线数字:<span class=hljs-number>4</span>) 第 <span class=hljs-number>10</span> 个:<span class=hljs-number>0.6180339887</span> (第 <span class=hljs-number>10</span> 位对角线数字:<span class=hljs-number>7</span>) 对角线构造出的新数:<span class=hljs-number>0.6306035492</span> 验证新数与列表中每个数都不同: 与第 <span class=hljs-number>1</span> 个在第 <span class=hljs-number>1</span> 位不同:原数<span class=hljs-punctuation>=</span><span class=hljs-number>1</span>,新数<span class=hljs-punctuation>=</span><span class=hljs-number>6</span>,不同<span class=hljs-punctuation>=</span><span class=hljs-literal>True</span> 与第 <span class=hljs-number>2</span> 个在第 <span class=hljs-number>2</span> 位不同:原数<span class=hljs-punctuation>=</span><span class=hljs-number>8</span>,新数<span class=hljs-punctuation>=</span><span class=hljs-number>3</span>,不同<span class=hljs-punctuation>=</span><span class=hljs-literal>True</span> 与第 <span class=hljs-number>3</span> 个在第 <span class=hljs-number>3</span> 位不同:原数<span class=hljs-punctuation>=</span><span class=hljs-number>5</span>,新数<span class=hljs-punctuation>=</span><span class=hljs-number>0</span>,不同<span class=hljs-punctuation>=</span><span class=hljs-literal>True</span> 与第 <span class=hljs-number>4</span> 个在第 <span class=hljs-number>4</span> 位不同:原数<span class=hljs-punctuation>=</span><span class=hljs-number>1</span>,新数<span class=hljs-punctuation>=</span><span class=hljs-number>6</span>,不同<span class=hljs-punctuation>=</span><span class=hljs-literal>True</span> 与第 <span class=hljs-number>5</span> 个在第 <span class=hljs-number>5</span> 位不同:原数<span class=hljs-punctuation>=</span><span class=hljs-number>5</span>,新数<span class=hljs-punctuation>=</span><span class=hljs-number>0</span>,不同<span class=hljs-punctuation>=</span><span class=hljs-literal>True</span> 与第 <span class=hljs-number>6</span> 个在第 <span class=hljs-number>6</span> 位不同:原数<span class=hljs-punctuation>=</span><span class=hljs-number>8</span>,新数<span class=hljs-punctuation>=</span><span class=hljs-number>3</span>,不同<span class=hljs-punctuation>=</span><span class=hljs-literal>True</span> 与第 <span class=hljs-number>7</span> 个在第 <span class=hljs-number>7</span> 位不同:原数<span class=hljs-punctuation>=</span><span class=hljs-number>0</span>,新数<span class=hljs-punctuation>=</span><span class=hljs-number>5</span>,不同<span class=hljs-punctuation>=</span><span class=hljs-literal>True</span> 与第 <span class=hljs-number>8</span> 个在第 <span class=hljs-number>8</span> 位不同:原数<span class=hljs-punctuation>=</span><span class=hljs-number>9</span>,新数<span class=hljs-punctuation>=</span><span class=hljs-number>4</span>,不同<span class=hljs-punctuation>=</span><span class=hljs-literal>True</span> 与第 <span class=hljs-number>9</span> 个在第 <span class=hljs-number>9</span> 位不同:原数<span class=hljs-punctuation>=</span><span class=hljs-number>4</span>,新数<span class=hljs-punctuation>=</span><span class=hljs-number>9</span>,不同<span class=hljs-punctuation>=</span><span class=hljs-literal>True</span> 与第 <span class=hljs-number>10</span> 个在第 <span class=hljs-number>10</span> 位不同:原数<span class=hljs-punctuation>=</span><span class=hljs-number>7</span>,新数<span class=hljs-punctuation>=</span><span class=hljs-number>2</span>,不同<span class=hljs-punctuation>=</span><span class=hljs-literal>True</span></code></pre><p>可以清楚地看到,新构造的数 <code>0.6306035492</code> 恰好在相应的位置上与列表中的每一个数都不同。当然,这里演示的只是十个数的有限情形(真正的无穷列表毕竟无法存入计算机),但这恰恰是证明核心逻辑步骤——对任意 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>k</mi></mrow><annotation encoding=application/x-tex>k</annotation></semantics></math></span>,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>y</mi><mo mathvariant=normal>≠</mo><msub><mi>x</mi><mi>k</mi></msub></mrow><annotation encoding=application/x-tex>y \neq x_k</annotation></semantics></math></span>——的直观实例化。无论列表多长,这条构造规则都能保证新数逃脱每一个条目。<h2 id=康托尔定理>康托尔定理</h2><p>对角线论证不仅能证明实数不可数;它还有一个更一般、更强大的表述:康托尔定理。<blockquote><p>康托尔定理。对任意集合 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>A</mi></mrow><annotation encoding=application/x-tex>A</annotation></semantics></math></span>,其幂集 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=script>P</mi><mo stretchy=false>(</mo><mi>A</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>\mathcal{P}(A)</annotation></semantics></math></span>(即 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>A</mi></mrow><annotation encoding=application/x-tex>A</annotation></semantics></math></span> 的所有子集构成的集合)的势严格大于 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>A</mi></mrow><annotation encoding=application/x-tex>A</annotation></semantics></math></span> 本身,即 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>∣</mi><mi>A</mi><mi mathvariant=normal>∣</mi><mo>&lt;</mo><mi mathvariant=normal>∣</mi><mi mathvariant=script>P</mi><mo stretchy=false>(</mo><mi>A</mi><mo stretchy=false>)</mo><mi mathvariant=normal>∣</mi></mrow><annotation encoding=application/x-tex>|A| &lt; |\mathcal{P}(A)|</annotation></semantics></math></span>。</blockquote><p>需要指出,该定理对有限集和无穷集都成立,而对无穷集尤其揭示出一个惊人的事实:不存在「最大的无穷」。无论 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>A</mi></mrow><annotation encoding=application/x-tex>A</annotation></semantics></math></span> 多大,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=script>P</mi><mo stretchy=false>(</mo><mi>A</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>\mathcal{P}(A)</annotation></semantics></math></span> 总更大;你可以无限地迭代幂集运算,得到一级级不断攀升的无穷层级。<h3 id=证明>证明</h3><p>假设存在一个满射 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo>:</mo><mi>A</mi><mo>→</mo><mi mathvariant=script>P</mi><mo stretchy=false>(</mo><mi>A</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>f: A \to \mathcal{P}(A)</annotation></semantics></math></span>(我们将证明这样的满射不存在,由此得到 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>∣</mi><mi>A</mi><mi mathvariant=normal>∣</mi><mo>&lt;</mo><mi mathvariant=normal>∣</mi><mi mathvariant=script>P</mi><mo stretchy=false>(</mo><mi>A</mi><mo stretchy=false>)</mo><mi mathvariant=normal>∣</mi></mrow><annotation encoding=application/x-tex>|A| &lt; |\mathcal{P}(A)|</annotation></semantics></math></span>)。<p>对每个元素 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>a</mi><mo>∈</mo><mi>A</mi></mrow><annotation encoding=application/x-tex>a \in A</annotation></semantics></math></span>,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo stretchy=false>(</mo><mi>a</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>f(a)</annotation></semantics></math></span> 都是 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>A</mi></mrow><annotation encoding=application/x-tex>A</annotation></semantics></math></span> 的一个子集。现在构造一个特殊的子集:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi><mo>=</mo><mo stretchy=false>{</mo><mtext></mtext><mi>a</mi><mo>∈</mo><mi>A</mi><mo>:</mo><mi>a</mi><mo mathvariant=normal>∉</mo><mi>f</mi><mo stretchy=false>(</mo><mi>a</mi><mo stretchy=false>)</mo><mtext></mtext><mo stretchy=false>}</mo></mrow><annotation encoding=application/x-tex>D = \{\, a \in A : a \notin f(a) \,\}</annotation></semantics></math></span><p>这就是「对角集」——它收集所有「不属于自己被映射到的那个子集」的元素。<p>由于 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi></mrow><annotation encoding=application/x-tex>f</annotation></semantics></math></span> 是满射,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi></mrow><annotation encoding=application/x-tex>D</annotation></semantics></math></span>(作为 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>A</mi></mrow><annotation encoding=application/x-tex>A</annotation></semantics></math></span> 的子集,因而是 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=script>P</mi><mo stretchy=false>(</mo><mi>A</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>\mathcal{P}(A)</annotation></semantics></math></span> 的元素)必有原像;即存在某个 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>d</mi><mo>∈</mo><mi>A</mi></mrow><annotation encoding=application/x-tex>d \in A</annotation></semantics></math></span> 使得 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo stretchy=false>(</mo><mi>d</mi><mo stretchy=false>)</mo><mo>=</mo><mi>D</mi></mrow><annotation encoding=application/x-tex>f(d) = D</annotation></semantics></math></span>。<p>现在问:<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>d</mi><mo>∈</mo><mi>D</mi></mrow><annotation encoding=application/x-tex>d \in D</annotation></semantics></math></span> 吗?<ul><li>若 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>d</mi><mo>∈</mo><mi>D</mi></mrow><annotation encoding=application/x-tex>d \in D</annotation></semantics></math></span>:根据 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi></mrow><annotation encoding=application/x-tex>D</annotation></semantics></math></span> 的定义,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>d</mi><mo>∈</mo><mi>D</mi><mtext></mtext><mo>⟺</mo><mtext></mtext><mi>d</mi><mo mathvariant=normal>∉</mo><mi>f</mi><mo stretchy=false>(</mo><mi>d</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>d \in D \iff d \notin f(d)</annotation></semantics></math></span>。由于 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo stretchy=false>(</mo><mi>d</mi><mo stretchy=false>)</mo><mo>=</mo><mi>D</mi></mrow><annotation encoding=application/x-tex>f(d) = D</annotation></semantics></math></span>,就有 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>d</mi><mo>∈</mo><mi>D</mi><mtext></mtext><mo>⟺</mo><mtext></mtext><mi>d</mi><mo mathvariant=normal>∉</mo><mi>D</mi></mrow><annotation encoding=application/x-tex>d \in D \iff d \notin D</annotation></semantics></math></span>。矛盾!<li>若 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>d</mi><mo mathvariant=normal>∉</mo><mi>D</mi></mrow><annotation encoding=application/x-tex>d \notin D</annotation></semantics></math></span>:同理,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>d</mi><mo mathvariant=normal>∉</mo><mi>D</mi><mtext></mtext><mo>⟺</mo><mtext></mtext><mi mathvariant=normal>¬</mi><mo stretchy=false>(</mo><mi>d</mi><mo mathvariant=normal>∉</mo><mi>f</mi><mo stretchy=false>(</mo><mi>d</mi><mo stretchy=false>)</mo><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>d \notin D \iff \neg(d \notin f(d))</annotation></semantics></math></span>,即 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>d</mi><mo>∈</mo><mi>f</mi><mo stretchy=false>(</mo><mi>d</mi><mo stretchy=false>)</mo><mo>=</mo><mi>D</mi></mrow><annotation encoding=application/x-tex>d \in f(d) = D</annotation></semantics></math></span>,从而 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>d</mi><mo>∈</mo><mi>D</mi></mrow><annotation encoding=application/x-tex>d \in D</annotation></semantics></math></span>。矛盾!</ul><p>两种情况都导致自相矛盾,说明「存在满射 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo>:</mo><mi>A</mi><mo>→</mo><mi mathvariant=script>P</mi><mo stretchy=false>(</mo><mi>A</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>f: A \to \mathcal{P}(A)</annotation></semantics></math></span>」这一假设站不住脚。因此 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>∣</mi><mi>A</mi><mi mathvariant=normal>∣</mi><mo>&lt;</mo><mi mathvariant=normal>∣</mi><mi mathvariant=script>P</mi><mo stretchy=false>(</mo><mi>A</mi><mo stretchy=false>)</mo><mi mathvariant=normal>∣</mi></mrow><annotation encoding=application/x-tex>|A| &lt; |\mathcal{P}(A)|</annotation></semantics></math></span>。<p>细心的读者可能已经发现,这个证明的结构与上面的不可数证明完全相同:<table><thead><tr><th>实数的不可数性<th>康托尔定理<tbody><tr><td>假设双射 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo>:</mo><mi mathvariant=double-struck>N</mi><mo>→</mo><mo stretchy=false>(</mo><mn>0</mn><mo separator=true>,</mo><mn>1</mn><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>f: \mathbb{N} \to (0,1)</annotation></semantics></math></span><td>假设满射 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi><mo>:</mo><mi>A</mi><mo>→</mo><mi mathvariant=script>P</mi><mo stretchy=false>(</mo><mi>A</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>f: A \to \mathcal{P}(A)</annotation></semantics></math></span><tr><td>构造对角数 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>y</mi></mrow><annotation encoding=application/x-tex>y</annotation></semantics></math></span>,每一位都与 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>x</mi><mi>n</mi></msub></mrow><annotation encoding=application/x-tex>x_n</annotation></semantics></math></span> 的第 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>n</mi></mrow><annotation encoding=application/x-tex>n</annotation></semantics></math></span> 位不同<td>构造对角集 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi><mo>=</mo><mo stretchy=false>{</mo><mi>a</mi><mo>:</mo><mi>a</mi><mo mathvariant=normal>∉</mo><mi>f</mi><mo stretchy=false>(</mo><mi>a</mi><mo stretchy=false>)</mo><mo stretchy=false>}</mo></mrow><annotation encoding=application/x-tex>D = \{a : a \notin f(a)\}</annotation></semantics></math></span><tr><td>对所有 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>n</mi></mrow><annotation encoding=application/x-tex>n</annotation></semantics></math></span> 有 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>y</mi><mo mathvariant=normal>≠</mo><msub><mi>x</mi><mi>n</mi></msub></mrow><annotation encoding=application/x-tex>y \neq x_n</annotation></semantics></math></span><td>对所有 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>a</mi></mrow><annotation encoding=application/x-tex>a</annotation></semantics></math></span> 有 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi><mo mathvariant=normal>≠</mo><mi>f</mi><mo stretchy=false>(</mo><mi>a</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>D \neq f(a)</annotation></semantics></math></span><tr><td><span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>y</mi></mrow><annotation encoding=application/x-tex>y</annotation></semantics></math></span> 无法被列表覆盖;矛盾<td><span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi></mrow><annotation encoding=application/x-tex>D</annotation></semantics></math></span> 无法被映射覆盖;矛盾</table><p>事实上,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo stretchy=false>(</mo><mn>0</mn><mo separator=true>,</mo><mn>1</mn><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>(0,1)</annotation></semantics></math></span> 中的实数可以与 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo stretchy=false>{</mo><mn>0</mn><mo separator=true>,</mo><mn>1</mn><msup><mo stretchy=false>}</mo><mi mathvariant=double-struck>N</mi></msup></mrow><annotation encoding=application/x-tex>\{0,1\}^{\mathbb{N}}</annotation></semantics></math></span>(由 0 和 1 组成的无穷二进制序列集)近似对应,而 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo stretchy=false>{</mo><mn>0</mn><mo separator=true>,</mo><mn>1</mn><msup><mo stretchy=false>}</mo><mi mathvariant=double-struck>N</mi></msup></mrow><annotation encoding=application/x-tex>\{0,1\}^{\mathbb{N}}</annotation></semantics></math></span> 本质上就是 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=script>P</mi><mo stretchy=false>(</mo><mi mathvariant=double-struck>N</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>\mathcal{P}(\mathbb{N})</annotation></semantics></math></span>(每个子集对应一个 0/1 序列,标明某个位置是否属于该子集)。因此,「实数不可数」实际上是康托尔定理在 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>A</mi><mo>=</mo><mi mathvariant=double-struck>N</mi></mrow><annotation encoding=application/x-tex>A = \mathbb{N}</annotation></semantics></math></span> 这一特例下的具体体现。<p>虽然我们无法在计算机中表示无穷集,但可以用有限集验证证明的逻辑骨架:<pre><code class="hljs language-python"><span class=hljs-keyword>def</span><span class="hljs-title function_">cantor_diagonal_demo</span>(<span class=hljs-params>A</span>): <span class=hljs-comment># 构造一个「任意」的映射 f: A -> P(A) 用于演示</span> f = {} <span class=hljs-keyword>for</span> i <span class=hljs-keyword>in</span> A: f[i] = <span class=hljs-built_in>frozenset</span>(j <span class=hljs-keyword>for</span> j <span class=hljs-keyword>in</span> A <span class=hljs-keyword>if</span> (i + j) % <span class=hljs-number>2</span> == <span class=hljs-number>0</span>) <span class=hljs-built_in>print</span>(<span class=hljs-string>"集合 A ="</span>, <span class=hljs-built_in>set</span>(A)) <span class=hljs-keyword>for</span> i <span class=hljs-keyword>in</span> A: <span class=hljs-built_in>print</span>(<span class=hljs-string>f" f(<span class=hljs-subst>{i}</span>) = <span class=hljs-subst>{<span class=hljs-built_in>set</span>(f[i])}</span>"</span>) <span class=hljs-comment># 对角线构造:D = { i in A : i not in f(i) }</span> D = <span class=hljs-built_in>frozenset</span>(i <span class=hljs-keyword>for</span> i <span class=hljs-keyword>in</span> A <span class=hljs-keyword>if</span> i <span class=hljs-keyword>not</span><span class=hljs-keyword>in</span> f[i]) <span class=hljs-built_in>print</span>(<span class=hljs-string>f"对角线构造出的集合 D = <span class=hljs-subst>{<span class=hljs-built_in>set</span>(D)}</span>"</span>) matches = [i <span class=hljs-keyword>for</span> i <span class=hljs-keyword>in</span> A <span class=hljs-keyword>if</span> f[i] == D] <span class=hljs-built_in>print</span>(<span class=hljs-string>f"是否存在 i 使得 f(i) = D? -> <span class=hljs-subst>{matches <span class=hljs-keyword>if</span> matches <span class=hljs-keyword>else</span><span class=hljs-string>'不存在(矛盾已建立)'</span>}</span>"</span>) cantor_diagonal_demo([<span class=hljs-number>0</span>, <span class=hljs-number>1</span>, <span class=hljs-number>2</span>, <span class=hljs-number>3</span>]) </code></pre><p>输出:<pre><code class="hljs language-scss">集合 <span class=hljs-selector-tag>A</span> = {<span class=hljs-number>0</span>, <span class=hljs-number>1</span>, <span class=hljs-number>2</span>, <span class=hljs-number>3</span>} 假定的映射 f: A -> <span class=hljs-built_in>P</span>(A): <span class=hljs-built_in>f</span>(<span class=hljs-number>0</span>) = {<span class=hljs-number>0</span>, <span class=hljs-number>2</span>} <span class=hljs-built_in>f</span>(<span class=hljs-number>1</span>) = {<span class=hljs-number>1</span>, <span class=hljs-number>3</span>} <span class=hljs-built_in>f</span>(<span class=hljs-number>2</span>) = {<span class=hljs-number>0</span>, <span class=hljs-number>2</span>} <span class=hljs-built_in>f</span>(<span class=hljs-number>3</span>) = {<span class=hljs-number>1</span>, <span class=hljs-number>3</span>} 对角线构造出的集合 D = { <span class=hljs-selector-tag>i</span> : i ∉ <span class=hljs-built_in>f</span>(i) } = <span class=hljs-built_in>set</span>() 是否存在 <span class=hljs-selector-tag>i</span> 使得 <span class=hljs-built_in>f</span>(i) = D? -> 不存在(矛盾已建立) 逐一验证 <span class=hljs-built_in>f</span>(i) ≠ D: <span class=hljs-selector-tag>i</span>=<span class=hljs-number>0</span>:<span class=hljs-selector-tag>i</span>∉D 但 <span class=hljs-selector-tag>i</span>∈<span class=hljs-built_in>f</span>(<span class=hljs-number>0</span>),故 D ≠ <span class=hljs-built_in>f</span>(<span class=hljs-number>0</span>) <span class=hljs-selector-tag>i</span>=<span class=hljs-number>1</span>:<span class=hljs-selector-tag>i</span>∉D 但 <span class=hljs-selector-tag>i</span>∈<span class=hljs-built_in>f</span>(<span class=hljs-number>1</span>),故 D ≠ <span class=hljs-built_in>f</span>(<span class=hljs-number>1</span>) <span class=hljs-selector-tag>i</span>=<span class=hljs-number>2</span>:<span class=hljs-selector-tag>i</span>∉D 但 <span class=hljs-selector-tag>i</span>∈<span class=hljs-built_in>f</span>(<span class=hljs-number>2</span>),故 D ≠ <span class=hljs-built_in>f</span>(<span class=hljs-number>2</span>) <span class=hljs-selector-tag>i</span>=<span class=hljs-number>3</span>:<span class=hljs-selector-tag>i</span>∉D 但 <span class=hljs-selector-tag>i</span>∈<span class=hljs-built_in>f</span>(<span class=hljs-number>3</span>),故 D ≠ <span class=hljs-built_in>f</span>(<span class=hljs-number>3</span>) </code></pre><p>这里构造出的 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi></mrow><annotation encoding=application/x-tex>D</annotation></semantics></math></span> 恰好是空集,而这个特定的映射 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi></mrow><annotation encoding=application/x-tex>f</annotation></semantics></math></span> 恰好没有把任何元素映射到空集——这是对角线论证「刻意构造逃逸者」这一核心思想的直接体现。当然,这只是一个具体的映射示例;真正的证明是对每一种可能的映射 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>f</mi></mrow><annotation encoding=application/x-tex>f</annotation></semantics></math></span> 都成立的普适论证。<h2 id=停机问题>停机问题</h2><p>对角线论证最令人惊叹的应用之一,出现在阿兰·图灵 1936 年对停机问题不可判定性的证明中。这一结果直接奠定了整个可计算性理论领域的基础。<p>停机问题。给定一个程序 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>P</mi></mrow><annotation encoding=application/x-tex>P</annotation></semantics></math></span> 和一个输入 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>x</mi></mrow><annotation encoding=application/x-tex>x</annotation></semantics></math></span>,是否存在一个通用算法,能够判断 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>P</mi></mrow><annotation encoding=application/x-tex>P</annotation></semantics></math></span> 在输入 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>x</mi></mrow><annotation encoding=application/x-tex>x</annotation></semantics></math></span> 上运行时,究竟会停机(并返回结果)还是永不停机(陷入死循环)?<p>图灵证明:这样的通用算法不存在(这是对角线论证的一个变体)。<p>假设存在这样一个「通用停机判定器」,我们把它形式化为一个函数:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mtext>halts</mtext><mo stretchy=false>(</mo><mi>P</mi><mo separator=true>,</mo><mi>x</mi><mo stretchy=false>)</mo><mo>=</mo><mrow><mo fence=true>{</mo><mtable columnalign="left left" columnspacing=1em rowspacing=0.36em><mtr><mtd><mstyle displaystyle=false scriptlevel=0><mtext>真</mtext></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mtext>若 </mtext><mi>P</mi><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mtext> 停机</mtext></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=false scriptlevel=0><mtext>假</mtext></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mtext>若 </mtext><mi>P</mi><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mtext> 不停机</mtext></mrow></mstyle></mtd></mtr></mtable></mrow></mrow><annotation encoding=application/x-tex>\text{halts}(P, x) = \begin{cases} \text{真} & \text{若 } P(x) \text{ 停机} \\ \text{假} & \text{若 } P(x) \text{ 不停机} \end{cases}</annotation></semantics></math></span><p>这个函数本身必须在有限时间内总是给出正确回答(这就是「通用」的含义)。<p>构造一个对角线程序 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi></mrow><annotation encoding=application/x-tex>D</annotation></semantics></math></span>,其行为定义如下:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi><mo stretchy=false>(</mo><mi>P</mi><mo stretchy=false>)</mo><mo>=</mo><mrow><mo fence=true>{</mo><mtable columnalign="left left" columnspacing=1em rowspacing=0.36em><mtr><mtd><mstyle displaystyle=false scriptlevel=0><mtext>死循环</mtext></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mtext>若 halts</mtext><mo stretchy=false>(</mo><mi>P</mi><mo separator=true>,</mo><mi>P</mi><mo stretchy=false>)</mo><mo>=</mo><mtext>真</mtext></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=false scriptlevel=0><mtext>立即停机</mtext></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mtext>若 halts</mtext><mo stretchy=false>(</mo><mi>P</mi><mo separator=true>,</mo><mi>P</mi><mo stretchy=false>)</mo><mo>=</mo><mtext>假</mtext></mrow></mstyle></mtd></mtr></mtable></mrow></mrow><annotation encoding=application/x-tex>D(P) = \begin{cases} \text{死循环} & \text{若 } \text{halts}(P, P) = \text{真} \\ \text{立即停机} & \text{若 } \text{halts}(P, P) = \text{假} \end{cases}</annotation></semantics></math></span><p>请注意这里的要害操作:把程序本身作为自己的输入喂给自己(<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mtext>halts</mtext><mo stretchy=false>(</mo><mi>P</mi><mo separator=true>,</mo><mi>P</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>\text{halts}(P, P)</annotation></semantics></math></span>)。这正是对角线论证中「取第 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>n</mi></mrow><annotation encoding=application/x-tex>n</annotation></semantics></math></span> 个数的第 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>n</mi></mrow><annotation encoding=application/x-tex>n</annotation></semantics></math></span> 位」的直接类比——让一个程序「审视」自身的自指动作。<p>导出矛盾。现在考察具体的执行 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi><mo stretchy=false>(</mo><mi>D</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>D(D)</annotation></semantics></math></span>。<ul><li>若 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mtext>halts</mtext><mo stretchy=false>(</mo><mi>D</mi><mo separator=true>,</mo><mi>D</mi><mo stretchy=false>)</mo><mo>=</mo><mtext>真</mtext></mrow><annotation encoding=application/x-tex>\text{halts}(D, D) = \text{真}</annotation></semantics></math></span>(即判定「<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi><mo stretchy=false>(</mo><mi>D</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>D(D)</annotation></semantics></math></span> 停机」),那么根据 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi></mrow><annotation encoding=application/x-tex>D</annotation></semantics></math></span> 的定义,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi><mo stretchy=false>(</mo><mi>D</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>D(D)</annotation></semantics></math></span> 应该死循环。这与「它停机」矛盾。<li>若 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mtext>halts</mtext><mo stretchy=false>(</mo><mi>D</mi><mo separator=true>,</mo><mi>D</mi><mo stretchy=false>)</mo><mo>=</mo><mtext>假</mtext></mrow><annotation encoding=application/x-tex>\text{halts}(D, D) = \text{假}</annotation></semantics></math></span>(即判定「<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi><mo stretchy=false>(</mo><mi>D</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>D(D)</annotation></semantics></math></span> 不停机」),那么根据 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi></mrow><annotation encoding=application/x-tex>D</annotation></semantics></math></span> 的定义,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi><mo stretchy=false>(</mo><mi>D</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>D(D)</annotation></semantics></math></span> 应该立即停机。这与「它不停机」矛盾。</ul><p>两种情况都导致自相矛盾。因此,「存在通用停机判定器 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mtext>halts</mtext></mrow><annotation encoding=application/x-tex>\text{halts}</annotation></semantics></math></span>」的假设是假的。停机问题不可判定。<p>若按某种规则把所有程序枚举出来(<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>P</mi><mn>1</mn></msub><mo separator=true>,</mo><msub><mi>P</mi><mn>2</mn></msub><mo separator=true>,</mo><msub><mi>P</mi><mn>3</mn></msub><mo separator=true>,</mo><mo>…</mo></mrow><annotation encoding=application/x-tex>P_1, P_2, P_3, \dots</annotation></semantics></math></span>——这是可行的,因为程序本质上就是有限长的字符串),并想象一张无穷表格:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo fence=true>(</mo><mtable columnalign="center center center" columnspacing=1em rowspacing=0.16em><mtr><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mtext>halts</mtext><mo stretchy=false>(</mo><msub><mi>P</mi><mn>1</mn></msub><mo separator=true>,</mo><msub><mi>P</mi><mn>1</mn></msub><mo stretchy=false>)</mo></mrow></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mtext>halts</mtext><mo stretchy=false>(</mo><msub><mi>P</mi><mn>1</mn></msub><mo separator=true>,</mo><msub><mi>P</mi><mn>2</mn></msub><mo stretchy=false>)</mo></mrow></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mo lspace=0em rspace=0em>⋯</mo></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mtext>halts</mtext><mo stretchy=false>(</mo><msub><mi>P</mi><mn>2</mn></msub><mo separator=true>,</mo><msub><mi>P</mi><mn>1</mn></msub><mo stretchy=false>)</mo></mrow></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mtext>halts</mtext><mo stretchy=false>(</mo><msub><mi>P</mi><mn>2</mn></msub><mo separator=true>,</mo><msub><mi>P</mi><mn>2</mn></msub><mo stretchy=false>)</mo></mrow></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mo lspace=0em rspace=0em>⋯</mo></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=false scriptlevel=0><mrow><mi mathvariant=normal>⋮</mi><mpadded height=0em voffset=0em><mspace height=1.5em mathbackground=black width=0em></mspace></mpadded></mrow></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mrow></mrow></mstyle></mtd><mtd><mstyle displaystyle=false scriptlevel=0><mo lspace=0em rspace=0em>⋱</mo></mstyle></mtd></mtr></mtable><mo fence=true>)</mo></mrow><annotation encoding=application/x-tex>\begin{pmatrix} \text{halts}(P_1, P_1) & \text{halts}(P_1, P_2) & \cdots \\ \text{halts}(P_2, P_1) & \text{halts}(P_2, P_2) & \cdots \\ \vdots & & \ddots \end{pmatrix}</annotation></semantics></math></span><p>对角线程序 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi></mrow><annotation encoding=application/x-tex>D</annotation></semantics></math></span> 的行为恰恰取决于这张表格的主对角线 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mtext>halts</mtext><mo stretchy=false>(</mo><msub><mi>P</mi><mi>i</mi></msub><mo separator=true>,</mo><msub><mi>P</mi><mi>i</mi></msub><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>\text{halts}(P_i, P_i)</annotation></semantics></math></span>,并且刻意表现得相反。这与康托尔构造「每一位都与相应对角线数字不同的实数」在结构上完全一致。<p>我们无法真正实现一个通用停机判定器(因为它根本不存在!),但可以通过代码演示这种逻辑矛盾是如何具体产生的:<pre><code class="hljs language-python"><span class=hljs-keyword>import</span> sys sys.setrecursionlimit(<span class=hljs-number>50</span>) <span class=hljs-keyword>def</span><span class="hljs-title function_">hypothetical_halts</span>(<span class=hljs-params>f, x, fuel=<span class=hljs-number>10</span></span>): <span class=hljs-string>"""假想的停机判定器(仅用于悖论演示;并非真正可行的实现)"""</span><span class=hljs-keyword>try</span>: result = f(x, fuel) <span class=hljs-keyword>return</span> result <span class=hljs-keyword>is</span><span class=hljs-keyword>not</span><span class=hljs-literal>None</span><span class=hljs-keyword>except</span> RecursionError: <span class=hljs-keyword>return</span><span class=hljs-literal>False</span><span class=hljs-keyword>def</span><span class="hljs-title function_">D</span>(<span class=hljs-params>x, fuel=<span class=hljs-number>10</span></span>): <span class=hljs-keyword>if</span> fuel &lt;= <span class=hljs-number>0</span>: <span class=hljs-keyword>raise</span> RecursionError(<span class=hljs-string>"燃料耗尽,模拟死循环"</span>) will_halt = hypothetical_halts(x, x, fuel - <span class=hljs-number>1</span>) <span class=hljs-keyword>if</span> will_halt: <span class=hljs-keyword>raise</span> RecursionError(<span class=hljs-string>"模拟死循环:halts 判定其停机,故 D 刻意不停机"</span>) <span class=hljs-keyword>else</span>: <span class=hljs-keyword>return</span><span class=hljs-string>"D 停机"</span> outcome = D(D, fuel=<span class=hljs-number>8</span>) <span class=hljs-built_in>print</span>(<span class=hljs-string>"D(D) 的执行结果:"</span>, outcome) </code></pre><p>输出:<pre><code class="hljs language-scss">=== 对角线悖论推导 === 假设 <span class=hljs-built_in>halts</span>(f, x) 是一个完美的停机判定器(能正确判断任意程序) 构造 <span class=hljs-built_in>D</span>(x):若 <span class=hljs-built_in>halts</span>(x,x)==停机 则 D 死循环;若 <span class=hljs-built_in>halts</span>(x,x)==不停机 则 D 立即停机 情形 <span class=hljs-selector-tag>A</span>:若 <span class=hljs-built_in>halts</span>(D,D) 判定为「停机」 -> 根据 D 的定义,D 应死循环 -> 矛盾 情形 <span class=hljs-selector-tag>B</span>:若 <span class=hljs-built_in>halts</span>(D,D) 判定为「不停机」 -> 根据 D 的定义,D 应立即停机 -> 矛盾 => 无论哪种判定都会自相矛盾,证明通用 halts 函数不可能存在。 === 代码实例化(低燃料以便快速演示) === 触发递归异常,模拟自相矛盾的执行状态:模拟死循环:halts 判定其停机,故 D 刻意不停机 </code></pre><p>这段代码里的 <code>hypothetical_halts</code> 显然不是一个真正的「通用」判定器——它只能在一个有限的 <code>fuel</code>(步数预算)内运行,这正是我们能在一台真实计算机上执行它的唯一原因。而这恰恰佐证了图灵的结论:一个总能给出正确答案的真正通用的停机判定器不可能存在。我们所能写的任何「模拟版本」都必然带有这样或那样的局限(比如这里采用的步数上限)。<h2 id=哥德尔不完备定理>哥德尔不完备定理</h2><p>1931 年,库尔特·哥德尔运用对角线论证的一个更加精巧的变体,证明了数理逻辑史上最深刻的成果之一:<blockquote><p>哥德尔第一不完备定理。任何包含初等算术的相容(不自相矛盾)形式系统,都存在一个在该系统内既不能被证明也不能被否证的命题。</blockquote><p>哥德尔的证明大体分为三步:<ol><li><p>哥德尔编号。把形式系统中的每个公式和每个证明都编码成一个自然数(这种编码技巧本身就是天才之举,如今被称为「哥德尔数」)。这样一来,「某个证明是否证明了某个公式」就变成了自然数上的一个算术关系,可以在系统内部表达出来。</p><li><p>构造自指命题。利用编码技巧,构造一个命题 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>G</mi></mrow><annotation encoding=application/x-tex>G</annotation></semantics></math></span>,其核心内容是:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>G</mi><mo>:</mo><mo>=</mo><mtext>「命题 </mtext><mi>G</mi><mtext> 本身在该系统内不可证明」</mtext></mrow><annotation encoding=application/x-tex>G := \text{「命题 } G \text{ 本身在该系统内不可证明」}</annotation></semantics></math></span><p>这是一个高度自指的构造,其数学基础被称为对角线引理(又称不动点引理):对任意只含一个自由变量的公式 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>ϕ</mi><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>\phi(x)</annotation></semantics></math></span>,都能构造一个句子 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>ψ</mi></mrow><annotation encoding=application/x-tex>\psi</annotation></semantics></math></span>,使系统证明 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>ψ</mi><mo>↔</mo><mi>ϕ</mi><mo stretchy=false>(</mo><mo><mi mathvariant=normal>⌜</mi></mo><mi>ψ</mi><mo><mi mathvariant=normal>⌝</mi></mo><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>\psi \leftrightarrow \phi(\ulcorner \psi \urcorner)</annotation></semantics></math></span>(其中 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mo><mi mathvariant=normal>⌜</mi></mo><mi>ψ</mi><mo><mi mathvariant=normal>⌝</mi></mo></mrow><annotation encoding=application/x-tex>\ulcorner \psi \urcorner</annotation></semantics></math></span> 表示 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>ψ</mi></mrow><annotation encoding=application/x-tex>\psi</annotation></semantics></math></span> 的哥德尔数)。这个引理正是「对角线」思想在逻辑中的抽象:它让一个命题能够「谈论」关于其自身代码的某种性质。</p><li><p>导出矛盾的两难。</p><ul><li>若系统能证明 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>G</mi></mrow><annotation encoding=application/x-tex>G</annotation></semantics></math></span>,那么根据 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>G</mi></mrow><annotation encoding=application/x-tex>G</annotation></semantics></math></span> 的含义(「<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>G</mi></mrow><annotation encoding=application/x-tex>G</annotation></semantics></math></span> 不可证明」),系统就同时证明了一个假命题——与系统的相容性矛盾。<li>若系统能否证 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>G</mi></mrow><annotation encoding=application/x-tex>G</annotation></semantics></math></span>(即证明 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>¬</mi><mi>G</mi></mrow><annotation encoding=application/x-tex>\neg G</annotation></semantics></math></span>,相当于证明「<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>G</mi></mrow><annotation encoding=application/x-tex>G</annotation></semantics></math></span> 可证明」),那么在合理的补充条件下,这同样会导致矛盾。<li>因此 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>G</mi></mrow><annotation encoding=application/x-tex>G</annotation></semantics></math></span> 既不能被证明也不能被否证——它是系统内的一个「不可判定命题」。</ul></ol><p>与前面两个证明的共通之处:<table><thead><tr><th><th>对角数 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>y</mi></mrow><annotation encoding=application/x-tex>y</annotation></semantics></math></span><th>对角集 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi></mrow><annotation encoding=application/x-tex>D</annotation></semantics></math></span><th>对角程序 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi></mrow><annotation encoding=application/x-tex>D</annotation></semantics></math></span><th>哥德尔句 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>G</mi></mrow><annotation encoding=application/x-tex>G</annotation></semantics></math></span><tbody><tr><td>自指的对象<td>每一位「避开」自身<td>收集「不属于自己」的元素<td>用自己的行为否定对自身的判定<td>断言「我不可证明」<tr><td>依赖的机制<td>十进制展开的对角线<td>集合属于关系的自指<td>程序以自身为输入<td>通过哥德尔编号实现的自指<tr><td>矛盾的来源<td>假定的双射无法覆盖 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>y</mi></mrow><annotation encoding=application/x-tex>y</annotation></semantics></math></span><td>假定的满射无法覆盖 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi></mrow><annotation encoding=application/x-tex>D</annotation></semantics></math></span><td>假定的判定器导致悖论<td>假定的可证明性导致悖论</table><p>这四个证明,本质上都在做同一件事:利用「自指」构造出一个必然与假定的「完备覆盖」相矛盾的对象。正是这一点,使对角线论证——横跨集合论、可计算性理论与数理逻辑三大领域——成为二十世纪最具穿透力的证明思想之一。<h2 id=延伸>延伸</h2><p>除了上面讨论的三个经典应用,对角线论证及其背后的思想还渗透进计算机科学与数学的许多角落:<ul><li><p>柯尔莫哥洛夫复杂度。对角线论证可用于证明「不可压缩」字符串的存在——即无法由任何比字符串本身更短的程序生成的字符串——而且这样的字符串构成绝对多数。</p><li><p>复杂度理论中的时间与空间谱系定理。对角线论证被用来证明,赋予图灵机更多的时间或空间预算,确实能让它解决严格更多的问题(这是 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>P</mi><mo>⊊</mo><mtext>EXP</mtext></mrow><annotation encoding=application/x-tex>P \subsetneq \text{EXP}</annotation></semantics></math></span> 等谱系关系的基础)。</p><li><p>塔斯基不可定义定理。该结果证明,在足够强的形式系统内,「真」这个概念无法被完整定义;其证明结构与哥德尔定理非常相似。</p><li><p>罗素悖论。虽然从历史上看它早于对角线论证在现代形式下的普遍认知,但「所有不包含自身的集合构成的集合」这个悖论,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>R</mi><mo>=</mo><mo stretchy=false>{</mo><mi>x</mi><mo>:</mo><mi>x</mi><mo mathvariant=normal>∉</mo><mi>x</mi><mo stretchy=false>}</mo></mrow><annotation encoding=application/x-tex>R = \{x : x \notin x\}</annotation></semantics></math></span>,与康托尔定理证明中的集合 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi><mo>=</mo><mo stretchy=false>{</mo><mi>a</mi><mo>:</mo><mi>a</mi><mo mathvariant=normal>∉</mo><mi>f</mi><mo stretchy=false>(</mo><mi>a</mi><mo stretchy=false>)</mo><mo stretchy=false>}</mo></mrow><annotation encoding=application/x-tex>D = \{a : a \notin f(a)\}</annotation></semantics></math></span> 具有完全相同的结构——两者都是「自指 + 自我排除」的产物。</p></ul><p>若把对角线论证提炼成一个可复用的「思维模板」,其轮廓大致如下:<ol><li>出发点(反证)。假设存在一种「完美覆盖」或「普适判定」——一个双射、一个满射、一个判定器、一个证明系统。<li>构造自指的对象。利用假设本身所提供的「编号」或「映射」能力,构造一个新对象,它刻意与假定的覆盖中的每一个条目「作对」(对角数、对角集、对角程序、自指命题)。<li>验证其逃逸性。证明这个新对象与假定覆盖范围内的每一个条目都系统性地不同(通常通过「第 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>n</mi></mrow><annotation encoding=application/x-tex>n</annotation></semantics></math></span> 个条目在第 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>n</mi></mrow><annotation encoding=application/x-tex>n</annotation></semantics></math></span> 个位置不同」这一模式)。<li>导出矛盾。按假设,这个新对象应当被覆盖——但构造过程保证了它必然逃脱覆盖。矛盾产生;原假设被推翻。</ol>

2026/7/30
阅读更多

在开始 AGI 之前,先定义它

<blockquote>RSS readers may not support rendering advanced formatting like math formulas. Click to view the original page: <a href="https://dreams.plus/blog/2026/2026-07-30-what-agi-needs-may-not-be-a-larger-model-but-a-set-of-theories" target="_blank">https://dreams.plus/blog/2026/2026-07-30-what-agi-needs-may-not-be-a-larger-model-but-a-set-of-theories</a></blockquote><p>最近,我看了梁文锋关于 AGI 的演讲,他指出人工智能的终极目标是通用人工智能(AGI)——一种能以类人方式解决各种问题的一般智能。<p>然而,我越来越觉得,当下 AI 领域围绕 AGI 的讨论仍停留在经验层面。<p>我们讨论模型规模、参数量、强化学习、智能体和多模态,却很少有人触及一个更根本的问题:<blockquote><p>什么才是 AGI?</blockquote><p>直到今天,仍然没有一个被广泛接受的正式定义。大多数讨论都在描述现象,而非把握本质。<h2 id=理论框架>理论框架</h2><p>历史上真正改变世界的,从来不是某台机器,而是它背后的理论。为了研究机械计算,图灵提出了图灵机模型。随后,丘奇 - 图灵论题指出:<blockquote><p>任何能用有效程序计算的函数,都能被图灵机计算。</blockquote><p>几乎所有现代计算机都是这个模型的工程实现:一个有限状态控制器加上外部存储。更重要的是,图灵进一步证明了停机问题不可判定。这意味着,人类第一次意识到:<blockquote><p>并非所有问题都是可计算的。</blockquote><p>换言之,计算机第一次拥有了明确定义的理论上限。这一发现的意义不亚于物理学中的热力学第二定律。<h2 id=理论的局限>理论的局限</h2><p>今天的 AGI,本质上正处于相当于计算机发明之前的那个阶段。<p>每个人都在造越来越大的机器,但下面这些问题仍然没有答案:<ul><li>什么是智能?<li>智能能被形式化吗?<li>一般智能的必要条件是什么?<li>智能有理论极限吗?</ul><p>如果未来有人能提出一套 AGI 公理,类似于图灵机之于计算理论,其意义或许远远超过再训练一个更大的模型。<p>只有这样的理论建立起来之后,我们才能真正讨论:什么能做到,什么永远做不到。<h2 id=计算主义的内在边界>计算主义的内在边界</h2><p>当今几乎所有主流 AI 方法,核心都建立在计算主义之上。<p>也就是说:智能就是计算。<p>如果这个前提成立,那么任何 AI 系统最终都属于可计算系统这一类。然而可计算性理论告诉我们,存在大量的不可判定问题(例如停机问题)。<p>于是,一个值得深思的问题浮现出来:如果 AGI 被定义为一种能够解决所有问题的智能,那么它必然要直面不可判定问题。<p>不可判定问题,按照丘奇 - 图灵框架,本质上是不可能被任何可计算系统解决的。<p>因此,如果采纳这种「全知全能」式的 AGI 定义,它与可计算性理论之间就出现了明显的张力。当然,这并不意味着 AGI 必然不可能;而是说明,「一般智能」到底意味着什么,需要更精确的定义。<p><a href=https://arxiv.org/abs/cs/0004001>AIXI 早已揭示了这一矛盾</a>。事实上,这个问题很早就出现了。Marcus Hutter 的 AIXI 是一般智能最著名的数学模型之一。<p>AIXI 把智能定义为:<blockquote><p>在所有可计算环境中,最大化长期期望回报的最优智能体。</blockquote><p>它拥有严谨的数学定义,因此常被视为 AGI 的理论上限。但与此同时,AIXI 本身却是不可计算的。原因在于,它依赖所罗门诺夫归纳,需要对所有可能的程序求和——这个操作天然涉及不可计算的对象,因而无法在真实的物理世界中实现。<p>换言之,我们已经有了一种「完美智能」的形式化定义,却证明了它无法被计算。<p>这不是工程上的困难,而是理论上的局限。<p>我认为有一个公理是缺失的。目前,包括 DeepMind 在内的许多机构都在探索元学习、自适应智能体、世界模型等统一框架。在某种意义上,这些努力都可以被理解为对 AGI「公理系统」的搜寻。<p>然而,我认为有一个关键公理可能是缺失的:<blockquote><p>智能体必须与环境保持连续的因果耦合,而不是作为一个超然的、观察者式的求解器运转。</blockquote><p>真正的智能不是对固定数据集的一次性推理,而是在与环境、行动、反馈与修正的持续互动中不断塑造自身。<p>没有这个因果闭环,即使再大的语言模型,也像是静态世界里运转的模板匹配系统,而不是在实质意义上发展智能。<p>也许,我们真正需要追寻的并不是一个万能 AI。我越来越倾向于认为,真正值得研究的问题不是如何造出一个「全能」的 AI,而是:<blockquote><p>智能是否存在类似于热力学第二定律或香农极限那样的根本性约束原理?</blockquote><p>如果未来有人能证明,任何位于有限物理时空中的系统都不可能实现绝对的一般智能,<p>那么这样工作的意义,或许不亚于图灵建立计算理论,也不亚于牛顿和爱因斯坦为物理学奠定的基础框架。<p>它不会宣告 AI 的失败。<p>恰恰相反,它将揭示:真正值得追求的并不是无限的智能,而是一种在理论极限内逐步逼近最优的有界智能。<p>也许,站在未来回望,人们记住的今天将不是 AGI 在 2026 年出现的那一年,而是我们开始重新思考这个根本问题的那一年:「智能,到底是什么?」

2026/7/29
阅读更多

涌现是幻象吗?

<blockquote>RSS readers may not support rendering advanced formatting like math formulas. Click to view the original page: <a href="https://dreams.plus/blog/2026/2026-06-30-about-the-emergency" target="_blank">https://dreams.plus/blog/2026/2026-06-30-about-the-emergency</a></blockquote><h2 id=涌现>涌现</h2><p>「涌现是伪概念」——即复杂系统中貌似质变的现象,只是把非线性的评估指标套在本质上线性或平滑变化的过程上所产生的假象——这一主张自 Schaeffer、Miranda 与 Koyejo 2023 年的论文《<a href=https://arxiv.org/abs/2304.15004>大语言模型的涌现能力是幻象吗?</a>》发表以来获得了广泛支持。这个论证的吸引力在于它的简洁:选一个不连续的指标,你就会在一个底层数据生成过程中不存在不连续的地方制造出一个不连续。本文考察这一论证的力量与局限,把它置于物理与生物系统相变研究的更广阔文献之中,并提出一个更具体的问题:当代机器学习理论——尺度定律、损失地形几何、grokking 与机制可解释性——究竟告诉我们,经过训练的网络中出现的涌现,是测量假象、真实的动力学相变,还是根本抗拒这种二分法?<p>我在下文详细论证的结论是:「幻象」批判作为对某一类基准报告式涌现能力的一个局部、方法论层面的论断是正确的,但它并不能推广为对涌现作为科学概念的彻底否定。过去三年的机器学习研究,已经从训练损失相变、grokking 动力学和电路层级的可解释性等方面独立积累了证据,证明神经网络行为中的某些不连续性是优化动力学自身的属性,与读出指标的选择无关。区分这两种情形需要特定的方法论纪律,本文试图把它明确化。<h2 id=幻象论证的形式化>幻象论证的形式化</h2><p>Schaeffer 等人的核心技术主张建立在一个简单的概率分解之上。考虑一个需要 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>n</mi></mrow><annotation encoding=application/x-tex>n</annotation></semantics></math></span> 个独立子步骤全部正确的多步任务——例如多位数字的算术问题,或带有若干中间步骤的思维链推导。如果模型每步的正确率 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>p</mi></mrow><annotation encoding=application/x-tex>p</annotation></semantics></math></span> 随参数量 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>N</mi></mrow><annotation encoding=application/x-tex>N</annotation></semantics></math></span> 平滑、连续地提高(比方说,按照尺度定律理论的标准形式遵循幂律,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>p</mi><mo stretchy=false>(</mo><mi>N</mi><mo stretchy=false>)</mo><mo>≈</mo><mn>1</mn><mo>−</mo><mi>a</mi><msup><mi>N</mi><mrow><mo>−</mo><mi>α</mi></mrow></msup></mrow><annotation encoding=application/x-tex>p(N) \approx 1 - aN^{-\alpha}</annotation></semantics></math></span>),那么在精确匹配指标下的任务级准确率就是:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>P</mi><mtext>任务</mtext></msub><mo stretchy=false>(</mo><mi>N</mi><mo stretchy=false>)</mo><mo>=</mo><mi>p</mi><mo stretchy=false>(</mo><mi>N</mi><msup><mo stretchy=false>)</mo><mi>n</mi></msup></mrow><annotation encoding=application/x-tex>P_{\text{任务}}(N) = p(N)^n</annotation></semantics></math></span><p>由于这是一个趋近于 1 的量的幂,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>p</mi></mrow><annotation encoding=application/x-tex>p</annotation></semantics></math></span> 在接近上限处的微小绝对增长,会引起 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>P</mi><mtext>任务</mtext></msub></mrow><annotation encoding=application/x-tex>P_{\text{任务}}</annotation></semantics></math></span> 不成比例的巨大相对增长。结果是出现一条先平后陡的曲线——正是 BIG-Bench 上几十个任务报告的那种标志性的「涌现」S 型曲线——尽管 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>p</mi><mo stretchy=false>(</mo><mi>N</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>p(N)</annotation></semantics></math></span> 本身完全平滑。关键在于,作者还表明:换成某种连续的指标(词元级对数似然、布莱尔分数或部分得分),就能在同一批模型、同一批任务上恢复平滑性。这之所以是一个有力的结果,恰恰因为它是一个受控比较:同样的系统、同样的数据,不同的读出函数,得到不同的定性结论。<p>这推广了统计学与心理物理学中一个早已熟知的观点:连续变量的阶跃函数可以通过取阈值轻而易举地构造出来,而取阈值带来的不连续,告诉你的只是阈值本身,而不是那个变量。同样的逻辑也能解释洞察式问题解决研究中出现的「恍然大悟时刻」——主观的、二值的自我报告掩盖了连续的、低于阈值的信息积累,后者要等眼动追踪等连续仪器才能揭示。它也能解释那些表面上的生态「崩塌」,一旦提高采样频率,便消解为渐进的衰退。这些情形的共同结构缺陷是:把观测的离散性误当成了过程的离散性。<h2 id=论证的越界>论证的越界</h2><p>从「某些报告的涌现能力是指标假象」推出「涌现是伪概念」,犯了我所谓反例消除谬误的错误:对某一子类主张的一次具体、受控的证伪,被当成了对整个范畴的证伪。有三点考虑限制了幻象论证的适用范围。<h3 id=组合式任务结构是世界的真实属性而非仅指标的属性>组合式任务结构是世界的真实属性,而非仅指标的属性</h3><p>如果某个下游应用确实要求全部 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>n</mi></mrow><annotation encoding=application/x-tex>n</annotation></semantics></math></span> 步都正确——编译后的程序必须没有语法错误;证明必须没有无效步骤——那么 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>P</mi><mtext>任务</mtext></msub><mo stretchy=false>(</mo><mi>N</mi><mo stretchy=false>)</mo><mo>=</mo><mi>p</mi><mo stretchy=false>(</mo><mi>N</mi><msup><mo stretchy=false>)</mo><mi>n</mi></msup></mrow><annotation encoding=application/x-tex>P_{\text{任务}}(N) = p(N)^n</annotation></semantics></math></span> 就不是测量假象,而是对用户相关的成功概率的正确描述。其机制完全可以解释、毫无神秘可言(这是初等概率,不是隐藏的相变),但现象本身——在一个狭窄的能力区间内可用输出占比的急剧上升——是真实且有后果的。幻象批判正确地揭开了机制的谜团;它并没有消除现象。这个重要的区分在论证的通俗转述中被抹平了:「无法解释」与「虚假」不是同义词。<h3 id=复杂系统中确实存在真实相变具有指标无关的签名>复杂系统中确实存在真实相变,具有指标无关的签名</h3><p>统计物理提供了一个严谨的反例类。铁磁体系中的居里点是真正意义上的二级相变:重整化群理论预言了临界指数(<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>β</mi></mrow><annotation encoding=application/x-tex>\beta</annotation></semantics></math></span>, <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>γ</mi></mrow><annotation encoding=application/x-tex>\gamma</annotation></semantics></math></span>, <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>ν</mi></mrow><annotation encoding=application/x-tex>\nu</annotation></semantics></math></span>),并在相互独立的可观测量——磁化强度、磁化率、关联长度、比热——上得到验证,所有这些量都在同一个临界温度处发散或消失,无论你选择测量哪一个。随机图上的渗流转变具有类似的普适性:当边密度跨越阈值时,连通性性质急剧转变,这可以从概率论的第一性原理出发证明,与任何特定的观测读出无关。在这些情形里,那个令 LLM「涌现能力」声名扫地的检验——转变在更换指标后是否依然存在?——被漂亮地通过了。一旦离开幻象论文所在的特定领域(LLM 基准评测),「涌现总是指标假象」这一全称论断在经验上就是错的。<h3 id=涌现涵盖多种不同的现象其中只有一部分处于争议之中>「涌现」涵盖多种不同的现象,其中只有一部分处于争议之中</h3><p>科学哲学文献(安德森 1972 年的《多即不同》是标准参考点)至少区分了:(a)认识论涌现——尽管原则上可由微观规则推导,却难以从微观规则预测的性质;(b)本体论/弱涌现——在宏观尺度上新颖、但原则上可经由模拟还原的性质;以及(c)强涌现——被声称原则上也不可还原的性质,这是一个更有争议的概念。幻象论证在其恰当范围内,是一个关于特定认识论错觉——由指标选择诱发的表面上的不可预测性——的论证,而对弱涌现是否存在于神经网络中几乎不置一词。混淆这些含义,正是这场争论产生更多热量而非光亮的缘由之一。<h3 id=镜像情形线性指标掩盖真实的非线性结构>镜像情形:线性指标掩盖真实的非线性结构</h3><p>前面的讨论都把指标选择当作产生假象式不连续的来源——LLM 的情形、洞察式问题解决的情形、粗略生态普查的情形。三者共享同一个误差方向:非线性或取阈值的读出函数,从平滑的底层现实中制造出表面上的陡峭。但地震震级里氏标度的发展历史则展示了相反的误差方向,它之所以有教益,恰恰因为它不符合幻象模板。<p>地震学家最初用地面运动的原始振幅量化地震强度,这是一种线性的仪器读数,与地震仪记录到的物理位移成正比。结果发现,这个指标与研究者真正关心的构念——破坏潜力——匹配得很差,因为地震能量释放随振幅不是线性而是乘性地变化:振幅增大十倍,辐射能量约增大三十二倍,而破坏能力与能量、而非位移成正比。在原始的线性振幅指标下,现象的真实结构——能量释放的古登堡 - 里克特幂律分布,其中灾难性事件与轻微震颤相差许多个数量级——被压缩进一个狭窄的、视觉上波澜不惊的数值区间,系统地掩盖了 8 级事件与 5 级事件之间类别的天壤之别。查尔斯·里希特在 1935 年的解决方案,是把震级定义为振幅以 10 为底的对数(并作距离修正)。这是有意把非线性引入指标,使得新标度上的等量增量对应底层能量释放的等量比值——把一个乘性的、难以沟通的现实,变成一个加性的、可解读的。<p>地震情形是 LLM 幻象在结构上的镜像:在那里,非线性指标(组合式任务结构下的精确匹配准确率)从一个实际上平滑的底层现实中制造出虚假的不连续。在这里,线性指标(原始振幅)掩盖了一个真实的、性质刻画清楚的乘性结构,而纠正的做法恰恰是采用对数——即非线性——指标,正因为底层物理过程(由断层破裂面积与应力降控制的弹性能量释放)本身在所测量的量上是指数式的。关键在于,这并不是随意的选择:采用对数变换,是因为独立的物理理论(地震矩、破裂尺度与辐射能量之间的关系)预先预言了乘性关系,新标度也正是依据这一理论得到验证——这正是下文判别框架中将被形式化为检验 2 的那种「独立理论预言」标准。<p>把 LLM 与地震这两个案例放在一起读,可以三角定位出这场争论背后那个更深层的方法论原则:任何指标对现象施加的定性形状都不可能是中立的,而可能的失真方向是双向的。非线性/取阈值的指标可以从平滑现实中制造出虚假的陡峭(LLM 基准);线性指标同样可以掩盖真实的、有理论根基的非线性结构(里氏标度之前的振幅标度)。因此,「偏好连续指标」本身并不是从幻象论证中应该提取的正确方法论教训——正确的教训是:指标的函数形式必须与被测量的原始量与科学关注的构念之间真实关系的函数形式相匹配,而这种匹配必须独立地(通过理论,或通过与破坏性之类外部准则的验证)得到辩护,而不是在任一方向上默认为之。仅仅因为某个指标是连续的便选择它,却不追问那个特定的连续变换是否追踪了所关注的构念,将和幻象论文所批评的精确匹配错误一样没有原则。<h2 id=机器学习理论的补充>机器学习理论的补充</h2><p>最有趣的近期证据并不来自基准准确率曲线,而是来自神经网络的内部训练动力学——这是幻象论文未曾涉及的领域,因为它只研究跨模型规模的推理期尺度行为,而不研究单个模型在训练时间上的轨迹。<h3 id=grokking真实的动力学转变>Grokking:真实的动力学转变</h3><p>Power、Burns、Edwards、Babuschkin 与 Misra(2022)记录了「grokking」现象:在小算法任务(例如模算术训练)上,网络几乎立即记住训练集,随后长时间停留在接近零的测试准确率平台上,再急剧转变到接近完美的泛化——往往比训练损失首次收敛的时间晚好几个数量级。这不是 Schaeffer 意义上的基准指标假象:它在许多随机种子下的测试集准确率上都能观察到,在测试损失等连续指标读出下也成立,而且后来被赋予了一个机制解释——同一网络内部一个记忆电路与一个泛化电路相互竞争,在权重衰减压力下泛化电路最终胜出(Nanda 等,2023,《通过机制可解释性衡量 grokking 的进展指标》)。关键在于,Nanda 等人表明,连续的机制性进展指标——从学习到的嵌入的傅里叶结构导出、追踪用于实现模加法的三角表示的逐渐形成的量——在测试准确率看似平坦的平台上平滑、可预期地上升。这正是 LLM 基准故事在结构上的镜像:在这里,粗粒度指标(准确率)中貌似离散的转变,底层是良好选择的细粒度指标中的连续进展,而这种细粒度进展确实最终促成了网络内部计算一次真实的、在机制上得到刻画的重新组织——一次电路层级的相变,而不只是统计读出的效应。粗与细两幅图景可以同时为真;有趣的问题是细粒度进展指标做了什么工作,而 grokking 研究给出了异常清晰的回答。<h3 id=归纳头与训练损失相变>归纳头与训练损失相变</h3><p>Olsson 等(2022,《上下文学习与归纳头》,Anthropic)报告了一个更有资格被称为真实相变的现象:transformer 语言模型的训练损失曲线上出现一个陡峭的隆起,发生在训练早期一个特定的、一致的时点,并在各模型规模与架构上,与「归纳头」的形成同步——归纳头是实现简单复制算法([A][B] ... [A] → 预测 [B])的注意力电路,后来被复用于更一般的上下文学习。这个转变在训练损失本身上可见——这是一个连续的、直接被优化的量,不涉及任何取阈值或精确匹配的离散化——这直接击破了幻象解释,因为幻象机制需要一个被人为离散化的读出才能制造出陡峭的外观。此外,损失隆起的时点(通过消融研究)与归纳电路的出现之间存在因果关系,这为转变为何发生提供了一个机制的说明,正如重整化群理论解释了为何居里点在磁化强度上产生陡峭行为一样。这是深度学习目前最接近物理式涌现的东西:一个指标不变的、有机制解释的、可复现的动力系统不连续。<h3 id=尺度定律损失地形与阈值附近方差的压缩>尺度定律、损失地形与阈值附近方差的压缩</h3><p>还有一条互补的、更带怀疑色彩的 ML 理论脉络值得摆到台面上,因为它从另一个角度部分支持了幻象阵营。标准的神经网络尺度定律(Kaplan 等,2020;Hoffmann 等,2022)表明,损失本身——可用理论动机最充分的连续指标——随参数、数据与计算量按平滑幂律缩放,跨越多个数量级都没有不连续。如果损失平滑而下游任务准确率不平滑,那么在缺乏内部离散重组证据的情况下,最节俭的解释确实是:任务级不连续是从损失到任务表现的映射(组合式结构、取阈值、指标选择都从这儿进入)所产生的下游假象,而非模型底层能力的不连续。这正是 Schaeffer 等人的论点;在缺乏训练期机制性叙事来回应它时(正如大多数报告的「涌现」基准能力那样,与归纳头或 grokking 形成对照),幻象解释应当被视为默认的、更节俭的假设,符合奥卡姆剃刀式先验。<h2 id=判别框架>判别框架</h2><p>把这些线索汇聚起来,我提出三个可操作的检验,用于在任何复杂系统(包括机器学习)中区分真实的动力学涌现与指标诱发的错觉。<p>指标不变性,方向要正确。转变在更换指标后是否依然存在?该指标的函数形式必须被独立地证明确实追踪了所关注的构念,而不仅仅是连续。正如地震震级案例所示,「连续」并不等于「正确」——线性指标同样容易掩盖真实的乘性结构,正如取阈值指标容易制造虚假结构一样。相关的问题不是「读出是否连续?」而是「读出的函数形式是否与真实生成关系的函数形式相匹配?」通过这一恰当表述的检验(如归纳头的损失隆起、经由多个独立可观测量测得的铁磁临界指数、或对照地震能量理论验证的对数震级),是底层存在真实结构的强证据。未通过(如大多数 BIG-Bench「涌现能力」在对数似然读出下的表现),则是原始指标选择造成假象的强证据。<p>独立的理论预言对比事后的曲线拟合。转变的位置或存在,是由独立的理论框架(临界现象的重整化群理论;归纳头的电路形成理论)预言的,还是仅仅通过肉眼看出一条恰好弯曲的曲线而事后识别出来的?先验的预言比事后的模式识别具有强得多的认识论效力,后者极易受确认偏误与基准套件中几十个任务上的多重比较问题的影响。<p>不连续的所在:生成机制对比读出函数。不连续位于生成系统内部状态的过程之中(一个电路形成、一个序参量跨越临界值、一个竞争电路动力学趋于解决),还是位于把内部状态映射到外部报告的函数之中(精确匹配评分器、二值的「解决/未解决」判断、粗糙的采样间隔)?第一类不连续是真实涌现的候选者;第二类不连续在没有反证之前应当按假象处理。<p>应用这个框架:归纳头的形成与 grokking 的电路竞争通过了全部三项检验,有资格被称为学习动力学中真实的——尽管规模不大——相变。而大语言模型的大多数基准报告的「涌现能力」正如 Schaeffer 等人直接展示的那样,在检验 1 上彻底失败,通常也在检验 2 上失败,因为它们是靠扫描许多任务找不连续形状的曲线识别出来的,而不是由独立的关于能力习得的理论预言出来的。<h2 id=结语>结语</h2><p>地震震级案例是一个有用的纠偏,可以和上面讨论的机器学习证据并置,因为它防止判别框架坍缩成一个简单启发式——「偏好平滑指标,警惕取阈值指标」。这个启发式是从 Schaeffer 等人那里应该得到的错误教训,因为它会劝告地震学家拒绝(非线性的、对数的)里氏标度,改用它所取代的(线性的、连续的)振幅读数——这恰恰反了,因为对数标度才是追踪物理现实的那个。一般原则与其说是关于线性本身,不如说是关于指标的函数形式是否已从关于底层生成过程的理论中独立推导出来、或依据该理论得到验证,而不是出于惯例或便利被采用。<p>幻象批判最好的理解方式,不是证明了涌现普遍是虚假的,而是证明了某一特定且流行的取证实践——把精确匹配准确率随模型规模的陡峭跳跃报告为质上崭新能力的证据——在统计上是有混淆的,应当退役或大幅限缩。这是对一处已然漂移的文献的一次真实而有价值的修正,那处文献在有些地方已滑向把基准曲线形状当作窥见模型认知的直接窗口。但机器学习理论本身,经由机制可解释性与训练动力学研究——它们与催生幻象论文的基准尺度文献基本正交——已经独立地提供了符合更严格、指标不变、有机制根基的真实动力学相变标准的例子:grokking 的电路竞争、归纳头的形成及其伴随的训练损失转变。这里的教训不是涌现作为一个笼统命题是真实的还是虚假的,而是这个词一直不加区分地被用来覆盖两类范畴,而这一领域如今第一次拥有了逐案区分二者的经验与理论工具。这种纪律——指标不变性、独立预言、以及对不连续所在之处的关注——才是对不加批判的涌现话语及其笼统否定两者的恰当继承者。

2026/6/29
阅读更多

最大似然估计视角下的神经网络

<blockquote>RSS readers may not support rendering advanced formatting like math formulas. Click to view the original page: <a href="https://dreams.plus/blog/2026/2026-06-08-explanation-of-neural-network-from-maximum-likelihood-estimation" target="_blank">https://dreams.plus/blog/2026/2026-06-08-explanation-of-neural-network-from-maximum-likelihood-estimation</a></blockquote><h2 id=抛硬币>抛硬币</h2><p>MLE(最大似然估计)是统计学中最核心的思想之一。<p>一句话总结:<blockquote><p>MLE 从所有可能的模型参数中,选出那个「让观测数据最有可能出现」的参数。</blockquote><p>下面,你拿到一枚纹理不均匀的残次硬币。所以你不知道它是否公平。也就是说,抛这枚硬币时,你不知道正面或反面的概率。你想知道:出现正面的概率 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>p</mi></mrow><annotation encoding=application/x-tex>p</annotation></semantics></math></span> 是多少。<p>于是你决定连抛 10 次,得到如下结果:正面 8 次,反面 2 次。<p>假设这是一枚公平硬币,那么设先验假设 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>p</mi><mo>=</mo><mn>0.5</mn></mrow><annotation encoding=application/x-tex>p=0.5</annotation></semantics></math></span>。<p>在这一先验假设下,出现上述结果的概率为:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>P</mi><mo stretchy=false>(</mo><mi>D</mi><mi mathvariant=normal>∣</mi><mi>p</mi><mo>=</mo><mn>0.5</mn><mo stretchy=false>)</mo><mo>=</mo><msup><mn>0.5</mn><mn>10</mn></msup><mo>≈</mo><mn>0.000976</mn></mrow><annotation encoding=application/x-tex>P(D|p=0.5) = 0.5^{10} \approx 0.000976</annotation></semantics></math></span><p>也就是说,如果这是一枚公平硬币,那么抛 10 次得到 8 次正面、2 次反面的概率约为 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mn>0.000976</mn></mrow><annotation encoding=application/x-tex>0.000976</annotation></semantics></math></span>——在概率统计里,这个数显然被视为几乎不可能。所以你能清楚地感觉到这枚硬币不公平。<p>现在提出另一个假设:假设正面的概率是 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>p</mi><mo>=</mo><mn>0.8</mn></mrow><annotation encoding=application/x-tex>p=0.8</annotation></semantics></math></span>。那么上述结果的概率为:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>P</mi><mo stretchy=false>(</mo><mi>D</mi><mi mathvariant=normal>∣</mi><mi>p</mi><mo>=</mo><mn>0.8</mn><mo stretchy=false>)</mo><mo>=</mo><msup><mn>0.8</mn><mn>8</mn></msup><mo>×</mo><msup><mn>0.2</mn><mn>2</mn></msup><mo>≈</mo><mn>0.0067</mn></mrow><annotation encoding=application/x-tex>P(D|p=0.8) = 0.8^8 \times 0.2^2 \approx 0.0067</annotation></semantics></math></span><p>我们还发现,当 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>p</mi><mo>=</mo><mn>0.8</mn></mrow><annotation encoding=application/x-tex>p=0.8</annotation></semantics></math></span> 时,上述结果的概率最大,达到最大值 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mn>0.0067</mn></mrow><annotation encoding=application/x-tex>0.0067</annotation></semantics></math></span>。</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mn>0.0067</mn><mo>></mo><mn>0.000976</mn></mrow><annotation encoding=application/x-tex>0.0067 > 0.000976</annotation></semantics></math></span><p>这说明:如果正面概率是 0.8,那么观察到这份数据的可能性最大。<p>因此:<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mover accent=true><mi>p</mi><mo>^</mo></mover><mo>=</mo><mn>0.8</mn></mrow><annotation encoding=application/x-tex>\hat p=0.8</annotation></semantics></math></span><p>这就是最大似然估计。<h2 id=似然函数>似然函数</h2><p>给定数据:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi><mo>=</mo><mo stretchy=false>{</mo><msub><mi>x</mi><mn>1</mn></msub><mo separator=true>,</mo><msub><mi>x</mi><mn>2</mn></msub><mo separator=true>,</mo><mo>⋯</mo><mtext></mtext><mo separator=true>,</mo><msub><mi>x</mi><mi>n</mi></msub><mo stretchy=false>}</mo></mrow><annotation encoding=application/x-tex>D = \{x_1, x_2, \cdots, x_n\}</annotation></semantics></math></span><p>假设我们有模型参数:<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>θ</mi></mrow><annotation encoding=application/x-tex>\theta</annotation></semantics></math></span>。<p>似然函数定义为:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>L</mi><mo stretchy=false>(</mo><mi>θ</mi><mo stretchy=false>)</mo><mo>=</mo><mi>P</mi><mo stretchy=false>(</mo><mi>D</mi><mi mathvariant=normal>∣</mi><mi>θ</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>L(\theta) = P(D|\theta)</annotation></semantics></math></span><p>最大似然估计(MLE)是:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mover accent=true><mi>θ</mi><mo>^</mo></mover><mo>=</mo><mi>arg</mi><mo>⁡</mo><munder><mrow><mi>max</mi><mo>⁡</mo></mrow><mi>θ</mi></munder><mi>P</mi><mo stretchy=false>(</mo><mi>D</mi><mi mathvariant=normal>∣</mi><mi>θ</mi><mo stretchy=false>)</mo><mo>=</mo><mi>arg</mi><mo>⁡</mo><munder><mrow><mi>max</mi><mo>⁡</mo></mrow><mi>θ</mi></munder><mi>L</mi><mo stretchy=false>(</mo><mi>θ</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>\hat\theta = \arg\max_\theta P(D|\theta) = \arg\max_\theta L(\theta)</annotation></semantics></math></span><p>很多人初学时感到困惑: 既然 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>P</mi><mo stretchy=false>(</mo><mi>D</mi><mi mathvariant=normal>∣</mi><mi>θ</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>P(D|\theta)</annotation></semantics></math></span> 和 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>L</mi><mo stretchy=false>(</mo><mi>θ</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>L(\theta)</annotation></semantics></math></span> 的表达式完全一样,为什么要换一个名字?<p>关键在于视角不同:<ul><li>概率 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>P</mi><mo stretchy=false>(</mo><mi>D</mi><mi mathvariant=normal>∣</mi><mi>θ</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>P(D|\theta)</annotation></semantics></math></span> 的视角: 参数 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>θ</mi></mrow><annotation encoding=application/x-tex>\theta</annotation></semantics></math></span> 是固定的已知值,而数据 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi></mrow><annotation encoding=application/x-tex>D</annotation></semantics></math></span> 是随机的。 我们问:「在给定参数的情况下,不同的数据结果出现的可能性有多大?」<li>似然 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>L</mi><mo stretchy=false>(</mo><mi>θ</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>L(\theta)</annotation></semantics></math></span> 的视角: 数据 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi></mrow><annotation encoding=application/x-tex>D</annotation></semantics></math></span> 是固定的观测值,而参数 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>θ</mi></mrow><annotation encoding=application/x-tex>\theta</annotation></semantics></math></span> 是变化的未知量。 我们问:「在不同的参数取值下,这份观测数据出现的可能性有多大?」</ul><p>根据条件公式:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>P</mi><mo stretchy=false>(</mo><mi>D</mi><mi mathvariant=normal>∣</mi><mi>θ</mi><mo stretchy=false>)</mo><mo>=</mo><munder><mo>∏</mo><mrow><msub><mi>x</mi><mi>i</mi></msub><mo>∈</mo><mi>D</mi></mrow></munder><mi>P</mi><mo stretchy=false>(</mo><msub><mi>x</mi><mi>i</mi></msub><mi mathvariant=normal>∣</mi><mi>θ</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>P(D|\theta) = \prod_{x_i \in D} P(x_i|\theta)</annotation></semantics></math></span><p>如果数据 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>D</mi></mrow><annotation encoding=application/x-tex>D</annotation></semantics></math></span> 包含很多样本,很多小数相乘会得到一个趋近于零的结果,在计算机里可能导致数值下溢。<p>于是我们取对数,把乘法变成加法:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>ℓ</mi><mo stretchy=false>(</mo><mi>θ</mi><mi mathvariant=normal>∣</mi><mi>D</mi><mo stretchy=false>)</mo><mo>=</mo><mi>log</mi><mo>⁡</mo><mi>P</mi><mo stretchy=false>(</mo><mi>D</mi><mi mathvariant=normal>∣</mi><mi>θ</mi><mo stretchy=false>)</mo><mo>=</mo><munder><mo>∑</mo><mrow><msub><mi>x</mi><mi>i</mi></msub><mo>∈</mo><mi>D</mi></mrow></munder><mi>log</mi><mo>⁡</mo><mi>P</mi><mo stretchy=false>(</mo><msub><mi>x</mi><mi>i</mi></msub><mi mathvariant=normal>∣</mi><mi>θ</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>\ell(\theta|D)= \log P(D|\theta) = \sum_{x_i \in D} \log P(x_i|\theta)</annotation></semantics></math></span><p>取对数后,数值保持在可接受的范围内,更利于优化。<p>因此,几乎所有实际训练都在优化:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><munder><mrow><mi>max</mi><mo>⁡</mo></mrow><mi>θ</mi></munder><mi mathvariant=normal>ℓ</mi><mo stretchy=false>(</mo><mi>θ</mi><mi mathvariant=normal>∣</mi><mi>D</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>\max_\theta \ell(\theta|D)</annotation></semantics></math></span><p>这种形式叫作对数似然。<p>在似然函数中,我们要找到使似然最大的参数 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mover accent=true><mi>θ</mi><mo>^</mo></mover><mtext>MLE</mtext></msub></mrow><annotation encoding=application/x-tex>\hat{\theta}_\text{MLE}</annotation></semantics></math></span>。<h2 id=求解参数>求解参数</h2><p>如果 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>ℓ</mi><mo stretchy=false>(</mo><mi>θ</mi><mi mathvariant=normal>∣</mi><mi>D</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>\ell(\theta|D)</annotation></semantics></math></span> 可微,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mover accent=true><mi>θ</mi><mo>^</mo></mover><mrow><mi mathvariant=normal>M</mi><mi mathvariant=normal>L</mi><mi mathvariant=normal>E</mi></mrow></msub></mrow><annotation encoding=application/x-tex>\hat{\theta}_{\rm MLE}</annotation></semantics></math></span> 通常满足:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mfrac><mrow><mi mathvariant=normal>∂</mi><mi mathvariant=normal>ℓ</mi><mo stretchy=false>(</mo><mi>θ</mi><mi mathvariant=normal>∣</mi><mi>D</mi><mo stretchy=false>)</mo></mrow><mrow><mi mathvariant=normal>∂</mi><mi>θ</mi></mrow></mfrac><mo>=</mo><mn>0</mn></mrow><annotation encoding=application/x-tex>\frac{\partial \ell(\theta|D)}{\partial \theta} = 0</annotation></semantics></math></span><p>二阶条件保证取到最大值:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mfrac><mrow><msup><mi mathvariant=normal>∂</mi><mn>2</mn></msup><mi mathvariant=normal>ℓ</mi><mo stretchy=false>(</mo><mi>θ</mi><mi mathvariant=normal>∣</mi><mi>D</mi><mo stretchy=false>)</mo></mrow><mrow><mi mathvariant=normal>∂</mi><msup><mi>θ</mi><mn>2</mn></msup></mrow></mfrac><mo>&lt;</mo><mn>0</mn></mrow><annotation encoding=application/x-tex>\frac{\partial^2 \ell(\theta|D)}{\partial \theta^2} &lt; 0</annotation></semantics></math></span><p>以最简单的伯努利分布为例:<ul><li>数据 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>x</mi><mi>i</mi></msub><mo>∈</mo><mo stretchy=false>{</mo><mn>0</mn><mo separator=true>,</mo><mn>1</mn><mo stretchy=false>}</mo></mrow><annotation encoding=application/x-tex>x_i \in \{0,1\}</annotation></semantics></math></span><li>模型:<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>P</mi><mo stretchy=false>(</mo><mi>X</mi><mo>=</mo><mn>1</mn><mo stretchy=false>)</mo><mo>=</mo><mi>p</mi><mo separator=true>,</mo><mi>P</mi><mo stretchy=false>(</mo><mi>X</mi><mo>=</mo><mn>0</mn><mo stretchy=false>)</mo><mo>=</mo><mn>1</mn><mo>−</mo><mi>p</mi></mrow><annotation encoding=application/x-tex>P(X=1)=p, P(X=0)=1-p</annotation></semantics></math></span></ul><p>我们有似然函数:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>L</mi><mo stretchy=false>(</mo><mi>p</mi><mi mathvariant=normal>∣</mi><mi>D</mi><mo stretchy=false>)</mo><mo>=</mo><munderover><mo>∏</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi></munderover><msup><mi>p</mi><msub><mi>x</mi><mi>i</mi></msub></msup><mo stretchy=false>(</mo><mn>1</mn><mo>−</mo><mi>p</mi><msup><mo stretchy=false>)</mo><mrow><mn>1</mn><mo>−</mo><msub><mi>x</mi><mi>i</mi></msub></mrow></msup></mrow><annotation encoding=application/x-tex>L(p|D) = \prod_{i=1}^n p^{x_i} (1-p)^{1-x_i}</annotation></semantics></math></span><p>转化为对数似然:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>ℓ</mi><mo stretchy=false>(</mo><mi>p</mi><mi mathvariant=normal>∣</mi><mi>D</mi><mo stretchy=false>)</mo><mo>=</mo><munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi></munderover><msub><mi>x</mi><mi>i</mi></msub><mi>log</mi><mo>⁡</mo><mi>p</mi><mo>+</mo><mo stretchy=false>(</mo><mn>1</mn><mo>−</mo><msub><mi>x</mi><mi>i</mi></msub><mo stretchy=false>)</mo><mi>log</mi><mo>⁡</mo><mo stretchy=false>(</mo><mn>1</mn><mo>−</mo><mi>p</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>\ell(p|D) = \sum_{i=1}^n x_i \log p + (1-x_i) \log (1-p)</annotation></semantics></math></span><p>对 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>p</mi></mrow><annotation encoding=application/x-tex>p</annotation></semantics></math></span> 求导并令其为零:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mfrac><mrow><mi mathvariant=normal>∂</mi><mi mathvariant=normal>ℓ</mi></mrow><mrow><mi mathvariant=normal>∂</mi><mi>p</mi></mrow></mfrac><mo>=</mo><mfrac><mrow><mo>∑</mo><msub><mi>x</mi><mi>i</mi></msub></mrow><mi>p</mi></mfrac><mo>−</mo><mfrac><mrow><mi>n</mi><mo>−</mo><mo>∑</mo><msub><mi>x</mi><mi>i</mi></msub></mrow><mrow><mn>1</mn><mo>−</mo><mi>p</mi></mrow></mfrac><mo>=</mo><mn>0</mn></mrow><annotation encoding=application/x-tex>\frac{\partial \ell}{\partial p} = \frac{\sum x_i}{p} - \frac{n-\sum x_i}{1-p} = 0</annotation></semantics></math></span><p>解得:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mover accent=true><mi>p</mi><mo>^</mo></mover><mrow><mi mathvariant=normal>M</mi><mi mathvariant=normal>L</mi><mi mathvariant=normal>E</mi></mrow></msub><mo>=</mo><mfrac><mrow><munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi></munderover><msub><mi>x</mi><mi>i</mi></msub></mrow><mi>n</mi></mfrac></mrow><annotation encoding=application/x-tex>\hat{p}_{\rm MLE} = \frac{\sum_{i=1}^n x_i}{n}</annotation></semantics></math></span><p>在神经网络中,MLE 的参数 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>θ</mi></mrow><annotation encoding=application/x-tex>\theta</annotation></semantics></math></span> 对应网络的权重和偏置,通常记为:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>θ</mi><mo>=</mo><mrow><msub><mi>W</mi><mn>1</mn></msub><mo separator=true>,</mo><msub><mi>b</mi><mn>1</mn></msub><mo separator=true>,</mo><msub><mi>W</mi><mn>2</mn></msub><mo separator=true>,</mo><msub><mi>b</mi><mn>2</mn></msub><mo separator=true>,</mo><mo>…</mo><mo separator=true>,</mo><msub><mi>W</mi><mi>L</mi></msub><mo separator=true>,</mo><msub><mi>b</mi><mi>L</mi></msub></mrow></mrow><annotation encoding=application/x-tex>\theta = {W_1, b_1, W_2, b_2, \dots, W_L, b_L}</annotation></semantics></math></span><p>其中 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>L</mi></mrow><annotation encoding=application/x-tex>L</annotation></semantics></math></span> 是层数,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>W</mi><mi>i</mi></msub></mrow><annotation encoding=application/x-tex>W_i</annotation></semantics></math></span> 是第 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>i</mi></mrow><annotation encoding=application/x-tex>i</annotation></semantics></math></span> 层的权重矩阵,<span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>b</mi><mi>i</mi></msub></mrow><annotation encoding=application/x-tex>b_i</annotation></semantics></math></span> 是偏置向量。<p>换言之:神经网络是一个函数族 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>f</mi><mi>θ</mi></msub><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>f_\theta(x)</annotation></semantics></math></span><p>它定义了条件概率分布:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>P</mi><mi>θ</mi></msub><mo stretchy=false>(</mo><mi>y</mi><mi mathvariant=normal>∣</mi><mi>x</mi><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>P_\theta(y|x)</annotation></semantics></math></span><p>训练神经网络 = 选择使观测数据出现概率最大的参数 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>θ</mi></mrow><annotation encoding=application/x-tex>\theta</annotation></semantics></math></span>:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mover accent=true><mi>θ</mi><mo>^</mo></mover><mrow><mi mathvariant=normal>M</mi><mi mathvariant=normal>L</mi><mi mathvariant=normal>E</mi></mrow></msub><mo>=</mo><mi>arg</mi><mo>⁡</mo><munder><mrow><mi>max</mi><mo>⁡</mo></mrow><mi>θ</mi></munder><munder><mo>∏</mo><mi>i</mi></munder><msub><mi>P</mi><mi>θ</mi></msub><mo stretchy=false>(</mo><msub><mi>y</mi><mi>i</mi></msub><mi mathvariant=normal>∣</mi><msub><mi>x</mi><mi>i</mi></msub><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>\hat{\theta}_{\rm MLE} = \arg\max_\theta \prod_i P_\theta(y_i | x_i)</annotation></semantics></math></span><p>以分类为例:一个二分类神经网络的输出为:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mover accent=true><mi>y</mi><mo>^</mo></mover><mo>=</mo><mi>σ</mi><mo stretchy=false>(</mo><msub><mi>f</mi><mi>θ</mi></msub><mo stretchy=false>(</mo><mi>x</mi><mo stretchy=false>)</mo><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>\hat{y} = \sigma(f_\theta(x))</annotation></semantics></math></span><p>我们看到,最大化似然可以写成最小化交叉熵损失函数作为代价函数:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mover accent=true><mi>θ</mi><mo>^</mo></mover><mrow><mi mathvariant=normal>M</mi><mi mathvariant=normal>L</mi><mi mathvariant=normal>E</mi></mrow></msub><mo>=</mo><mi>arg</mi><mo>⁡</mo><munder><mrow><mi>max</mi><mo>⁡</mo></mrow><mi>θ</mi></munder><munder><mo>∏</mo><mi>i</mi></munder><msubsup><mover accent=true><mi>y</mi><mo>^</mo></mover><mi>i</mi><msub><mi>y</mi><mi>i</mi></msub></msubsup><mo stretchy=false>(</mo><mn>1</mn><mo>−</mo><msub><mover accent=true><mi>y</mi><mo>^</mo></mover><mi>i</mi></msub><msup><mo stretchy=false>)</mo><mrow><mn>1</mn><mo>−</mo><msub><mi>y</mi><mi>i</mi></msub></mrow></msup></mrow><annotation encoding=application/x-tex>\hat{\theta}_{\rm MLE} = \arg\max_\theta \prod_i \hat{y}_i^{y_i} (1-\hat{y}_i)^{1-y_i}</annotation></semantics></math></span><p>最终得到交叉熵损失:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>L</mi><mo stretchy=false>(</mo><mi>θ</mi><mo stretchy=false>)</mo><mo>=</mo><mo>−</mo><munder><mo>∑</mo><mi>i</mi></munder><mo fence=false maxsize=1.8em minsize=1.8em stretchy=true>[</mo><msub><mi>y</mi><mi>i</mi></msub><mi>log</mi><mo>⁡</mo><msub><mover accent=true><mi>y</mi><mo>^</mo></mover><mi>i</mi></msub><mo>+</mo><mo stretchy=false>(</mo><mn>1</mn><mo>−</mo><msub><mi>y</mi><mi>i</mi></msub><mo stretchy=false>)</mo><mi>log</mi><mo>⁡</mo><mo stretchy=false>(</mo><mn>1</mn><mo>−</mo><msub><mover accent=true><mi>y</mi><mo>^</mo></mover><mi>i</mi></msub><mo stretchy=false>)</mo><mo fence=false maxsize=1.8em minsize=1.8em stretchy=true>]</mo></mrow><annotation encoding=application/x-tex>L(\theta) = - \sum_i \Big[ y_i \log \hat{y}_i + (1-y_i) \log (1-\hat{y}_i) \Big]</annotation></semantics></math></span><p>这里的 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>θ</mi></mrow><annotation encoding=application/x-tex>\theta</annotation></semantics></math></span> 表示所有权重和偏置。<p>再以回归为例:假设</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><msub><mi>y</mi><mi>i</mi></msub><mo>=</mo><msub><mi>f</mi><mi>θ</mi></msub><mo stretchy=false>(</mo><msub><mi>x</mi><mi>i</mi></msub><mo stretchy=false>)</mo><mo>+</mo><msub><mi>ϵ</mi><mi>i</mi></msub><mo separator=true>,</mo><mspace width=1em></mspace><msub><mi>ϵ</mi><mi>i</mi></msub><mo>∼</mo><mi>N</mi><mo stretchy=false>(</mo><mn>0</mn><mo separator=true>,</mo><msup><mi>σ</mi><mn>2</mn></msup><mo stretchy=false>)</mo></mrow><annotation encoding=application/x-tex>y_i = f_\theta(x_i) + \epsilon_i, \quad \epsilon_i \sim N(0, \sigma^2)</annotation></semantics></math></span><p>对数似然:</p><span class=katex><math display=block xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi mathvariant=normal>ℓ</mi><mo stretchy=false>(</mo><mi>θ</mi><mo stretchy=false>)</mo><mo>=</mo><mo>−</mo><mfrac><mn>1</mn><mrow><mn>2</mn><msup><mi>σ</mi><mn>2</mn></msup></mrow></mfrac><munder><mo>∑</mo><mi>i</mi></munder><mo stretchy=false>(</mo><msub><mi>y</mi><mi>i</mi></msub><mo>−</mo><msub><mi>f</mi><mi>θ</mi></msub><mo stretchy=false>(</mo><msub><mi>x</mi><mi>i</mi></msub><mo stretchy=false>)</mo><msup><mo stretchy=false>)</mo><mn>2</mn></msup><mo>+</mo><mi>C</mi></mrow><annotation encoding=application/x-tex>\ell(\theta) = -\frac{1}{2\sigma^2} \sum_i (y_i - f_\theta(x_i))^2 + C</annotation></semantics></math></span><p>我们看到,最大似然目标等价于最小化均方误差,其中 <span class=katex><math xmlns=http://www.w3.org/1998/Math/MathML><semantics><mrow><mi>θ</mi></mrow><annotation encoding=application/x-tex>\theta</annotation></semantics></math></span> = 神经网络的权重和偏置。<p>这里隐含的假设是误差服从高斯分布。如果我们改为假设拉普拉斯分布,MLE 就会导出 MAE 损失。这就解释了为什么不同任务选择不同的损失函数——它们对应着关于数据分布的不同假设。<blockquote><p>在神经网络中,最大似然估计就是在所有权重和偏置的组合中,找出最可能让训练数据出现的那一组。</blockquote><p>因此,每次我们用梯度下降更新权重时,本质上都在做 MLE 优化。

2026/6/7
阅读更多

推荐订阅

Cloudflare 官方博客中文版,涵盖安全、AI 和开发者相关内容

美团技术团队最近更新内容。