【外一篇:推理范式演进中的概念】

1.1 训练与推断的二分

机器学习系统存在两个核心阶段:

- 训练时间(Training Time):参数空间Θ的优化过程,目标函数为误差最小化 minL(θ;D_train)
- 推断时间(Inference Time):固定参数θ时对新样本x_test的条件分布预测p(y|x_test;θ)

大语言模型(LLM)领域的最新进展显示,通过引入思维链(CoT)机制,推断阶段的计算量(test time compute)显著增长,也收获了相应的智能提升。

1.2 逻辑学视角

推理类型 逻辑结构 确定性 典型应用
演绎 前提→必然结论 确定性 数学证明
归纳 个案→普遍规律 概率性 趋势发现
溯因 现象→最佳原因 启发式 诊断推测

Inference 对应概率模型中的推断过程,本质是大数据压缩后的经验性模式归纳。在传统的符号逻辑语境下,Reasoning 特指演绎推理的符号化过程,但考察当下的LLM推理模型,reasoning 最多只是对逻辑演绎的符号化模拟,本质上仍然是概率模型的推断(inference)生成。溯因在大模型范式下,其实现启发式推测的手段也还是大数据压缩后的经验性(逆向)模式归纳。总之,生成式AI大模型以不变应万变,各种思考推理过程一律采用下一词元预测(Next Token Prediction)形式的推断实现。生成机理不变,但 input-output 函数范式变了。

1.2 认知科学视角的函数范式

Kahneman在《思考,快与慢》中提出的双系统理论为理解大脑行为提供新视角:

- System 1(快思考):直觉式响应 input→output,对应大模型 seq2seq 函数式生成模式

output=F(input)

- System 2(慢思考):反思性推理 input→[Think]→output,体现为CoT (ChainofThought) 驱动的两阶段函数生成模式

CoT=F(input) & output=F(input+CoT)

大模型 F 的底层逻辑不变,但强化学习启动了思维链外化(CoT),搭建了应对复杂问题(input)的信息桥梁CoT,增加了大模型推断output的可解释性,最重要地,大幅提升了复杂问题的解决智能。

1.3 推理模型的计算-智能增长关系

强化学习赋能的推理模型新范式呈现的新 scaling law 是怎样的呢?并无定论,一切刚刚开始,经验法则需要时间测量。

例如,当test time compute增加10倍时:
- 推理准确率提升多少?
- 响应延迟增长多少?

`

1.4 答问

「蔡江滨l六问:早安,能否理解为cot的生成是推断inference ,根据cot生成的具体内容是推理?@wei li 」

cot+answer 的区分是人为的格式区分,对于ntp GPT 模型,它们都是概率性 inference 生成的 response

如果这个response 是针对理工类推理题目,那么这种 inference 是对于人类 reasoning,尤其是演绎( deduction)的模拟,但不是严格意义上的逻辑演绎。

如果是创作类任务,inference 中的 CoT 就是 planning/pondering 等思考过程, inference 中的answer就是生成结果,都谈不上逻辑推理。

reasoning model 这个实命名也不准确,还不如叫思考模型、思维链模型、慢思维模型、意识流模型、内心独白模型、小九九模型,总之就是 system 2,与传统的 system 1 模型比,只是多了个 CoT。

 

【原文】

生成式AI学习中容易混淆的几个术语

test time / reasoning / inference 辨析

推理模型是当前生成式AI的主流热点,带火了一个热词(buzz word)叫 test time compute,咱们就先从它谈起。

从模型开发者视角,test time(测试时间) 针对的是 training time (训练时间)。众所周知,这是机器学习的两个阶段,一个是在线,一个是离线。训练模型好比是软件开发;测试模型就是软件测试。模型测试阶段就是常说的(在线)推理(inference)阶段,所以 test time 又叫 inference time。

问题是,中文翻译“推理”对应了英文两个词:inference 和 reasoning,业内人士很多人是认为后者才是推理正解,而前者是错译(misnomer),合适的翻译是“推断”。但“推理”的一词二用已经混淆并流行了很久,社区习惯上不一定能改过来。但对于后学,还是要辨析清楚才好。

test time compute 之所以流行,是因为大模型领域近几个月的“范式转变”。社区依据预训练scaling law原来一直聚焦基座大模型的做大做强,但发现大算力带来大智能的效益递减,进入了平台期。于是把重心转移到后训练的强化学习,发展了一种称为 System 2 慢思维模式的推理模型。这种推理模型最大的特点就是运行起来慢了,原来的秒回现在是慢了几拍才回复,消耗了更多在线时间和在线推断的算力(即 test/inference time compute)。

按常理,在线计算量增加,模型运行慢了,听上去是在退步,而不是进步。但好消息是,模型对于复杂问题的处理智能飙升。时间换质量,当然应该看好这个新方向。慢思维推理模型的成就,就好比人类的三思而后行。一般而言,凡事喜欢琢磨的人,比不假思索就行动的人,更有智慧,也更加靠谱。学会了慢思维(术语叫思维链)的大模型亦是如此。

模型训练阶段,无论是预训练还是后训练,都是离线进行的,迭代循环,在改变模型的参数,模型并未成形,属于开发进行时。而 test time 说的是模型已经完成阶段。严格说,test time 是内部试运行阶段,让 QA(quality assurance)部门在上线发布前做测试。但现在谈 test time compute,已经不分内部测试还是用户使用,所以更准确的术语还是 inference time compute。

白老师说:

Inference当初译成推理就错,真的推理Reasoning不来还则罢了,这回真的来了,将错就错都难。

我说:

不知是不是下意识,以前一直有意无意地把 inference 与统计预测关联得更紧,而把 reasoning 与符号演绎(deduction)划了等号。前者是统计性的,后者是确定性的。(概率性)推断就是(统计性)预测,statistical inference。不知道受到了什么的暗中影响。

老友尼克说:

本意也差不多是这个意思。reasoning是偏deduction的。

大模型的术语最早借自于统计,统计中区分建模与inference两个阶段,大模型训练相当于建模。统计中inference翻译为“推断”。简中自媒体乱翻导致业界人也瞎起哄,好像上海电影译制厂把中国两代人的英文发音都带偏了。

但是定理证明community也用inference,好多会都以此冠名,所以很难把inference与reasoning完全隔开。相对讲,reasoning更偏deduction,最好的办法是在可能引起歧义时括号英文。

abduction在逻辑里是美国实用主义的特定叫法,源自Peirce。这个意思是把建模和inference合到一起的意思,就是Solomonoff Induction的不严谨的哲学说法。inference出错时,再去修正模型,the whole nine yard。在Kolmogorov Complexity中,inference被称为logic depth 。。。

其实,inference time 口语中也叫 running time 或 runtime,其他的近义词和关联词还有很多: test-time,real time,decoding time, prediction time, service time, execution time, on-the-fly computing time ...

 

 

【外一篇:推理范式演进中的概念

1.1 训练与推断的二分

机器学习系统存在两个核心阶段:

- 训练时间(Training Time):参数空间Θ的优化过程,目标函数为误差最小化 minL(θ;D_train)
- 推断时间(Inference Time):固定参数θ时对新样本x_test的条件分布预测p(y|x_test;θ)

大语言模型(LLM)领域的最新进展显示,通过引入思维链(CoT)机制,推断阶段的计算量(test time compute)显著增长。

1.2 逻辑学视角

推理类型 逻辑结构 确定性 典型应用
演绎 前提→必然结论 确定性 数学证明
归纳 个案→普遍规律 概率性 趋势发现
溯因 现象→最佳原因 启发式 诊断推测

在传统的符号逻辑语境下,Reasoning 特指演绎推理的符号化过程,但考察当下的LLM推理模型,reasoning 最多只是对逻辑演绎的符号化模拟,本质上仍然是概率模型的推断(inference)生成;而Inference对应概率模型中的推断过程,本质是大数据压缩后的经验性模式归纳。溯因在大模型范式下,实现启发式推测的手段也还是大数据压缩后的经验性(逆势)模式归纳。总之,生成式AI大模型以不变应万变,各种思考推理过程一律采用下一词元预测(Next Token Prediction)的 inference 实现。

1.2 认知科学维度

Kahneman在《思考,快与慢》中提出的双系统理论为理解大脑行为提供新视角:

- System 1(快思考):直觉式响应 input→output,对应大模型 seq2seq 函数式生成模式

output=F(input)

- System 2(慢思考):反思性推理 input→[Think]→output,体现为CoT(ChainofThought) 驱动的两阶段函数生成模式

CoT=F(input) & output=F(CoT)

1.3 推理模型的计算-智能增长关系

强化学习赋能的推理模型新范式呈现的新 scaling law 是怎样的呢?并无定论,一切刚刚开始,经验法则需要时间测量。

例如,当test time compute增加10倍时:
- 数学推理准确率提升多少?
- 响应延迟增长多少?

`

【相关】

 

 

 

 

思维链是大模型的符号神助攻

在人工智能发展的历史长河中,符号逻辑和神经网络一直如两条平行线,难以交汇。然而,2025年春节,DeepSeek发布的推理大模型R1揭示了一个令人惊叹的技术突破——思维链(Chain of Thought, CoT)的自主生成,其展现出的语言序列仿佛在模拟人类的符号逻辑。这一强化学习的进展或将重新定义符号逻辑与神经网络的融合方向。

DeepSeek R1 CoT 示例

符号逻辑的回归

DeepSeek R1推理模型的发布引发全球关注,其强化学习框架下自主生成的思维链展现出惊人的问题解决能力与创作能力。其核心机制仍是GPT风格的自回归下一词元预测 (next token prediction, NTP),但模型生成的中间结果——思维链,却呈现出典型的符号逻辑特征,有效模拟了人类的思考过程。

这一现象值得深思:大语言模型的本质从未改变,包括最新的推理模型,其内部运作仍是基于向量计算的条件概率。然而,为了模拟人类的符号推理,这些模型竟然学会了通过自然语言构建推理链条。更令人惊讶的是,这些符号链条确实有效,它们结合内部的词元预测机制,显著提升了模型的推理和创造能力。这是一个非常值得回味反思的技术进展。这件事的奇妙,是ChatGPT核爆以来最大的震撼。

符号与神经的无缝对接

这项奇迹的发生尤其让我们符号AI的老司机感慨。多少年来,我们心心念念地追求两条路线的融合,希望符号逻辑能在关键时刻帮助神经系统和统计模型,但一直看不到入口。忽然间,在大模型预训练进入平台期的关口,神经社区内部打开了一扇通向符号逻辑的大门,找到了一种神经与符号融合的路径。这一突破来得如此突然而有力,不能不让人既惊且叹。可惊的是,符号逻辑终于开始发力了;可叹的是,闯出这条路的还是神经社区的研发者,没有符号研究者什么事儿。

大模型就是个端到端的黑盒子,符号仅在输入输出两个端口出现。具体说,我们只能在输入端将符号“嵌入”(embedding)至高维向量空间,并在输出端通过 softmax 映射回符号,而内部的多层前馈的数据流则完全由向量运算主导,与符号逻辑无关,也很难以人类可以理解的符号来解释(因此才有专门的大模型可解释性研究)。此前所有结合符号与向量的努力都失败了,感觉这两种表示就是不同物种,无法融合。符号逻辑一直坐冷板凳,而符号本身除了作为训练数据燃料,在内部智能运作上一点也帮不了忙。

符号与概率的桥梁:CoT的奥秘

现今的推理大模型将内在“思考过程”外化为自然语言CoT,很像是模型的内心独白或意识流。模型在生成最终答案前,CoT重新嵌入系统中助力最终答案的生成。看似简单的这一过程,却在推理时成功地利用了自然语言这一符号载体,使得符号逻辑与神经网络在端口上实现了全程对接,没有一点违和或不容。

这是怎么发生的呢?一切多亏了自回归的 NTP 范式。下一词元预测的GPT生成方式,使得内部的“思维过程”可以在输出端外化为符号CoT,从而利用符号推理的形态,一步步模拟人类思维过程。

从信息论的角度看,推理大模型在 question-CoT-answer 的生成过程中,实际上构建了一条低熵的信息传输路径。相比传统的 question-answer 直接映射,这种显式的中间步骤大大降低了输入question与输出answer的信息鸿沟,显著提升了正确答案的生成概率。正如我在之前的博客(推理新范式 query+cot+answer 支持新的 scaling law 吗)中所论述的,CoT 充当了信息桥梁的角色。虽然不是严谨的符号逻辑推断过程,但它无需改变概率模型的底层运作机理,实现了对于人类推理的有效模拟。

自然语言vs形式语言:CoT的载体选择

CoT 本质是思维,语言只是载体,原理上没必要用自然语言,或任何特定的语言(例如中文,或英文)。但现在的实现方式,无路DeepSeek的R系列,还是OpenAI的O系列,就是直接用了中文或英文的思维链表示。推理模型在运行时,CoT先在输出端外化为中文或英文的符号序列,然后自回归循环运作,最终生成答案。看上去简直就是在符号与神经之间变戏法。以前何曾想到符号介入神经,还带这么玩的,内部与端口天衣无缝。

我们都要感谢DeepSeek,要不是 DeepSeek 给了这样一个开源的春节大礼包,又完全公开了自己的CoT,我们会一直蒙在鼓里,绞尽脑汁也想不明白 reasoning 这种符号逻辑,怎么就悄悄进入了神经过程。符号与向量的矛盾通过端口外化,化解于无形。

从符号逻辑的角度看,自然语言虽然老妪能解,但其精确性远逊于数学符号、形式逻辑表达式或编程语言代码。对于数理问题或逻辑推演,CoT 用这些形式语言比用自然语言显然更合适。然而,目前思维链生成采用自然语言,而不是形式语言。偶然也夹杂了一些数学符号,但思维链整体还是压倒性的使用英语或中文。R1论文中还提到他们的CoT连计算机代码都排斥在外。感觉上,这其实不是推理的正道,但可以理解其成因。CoT 是模型自主生成的序列,而据以生成的基座大模型本身,其训练数据以自然语言压倒多数。原因之二是开发者刻意追求的可解释性以及对用户的透明性,觉得自然语言大家都容易看明白。R1在设计CoT强化训练的时候,强调了格式的奖励,其中语言一致性当成了一个目标。夹杂不同语言或代码的CoT,剔除出局了。从长远来看,这未必是最明智的决策。

前景与思考

推理模型的 CoT 无疑是神经网络与符号逻辑融合的一次创新,也是近年来人工智能领域的重要里程碑。未来的CoT研究方向,可以考虑越来越多地奖励 CoT 以更加严谨的形式语言表示。至少要文理分科,文科任务(如创作)继续用自然语言做CoT的载体,这类思维过程涉及的主要是篇章规划和表达斟酌,而非严格推理;理工任务(数学、编程、逻辑等)则不同,应该训练模型尽量使用形式语言来表示CoT推理过程。当然,要做到后者,可能还要进一步加强基座模型等代码和其他形式语言的数据配比,否则 LLM也许 “憋”不出来合适的表示。

最后说一下概率模型与符号逻辑的严谨性差异。推理模型的 CoT 是推理模型的现场发挥,很多时候显得不够严谨。但其实人脑也是一样。没人能出口成章地把一个复杂数学证明一气呵成,就如同没人能一口气写出一个没有bugs的程序。严谨性都是在反复校验、修正,甚至是几代科学家前赴后继不断探究中完成的。CoT 不够严谨是拿模型的“草稿”与人类专家的定稿对比产生的印象。可以预见,对于非常复杂的问题,推理模型应该像人类一样反复校正,独立复现结果比对。这可能要指望各种推理 agents 的相互协作,以及它们与人类反馈的多层交互。

【相关】

 

再谈自然模态数据是高维空间的低维流形

这个话题实际上涉及 流形假设(Manifold Hypothesis)对抗样本攻击(Adversarial Attacks)高维几何的脆弱性


1. Normal Bundle 在高维空间的“刺猬”形象

normal bundel 是微分几何里的一个重要术语,中文翻译叫“法丛”,对于欠缺数学背景的我们来说,这个术语不好理解,但理解它对于大模型的骇客攻击与AI安全性蛮重要,咱们先看看它是个什么东西。

先破题:Normal 不是‘正常’,而是‘垂直’!

咱中文里‘法’字,来自‘法线’——就是几何里那个与曲面切线呈90度的垂直方向的线。比如你拿根筷子插进苹果,筷子方向就是苹果表面的‘法线方向’。数学家说的‘法丛’(Normal Bundle),其实就是把曲面上每一点的所有垂直方向‘打包’成捆(Bundle),像给苹果表面插满箭头的刺猬!

刺猬的类比是准确的!在 低维流形嵌入高维空间 时,法丛(Normal Bundle)确实可以被想象成“刺猬”——流形的每个点都有一个法向空间,而法丛就是把这些法向空间整体“打包”在一起。见我让Sora生成的法丛示意图:

这是我给Sora发的指令:

制作3D曲面切线与法线动态演示短视频,为科普用,数学家说的‘法丛’(Normal Bundle),其实就是把曲面上每一点的所有垂直方向‘打包’成捆(Bundle),像给苹果表面插满箭头的刺猬!

有几个关键点:

    • 在 3D 空间里,我们习惯把曲面(2D 流形)的法丛(Normal Bundle)想象成一个 1D 线性空间(即法线),所以它看起来像是一个“箭头丛”。
    • 在更高维空间中,比如一个 d 维流形嵌入到 n 维空间(d < n),它的法丛一般是 (n-d) 维的,这意味着法丛方向本身就有多个自由度,而不只是单纯的“刺”。
    • 用 3D 可视化高维流形的法丛,最常见的做法确实是让法丛的“刺”呈现出扇形的扩展感,因为高维空间的法向方向比低维空间的直观“法线”更加复杂。

所以 Sora 生成的图如果能表现出“立体感更强的刺猬形态”,或者在某些点上看到“扇面展开的刺”,就能更好地表达高维法丛的概念。

想象你是只二维蚂蚁,活在皱巴巴的树叶上。对你来说,前后左右是‘切空间’——现实世界;而上下方向就是‘法丛’——完全不可见的维度。所以‘法丛’的normal,本质是几何垂直性,不是日常说的‘正常不正常’。

数学家眼里的‘法丛’一点也不玄乎,就是垂直方向的集合。既然切空间是‘tangent’(相切的),那垂直方向就叫‘normal’(正交的),跟‘正常’没半毛钱关系!要怪就怪英文一词多义。


2. 高维空间 vs. 自然数据流形

“自然数据(文本、音频、图像、视频等)通常分布在一个远低于高维空间的流形上”,这是 流形假设(Manifold Hypothesis) 的核心观点:

    • 我们的高维数据(比如图片,通常是 256×256×3 维)并没有填满整个高维空间,而是集中在 远低于该维数的流形上
    • 这类似于:宇宙是三维的,但星星和星系主要分布在局部区域,而不是均匀填充整个宇宙。
    • 这个流形的维度一般和“人类可感知的主要变化”相关,比如在 人脸识别模型 里,所有可能的“人脸”数据分布在一个 远低于像素维度的低维流形 上,而这个流形包涵了现实中所有合理的人脸样本。这实际上是人脸与表情解耦可以work的原因。

3. 对抗样本:在法丛方向制造“幽灵数据”

既然 自然数据的流形是稀疏的,那这意味着:

    • 绝大多数可能的数据点 根本不属于自然数据的流形
    • 但在数学上,它们仍然是“合法”的高维向量,可以被构造出来,并且会落在 法丛方向 之中。

这是对抗攻击(Adversarial Attacks) 可以成立的根本原因:

    1. 模型只在自然流形上训练,它对“流形外的点”几乎没有概念。
    2. 对抗攻击就是在法丛方向上微调输入数据,让它离开流形,但仍然能欺骗模型的决策边界。
    3. 由于高维空间的稀疏性,很多非自然数据的点可能距离决策边界非常近,但在我们人类看来它们几乎与原始自然数据无差别。

一个经典的例子是:给神经网络输入一张猫的图片,稍微在 法丛方向 加一点扰动(人眼几乎察觉不到)。这张图片仍然落在数据空间里,但 已经偏离自然流形,导致模型认为它是一只狗。

这种“幽灵数据”之所以有效,正是因为 法丛方向是流形的正交补空间(Orthogonal Complement),而流形本身对它并不敏感——就像蚂蚁看不到第三维的变化。


4. 为什么法丛方向上的攻击有效?

既然自然数据流形本身很低维,而法丛方向是它的补空间,远高于流形维度,那么:

    1. 法丛方向上的变动可以很大,但仍然不影响数据的可感知特性(因为它们对人类而言是“无意义的方向”)。
    2. 但是对于机器学习模型而言,这些方向仍然是合法的数据输入,它并没有经过特殊训练去防御这种扰动。
    3. 于是,在某些关键点上,对抗样本只需要在法丛方向上加一点点扰动,就能让模型的决策边界翻车

这也解释了:

    • 为什么对抗样本攻击几乎无处不在?因为高维空间里“非自然数据”占比极高,总会有某些点可以被找到来攻击模型。
    • 为什么对抗样本对人类视觉几乎无影响?因为它利用的不是“自然数据的流形变化”,而是“法丛方向的变化”,这个方向人类或自然模型根本不敏感。
    • 为什么深度学习模型的泛化能力有时不稳定?因为它们过度依赖训练数据流形,而法丛方向上的任何变化都会导致预测结果的剧烈偏移。

5. 这是否意味着“无限对抗攻击”可能存在?

在理论上,确实可以构造出 无穷多的“几何意义上非自然的数据” 来攻击模型。

    • 这些数据点不属于原始数据流形,但它们可以被设计得 足够接近决策边界,从而诱导模型出错。
    • 只要高维空间的维度够高,法丛方向的自由度就足够多,攻击者总能找到某个点来实现攻击。

这也是为什么:

    • 对抗样本防御是个无止境的军备竞赛,模型越强,对抗攻击手段就要越高级。
    • 对抗训练(Adversarial Training) 是当前最有效的解决方案之一,本质上就是“让模型在法丛方向上也学会一些关键的变化”,从而增加对抗鲁棒性。
    • 如果不考虑计算成本,我们可以尝试在更大的法丛方向空间中做鲁棒性优化,但这通常代价太高,所以现实中只能有限度地解决。万全之策是少有的,迅速堵漏或patches 对应用系统变得尤为重要。

6. AI炼丹里的‘法丛陷阱’

搞大模型训练时,参数空间就像高低起伏的山脉。梯度下降是沿着‘切空间’(Tangent Space)找路,但万一算法抽风往‘法丛’方向抖动,就可能造成极度的训练不稳定。所以高阶炼丹师都要用正则化当护栏,专门防着往法丛深渊掉。

如果没有黑客,模型使用者用到的数据输入都是自然数据,与模型训练集是同质的,模型本身的泛化能力足以轻松应对。这是因为自然数据,包括用户的自然语言指令和样例都处于模型数据的切空间里,好比在平原地带,东西南北方向坡度平缓。

但不怕贼,就怕贼惦记。黑客可以刻意制造法丛区域的数据,攻击模型。法丛处于训练数据没有覆盖的未知区域,以此为测试数据,模型性能就急剧下降,可能表现得一塌糊涂。这就像开车——切空间是方向盘能控制的方向,法丛是侧翻悬崖的方向。

这是个头痛问题,单纯依靠数据中的统计模式,难以实现真正的分布外泛化和可靠的安全性保障。常规数据增强很难解决这个法丛数据攻击的问题,因为常规自然数据如同在已知区域做探索,不会主动探索法丛方向,而且这样的数据在通常的场景极为罕见:正常用户也不会故意跳崖。开发者要探索所有法丛危险方向需要无限资源,防不胜防,通常是对骇客的数据进攻,亡羊补牢,给模型做针对性补漏。

总结:

“刺猬模型”来展示法丛(Normal Bundle)是合理的,需要强调“不同点的法向方向形成的丛”,就能很好地表达它的几何概念。
自然数据流形 vs. 法丛方向的思考是对的,它基于自然数据的流形假设。
高维空间的稀疏性 + 法丛方向上的非自然数据确是对抗攻击成立的根本原因,所以确实可以构造无数个“几何上合法但不自然”的数据点来让模型翻车。
如果要防御,关键是让模型学会法丛方向上的“稳定性”,这就是对抗训练、正则化、鲁棒性优化、构造对抗数据patching等技术的意义。

高维空间和对抗攻击的研究,可以进一步研读对抗学习(Adversarial Learning)相关论文,尤其是 Ian Goodfellow 提出的 FGSM(Fast Gradient Sign Method)经典攻击方法及其后续的种种高级变体

 

【相关】

大模型三阶段的 scaling laws 接力赛

黄教主背后是三个S曲线,illustrate 的是大模型三个阶段的“做大做强”的 scaling 接力赛,颇显挖山不止的愚公移山精神。

我们知道,大模型有三个阶段:预训练、后训练、在线推理。过去几个月最大的改变是,业内基本有了共识,就是伊利亚宣称的说法,预训练时代结束了,著名的预训练的 scaling law 的经验法则貌似走到了头,进入平台期。于是有了推理模型(OpenAI O 系列,以及deepseek R 系列等)的兴起,强调的是后训练的思维链强化学习的投入以及对于在线推理时间(所谓 test time compute)的利用。推理模型也确实在数学、代码以及文字创造性方面展现了前所未有的亮眼成绩。

推理模型的后训练 scaling 刚开始,能走多远,还不清晰。但这个轨迹可以从 o1 变成 o3,以及 r1 到据说今后一两个月随时可能发布的 r2 等能力增强上,慢慢看到。最后这个推理阶段的 test time scaling 呢?

前阵子我跟国内最早鼓吹 scaling 三条S曲线的老友 Junlin 说,根本就没看到什么 test time scaling 呀,因为用户不能掌控模型的 test time compute,它花多少时间/算力,啥时候完成我给它的指令任务,是大模型自己决定的,test time 并不是可以“伸缩”(scaling)的呢。Junlin说,目前确实如此。

这几天玩大模型 deep research,逐渐体会到一点 test time scaling 的伸缩可能性。答案的端倪出现了。说到底就是,如果一个query 或课题,有没有一条曲线表示,如果你给它更多的思考和响应时间,它就完成得更好。具体说,在 o3-mini 下,有一个 button 叫 deep research,用户可以选择用或者不用。如果不用,你的问题也会有思维链,因为你一开始就选择了已经后训练强化的 o3 推理模型。推理模型的思维过程通常是一两分钟吧。但是如果你同时又按下 deep research 按钮,它最终完成任务的推理时间是加n倍的等待时间,可以长达10来分钟。这至少让我们看到了,模型不变,但推理现场的缩放时间不同,其结果是不同的。这应该算是 test time scaling 的前序或影子了。

那它是怎么做到的呢?让用户可以根据自己的课题的难易或挑战性,以及自己可以容忍的等待时间,来对同一个课题做不同的 test time compute 的投入,以便生成不同的结果呢?原来,它用的是某种 agent 的思路。deep research 这个按钮所提供的功能,实际上就是一个研究性推理的 agent。agent 是 LLM-native 的附加 feature,但不需要改变模型,它所改变的是在推理阶段与用户的交互方式。目前这种交互非常简单,只有一轮,但所开辟的这个 test time scaling 方向,预计可以继续探索与用户更长更多的交互,来帮助最大化 test time compute 的效果。

如果 test time compute scaling 并不是很快就遇到瓶颈,可以想象将来的 deep research 可以与用户互动很长的时间去完成一个非常复杂的项目,也许不是分钟量级的推理时间投入了,完全可以想象大模型投入 hours 甚至 days 来完成一个高难课题,譬如一个人类研究员需要几个月甚至几年才能完成的项目,或者完成一个人类无法完成的研究项目。当前的 deep research 非常简单,它在得到用户的 prompt/query 后,立即分解问题,并反问用户五六个简单的问题,来确认这个研究所需要的资料来源、广度、深度以及注意事项。得到用户的反馈以后,模型开始接受用户更新的资料(if any),并用 search 来收集更多的相关资料,然后按照任务的分解以及与用户确认过的计划和信息,对于每一个来源做分析,最后综合贯通,形成研究报告。这样一来,它所需要耗费的推理时间自然就加长了,因为任务不再是单一的任务,资料也不仅仅是自己模型内部已经消化了的知识,而是现场搜索的更多来源,处理这一切都需要时间。

对于推理模型的后编辑阶段的强化学习以及它在推理阶段的 test time compute 的投入,这两阶段的 scaling 征程刚刚开始。希望这两条S曲线还可以稳定上升一段时间,让 scaling 的接力赛助力我们在通用智能(AGI)和超级智能(ASI)的道路上不断前行。

 

 

【相关】

张俊林:从Deepseek R1看Scaling Law

Fundamental Limitations of Deep Learning: Origins in Data-Driven Methodology

In today's rapidly evolving artificial intelligence landscape, deep learning models have become the core engine driving technological innovation. However, behind these impressive achievements, deep learning faces several fundamental limitations that are not merely technical implementation challenges but are determined by the essence of its methodological approach.

This article explores the core limitations of deep learning beyond the well-known "black box" problem and analyzes their mathematical origins.

I. "Original Sin" of Data-Driven Approaches: Philosophical Dilemma of Statistical Learning

Confusion Between Correlation and Causation

Deep learning models are essentially high-dimensional probability density estimators. Their core objective is to find the best approximation of the conditional probability distribution P(y|x;θ) through parameters θ. Models learn from large volumes of training data, attempting to capture statistical patterns of various sizes and generalize them to unknown data. However, this statistical learning paradigm leads to a fundamental problem: models learn P(y|x) rather than P(x→y) – statistical correlation rather than causal relationships.

Consider a simple example: an AI medical system might discover that a certain type of rash is highly correlated with malaria diagnoses (possibly because the data was collected in regions with mosquito proliferation issues). The model establishes a pseudo-causal relationship of "rash → malaria" while overlooking temperature, humidity, and other actual disease factors.

This "causal misplacement" leads to poor model performance in new environments:

    • In regions without mosquito problems, the model may over-diagnose malaria
    • When facing new infectious diseases, the model may misclassify them as known categories
    • When the diagnostic environment changes, model performance significantly deteriorates

Information Bottleneck and Compression Distortion

According to information bottleneck theory, neural networks need to perform a special kind of information compression during training: discarding information in input X that is irrelevant to prediction Y while preserving all relevant information. Mathematically, this is expressed as maximizing:

I(Z;Y) - β·I(X;Z)

Where Z is the intermediate representation, I denotes mutual information, and β is a trade-off coefficient.

When training data is insufficient or biased, this compression process encounters serious problems:

    1. Discarding genuine causal signals (e.g., cell morphological features in medical images)
    2. Preserving pseudo-correlative signals (e.g., using hospital wall colors as diagnostic criteria)

The essence of this "lossy compression" causes models to grasp incorrect features in new environments. In fact, when H(Y|X) is incorrectly minimized, the model establishes data defect-driven false information channels rather than accurate mappings of reality.

II. The Low-Dimensional Manifold Hypothesis for Natural Data

A classic assumption in machine learning theory is that natural data resides on low-dimensional manifolds within high-dimensional spaces. Taking a simple example of a two-dimensional manifold in three-dimensional space, it resembles folded paper – although data points exist in 3D space, the intrinsic structure is 2D. Manifolds possess local Euclidean properties of smoothness and continuity: the neighborhood of any point on the manifold can be mapped to a low-dimensional Euclidean space. For instance, when a face rotates, the image slides continuously on the manifold without sudden changes.

Basic Concepts

    • High-dimensional space: Refers to mathematical spaces with dimensions far greater than 3. For example, a 100x100 pixel image exists in a 10,000-dimensional space (each pixel being one dimension).
    • Low-dimensional manifold: A continuous, smooth low-dimensional structure embedded in high-dimensional space. For example, a two-dimensional surface in three-dimensional space, or a structure of dozens of dimensions in a space of millions of dimensions. For instance, all ways of writing the digit "2" in a 784-dimensional pixel space form an approximately 10-dimensional manifold (controlling stroke thickness, tilt, curvature, etc.).

Why Natural Data Forms Low-Dimensional Manifolds

Natural data (such as video, images, audio, text) may seem to contain high-dimensional features but is constrained by physical laws and semantic restrictions, exhibiting low-dimensional characteristics:

Physical constraints:

    • A facial photograph's parameters are limited by bone structure, lighting angle, facial muscle movements, etc., with actual degrees of freedom potentially fewer than 50 dimensions.

Semantic constraints:

    • In textual data, grammatical rules and semantic coherence restrict seemingly unlimited vocabulary combinations to a finite meaning space. Other modal data is similar, also constrained by relationships between atomic units (tokens).

Dimensionality Reduction and Feature Extraction

The information "compression" in models is actually a process of dimensionality reduction and feature extraction. For example, the hierarchical structure of Convolutional Neural Networks (CNNs) progressively strips away redundant dimensions, approaching the essence of data manifolds. Shallow layers extract edges (local linear structures), while deeper layers combine them into object parts (global manifold structures). Manifold Learning explicitly recovers the intrinsic low-dimensional structure of data.

Taking 3D object recognition as an example: The translation and rotation of objects in 3D space form a 6-dimensional manifold (3 translations + 3 rotations). When related video image data is embedded in high-dimensional pixel space, ideal 3D object recognition involves dimensionality reduction to its 6-dimensional manifold, identifying objects through feature extraction.

III. Adversarial Examples: Fragility at Distribution Boundaries

Adversarial examples refer to samples that, through minor perturbations to original input samples, can cause deep learning models to produce incorrect outputs. For instance, a slightly modified panda image might be identified as a turtle with 99% confidence by AI.

The existence of adversarial examples reveals structural defects in data manifolds, challenging the traditional manifold hypothesis discussed above and exposing its fragility:

    • Natural data manifolds contain numerous "holes": areas not covered by training data
    • Manifold boundaries have high-curvature regions: minor perturbations can cross category boundaries

Theoretically, the possible combinations of high-resolution color images far exceed astronomical numbers. While natural images are constrained by physical laws, substantially reducing the effective space, it remains far from being adequately covered by existing datasets. This data sparsity is one fundamental reason why deep learning models are susceptible to adversarial attacks and struggle to generalize to extreme scenarios.

This sparse coverage allows attackers to find vulnerable points near decision boundaries. For example, adding carefully designed noise to a panda image that is almost imperceptible to the human eye can cause an image recognition model to misclassify it as a turtle.

Adversarial examples are not random but systematically exploit the geometric structure of model decision boundaries. A panda image being identified as a turtle is not due to random noise but because the noise is precisely added in the direction of the shortest path to the decision boundary.

Failure of Lipschitz Continuity

Lipschitz continuity is a metric for measuring how sensitive a function is to input changes. The higher the Lipschitz constant (L-value) of a deep network, the more sensitive the model is to input perturbations. The L-value of actual deep networks in adversarial directions can reach 10^3 magnitude, meaning that even minor perturbations may cause dramatic changes in model output. For example, in an autonomous driving system, if the image recognition model is overly sensitive to input perturbations, it might misidentify a large truck crossing an intersection as sky, leading to incorrect driving decisions.

Ideal classification models should satisfy the Lipschitz continuity condition, meaning that minimal input changes should only lead to limited output changes:

‖f(x+δ)-f(x)‖ ≤ L‖δ‖

Mathematical expression meaning:

‖model(input+small change) - model(input)‖ ≤ L × ‖small change‖

L is the "sensitivity coefficient," smaller L is better.

The failure of Lipschitz continuity causes input space to exhibit strong anisotropy (i.e., sensitivity in different directions varies dramatically). Imagine standing in complex terrain:

    • Natural perturbation directions (L≈1): Like walking on a gentle slope, moving 1 meter changes elevation by 1 meter, movement is safe and controllable
    • Adversarial perturbation directions (L≫1, e.g., L=10³): Like standing at a cliff edge, moving 1 centimeter might result in a 100-meter fall

This geometric structure makes it difficult for data augmentation based on uniform sampling to cover high-risk areas, as these areas have extremely low probability in natural data distribution but are "close" in Euclidean distance. For example:

    • Natural direction: Not sensitive to perturbations like lighting changes, blur, etc. (L≈1) ➔ Model can correctly handle everyday image variations
    • Adversarial direction: Specific minor perturbations cause dramatic changes (L=10³) ➔ Like applying "magic noise" to images, causing model misclassification

The Danger:

    • Exploited by attackers: Finding high-L directions to create adversarial examples is like knowing cliff locations and specifically targeting vulnerable points
    • Difficult to defend: Regular training covering all directions is prohibitively expensive, like requiring hikers to adapt to all terrain types, which is unrealistic

IV. The Mathematical Chasm Between Interpolation and Extrapolation

Interpolation Success vs. Extrapolation Failure

Deep learning models perform excellently on interpolation tasks but often fail in extrapolation tasks. This is not coincidental but determined by the essence of statistical learning:

    • Interpolation: Predicting points within the support set of the training data distribution, equivalent to filling gaps in known regions
    • Extrapolation: Predicting points outside the support set of the training data distribution, equivalent to exploring unknown regions

The success of modern deep learning largely depends on the assumption that "training distribution ≈ testing distribution." When this assumption is broken, extrapolation problems become severe, and model performance deteriorates dramatically.

Differential Geometric Explanation of Extrapolation Failure

Imagine you are a geographer drawing terrain maps:

    • Input space (M): The entire Earth's surface, containing plains, mountains, canyons, and various terrains
    • Data distribution (P_data): Regions explored by humans (cities, roads, farmland, etc.)
    • Classification model (f): Maps drawn based on terrain features (marking where forests, deserts are)
    • Decision boundaries: Transition zones between different terrains (e.g., transition between forest and grassland)

Tangent Space: Trends in terrain changes in explored areas. For example, in plains, slopes are gentle in east, west, north, and south directions (corresponding to natural perturbation directions).

The normal bundle refers to directions perpendicular to explored areas, such as suddenly appearing cliffs.

Key problem: Maps are accurate in explored regions but fail in unknown cliff areas.

When moving in unknown cliff areas, test data falls in the normal bundle of the training data distribution, and model generalization performance drops dramatically. This situation can be characterized by the following inequality:

∇ₓ log P_data(x)·δ > κ

Mathematical expression meaning:

(Terrain steepness) × (Movement direction) > (Map boundary blurriness)

Where κ is the curvature radius of the decision boundary, comparable to the width of the transition zone between forest and grassland on the map; δ is the perturbation vector, i.e., the direction of movement.

∇ₓ log P_data(x): "Terrain steepness" of data distribution

    • In frequently visited human areas (like cities), terrain is gentle (small gradient)
    • In uninhabited areas (like deep sea), terrain is steep (large gradient)

It is impossible to effectively cover unknown cliff areas through conventional training data augmentation because they have extremely low probability in the training distribution. Conventional data augmentation is like exploring in known areas and will not actively explore cliff directions because (1) the probability is extremely low: normal people don't deliberately jump off cliffs; (2) the cost is prohibitively high: exploring all dangerous directions requires infinite resources.

Consequence: When map users accidentally walk to the edge of a cliff, the navigation provided by the map fails; the map cannot predict whether you will fall off the cliff or discover a new continent.

Beyond Data-Driven Artificial Intelligence

The limitations of deep learning are not temporary technical difficulties but methodological boundaries determined by its "data-driven" nature. Relying solely on statistical patterns in data makes it difficult to achieve true causal understanding, out-of-distribution generalization, and reliable security guarantees.

One future direction may be to combine data-driven learning with structured prior logical symbolic systems, creating hybrid systems that can both leverage massive data and possess causal reasoning capabilities.

 

 

【Related】

深度学习的局限性研究综述

在人工智能快速发展的今天,深度学习大模型已成为推动技术革新的核心引擎。然而,在这些耀眼成就的背后,深度学习也面临着一系列根本性的局限,这些局限不仅是技术实现上的挑战,更是其方法论本质所决定的。

本文探讨深度学习除了黑箱以外的核心局限性,并分析它们的数学根源。

请参照机器自动生成的研究报告 o3 deep research: 深度学习局限性研究报告,本文不是在该研究报告基础上修正的版本,而是笔者综述调研同时进行的平行版本。因此,不敢说一定更好,虽然我花了不少时间核对、查验、精简、修正,道理上应该靠谱一些,至少可读性更好(?)。

一、数据驱动的"原罪":统计学习的哲学困境

相关性与因果关系的混淆

深度学习模型本质上是高维概率密度估计器,它的核心目标是通过参数θ找到条件概率分布P(y|x;θ)的最佳近似。模型通过学习大量的训练数据,试图捕捉数据中的大大小小的统计规律,并将其泛化到未知数据。然而,这种统计学习范式决定了一个根本性问题:模型学习的是P(y|x)而非P(x→y),即统计相关性而非因果关系。

举个简单例子,假设一个医疗AI系统在训练数据中发现,某种皮疹与疟疾诊断高度相关(可能因为采集数据的地区同时存在蚊虫滋生问题)。模型会建立"皮疹→疟疾"的伪因果关系,而忽略温度、湿度等真实致病因素。再如,模型可能学习到“公鸡打鸣”与“太阳升起”之间的强相关性,但这并不意味着公鸡打鸣导致了太阳升起。

这种"因果错置"导致模型在新环境中表现不佳:

    • 在没有蚊虫问题的地区,模型可能过度诊断疟疾
    • 面对新型传染病,模型可能将其误判为已知类别
    • 当诊断环境变化时,模型性能会显著下降

信息瓶颈与压缩失真

根据信息瓶颈理论,神经网络在训练过程中需要执行一种特殊的信息压缩:丢弃输入X中与预测Y无关的信息,同时保留所有相关信息。数学上表达为最大化:

I(Z;Y) - β·I(X;Z)

其中Z是中间表示,I表示互信息,β是权衡系数。

当训练数据不足或有偏时,这种压缩过程会出现严重问题:

    1. 丢弃真实因果信号(如医学图像中丢弃细胞形态学特征)
    2. 保留伪相关信号(如将医院墙面色调作为诊断依据)

这种"有损压缩"的本质导致模型在新环境中往往抓住了错误特征。实际上,当H(Y|X)被错误最小化时,模型建立的是数据缺陷驱动的虚假信息通道,而非对现实的准确映射。

二、自然数据的低维流形假说

机器学习理论中有一个经典假设:自然数据位于高维空间的低维流形上。以简单的三维空间中的二维流形为例,它就形似卷起的纸张,虽然数据点存在于3D空间,但内在结构是2D的。流形具有光滑性与连续性的局部欧几里得性:流形任意点的邻域可映射到低维欧几里得空间。例如,人脸旋转角度变化时,图像在流形上连续滑动,不会突变。

基本概念

    • 高维空间:指维度远大于3的数学空间,例如一张100x100像素的图像存在于10,000维空间中(每个像素为一个维度)。
    • 低维流形:嵌入在高维空间中的连续、光滑的低维结构。例如,三维空间中的二维曲面,或万维空间中的几十维结构。例如,784维像素空间中,数字"2"的所有写法构成约10维流形(控制笔画粗细、倾斜、弧度等)。

自然数据为何形成低维流形

自然数据(如视频、图像、语音、文本)看似蕴含着高维特征,实则受物理规律和语义约束,呈现低维特性:

    • 物理约束
      一张人脸照片的参数受限于骨骼结构、光照角度、表情肌肉运动等,实际自由度可能不足50维。
    • 语义约束
      文本数据中,语法规则和语义相谐性将看似无限的词汇组合限制在有限的意义空间内。其他模态数据也是如此,同样存在原子性单元(tokens)之间相互关系的约束。

降维与特征提取

模型的信息“压缩”实际上是降维与特征提取的过程。例如,卷积神经网络(CNN)的层级结构逐步剥离冗余维度,逼近数据流形本质。浅层提取边缘(局部线性结构),深层组合成物体部件(全局流形结构)。流形学习(Manifold Learning)意味着显式恢复数据的内在低维结构。

以3D物体识别为例
物体在3D空间中的平移、旋转形成6维流形(3个平移+3个旋转)。当相关视频图像数据嵌入到高维像素空间中以后,理想的3D物体识别就是降维到其6维流形,通过特征抽取识别物体。

三、对抗样本:分布边界的脆弱性

对抗样本是指通过对原始输入样本进行微小的扰动,就能使深度学习模型产生错误输出的样本。例如,一张微调过的熊猫图片会被AI以99%的置信度识别为乌龜。

对抗样本的存在揭示了数据流形的结构性缺陷,挑战了上文的传统流形假说,揭示了这一假说的脆弱性:

    1. 自然数据流形存在大量"孔洞":未被训练数据覆盖的区域
    2. 流形边界存在高曲率区域:微小扰动即可跨越类别边界

ImageNet包含128万张标注图像,但这些数据仅覆盖了自然图像空间的极小部分。理论上,高分辨率彩色图像的可能性组合数远超天文数字,而虽然自然图像受物理规律约束,实际有效空间大幅减少,但仍远未被现有数据集充分覆盖。这种数据稀疏性是深度学习模型易受对抗样本攻击、难以泛化到极端场景的根本原因之一。

这种稀疏覆盖使得攻击者可以在决策边界附近找到脆弱点。例如,在一张熊猫图片中加入一些精心设计的噪声,人眼几乎无法察觉,但却可以使图像识别模型将其误判为烏龜。

对抗样本不是随机的,而是系统性地利用了模型决策边界的几何结构。一张熊猫图片被识别为烏龜,不是因为随机噪声,而是因为噪声被精确添加到决策边界的最短路径方向。

李普希茨连续性的失效

李普希茨连续性是衡量函数对输入变化敏感程度的一个指标。深度网络的李普希茨常数(L值)越大,表示模型对输入的扰动越敏感。实际深度网络的 L 值在对抗方向上可达 量级,这意味着即使微小的扰动也可能导致模型输出发生剧烈变化。例如,自动驾驶系统中的图像识别模型如果对输入的扰动过于敏感,就可能将前方横穿路口的大卡车误识别为天空,从而导致错误的驾驶决策。

理想的分类模型应满足李普希茨连续条件,即输入的微小变化只能导致输出的有限变化:

‖f(x+δ)-f(x)‖ ≤ L‖δ‖

数学表达含义:‖模型(输入+小改动) - 模型(输入)‖ ≤ L × ‖小改动‖
L是"敏感系数",L越小越好。

李普希茨连续性失效导致输入空间呈现强烈的各向异性(即,不同方向上的敏感度天差地别)。想象你站在一片复杂地形中:

    • 自然扰动方向(L≈1):如同缓坡行走,移动1米海拔变化1米,行动安全可控
    • 对抗扰动方向(L≫1, 例如 L=10³):如同悬崖边缘,移动1厘米可能坠落100米

这种几何结构使得基于均匀采样的数据增强很难覆盖高风险区域,因为这些区域在自然数据分布中概率极小,但在欧氏距离上却很"近"。例如,

    • 自然方向:对光照变化、模糊等扰动不敏感(L≈1)
      ➔ 模型能正确处理日常图片变化
    • 对抗方向:存在特定微小扰动导致剧烈变化(L=10³)
      ➔ 如同在图片上施加"魔法噪声",使模型错判

各向异性的危险

    • 攻击者利用:找到高L方向制作对抗样本
      就像知道悬崖位置后,专攻脆弱点
    • 防御困难:常规训练覆盖所有方向成本过高
      如同要求登山者适应所有地形,不现实

四、内插与外推的数学鸿沟

内插成功vs外推失败

深度学习模型在内插(interpolation)任务上表现出色,但在外推(extrapolation)任务上往往失效。这不是偶然现象,而是其统计学习本质决定的:

    • 内插:预测落在训练数据分布支撑集内的点,相当于填补已知区域的空白
    • 外推:预测落在训练数据分布支撑集外的点,相当于探索未知区域

现代深度学习的成功很大程度上依赖于"训练分布≈测试分布"这一假设。当这一假设被打破时,外推问题严重,模型的表现会急剧恶化。

外推失效的微分几何解释

从微分几何视角看,可以将输入空间视为黎曼流形(M,g),分类模型f:M→ℝ^C将数据点映射到类别空间。

想象你是一位绘制地形图的地理学家:

输入空间(M):整个地球表面,包含平原、高山、峡谷等各种地形

数据分布(P_data):人类已探索区域(城市、公路、农田等)

分类模型(f):根据地形特征绘制的地图(标注哪里是森林、哪里是沙漠)

决策边界:不同地形的分界线(如森林与草原的过渡带)

切空间(Tangent Space):已探索区域的地形变化趋势,例如在平原地带,东西南北方向坡度平缓(对应自然扰动方向)。所谓法丛区域(normal bundle)指的是垂直于已探索区域的方向,例如突然出现的悬崖。

关键问题:地图在已探索区域表现精准,但对未知悬崖区域失效。

在未知悬崖区域移动时,测试数据落在训练数据分布的法丛区域,模型泛化性能急剧下降。这种情况可以用以下不等式表征:

 ∇ₓ log P_data(x)·δ > κ

数学表达含义:(地形陡峭度) × (移动方向) > (地图边界模糊度)

其中κ为决策边界的曲率半径,好比地图标注的森林与草原的过渡带宽;δ为扰动向量,即移动的方向。

∇ₓ log P_data(x):数据分布的"地形陡峭度"

      • 在人类常去区域(如城市),地形平缓(梯度小)
      • 在无人区(如深海),地形陡峭(梯度大)

无法通过常规训练数据增强来有效覆盖未知悬崖区域,因为它们在训练分布中概率极低。常规数据增强如同在已知区域做探索,不会主动探索悬崖方向,因为(1)概率极低:正常人不会故意跳崖;(2)成本过高:探索所有危险方向需要无限资源。

后果:当地图使用者意外走到悬崖边时,地图提供的导航失效,地图无法预测你会掉下悬崖还是发现新大陆。

结论:超越数据驱动的人工智能

深度学习的局限不是技术实现上的暂时困难,而是其"数据驱动"本质所决定的方法论边界。单纯依靠数据中的统计模式,难以实现真正的因果理解、分布外泛化和可靠的安全性保障。

一个未来方向可能是将数据驱动学习与结构化先验逻辑符号系统相结合,打造既能利用海量数据又具备因果推理能力的混合系统。

 

【相关】

 

深度学习的基石:多层感知机

一、单层感知机的致命缺陷

要理解多层感知机的突破性,我们先看一个经典案例:假设我们需要实现“异或”逻辑(XOR),定义如下:

| 输入A:0 | 输入B:0 | 输出:0 |
| 输入A:0 | 输入B:1 | 输出:1 |
| 输入A:1 | 输入B:0 | 输出:1 |
| 输入A:1 | 输入B:1 | 输出:0 |

当我们在坐标系中绘制这些点时,会发现正例(0,1)和(1,0)位于对角线两侧,形成一个典型的非线性可分问题。单层感知机的决策边界只能是直线,就像试图用一把直尺分开两堆交叉摆放的硬币——这是数学上证明不可能完成的任务(闵斯基1969年证明)。

二、解法:特征空间升维

关键思路:通过增加隐藏层,将原始二维输入投影到三维特征空间。

我们设计两个特殊神经元:

神经元H₁:激活条件 = 1*A + (-1)*B > 0.5
神经元H₂:激活条件 = (-1)*A + 1*B > 0.5

输入变换过程

当输入(1,0)时:

H₁:1*1 + (-1)*0 = 1 → 激活
H₂:(-1)*1 + 1*0 = -1 → 不激活

当输入(0,1)时:

H₁:1*0 + (-1)*1 = -1 → 不激活
H₂:(-1)*0 + 1*1 = 1 → 激活

当输入(1,1)时:

H₁:1*1 + (-1)*1 = 0 → 不激活
H₂:(-1)*1 + 1*1 = 0 → 不激活

此时特征空间变为:

| 原始输入:(0,0) | 隐藏层特征 :(0,0) |
| 原始输入:(0,1) | 隐藏层特征 :(0,1) |
| 原始输入:(1,0) | 隐藏层特征 :(1,0) |
| 原始输入:(1,1) | 隐藏层特征 :(0,0) |

神奇的事情发生了——原本线性不可分的问题,在特征空间中被转换为线性可分问题!

三、输出层

在输出层,我们只需一个简单的OR逻辑:

输出 = H₁ OR    H₂

此时只需一条直线就能完美分割正负例。这种「空间变换+线性分割」的思想,正是深度学习突破维度诅咒的武器。现代神经网络中,每个隐藏层都在进行更复杂的空间扭曲,最终在高维特征空间中用超平面分割数据。

四、数学本质:非线性变换

整个过程可视为:

f(X) = σ(W₂·σ(W₁X + b₁) + b₂

其中:

W₁是第一层权重矩阵 [[1,-1], [-1,1]]
b₁是偏置向量 [-0.5, -0.5]
σ是阶跃激活函数
W₂是输出层权重 [1,1]
b₂是输出偏置 -0.5

这个结构实现了:
1. 第一层:将输入空间扭曲为线性可分的新空间
2. 第二层:在新空间中进行线性分类

传统OR门的感知机表达式:

输出 = 1*H₁ + 1*H₂ - 0.5 > 0

每个输入的权重都是1,表示H₁和H₂同等重要
当任意一个输入为1时,加权和为1;两个都为1时和为2
设置阈值0.5(移项后表达式为加权和 > 0.5)
只要有一个输入为1(1 > 0.5),即触发激活
两个都为0时(0 > 0.5)不激活


用真值表验证公式的正确性:

H₁ H₂ 计算过程 结果
0 0 0+0-0.5 = -0.5 0
0 1 0+1-0.5 = 0.5 1
1 0 1+0-0.5 = 0.5 1
1 1 1+1-0.5 = 1.5 1

(注:在XOR场景中,H₁和H₂不会同时为1,最后一行为理论验证)

用Python实现这个经典XOR网络:

import numpy as np

# 定义网络结构
W1 = np.array([[1, -1], [-1, 1]])  # 第一层权重
b1 = np.array([-0.5, -0.5])        # 第一层偏置
W2 = np.array([1, 1])              # 输出层权重
b2 = -0.5                          # 输出层偏置

def perceptron(X):
    # 第一层计算
    h = np.heaviside(np.dot(X, W1) + b1, 0)
    # 输出层计算
    return np.heaviside(np.dot(h, W2) + b2, 0)

# 测试所有输入
inputs = [[0,0], [0,1], [1,0], [1,1]]
for x in inputs:
    print(f"输入{x} → 输出{perceptron(x)}")

输出结果:

输入[0, 0] → 输出0
输入[0, 1] → 输出1
输入[1, 0] → 输出1
输入[1, 1] → 输出0

六、历史意义与延伸

这个简单案例揭示了深度学习的核心思想:

- 层次化处理:如同视觉皮层V1→V2→V4的信息处理流程
- 分布式表示:单个概念由多个神经元协同表示
- 端到端学习:现代网络通过反向传播自动学习W,b参数

今天的Transformer架构依然延续这个基本原理,只是:

- 隐藏层数从2层增加到数百层
- 手动设计参数变为自动优化
- 阶跃激活变为ReLU等平滑函数
- 增加了注意力机制等复杂交互

理解这个案例,就掌握了理解深度学习的钥匙——任何复杂网络,本质上都是这个「俄罗斯套娃」结构的扩展与优化。

 

o3 Deep Research: DeepSeek R1 多阶段训练流程问答解析

好的,我将对 DeepSeek R1 的整体训练过程进行研究,并重点分析强化阶段(第二、三、四阶段)的具体细节,包括 RL、SFT、CoT 的方法和策略。

报告将采用问答解析的形式,同时保持一定的技术深度,并确保可读性。还会在必要时提供与 GPT-4、Claude、Gemini 等模型的简单核心对比,以展示其独特性。

我会尽量参考 DeepSeek 官方网站的论文和技术资料,同时结合网络上的研究和学习经验进行综合分析。

DeepSeek R1 多阶段训练流程问答解析

Q1: DeepSeek R1 的整体训练包含哪些阶段,为什么采用多阶段策略?

A: DeepSeek R1 采用了四阶段的训练流程,包括两个强化学习(RL)阶段和两个监督微调(SFT)阶段 (DeepSeek-R1的四个训练阶段 - 蝈蝈俊 - 博客园)。这一多阶段策略旨在先通过少量数据稳定模型输出格式,然后大规模提升推理能力,接着扩展通用能力,最后对齐人类偏好,逐步打造出既擅长推理又安全实用的模型 (DeepSeek-R1的四个训练阶段 - 蝈蝈俊 - 博客园) (DeepSeek-R1的四个训练阶段 - 蝈蝈俊 - 博客园)。具体来说:

通过上述多阶段渐进式训练,DeepSeek R1 最终在推理能力上达到接近OpenAI o1系列闭源模型的水平,同时保持了输出的规范性和对用户需求的良好适应 ([2501.12948] DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning) (阅读 | DeepSeek-R1:怎么用强化学习把一个普通语言模型调教成推理高手?_腾讯新闻)。

Q2: 第二阶段的推理强化学习是如何实施的?训练是逐个问题进行还是批量进行?训练数据是否会保留?奖励机制如何设计?

A: 阶段2是针对推理能力的强化学习训练。在这一阶段,DeepSeek R1 采用了GRPO算法(分组相对策略优化)来高效地进行RL训练 ([2501.12948] DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning)。具体来说,对每个问题,不会只生成单一回答,而是从当前策略采样一组不同的回答,然后根据这组回答的得分情况来优化模型 ([2501.12948] DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning) ([2501.12948] DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning)。这种“按问题分组”的方式相当于批量生成和评价:每道训练题目产生多个解答,计算每个解答的奖励,并用组内奖励的相对差异(优势值)指导模型参数更新 ([2501.12948] DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning)。由于采用组内平均得分作为基准(baseline),GRPO 不需要额外的价值网络(critic),降低了大模型RL的开销 ([2501.12948] DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning)。因此,就单个问题而言是通过多次尝试来强化,但在实现中会并行处理多个问题批次,以加速训练。每轮生成的回答在用于计算梯度更新后并不长期保留,属于在线的RL采样;只有当阶段2训练收敛后,会使用最终的模型来批量生成数据供下阶段使用 (DeepSeek-R1的四个训练阶段 - 蝈蝈俊 - 博客园)。

奖励机制方面,DeepSeek R1 在此阶段设计了规则奖励,主要包括:

最终,以上各项奖励会加权求和形成总奖励 (DeepSeek-R1的四个训练阶段 - 蝈蝈俊 - 博客园)。模型通过最大化期望奖励来更新参数:正确且格式规范、语言一致的回答获得最高回报,从而模型逐步学会既推理正确表述规范地回答问题 (DeepSeek-R1的四个训练阶段 - 蝈蝈俊 - 博客园)。

值得一提的是,DeepSeek R1-Zero(没有冷启动微调的版本)在纯RL下已经自行涌现出了反思验证、超长链式推理等强大能力,但同时输出可读性差、语言混杂 (阅读 | DeepSeek-R1:怎么用强化学习把一个普通语言模型调教成推理高手?_腾讯新闻) (阅读 | DeepSeek-R1:怎么用强化学习把一个普通语言模型调教成推理高手?_腾讯新闻)。因此在 R1 中通过以上冷启动和奖励改进,显著改善了这些问题 (阅读 | DeepSeek-R1:怎么用强化学习把一个普通语言模型调教成推理高手?_腾讯新闻)。阶段2 的RL训练让模型的推理准确率在数学等任务上大幅提升(例如 AIME 数学竞赛准确率从15.6%提高到71% (阅读 | DeepSeek-R1:怎么用强化学习把一个普通语言模型调教成推理高手?_腾讯新闻)),为后续步骤打下强大的推理基础。训练过程中产生的大量问答尝试并未直接用于模型参数更新之外的用途,而是在训练完成后经过筛选用于下一阶段的数据集构建 (DeepSeek-R1的四个训练阶段 - 蝈蝈俊 - 博客园)。

Q3: 第三阶段为什么要用 60 万条推理再生数据和 20 万条非推理数据进行微调?这一混合微调策略有何作用?

A: 阶段3是承上启下的监督微调,目的是在保持高推理能力的同时扩展模型的通用能力 (DeepSeek-R1的四个训练阶段 - 蝈蝈俊 - 博客园)。之所以采用“60万推理 + 20万非推理”的数据组合,主要有以下考虑:

Q4: 第四阶段为何需要再次进行强化学习?这一阶段是如何结合人类偏好进行对齐的,人类偏好对齐有什么必要性?

A: 阶段4是DeepSeek R1的二次强化学习阶段,核心目的在于对齐人类偏好,进一步提升模型在实际应用中的安全性和实用性 (DeepSeek-R1的四个训练阶段 - 蝈蝈俊 - 博客园)。即使经过阶段2和阶段3,模型在推理和一般任务上已表现出色,但仍可能存在不符合用户期望的行为,例如回答不够礼貌有用,或在敏感问题上产生不安全内容。这正是当前尖端LLM都会面临的问题,需要引入人类偏好对齐(例如 OpenAI 的GPT-4通过RLHF过程进行对齐)。对于DeepSeek R1,这一阶段通过融合人类偏好相关的奖励信号来微调模型,使其行为更符合人类期望 (DeepSeek-R1的四个训练阶段 - 蝈蝈俊 - 博客园)。具体而言:

通过上述措施,阶段4 实现了模型行为和人类期望的深度对齐,相当于执行了一次RLHF式(基于人类反馈的强化学习)训练。 (阅读 | DeepSeek-R1:怎么用强化学习把一个普通语言模型调教成推理高手?_腾讯新闻)在对齐后,DeepSeek R1 兼具强大的推理能力和良好的安全性/有用性:既能给出复杂问题的正确解答,又能确保回答让用户容易理解、愿意接受,在敏感问题上遵循安全准则 (DeepSeek-R1的四个训练阶段 - 蝈蝈俊 - 博客园) ([2501.12948] DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning)。这种人类偏好对齐对于模型大规模应用是必要的 (DeepSeek-R1的四个训练阶段 - 蝈蝈俊 - 博客园)——它保证模型不会因为追求高推理准确率而忽略了与用户互动的品质,确保模型的高智商能够以让人类舒适的方式呈现出来。换句话说,经过阶段4,DeepSeek R1 不仅是“推理高手”,也是“贴心助手”。

Q5: DeepSeek R1 与 GPT-4、Anthropic Claude、Google Gemini 等顶尖模型有哪些核心差异?

A: DeepSeek R1 的训练路线与这些闭源大模型有一些独特之处,但总体目标相似(都追求强性能和对齐人类意图)。主要区别在于:

综上,DeepSeek R1 展现了一条与主流商用大模型不同但并行的研发路线:用较少人工介入、充分利用RL自我提升推理,再辅以必要的监督和对齐,来培养强大的通用AI。这为业界提供了新思路,也使研究者能够探究在不开天量数据集的情况下提升模型智力的可能 (The Illustrated DeepSeek-R1 - by Jay Alammar) (The Illustrated DeepSeek-R1 - by Jay Alammar)。各模型各有侧重,但目标殊途同归:让AI既“智商高”又“情商高”,能真正解决问题并让用户放心使用。

**参考文献:**

DeepSeek R1 官方论文 ([2501.12948] DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning) ([2501.12948] DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning)及技术报告、DeepSeek 官方博客和数据集说明 (DeepSeek-R1的四个训练阶段 - 蝈蝈俊 - 博客园) ([2501.12948] DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning),以及相关分析文章和讨论 (阅读 | DeepSeek-R1:怎么用强化学习把一个普通语言模型调教成推理高手?_腾讯新闻) (阅读 | DeepSeek-R1:怎么用强化学习把一个普通语言模型调教成推理高手?_腾讯新闻)。

上述内容综合了官方资料与社区解读,以问答形式呈现,希望对DeepSeek R1的训练策略有全面而清晰的说明。

 

后记

才试了一下 openai o3 最新推出的 deep research 功能,不能不说,作为研究工具,非常给力,完成后的成品具有直接发表的水平,想做一点后编辑都难。有点叹为观止的感觉,堪称完美。当然,现在各家头部模型都开始 offer 这种“深度研究”的功能了,这等于是平替了大多数咨询公司的研究人员的工作。即便是训练有素的数据分析和调研人员,多数人实际上做不了它这么全面和细致。最见功力的是它的引用的全面和细密。说话有根据,幻觉自然减少。

【相关】

Dilemma of RPA and Early-Stage LLM Co-pilot Entrepreneurs in the Age of Agent Tsunami

As large language models (LLMs) surge forward, LLM Agents are reconstructing the automation landscape at unprecedented speed. This revolution not only threatens traditional RPA (Robotic Process Automation, reliant on rule engines or small models) but also pushes early-stage co-pilot application builders to the edge of a cliff. At its core, this technological shift represents two fundamental disruptions: 
1. Natural language interaction overpowering low-code programming in complex, dynamic, unstructured data scenarios. 
2. General intelligence violently overshadowing shallow vertical solutions.

"Triple Disruption" of LLM Agents

1. Paradigm Shift: From "Low-Code" to "Emergent Intelligence"

- Traditional RPA: Engineers script step-by-step logic (e.g., UiPath’s drag-and-drop designer), akin to teaching robots to hop grids – brittle and error-prone.
- LLM Agent: Directly interprets human intent (e.g., "Extract invoice data from emails into the system"), autonomously decomposes tasks, and dynamically adjusts execution paths.
- Case Study: ChatGPT plugins already book flights or fetch data via API calls, while traditional RPA requires low-code scripting for equivalent functions.

2. Moat Erosion: Data Barriers vs. General Intelligence

Pre-LLM RPA Moats:
Industry know-how (e.g., nuances of financial reimbursement workflows) + custom deployment capabilities + template libraries.
Reality: Most RPA firms accumulated shallow industry exposure rather than deep vertical data expertise.

LLM’s Breaching Tactics:
- Digests unstructured documents (e.g., diverse invoice formats) via multimodal vision and computer use capabilities.
- Adapts to new workflows via zero-shot Chain-of-Thought (CoT) reasoning (e.g., interpreting vague commands like "Sync key contract terms to CRM").

Final Blow: As standardized scenarios get natively covered by leading LLMs (including reasoning models), RPA’s last defense – proprietary industry APIs – is being devoured by LLM vendors’ customization and privacy solutions.

3. Ecosystem Cannibalization: From "Tool Vendor" to "LLM-native Layer"

Early Co-pilot Traps:
Products like Character.ai (personalized chatbots) and Jasper (writing/marketing assistants) – essentially thin wrappers over base models – crumble when ChatGPT launches role presets or DALL·E 3 plugins.

Survivor Playbooks:
- Perplexity.ai: Carves a niche with real-time search + academic citations (fixing LLM hallucination).
- Cursor: Builds vertical moats via developer workflow integration (codebase semantics, AI pair programming).

Industry Upheaval in RPA

- UiPath’s stock plummets from 2021 highs; its "Autopilot" feature (English-to-automation) criticized as a "GPT-4 wrapper."
- Microsoft Power Automate integrates Copilot, generating cloud workflows from natural language prompts.
- Adept (AI-for-computer-actions startup) hits $1B+ valuation, directly threatening RPA’s existence.

Survivor’s Map: Niches Resisting the LLM Tide

1. Deep Verticalization
- Cursor: Dominates IDE ecosystems via VSCode extensions and developer workflow data.
- Harvey (legal AI): Trains on LexisNexis corpus + private deployment for compliance.

2. Real-Time Data Masters
- Perplexity.ai: Search engine-grade indexing + academic database partnerships.
- Hedgeye (finance): Aggregates Bloomberg/Reuters feeds + proprietary prediction models.

3. Hardware Fusion
- Covariant: Embeds LLMs into warehouse robotics, leveraging mechanical barriers.
- Tesla Optimus: Physical-world operation via embodied AI, evading pure-digital competition.

Agent Startup Pitfalls & Counterstrategies

Common Traps

- Thin Model Wrapping
Issue: Repackaging ChatGPT prompts as "AI customer service" adds no real value.
Fix: Develop domain-specific features (e.g., clinical decision support requiring privacy-sensitive data pipelines).

- Over-Reliance on Fine-Tuning
Issue: Claiming "medical LLM" after basic terminology tuning ignores the need for closed-loop clinical workflows.
Fix: Build proprietary data flywheels and scenario-optimized architectures.

- Ignoring Enterprise Needs
Issue: Overlooking security, SLA guarantees, and system integration.
Fix: Architect enterprise-grade frameworks for organizational deployment.

Differentiation Strategies

- Workflow Integration Specialists: Develop deep connectors for niche scenarios (e.g., legal document parsing).
- Human-AI Orchestrators: Design quality control layers and manual override mechanisms.
- Vertical Knowledge Engineers: Curate domain-specific benchmarks and evaluation protocols.

RPA’s Last Stand

While battered, RPA retains residual value in:

- High-compliance scenarios: Auditable/traceable workflows (e.g., financial regulations).
- Legacy system integration: Stability in outdated IT environments.
- Ultra-high precision demands: Deterministic execution for core systems (e.g., stock trading).


Challenges for Early Co-pilot Entrepreneurs

Two fatal flaws plague AI application startups: 
1. No proven scaled success cases – LLMs are barely 2-3 years old, leaving co-pilots (beyond chatbots) unvalidated for commercial viability. 
2. Vulnerability to LLM upgrades – Without exclusive industry data or customer channels, co-pilot startups risk being crushed by foundational model advancements.

The Inevitable Conclusion

LLM Agents are replaying cloud computing’s annihilation of on-prem servers: foundational capabilities get standardized (like AWS replacing data centers), while vertical opportunities spawn new giants (like Snowflake). RPA and generic Agent startups must either:
1. Become vertical domain experts, or
2. Master human-AI collaboration architectures

... or face obsolescence as LLM agents absorb 90% of automation value. The silver lining? This disruption will unlock an automation market 100x larger than the RPA era – but tickets are reserved for those who architect vertically fused, LLM-empowered solutions.

As Sam Altman warned: Avoid building what foundational models will inevitably swallow.

 

 

【相关】

Understanding the Division of Labor Among Q, K, V in Self-Attention Mechanism

For those diving into self-attention mechanisms, the roles of Query (Q), Key (K), and Value (V) often spark confusion: Why must every token in a sequence generate these three distinct roles to capture contextual dependencies?To grasp how Q, K, and V matrices autonomously specialize through backpropagation, we must delve into the foundational logic of model training. This process mirrors the natural phenomenon of "ant colony division of labor": though initially identical, ants evolve into workers, soldiers, or reproducers through environmental feedback. Similarly, Transformer parameters self-organize via error-driven optimization.

I. The Driving Force: Loss Function as a Macro-Regulator

Suppose we are training a translation model, with the input sentence "猫追逐激光点", and the target output "The cat chases the laser dot." The following are the key steps in parameter differentiation:

1. Initial Chaotic State
- W_Q, W_K, W_V matrices are all randomly initialized
- At this point, the Q vector of "追逐" (chase) may have no correlation with the K vector of "激光点" (laser dot)

2. First Forward Propagation
- When calculating attention weights, "追逐" (chase) fails to associate with "激光点" (laser dot)
- This leads to an incorrect translation (such as outputting "The cat eats the laser")

3. Error Signal Feedback
The loss function calculates two key gradients:
- Content missing gradient: Need to strengthen the action association "追逐→chases"
- Object mismatch gradient: Need to establish the verb-object relationship between "追逐" (chase) and "激光点" (laser dot)

4. Parameter Differentiation Begins
- W_Q matrix receives the signal: Make the Q vector of verbs more attentive to action target features
- W_K matrix receives the signal: Strengthen the acted-upon object attributes in noun K vectors
- W_V matrix receives the signal: Preserve details such as mobility in nouns

🔥 Key Mechanism: The same error signal propagates through different computational paths, causing the update directions of the three matrices to differentiate.

II. Mathematical Principles of Parameter Differentiation

By breaking down the attention calculation process, we can see how gradients guide division of labor:

Attention Weight Calculation Paths

- Gradients for W_Q:
Mainly come from the similarity calculation between the Q of the current token and the K of contextual tokens, forcing W_Q to learn how to generate effective query features
(Example: Making the Q vector of a verb contain potential features like "needs to be paired with an object (transitive verb)"; Q resembles the encoding signal for potential sentence patterns in traditional linguistics, similar to Subcat)

- Gradients for W_K:
Also come from Q-K similarity calculation, but the direction is to optimize K features to be recognizable by Q
(Example: Making the K vector of nouns contain attributes like "can serve as an object of action (object noun)")

- Gradients for W_V:
Come from the final weighted sum, requiring V to retain sufficient information
(Example: The V vector of "激光点" (laser dot) needs to include details like "small, bright, movable")

Four Steps of Weight Calculation:

1. Q-K Dot Product: Measure relevance.
2. Scaling: Prevent gradient explosion.
3. Softmax: Normalize into probability weights.
4. Weighted Sum: Generate contextualized representations.

III. Structural Guarantees for Stable Division of Labor

Beyond gradient driving, model structure design also ensures that the division of labor remains consistent:

1. Isolation of Linear Transformations
- Q/K/V come from three completely independent matrix multiplications
(Unlike LSTM gating mechanisms that share parameters)
- Gradient updates for each matrix do not interfere with each other

2. Multi-Head Attention Mechanism
Using 8-64 independent attention mechanisms (multi-head attention) is like having a team of detectives investigating different directions: some focus on the timeline, others analyze character relationships, and finally, all relationship matching results are synthesized.

Different attention heads form a "division of labor":
- Head 1: W_Q¹ learns grammatical role matching
(Example: Matching the Q of a subject with the K of a predicate)
- Head 2: W_Q² learns semantic associations
(Example: Matching the Q of "bank" with the K of "interest rate")
- This multi-objective optimization forces parameters to specialize

IV. Empirical Validation: Concretization of Parameter Division of Labor

By visualizing the parameters after training, clear patterns of division of labor can be observed:

Case Study: Related Parameters for the Verb "吃" (eat)
- W_Q Matrix:
In the Q vector of "吃" (eat), high-weight dimensions correspond to features like "edible," "concrete object," etc.
- W_K Matrix:
In the K vector of "苹果" (apple), high-weight dimensions correspond to attributes like "food category," "solid," etc.
- W_V Matrix:
In the V vector of "苹果" (apple), high-weight dimensions include details like "color," "texture," "nutritional components," etc.

When calculating `Q(吃)·K(苹果)` (`Q(eat)·K(apple)`), strong attention weights are generated due to high activation values on the "edibility" dimension from both parties. Meanwhile, V(apple) carries the specific information needed for output production (such as knowing it's a fruit rather than a technology company when translating to "apple").

Key Conclusion: The Wisdom of Self-Organization
The essence of parameter division of labor in Transformers is the functional specialization that naturally evolves under the constraints of a unified objective function. The system does not need to preset division of labor details but spontaneously forms an efficient information processing system through repeated "trial-error-feedback" cycles with massive data. This self-organizing process driven by error is the source of the powerful representation capabilities of deep learning models.

[Addendum] A Deeper Interpretation of Q/K/V Relationships

Relationship Between Q and K
- Q is a specific perspective or projection of the K space
- Just like a book can be retrieved from different angles:
- Q1: Subject classification (K1: Literature/Technology/History)
- Q2: Difficulty level (K2: Beginner/Advanced/Professional)
- Q3: Writing style (K3: Theoretical/Practical/Case-based)

This is because Q "actively" seeks certain features associated with other tokens, while K is "passively" prepared to be matched by other tokens. K is like an index that needs to summarize all the main features of a token, but Q focuses on querying a specific feature.

This makes understanding multi-head attention more intuitive:

```
Each head learns a different projection perspective
Q1 = token * W_q1 # May focus on thematic relevance
Q2 = token * W_q2 # May focus on grammatical relationships
Q3 = token * W_q3 # May focus on semantic roles
```

It's like different facets of a high-dimensional space:
- Each attention head learns a specific "query perspective"
- These perspectives collectively build a complete picture of inter-token relationships

Division of Labor Between K and V
- K: Information's "retrieval representation"
- Contains various ontological features that might be queried
- Similar to a multidimensional tagging system for books
- V: Information's "content representation"
- Contains information that actually needs to be utilized
- Like the specific content of a book's text

A Concrete Example
Using the word "驾驶" (driving) as an example:

Different perspectives that multi-head attention might learn:
- Q1: Seeking action tools (highly relevant to "汽车" (car))
- Q2: Seeking action subjects (highly relevant to "司机" (driver))
- Q3: Seeking action modifiers (relevant to "快" (fast), "稳" (stable), etc.)

This understanding effectively explains:
1. Why Q/K separation is necessary
2. Why multi-head QKV mechanisms are needed
3. How the model automatically learns different types of contextual relationships

Continuity Between V and Token Representation
A token's V (Value) is most related to the token's initial embedding, as both represent the content and meaning of this token.
- Initial embedding: Represents the general meaning of the token learned in large-scale embedding training in advance, similar to looking up a dictionary
- Value vector: Can be seen as a continuation and update of this initial representation in a specific context

In other words:
1. Embedding is the "basic dictionary definition" of a token
2. Value is the "specific expression" of this definition in a particular context

Evolution of Token Represenation in the Model

As information flows through multiple network layers:

Initial embedding → Layer 1 Token → Layer 2 Token → ... → Final representation

During this process:
- Each layer's token representation carries increasingly rich contextual information
- While maintaining continuity with the original token meaning (residual connections can compensate if continuity degradation is a concern)
- This evolution is gradual, not disruptive

Essential Differences Between Q/K and V
- Q and K primarily serve the goal of "establishing relationships"
- Q and K extract query features and index features for matching
- Q and K are naturally more abstract and general than V
- V directly carries "concrete content"
- Contains actual information that the token needs to convey
- More specific, more detailed

Figuratively speaking:
- Q/K is like the retrieval system in a library
- V is like the actual content of books on the shelves

Conclusion: The Deep Wisdom of the QKV Mechanism

From the perspective of the entire model:
1. Initial embeddings enter the first layer
2. Each layer updates the next layer's token representation through attention mechanisms and feed-forward networks
3. The final layer's representation encompasses all contextual relationships and meanings, directly empowering the output

The QKV division of labor in self-attention mechanisms, seemingly simple yet embedding profound information processing philosophy: through carefully designed computational flows and gradient paths, the model naturally develops functional differentiation during the optimization process. This design philosophy of "emergent intelligence" has become a core paradigm in modern artificial intelligence.

It is precisely this capability for self-organization and self-evolution that enables Transformer models to capture complex and variable relationship patterns in language, laying the foundation for the powerful capabilities of large language models.

 

【相关】

Linguists Should Find Self-Attention Intuitively Familiar

Written for my linguistics and symbolic NLP peers — a reflection on my journey to leverage computational linguistics in undersranding modern AI LLM.

Breaking Through the Jargon Barrier

For linguists bewildered by large language models (LLMs), the confusion often stems from terminology and implementation details obscuring shared foundational principles. Let’s cut through the noise and focus on self-attention — the beating heart of the Transformer architecture.

As a computational linguist and lifelong NLP practitioner, I’ve spent years dissecting symbolic grammars and, more recently, tracking the rise of LLMs. Here’s my attempt to "translate" the core design of multi-head Query-Key-Value (QKV) mechanisms into a framework linguists already know.

QKV: A Linguistic Reinterpretation

Query as Subcategorization (Subcat)
First, I would like to point out, Query mirrors Subcat in symbolic grammar: the slots a head word "digs" for its dependents. Take a transitive verb (vt) as an example: it creates two syntactic "slots"—a noun subject (pre-verbal) and a noun object (post-verbal). Similarly, the predicate eat defines two semantic slots: an animate agent (e.g., animal) and an edible patient (e.g., food). These constraints — syntactic roles and semantic selection restrictions — are bread-and-butter concepts for linguists.

Key as Ontological Features
Key represents ontological attributes: nounhood, animacy, action, state, time, descriptive, etc.  Value is the filler—the "carrot" that occupies a slot. When I first read Attention is all you need, the QKV triad felt alien. No one explained that this was just dynamic slot-filling.

Why LLMs "Get" Language

LLMs thrive because their "slots" and "fillers" align perfectly across linguistic hierarchies. Every token carries QKV information because every word can both be a seeker (Query) and a target (Key/Value). When a Query (e.g., eat) finds a compatible Key (e.g., apple), their dot product sparks a high attention weight. The Value (the token’s semantic essence) is then passed forward, blending into the next layer’s representation of the token.

Contextual "Polygamy"
Tokens in the context window engage in group marriage, not monogamy. Each token 'flirts' with all others via Query-Key dot products. Relationships vary in intensity (weights), and the resulting "offspring"—the next layer’s tokens—inherit traits from multiple "parents" through weighted summation. Stronger relationships dominate; weaker ones fade. This crazy yet efficient "breeding" compresses linguistic structure into dense vector spaces, a process conceptually equivalent to parsing, understanding, and generation in one unified mechanism.

The Database Analogy (and Why It 'Misled' Us)

QKV borrows terms from database systems (Query for search, Key-Value for retrieval), but early attempts to map this to linguistics fell flat. We thought: "Databases? That’s just dictionary lookups — isn't it already handled by embeddings?!" The breakthrough came when we realized: Self-attention isn’t static retrieval—it’s dynamic, context-aware slot-filling.

For decades, we built bottom-up parsers using Subcat frames. Transformer layers do the same, but with vectors instead of symbolic representaions. See the 2 slides I made 3+ years ago when GPT3 playground was launched when I compared the parallel archtectures and approaches from two schools of AI, grammar school and multi-neural network school.  Symbolic grammars, though, despite their transparency, pale in scalability:
- Granularity: LLMs leverage hundred or thousand dimensional vectors; we relied on only hundreds of one-hot features.
- Generalization: Transformers parse text, audio, video—any modality. Symbolic grammars, at best, aspire to universal grammar across languages.

A Convergence of Paths

My colleague Lü Zhengdong once mapped the evolution of attention: 
Seq2Seq (Google Brain) → Auto-alignment (Mila) → Transformer (Google) → Pre-trained LMs → LLMs (OpenAI)...

To this, I chuckled: "You pioneers see the trajectory clearly. But for us symbolic refugees, diving into Attention is all you need felt like drinking from a firehose." Without fully understanding the historical context, the concepts overwhelmed us—until one day, it clicked: Subcat-driven parsing and self-attention are two sides of the same coin.

Symbolic methods are obsolete, yes—clunky, rigid, and modality-bound, with the only merit of full transparency of symbolic logic. Yet understanding their parallels to Transformers suddenly made LLMs feel familiar. The difference? Scale and ambition. Linguists seek cross-linguistic universals; AI aims for cross-modal universals.

Postscript: Simplifying the Transformer

The original Transformer paper (Attention is all you need) is not an easy-read at all, bogged down by encoder-decoder specifics for machine translation. Strip away the noise, and the core is simple:
1. Self-attention layers (dynamic slot-filling).
2. Feedforward networks (nonlinear transformations).

GPT’s decoder-only architecture reveals the essence: next-token prediction (NTP) is the key to general intelligence. The so-called "decoder" isn’t just about decoding or generation—it’s also analysis and understanding fused into one stream.

Closing Thoughts

Dr. Bai, Shuo once remarked:

Language processing demands a unified ‘currency’—a mechanism to reconcile syntax, semantics, pragmatics, and world knowledge. Only neural networks (imperfect as they are) managed to have achieved this, probabilistically. Attention is that currency.

He’s right.  Attention isn’t just a tool—it’s the universal metric we’ve sought all along.

 

【相关】

语言学家应该很容易理解自注意力机制

作为计算语言学家和NLP老司机,本篇是写给我的语言学老师和同学,以及符号NLP同行的,分享自己的心路历程,希望对大家有所启发。

如果语言学家以前觉得大模型烧脑和不解,那是因为窗户纸没有捅破,存在不同体系下的术语与机制细节的理解障碍,但底层逻辑并不乏不少共同的东西。本篇聚焦在大模型Transformer架构中的核心注意力机制的理解。

我出身计算语言学,这几年又一直在追踪大模型,可以“翻译”一下自注意力机制的核心设计多头的 QKV。

我们做符号文法的 早就该知道 Query 就是 Subcat,主导词为潜在结构“挖坑”用的,例如及物动词 (vt)就挖了两个坑:一个「名词」主语,一个「名词」宾语。主语、宾语是句法结构的角色要求,「名词」是对所要求对象的限制条件(更细致地,Subcat 还有其他限制条件,例如主语在vt前,宾语在 vt后,等)。具体到概念谓词“eat”,逻辑语义上也相应地挖了两个坑:一个是「动物」施事,一个是「食物」受事。「动物」(包括「人」)是逻辑语义结构中对施事角色的语义限制条件,「食物」是逻辑语义结构中对受事角色的语义限制条件。这些都是我们语言学家践行多年、耳熟能详的概念体系。

Key 就是本体特征, 例如,名词、物体、食物、动作、状态、修饰、时间等,Value 就是填坑的“萝卜”。可惜,初读论文「Attention is all you need」 ,被 QKV弄得晕头转向的时候,没有人指点迷津。

为什么LLM大模型吃透了语言,说话那么顺溜,原来各个层级的坑与萝卜,都是那么相配,天赐良缘。为什么每一个单词都有QKV信息,道理也简单,每一个词都可能在“求偶”,追求别人,也都可能被追求。追与被追发现非常谈得来的时候, QK相配,注意力权重大,于是结合,就是把身子(Value)献上;然后生子 ,就是创造下一层的 Token 表示。

有意思的是,上下文窗口里的 Tokens 是群婚制,不是一夫一妻制生孩子。一个 Token 与周围所有 tokens 谈恋爱 q k(i)点积,其他tokens(包括该 Token自己)都与该Token 有一腿,但关系强度不同(谈吹的tokens,权重为0)。该 Token与这种多边关系“杂交”生出的孩子是怎样的呢?加权求和。就是说孩子继承了母亲的很多特征,同时也继承了周围众父亲的特征。谁的特征在子代最彰显或较弱,完全决定于交情的深浅、关系的强度。每个token都是这样推陈出新,一代一代传下去。最后发现,这种群婚制对于信息压缩(理解、解析、生成)特别有效。真有意思。

QKV这些概念显然是从数据库技术拿来的,对于软件界一点都不陌生。但当年理解注意力机制的时候,还是遭遇很大的困惑,想不明白 语言解析与数据库啥关系。当时觉得扯上数据库,最多就是查词典相关,而查词典早就在词嵌入(embedding)编码阶段就完成了。自注意力的核心不是静态的查词典,而是动态的上下文理解。 当年因为想不明白为什么要套用数据库的信息查询和匹配的说法,只能把注意力机制泛泛理解为关注上下文。这也没错,但看不到 insights,也理解不了为什么这东西这么厉害,成就了大模型的超人语言能力。

经过很久终于豁然开朗:原来我们做了一辈子的 subcat-based bottom up parsing,跟 attention+feedforward 做的完全是一回事,一个原理,殊途同归(见下图:这是我在大模型GPT3 playground刚冒头时候做的一个对比,illustrate 当年意识到两条路线殊途同归时候的震撼)。只不过我们符号文法处理完全打不过它。一个是颗粒度没法比,人家的家底是几百上千维度的实数向量,加上各种投射以及非线性转换,我们才有最多几千个强行结构化的符号特征(one hot features)。另外,人家的泛化可以从文字解析,推广到任何模态信号的压缩和理解,我们的文法不具有任何的模态可推广性、可移植性,最多只是跨过了语言壁垒,文法追求可以适用于任何语言的 universal grammar。

我的主流弄潮儿的一位老友吕正东说:

在attention 的发展史上(so far),我看到多次颠覆式的创新, 从最早的 seq2seq (Google Brain) → auto alignment (Mila) → Tranformer (Google again) → pre-trained language model (?) → LLM (openAI )→ ...

我苦笑道:你是真正业内前沿,一路发展轨迹自然一目了然。你可能想象不出我们这些符号出身的人,突然被逼去研读这种经典论文(Attention is all you need)时候的困境。因为缺乏历史演进的知识垫底,一下子就被这些概念砸晕了。不知道经过多少次嘀咕、查阅,才慢慢明白:天下大势,冥冥之中,有万变不离其宗。原来,我们在符号文法摸索了一辈子的被证明最有效的谓词Subcat框架和自底而上的结构解析算法,底层逻辑与 transformer 及其自注意力机制不谋而合。 虽然符号技术过时了,也确实笨拙,除了符号逻辑的透明性外,没有多少其他长处,但现在理解深度学习大模型的原理和框架,由此骤然变得亲切了很多。只不过现在眼界开阔了,与信息论和计算理论更加靠近。(计算)语言学家一辈子的追求就是跨语言,而AI的追求更高一筹,是跨模态,无论音频、视频还是文字。

【后记】

大模型经典论文 Attention is all you need 不好读也有时代的原因,它提出的框架是直接应对RNN的短板和机器翻译的需求和验证。这就让它的核心部分被这些因素干扰而模糊了。框架看上去太复杂,encoder decoder 两大部分,还必须在encoder 到 decoder 之间做一种交叉对齐 ,但其实内核组块没有任何区别。这些对于理解 transformer 的通用性和原理,都是“噪音”。

transformer 主体简单极了,不过就是多层感知器,在每一层加了个自注意力而已。 到了GPT 发现 ntp(下一词预测)是打开通用智能的钥匙的时候,从框架角度就更简单了,decoder-only 足矣(说明:decoder 并不是名字所说的那样只做解码,它一样做分析和理解,这是由其核心组块决定的)。

老友看了我的transformer博客解说(Transformer 和注意力机制简介),说你这个太简陋了,连篇幅都比原论文短。

原文中有一些细节舍去了。
作者: 立委 (*)
日期: 2025/02/21 12:23:37

包括:

原架构是两大块:encoder + decoder

但实际上这两大块里面的组快都是完全一样的。而且,主流已经抛弃了 encoder,GPT 采用的就是 decoder-only 架构。

另外,位置编码是序列的一个因素,与处理过程解耦以后,位置编码有一套说法,怕干扰了主旨的理解,就点到为止了。

再有就是一些数学公式和实现细节,包括归一化、残差等。舍弃不影响对于 “注意力+神经网络” 这个核心主旨的理解。

所以通篇实际上就是一个理解重点:自注意力机制怎么work的,因为多层感知器是个 given,不是 transformer 的创新。

顺便一提,所谓 自注意力,国人喜欢顾名思义,以为是自己注意自己,感觉很蹊跷。其实自注意力是针对跨序列的交叉注意力而言的,自注意力是在同一层序列的上下文中注意所有的相关tokens(确实也包括它自己),是单层序列之内的事儿,这个“自”回指的不是token自己,而是token自己所在的那个窗口序列。交叉注意力说的是跨序列层的注意力,例如传统的神经机器翻译中,目标语序列针对源语序列的注意力。到了 GPT 的通用生成式AI(gen-AI)主流,没有跨序列的必要了,因为所有的 input 序列 和 output 序列,都被自回归“挤压”到同一层的序列去了。仅有的 output 就是 next token,其余一切tokens都连成一串了作为input的条件:everything is ntp。

以“中译英:我爱你” 的机器翻译为例,GPT自回归生成的序列是这样的:

Input                  Output
中译英:我爱你         I
中译英:我爱你 I       love
中译英:我爱你 I love  you

屠可伟老师的研究进一步验证了parsing与transfromer的可对齐性:

李老师,关于transformer自注意力机制和语言学的关系,我们前年有个工作,之前也和您提过:我们发现transformer自注意力机制与概率依存句法模型的近似推理计算图极为相似,局部几乎一模一样: Probabilistic Transformer: A Probabilistic Dependency Model for Contextual Word Representation

白硕老师说:

我对这个问题的观点:

1、语言处理的符号主义本身并没有一个基于第一性原理的强有力理论体系,最牛的乔姆斯基也没做到。

2、语言处理的完整方案必须包含一个词法、句法、语义、语用、常识、事理、逻辑各方面“角力”因素能够以可以“统一度量衡”的表达-竞争-筛选机制,这点,目前只有多层神经网络可以做到,虽然只是“概率性的”。

3、语言处理和知识处理的共性是滑动上下文内的key-value填充,也就是我们俗称的“哪些萝卜填哪些坑”,这个共性的需求,被一个共性的机制——注意力机制在很大程度上解决了。再单独、分别做语言层面的填充机制(什么成分做什么角色)或是知识层面的填充机制(什么槽位取什么值)已经失去意义。要么不做,要么统一做而且比注意力机制做得更好。没有其他的出路。

白老师所言极是。白老师说的“统一的度量衡”就是自注意力。

 

【相关】

Introduction to Transformer and Its Attention Mechanism

The Transformer architecture and its attention mechanism form the foundation of mainstream GPT large language models, making them extraordinarily important. Despite the abundance of explanations and popular science articles on this topic, many friends tell me they still find it bewildering or only partially understand it. Therefore, I've decided to write a couple of blogs to contribute my understanding.

As someone curious about mainstream AI, you've likely heard of the renowned Transformer framework and its "attention mechanism" that powers large language models, perhaps considering them mysterious concepts. You may have read the classic paper "Attention is All You Need," but still found it confusing or difficult to decode. Don't worry—this is completely normal, and most of us have gone through this stage! While the paper may be a bit mind-bending, its core logic isn't actually that complex.

To understand the Transformer architecture in AI large language models (LLMs), we need to break down its workflow. First, we should understand how large language models work and how they're trained. Base large language models gain knowledge from data through "self-supervised learning" using multi-layer neural networks. Self-supervised learning is a special type of machine learning that uses "masking" to generate supervision signals. While supervised learning typically uses human-annotated data with output targets, self-supervised learning requires no human annotation. Instead, it masks certain data points and trains the system to predict them (like "filling blanks" or "continuing sequences"), using the masked data as the correct answer and supervision signal. Mainstream GPT models mask the next word, training the system to predict it based solely on previous context (called "next token prediction")—this is the current paradigm for generative AI.

The Complete Process from Input to Output

1. Starting with "Dictionary Lookup": Tokenization and Embedding

To understand an entire input text for next token prediction, we first need to break it down into basic units, called tokenization, which converts text into a sequence of tokens (the smallest units of text). These tokens might be complete words (like "work") or subwords (like "un+believ+able").

Tokens are symbols, and computers struggle with direct symbol manipulation—they only work well with numbers. So we need to convert tokens into numbers.

Each token is converted into a numerical representation—a multi-dimensional vector—by looking up an embedding dictionary. Each token is transformed into a 300-1024 dimensional vector (imagine establishing feature representations for each word across many conceptual dimensions, such as: noun, singular, organization, finance, etc.). Embedding allows words to have computable semantic spatial relationships.

This multi-dimensional vector space acts like a "meaning space" where each token's vector defines its position. The distance between tokens across different dimensions represents their semantic distinctions. This aligns with our intuition: a word's meaning becomes apparent through comparison with other words.

These vectors aren't randomly generated but are numerically encoded representations trained on massive natural text corpora, providing the basic semantic information of tokens—their position in meaning space. For example, the vector for "bank" naturally sits closer to "money" and far from "trees." Similarly, the vector for "apple" might contain information about both "fruit" and "technology company."

Imagine trying to help a computer understand the sentence: "The cat sat on the mat."

Step one: Tokenization breaks this sentence into individual tokens: The+cat+sat+on+the+mat.

Step two: Dictionary lookup (Embedding) finds a numerical representation—a multi-dimensional vector—for each token.
"cat" -> [0.1, 0.5, -0.2, ...]
"sat" -> [-0.3, 0.8, 0.1, ...]
...

Simply put:
Tokenization breaks text into the smallest units (tokens) that computers can easily process and analyze.
Embedding converts these tokens into vectors that computers can easily calculate and combine.

Key point: The vectors obtained from the embedding dictionary are only the "initial meaning representations" of tokens, without considering their specific context. Decoding contextual meaning from vector representations is the task of the next steps, using the multi-layer neural networks + attention mechanism in the Transformer architecture.

The core modules of Transformer can be broken down into two parts:
1. Attention mechanism: Used to calculate the relevance between tokens and dynamically update token representations.
2. Neural network: Used to process information transformation between tokens.

The entire Transformer is stacked with multiple such blocks for transformation, and with each attention layer recalculating token representations, deepening understanding progressively.

2. Attention Takes the Stage: Updating Word Meanings Based on Context

Now we have a sequence of vectors, each representing the "initial meaning" of a token. But here's the problem: the same word can have different meanings in different contexts! For instance, "bank" can mean a financial institution or a riverbank.

The core of the Transformer architecture is the attention mechanism (self-attention), which serves to dynamically adjust the representation of each token based on context, reflecting its relationships with other tokens.

For example: In the sentence "I like to eat apples," "apple" and "eat" are highly correlated, so the model will rely more on the word "eat" to update the meaning of "apple," determining that "apple" here refers to fruit rather than a company.

How is this done?

The model calculates attention weights between each token and other tokens through QKV attention:
- Query: querying vector of the current token (e.g., "he")
- Key: key vectors of contextual tokens (e.g., "police," "witness")
- Value: The actual meaning after association

For example, through matrix operations, the model discovers that "he" is most strongly associated with "witness," so it updates the vector for "he" to carry information from "witness."

Calculating "relevance": For each token, we calculate its "relevance" with all other tokens in the sentence, assigning different "attention weights" (attention scores) to different tokens. This "relevance" can be understood as: how important are other tokens when understanding the meaning of the current token.
* For example, when understanding the word "sat," "cat" and "mat" are obviously more important than "the."

Weighted average: Based on the calculated "relevance" (i.e., token weights), we take a weighted average of the V vectors from all tokens in the context to obtain a new vector representation for this token. This new vector is the meaning representation of the current token in this specific sentence.
For instance, the new vector for "sat" will be more influenced by the vectors of "cat" and "mat," and less by the vector of "the."

Key point: The attention mechanism dynamically updates the meaning of each token by calculating the relevance between tokens. This update is context-based—the same token will have different representations in different sentences.

This way, each token's meaning is no longer fixed but changes dynamically based on the entire sentence's context. For example, in "I saw a bat," "bat" could refer to either a flying mammal or a sports implement, but the attention mechanism will combine the bigger context to infer its more appropriate meaning.

For details on how QKV works in the attention mechanism, please refer to the companion article "How to Understand QKV Division of Labor in Self-Attention Mechanism?"

3. The Transformer Backbone: Multi-layer Progressive Information Compression

The core building blocks of Transformer can be broken down into two parts:
Multi-head attention layer: Used to calculate relevance between tokens and dynamically update token representations.
Feed-forward neural network layer: Further process and transform information (compression, abstraction)

The entire Transformer consists of multiple such modules stacked together, with each layer recalculating token representations for deeper understanding. Depending on the number of blocks, the Transformer repeatedly performs this update process. Like humans pondering a text multiple times, each layer deepens the understanding of the text. Deeper layers may capture more complex semantic relationships.

Each Transformer block iteratively upgrades understanding, for example:
- Bottom layers: Capture local grammar (such as the contrasting relationship in "not...but...")
- Middle layers: Understand "who 'he' actually refers to"
- Top layers: Grasp the main theme of the entire text

The main features of Transformer
1. Parallel computation: Word order is decoupled from token processing, allowing parallel processing of all tokens (in contrast to the linear inefficiency of previous RNNs)
2. Hierarchical understanding: Progressive interpretation from literal meaning to deep intention, capturing patterns both large and small.

4. Output: The Model's Final Prediction

Transformer models can be used for various tasks. Different tasks have different forms of output.

GPT: Next Token Prediction
For mainstream GPT models, their ultimate task is to predict what comes next through "autoregressive" next token prediction (autoregression is the dynamic extension of previous context, recursively implementing word-by-word continuation). The model decides what content should logically follow based on the deeply understood context. This opened the path to general AI, as sequence learning has mastered the "code" for converting inputs to outputs for general tasks, but that's a topic for another article.

5. Summary

Tokenization and Embedding lay the foundation for computers to understand text, similar to looking up a dictionary.
Attention mechanism calculates relevance between tokens and dynamically updates token representations.
Transformer consists of neural network layers + attention layers, optimizing token representations layer by layer, covering various relationships at different levels.
The final output depends on the task. Translation models generate target language text. GPT is responsible for predicting the next token, ultimately evolving this simple prediction mechanism into a general-purpose large model capable of unlocking various tasks.

 

【相关】

Has Symbolism Been Sidelined for Too Long? Could Neural LLM terminate AI?

Though no one can predict the future, and though abandoning one of the two paths feels politically incorrect, we cannot rule out the possibility of such unipolar dominance.

As is widely known, AI has always been marked by the competition between two schools: symbolic rationalism and data-driven empiricism. Their fortunes have waxed and waned throughout history, but over the past 30+ years, the pendulum has shown no sign of swinging back toward symbolism.

Why?

The ongoing contemporary history of large language models is fascinating. Each time challenges and obstacles arise, the mainstream paradigm overcomes them from within. Whether this will continue remains to be seen, but the trend seems likely to persist.

When large language models (LLM) first emerged, people marveled at their capabilities. But soon, critiques arose: their simple "next token prediction" (NTP) objective and the statistical nature of their probabilistic models led many to conclude they were merely advanced statistical tools, like large parrots—lacking true "understanding."

Ilya Sutskever and Geoffrey Hinton had to step in repeatedly to explain: "Do not underestimate next token prediction. This is no mere statistical n-gram model from the past. It abstracts a system of understanding that integrates human knowledge. When next-token prediction grows increasingly accurate, deep comprehension of context becomes indispensable." Such explanations struggled to convince skeptics. Later, Ilya invoked Kolmogorov complexity as a theoretical foundation, but this framework remains esoteric and inaccessible to most audiences—even many PhDs and professors view it with bemused skepticism. Yet, no better explanation exists.

What ultimately dissolved the "statistical parlor trick" critique was firsthand experience. Users interacting with LLMs realized: these systems seem to genuinely understand. No matter how you phrase your queries, in any language, with nuance or subtext, large models grasp meaning more reliably than most humans.

With the "understanding" debate fading, critics shifted focus: "LLMs cannot reason."

As recently as last year, Yann LeCun cited this as one of his core arguments against the mainstream GPT-style LLM paradigm (advocating instead for vision-based world models as the true path). Many relished pointing out flaws—like LLMs failing at elementary arithmetic such as multi-digit multiplication.

But this critique no longer holds. With the advent of reasoning models like OpenAI’s "o-series" and DeepSeek’s "r-series," accusations of "no reasoning ability" have collapsed. Hardliners may still dismiss probabilistic reasoning as unstable, lacking the rigor of symbolic logic. Yet users deploying these models for mathematics, coding, or project planning overwhelmingly report breakthroughs. Large-model reasoning now rivals or surpasses human experts, approaching master’s or doctoral proficiency. Coding capabilities already exceed those of average engineers.  This is just the beginning.  It is well plausible that within a year or two, reasoning models could dominate Olympiad-level math or competitive programming.

Once again, barriers were breached through internal innovation—this time after large-model pretraining neared its limits. The core framework remains unchanged, though: reinforcement learning still relies on NTP for chain-of-thought (CoT) generation; reasoning models remain probabilistic. Symbolic AI contributed nothing. Symbols remain confined to input/output interfaces—even the "inner monologue" of CoT manifests as output tokens.

The sheer creative potential within this paradigm is staggering. Those of us from symbolic AI backgrounds once naively imagined that when neural approaches hit walls, our logic-and-grammar toolkit would ride to the rescue. Hybrid neuro-symbolic fantasies danced in our minds.

Zooming out, modern large models evolved from earlier statistical frameworks, with neural networks as a tributary. When those statistical models hit ceilings, breakthroughs came from within—via deep learning. Symbolism played no role.

A profound question arises: Why has the theoretically appealing vision of hybrid neuro-symbolic synergy remained an impractical or unnecessary dream?

Two possibilities stand out.

First, the data-driven empiricist approach possesses far greater resilience and potential than we imagined.

This hints at deeper truths. Artificial neural networks, inspired by biological brains, had languished for decades until the deep learning revolution. Over the past decade, their human-like (or superhuman) performances have forced us to confront a possibility: perhaps this is indeep how intelligence works. If artificial systems achieve human-level cognition through mechanisms mirroring our own biology—despite neuroscientists’ caveats about our limited brain knowledge—this alignment would powerfully validate the neural paradigm. Symbolic logic and statistical feature engineering, by contrast, are alien to biological cognition. Their limitations may stem from this fundamental mismatch. One might even argue that high-dimensional vector spaces in LLMs—where multimodal signals are embedded within neural frameworks—encode a "language of God," or the essence of universal information. Symbols, then, are mere human-imposed constructs, sensory accommodations divorced from reality’s substrate.

Second, when a paradigm harbors untapped potential, progress demands sufficient talent density to exploit it.

AI uniquely concentrates genius. Countless brilliant minds flock to this field, creating an intellectual critical mass unmatched in most domains.

With these conditions in play, we must never underestimate the internal momentum to break through barriers. AGI (Artificial General Intelligence) believers, via their "insane" grind, keep delivering results. Could they indeed be AI’s ultimate Terminators?

 

Addendum: Symbolic might just be "reduced" to a symbolic tool that may retain its irreplaceable cognitive value

yanyongxin:

What distinguishes humans from other animals is our evolved reasoning capacity. Though rooted in neurons, this ability represents a qualitative leap beyond mere "instinctive reactions." It abstracts object relationships, enabling multi-step reasoning that can be transmitted and memorized through linguistic symbol chains. Reasoning is inherently discrete—thus symbolizable—as a simulated system built atop neural architecture. This simulation likely requires structural differences in human neural systems compared to other animals.

The most striking contrast between reasoning systems and primal neural cognition lies in sustained deliberation. Unlike "muscle memory" or intuition, human reasoning varies dramatically. During my university years, I observed students who excelled at quick problem-solving yet froze when faced with complexity. Today's LLMs approximate the reasoning level of humanities undergraduates, but still lag behind trained STEM specialists—particularly in mathematics and physics. The essence of STEM disciplines lies in rigorously symbolizing real-world problems. Simulating such precision within biological neural systems demands rare opportunities (elite education), prolonged training, and specific neurostructural advantages ("talent"), all channeled through disciplined formalization. Yet achieving this capability bridges biology with mechanical rigor—enabling interfaces with tools like Mathematica.

This charts AI's next frontier: building superior logical simulation systems atop neural frameworks until seamless integration with pure symbolic tools is achieved. The brain's logical simulation system remains energy-intensive, error-prone, and costly to develop. Its key advantage? Seamless integration with underlying neural processes.

Li Wei: Well said.

Interfacing with symbolic systems manifests as tool use. For instance, when confronting complex math problems, instead of forcing probabilistic reasoning through natural-language chain-of-thought (CoT), LLMs should just generate code properly to invoke Mathematica. This tool-use capability is now defined as a fundamental trait of LLM-native agents—yet another innovation emerging from within the paradigm.

Thus, we see a clear evolutionary trajectory:

1. Traditional Statistical Models ("Artificial Idiocy"):
Failure: Little natural language understanding 
Solution: LLMs (e.g., ChatGPT)

2. Pretrained LLM: 
Failure: Lacking reasoning ability 
Solution: Reasoning-reinforced LLMs (e.g., OpenAI’s o1, DeepSeek’s r1)

3. Reasoning LLM:
Failure: Insufficient symbolic rigor 
Solution: LLM Agents (symbolic tool integration)

yanyongxin:

Traditional statistical models earned their "artificial idiocy" label because their parameter spaces and data structures proved inadequate to host the world models required for true language understanding.

 

【相关】

符号主义被打入冷宫太久了,难道神经是AI的终结者吗?

虽然没人可以预测未来,虽然抛弃两条路线的一条感觉政治不正确,但的确不能排除这种单极主义的可能性。

众所周知,AI自从诞生,就有符号理性主义和数据经验主义的两条路线竞争,以及此伏彼起来回震荡的历史轨迹,直到30年前,钟摆就再也没有回落到符号主义一边的迹象。

这是为什么?

看大模型的当代史(still on-going)很有意思。每一次遇到挑战和障碍,都是主流自己跨过去的。将来是不是还是如此,可以观望,但感觉大概率还会持续。

大模型刚问世,大家惊异于其表现,但很快就从它的简单的“下一词预测”(ntp,next token prediction)的目标函数以及它概率模型的统计特性,得出一个结论:这不过是高级的统计模型,大号鹦鹉而已,它并没有理解。

伊利亚和辛顿不得不站出来一再解释:不要小看 next token prediction,它绝不是以前统计时代的 ngrams,而是抽象了人类各种知识的理解系统。当下一词预测越来越准的时候,没有对上文的深入理解是不可想象的。这种解释并不容易说服人。后来伊利亚追溯到了 K氏复杂性理论,似乎有了拿得上台面的理论支撑。但这一套说法对于绝大多数受众,太过玄妙和高冷,甚至很多博士和教授,也一样是雾里看花,不得不半信半疑。但除此之外,其实也没有更好的理论解释。

最后解开这个质问心结(“大模型根本就没有真正理解,一切不过是统计”)的是无数人与大模型交互的切身体验。 自己的体验不会骗自己: 每一个玩过大模型的人现在都意识到,大模型真能听懂自己的话,无论你怎么说,无论你用什么语言,甚至你话语背后的机锋和细微之处,它也比多数人理解更到位。

好,理解的问题大家搁置一边了,现在很少人还质疑大模型理解能力了。但接着就是另一个问题: 大模型不会推理。

杨立昆去年还把这一条作为自己反对主流大模型路线的根本理由(并鼓吹他的以视觉为基础的世界模型才是真正的出路)。很多人曾津津乐道的是大模型不会多位数乘法这样的小学算术。

但这条理由现在不成立了。在主流业界推出了 OpenAI的o系列和 DeepSeek的r系列等推理模型的今天,这种大模型不懂推理的指责不攻自破。

极端批判派当然可以从概率模型的不稳定的角度,继续质疑其推理不是真正的推理,不具有符号推理的严谨性和确定性。但用过推理模型做数学、代码以及做项目计划的人,绝大多数不再被此困扰了,因为很明显,大模型推理正在超越人类,现在已经修炼到硕士或博士的水平,代码能力也已经超过了大多数码农。而这只是推理模型刚刚起步上线的阶段,再给一两年,推理模型成为奥数冠军或代码冠军,都不是不可想象的事儿。

Again,跳过这个障碍,仍然来自内部,是大模型预训练几乎撞墙后的又一次内部创新。基本性质和基础未变,强化学习还是靠 ntp 去生成思维链(cot,chain-of-thought),推理模型仍然是概率模型。符号AI并没有帮任何忙。符号的作用仍然局限在 input 和 output 两端,连所谓内心独白的思维过程 cot,也是以 output 形式表现的。

这种领域流派内部的创造性和潜力,让人瞠目结舌。以前我们出身符号流派的人老一厢情愿地想着,AI主流遭遇困难了,我们逻辑派、文法派可以出手帮忙了。各种结合符号AI与神经AI的幻想,在我们的心中激荡。

如果把回顾AI历史的眼光拉得更远,我们可以看到现代大模型的前身是当年的各种统计模型,而神经基本是其中的一个支流。当年的那些统计模型遭遇种种瓶颈或天花板,最后还是在内部被深度学习突破了,从来没有符号主义任何事儿。

一个值得深思的问题是:为什么两条路线融合互补的理论美好,一直都是不可实现或不必实现的梦想呢。

可能说明了两件事。

第一是这种数据经验主义的路线,的确具有极大的韧性和潜力,远超我们想象。

这种潜力应该有更深层的原因。众所周知,人工神经网络是受到人脑神经启发而来的一种模拟,停滞多年后爆发了深度学习革命。十几年前的这场革命给我们带来了一次又一次的震撼,这些亮丽的拟人或超人的智能表现,使我们不禁在想,人脑神经也许就是这么工作的,具有同样的原理。人工智能达到或超越人类智能,机理相同应该是最有力的一个支持(虽然脑科学总有人说,我们对大脑知之甚少,貌似有一种把大脑神经的工作机理神秘化的倾向)。其他的一切手段,例如符号逻辑的公式和算法、统计模型的 feature engineering,都不是从真正意义上模拟人脑神经的工作方式,也许这就是它们注定走不远的症结所在。甚至可以说,神经框架内的各模态信号编码嵌入后的高维向量空间的确就是上帝的语言,或宇宙信息的本质,而符号不过是迁就人类感官的表象而已,或者说是人类强加给世界的一种体系。

第二,当一种路线具有超出我们想象的潜力的时候,科技进步所需要的就是足够人才密度去挖掘这种潜力。

我们知道,AI 领域具有这种聚集天才的优势。无数年轻才俊、聪明的大脑被吸引到这个领域,其天才密度超过了大多数领域。

在这样两个条件都具备的时候,我们永远不要低估它突破各种瓶颈的内部力量。那些AGI(Artificial General Intelligence,通用人工智能)的信仰者们一直在疯狂内卷,同时也的确不断在交出自己的成绩单。他们可能是AI的终结者吗?

 

【外一篇:符号逻辑“沦落”为辅助工具还是有自己不可取代的智能补足作用的】

yanyongxin:人之所以区别于其他动物,是因为进化出了推理能力。这种推理能力虽然是建立在神经元上的,但跟单纯的“本能反应”有了质的飞跃。它有了对象关系的抽象,从而可以进行多步骤推理,从而可以以对象关系链——语言的形式传播和记忆。推理本质上是一个离散过程,因此是可以符号化的,是一个在神经元体系上建立出来的模拟系统。但这种模拟的可能,很可能要求神经元系统与其他动物有结构上的差异。

推理系统与原始神经元思维的最显著差异,就是可以长时间思考。而不是“肌肉记忆”、“直觉”。不同人之间的差异很大。大学期间,注意到有些学生遇到简单问题时反应很快,面对复杂问题时,给他多少时间也没用。现在的LLM大致达到了文科生的推理水平。但还与训练有素的理科生,尤其是数学、物理的理科生有差距。数理专业的特征,就是将现实世界的问题严格的符号逻辑化。要在人的神经元系统上模拟出如此严谨的符号逻辑系统是需要特殊的机会(好大学,好老师)、长期的训练、和特殊的脑结构(“天赋”)的,要遵循良好的规则化习惯。但达到这个能力,就可以与机械化的严谨逻辑系统接口了,可以使用 Mathematica 之类了。

这就是人工智能下一步的走向:在神经元上建立更好的逻辑模拟系统,直到能与纯符号逻辑工具无缝链接。人脑中逻辑模拟系统是一个高能耗、高错误率、高构建成本的系统。它的一大好处,是能够跟底层神经元系统无缝联结。

立委:说得很好。

与符号逻辑系统接口就是 tool use,例如,遇到复杂数学问题,不要用自然语言的思维链(cot)去强行推理来影响概率性推理结论,而是LLM自己写代码去 call Mathematica。现在这种 tool use 的能力被定义为 LLM-native agent 的根本特性(之一)。所以 这种能力也还是 from within。

所以 我们看到了清晰的演进路线:

1 传统统计模型人工智障 不理解自然语言
solution: LLM e.g. ChatGPT


2. pretrained LLM 缺乏推理能力
solution: reasoning LLM e.g. o1 / r1


3. reasoning LLM 缺乏严谨的符号逻辑能力
solution: LLM agent (interfacing symbolic tools)

yanyongxin: 传统统计模型之所以人工智障 不理解自然语言,是因为没有足够大的参量空间和足够复杂的数据结构,来容纳理解语言所必须的世界模型。

 

 

 

【相关】

 

 

Transformer 和注意力机制简介

transformer架构及其注意力机制是主流GPT大模型的基础,特别特别重要。虽然这方面的科普和讲解已经汗牛充栋,但还是有很多朋友跟我说一头雾水或雾里看花。所以下决心写了三篇科普系列,试图做出我的理解贡献。

作为对主流AI有好奇心的同学,你可能早就听说过大名鼎鼎的大模型的基本框架 transformer及其“注意力机制”,觉得它们是高深莫测的概念。 你也许也读过那篇经典论文 Attention is all you need,但还是感觉云里雾里。别担心,这很正常,我们多数人都经过这个阶段!这篇论文确实有点“烧脑”,但它的核心逻辑其实并不复杂。

要理解AI大模型的Transformer架构,就需要拆解其工作流程。

首先应该了解一下大模型的工作原理和训练方式。

基础大模型通过原始大数据的“自监督学习”(self-srupervised learning),利用多层神经网络,获得数据相关的知识。自监督学习是一种特别的监督学习,它利用“掩码”获得监督信号。我们知道监督学习的训练数据是标注了输出目标作为监督信号的学习,但自监督无需人类标注,而是在数据中遮盖了部分数据点,让系统学习预测它(“填空”或“接龙”),以被遮盖的数据点作为标准答案和监督信号。主流的GPT大模型的掩码就是遮盖住下一个词,让系统仅仅根据上文来预测它(叫 next token prediction),这是当前生成式AI的主流模型。

当我们输入一段文字时,模型首先要做的就是把它切分成一个个基本单位(词元),然后给每个词元找到它的"字典释义"(向量表示)。

从输入到输出的全过程

1. 从“查词典”开始:Tokenization 和 Embedding

要理解整个输入文本,首先需要拆分基本单元,叫做 tokenization(分词),即,将文本拆解成序列 tokens(词元,文本的最小单位),这些 tokens 可能是完整词(如"work")或子词(subword,如"un+believ+able")。

词元是符号,而计算机对符号难以计算,它只玩得转数字,所以需要把词元转成数字。

每个 token 都会通过查一种嵌入(embedding)词典,把词元符号转化成一个数字化表示:多维向量。每个Token被转换为300-1024维的向量(想象给每个词建立很多概念维度的特征表示,例如:名词,单数,机构,金融,......)。Embedding 让词语有了可计算的语义空间关系。

多维向量好比一个“意义”空间,每个token的多维向量定义了这个token在意义空间的位置;token与其他tokens在不同维度的距离,就是它们在意义上的区分。这符合我们的常识:一个词的意义可以在与其他词的比较中显现。

这些向量不是随机生成的,而是通过海量语料训练出来的数字化表示,提供了词元的基本语义信息,即词元在意义空间的位置——例如"银行"的向量天然接近"金钱",而与"树木"相距甚远。再如"苹果"这个词的向量,可能会包含"水果"、"科技公司"等多个方面的信息。

想象一下,你要让计算机理解一句话:“The cat sat on the mat”。

第一步:分词(Tokenization),先把这句话拆成一个个的 tokens:The+cat+sat+on+the+mat 。

第二步:查字典(Embedding), 给每个 token 找一个数字化表示,也就是一个多维向量。

“cat” -> [0.1, 0.5, -0.2, ...]
“sat” -> [-0.3, 0.8, 0.1, ...]
...
(注:实际向量维度更高且值为连续分布)

简单来说

Tokenization 将文本拆解成计算机容易处理分析的最小单位 token。
Embedding 把这些 token 转换成计算机容易运算组合的向量。

关键点: 嵌入词典得到的向量只是 token 的“初始意义表示”,它还没考虑这个token的具体语境。在向量表示中解码上下文意义是下面步骤的任务,用的就是transformer架构中的多层神经网络+注意力机制。

Transformer 的核心模块可以拆解为两部分:

    1. 注意力机制:用于计算 token 之间的相关性,并动态更新 token 的表示。
    2. 神经网络:用于处理 token 之间的信息转换。

整个 Transformer 由多个这样的模块堆叠而成,每一层都会重新计算 token 的表示,使得理解越来越深。

2. 注意力登场:根据上下文更新词义

现在,我们有了一串向量,每个向量代表一个 token 的“初始含义”。但问题来了,同一个词在不同语境下可能有不同的意思啊!比如,“bank” 可以是“银行”,也可以是“河岸”。

Transformer 架构的核心是 注意力机制(self-attention),其作用就是:根据上下文,动态地调整每个 token 的含义表示,反映与其他token的关系。

打个比方:在"我喜欢吃苹果"这句话里,"苹果"和"吃"的相关度很高,所以模型会更多地参考"吃"这个词来更新"苹果"的含义,从而确定这里的"苹果"指的是水果而不是公司。

怎么做呢?

模型通过QKV注意力计算每个词元与其他词元的注意力权重:
- Query:当前词元的特征向量(如"他")
- Key:上下文词元的特征向量(如"警察","目击者")
- Value:关联后的实际含义

    • 例如,通过矩阵运算,发现"他"与"目击者"关联度最高,于是更新"他"的向量,使其携带"目击者"的信息。

计算“相关度”: 对于每个 token,我们都要计算它和句子中 所有 其他 token 的“相关度”,给不同的词元分配不同的"注意力权重"(attention scores)。这个“相关度”可以理解为:在理解当前这个 token 的含义时,其他 token 有多重要。

    • 例如,在理解 "sat" 这个词时,"cat" 和 "mat" 显然比 "the" 更重要。

加权平均: 根据计算出的“相关度”(也就是词元的权重),把上下文中所有 token 的V向量 加权平均 起来,得到本token的一个新的向量表示。这个新的向量就是当前 token 在 这个特定句子 中的含义表示。

    • 比如,"sat" 的新向量会更多地受到 "cat" 和 "mat" 向量的影响,而较少受到 "the" 向量的影响。

关键点: 注意力机制通过计算 token 之间的相关度,实现了对每个 token 含义的 动态更新。这种更新是 基于上下文 的,同一个 token 在不同的句子中会有不同的表示。

这样,每个 token 的意义不再是固定的,而是会根据整个句子的上下文动态变化。例如,在 "I saw a bat" 这句话中,"bat" 可能是 "蝙蝠",也可能是 "球棒",但注意力机制会结合上下文来推测其在上下文中更合适的含义。

关于注意力机制中QKV如何分工和工作的细节,可参照姊妹篇《立委科普:如何理解自注意力机制中的QKV分工?》。

3. Transformer 主干:多层递进的信息压缩

Transformer 的核心组块可以拆解为两大部分:

    • 多头注意力层:用于计算 token 之间的相关性,并动态更新 token 的表示。
    • 前馈神经网络层:非线性特征转换,进一步压缩信息(抽象、泛化)

整个 Transformer 由多个这样的模块堆叠而成,每一层都会重新计算 token 的表示,使得理解越来越深。根据组块的多寡,Transformer 会反复进行这个更新过程。就像人类理解文章时会反复琢磨一样,每一层都在加深对文本的理解。越深的层次可能捕获到越复杂的语义关系。

每个Transformer组块都在迭代升级认知,例如:
- 底层组块:捕捉局部语法(如"not...but..."的转折关系)
- 中层:理解"他指代的真实人物"
- 高层:把握全文主旨

Transformer的最大特点
1. 并行计算:词序与token处理解耦,并行处理所有token(对比此前RNN的线性低效)
2. 层次化理解:从字面含义到深层意图的渐进式解读,捕捉大大小小的规律性。

与前Transformer的RNN相比,架构优势的工程化体现

特性 RNN Transformer
并行计算 序列依赖无法并行 全token并行处理
长程依赖处理 存在梯度衰减 直接全局注意力
训练效率 O(n)时间复杂度 O(1)层内时间复杂度
内存消耗 相对较低 随序列长度平方增长

4. Output:模型的最终预测

Transformer 模型可以用于各种各样的任务。不同的任务,输出(output)的形式也不同。

    • GPT:预测下一个词(Next Token Prediction) 对于主流 GPT ,其最终的任务是预测下文,通过所谓“自回归”下一词元预测实现(自回归就是动态扩展上文,递归实现一个词一个词的接龙)。模型会根据已经深入理解的上下文,来决定接下来最合理的内容应该是什么。这一路打开了通用AI的路,原理是序列学习学到了一种通用任务的输入转输出的“密码”,但这是另一篇科普的内容了。

5. 总结

    • Tokenization 和 Embedding 给计算机理解文本打下基础,好比查了词典。
    • 注意力机制 计算 token 之间的相关性,并动态更新 token 表示。
    • Transformer 由神经网络层 + 注意力层组成,层层优化 token 表示,涵盖不同层次的各种关系。
    • 最终的 output 取决于任务,翻译模型是生成目标语言文本。GPT 负责预测下一个 token,最终发现这个简单的预测机制自然进化成解锁了各种任务的通用大模型。

 

 

【相关】

True Story Behind DeepSeek's Success: AI Learning to Think Slowly Without Human Supervision

*Edited transcript from InfoQ's second DeepSeek series livestream featuring Dr. Wei Li, former VP of Engineering at Mobvoi's Large Language Model team, discussing R1 Zero's innovative contribution to democratizing reasoning models.*

DeepSeek's Greatest Achievement: Making Everything Transparent

InfoQ: "DeepSeek adheres to a pure reinforcement learning approach, but the industry often refers to RL as 'alchemy' - how did they make this process controllable and accessible? What's innovative about their reasoning paradigm?"

Dr. Li:** The reinforcement learning for reasoning models has long been an industry challenge. About six months ago, when Ilya and others declared the end of the pre-training era, it signaled that simply scaling up pre-trained models was no longer sufficient for performance improvements. The delayed release of GPT-5 is another indicator of pre-training's decline. As a result, the industry began seeking new growth paths, with on-the-fly reasoning models gaining momentum among leading teams until OpenAI released O1, the world's first reasoning large language model. DeepSeek's R1 then followed with its breakthrough success.

From the mysterious Q-Star project (reportedly causing dramatic internal conflicts at OpenAI) to the release of O1, reasoning models have been widely recognized as a new paradigm in AI. The core of this paradigm is enabling models' "slow thinking" capability, or System 2 as it is called, using reinforcement learning to enhance model intelligence in complex tasks. However, all of this was closed-source. OpenAI even deliberately created mystique around their chain-of-thought content. Apart from a few top players like Google and Anthropic quietly exploring and tracking this field, other teams knew very little about it.

DeepSeek's greatest achievement lies in making everything about LLMs transparent. They open-sourced their models and detailed technical papers, and weren't afraid to expose their thought of chains (CoTs) in the system. Through pure reinforcement learning, they proved that even without process control data, result-based control alone could achieve top-tier reasoning model performance. This breakthrough was like piercing through a paper window, showing the industry a feasible path to democratizing reinforcement learning.

InfoQ: The innovation in reasoning paradigm sounds abstract. Could you provide an example?

Dr. Li:** R1's paper is outstanding, arguably one of the finest in the large model field. It consists of two parts: one focusing on Zero research, which presents remarkable achievements in pure reinforcement learning for reasoning; the other detailing the practical R1 system, a top-tier production reasoning model. For R1's development, they considered practicality, balancing comprehensive performance, safety, and various practical considerations, detailing a four-stage training pipeline as best practice to help other teams understand and replicate their success.

The most brilliant part is the Zero research. Zero proved a revolutionary point: contrary to traditional beliefs (or OpenAI's implied stance that reasoning requires step-by-step supervision), process supervision isn't actually necessary. Using only the final result against the "gold standard" as a supervision signal is sufficient to train the "slow thinking" process required for reasoning models.

This is Zero's greatest highlight and the origin of its name - it draws inspiration from AlphaZero's spirit. AlphaZero historically pioneered complete independence from human game records or experience, achieving zero human supervision reinforcement learning through self-play generated process data (state+move+score triplets). Similarly, DeepSeek's Zero research demonstrates that in reasoning tasks, models can autonomously generate internal process data - Chain of Thought (CoT) sequences - without human annotation.

Specifically, reasoning models initially focused on mathematics and coding because these domains have standard answers. Macroscopically, this is typical end-to-end supervised learning, as both input (math/coding problems) and output (answers/execution results) are fixed and known. However, the process from input to output is highly complex with significant information gaps, requiring a CoT bridge. Just as humans need to break down problems and think step by step when facing difficulties, models need this process too. DeepSeek's research found that models possess the ability to learn this deep thinking process autonomously if given sufficient time and space.

InfoQ: Dynamic reasoning paths sound like AI "drawing mind maps" - but how do you prevent it from going off track? Like suddenly writing poetry while coding?

Dr. Li:** Based on current evidence, this possibility is virtually non-existent or negligibly low. Before DeepSeek published their results and research details, many were puzzled about this point: wouldn't deep thinking go haywire with only result supervision and no process supervision? Without large-scale reinforcement learning experiments, this was indeed a significant concern. It's like flying a kite - you're holding just one string while letting it soar freely, worried it might nosedive.

These concerns proved unnecessary. The reason it doesn't go off track is that all this reasoning reinforcement learning, including self-generated reasoning CoTs, is built upon existing top-tier models (like V3). These models have already mastered coherent expression through massive data learning. This coherence implies orderliness, which, while not equivalent to pure logic, prevents completely unreasonable deviations. It is observed that fluent human speech typically reflects organized thinking.

InfoQ: On another note, compared to OpenAI's O1, DeepSeek R1 has another notable highlight in applying reasoning CoTs to language generation and style imitation. Could you elaborate on this?

Dr. Li:** When O1 was released, everyone knew it demonstrated significant improvements in mathematics and coding abilities, as standard tests revealed higher performance levels. What people didn't realize was that this reasoning ability, or "slow thinking" capability, excels not only in domains requiring strict logical reasoning but can also shine in traditional language tasks.

By nature, language ability has been a strength of large models - everyone knows they generate very fluent text, more native than natives. By the time we reached models like 4o or V3, their writing was already quite smooth, seemingly leaving little room for improvement. However, when asked to write classical poetry or imitate Lu Xun's writing style, previous models fell short. R1 solved these challenges. From a social impact perspective, this is actually quite remarkable and particularly noticeable.

Honestly, not many people are deeply concerned about mathematics or coding, although we know coding is a major direction for the coming years and automated programming can change the world. Everything in IT ultimately comes down to software; the digital world is built on software. If software development can transition from manual coding to model-assisted or even model-autonomous programming, this will greatly increase productivity. While this is visible to all, it's not as intuitive for ordinary people who more often face tasks like writing compelling articles.

When R1's humanities capabilities were discovered, not just geeks or software developers saw the benefits of reasoning models - ordinary people were excited too. Suddenly, anyone could claim to be a poet, writer, advisor or philosopher - the impact was tremendous. This wasn't felt with o1, perhaps because OpenAI didn't realize or at least didn't focus on this aspect of reasoning models. But while working on code and mathematical reasoning, DeepSeek must have internally realized that this "slow thinking" mechanism could also significantly improve writing abilities, especially in classical Chinese.

Everyone knows Chinese data isn't as rich as English data, so while previous models could write beautiful English poetry, they struggled with Tang poetry. This might be because Chinese data was insufficient in quantity or quality, preventing models from learning adequately. We always felt this was unfortunate - models would sometimes rhyme correctly, sometimes not, sometimes add or miss characters, not to mention tonal patterns to follow. DeepSeek clearly put effort into this area; their data quality must be significantly higher than industry standards.  More significantly, they know how to transfer the CoT ability from science and technology to language and literature.

InfoQ: If you were to recommend a DeepSeek module most worth replicating for programmers, which would it be? Like those "Aha moments" claiming to replicate R1 for tens of dollars?

Dr. Li:** If I were to recommend a DeepSeek module most worth replicating for the programming community, it would be the Zero research-related components. This replication isn't about achieving comprehensive capabilities but rather verifying Zero research's key revelation - that machines can indeed autonomously learn. This is what OpenAI kept under wraps; perhaps they had figured it out earlier but chose not to disclose it.

Now, we've seen quite a number of different teams claimed to have reproduced R1's reflective capabilities with minimal resources. This isn't just an interesting experiment; more crucially, it marks the democratization of reasoning models. Previously, people didn't understand how reasoning models worked, only knowing that vast amounts of process data were needed for models to learn slow thinking. This was considered an almost insurmountable barrier because process data is hard to obtain, and reinforcement learning's instability and high data requirements confused and challenged many programmers.

But now, we know we can bypass this most difficult process data requirement and reproduce this "Aha moment" with limited resources, proving that slow-thinking capabilities can be learned autonomously by models. Based on this premise, if you're a domain expert, you might wonder: could these techniques achieve significant improvements in your field? This is entirely possible. Even the most powerful models (like V3 or 4o) only achieve 60-70% accuracy in specific scenarios without optimization, and experience tells us that without at least 80-85% accuracy, you can't launch a truly valuable system in real-life applications.

That is to say, between a large model's out-of-box results and actual valuable application deployment, there's a gap. Previously, our only method was collecting domain data for fine-tuning (SFT). Now, we have another path RL: following the reasoning model approach, letting systems fully utilize slow thinking capabilities during the reasoning phase to improve data quality to acceptable or even exceptional levels. This path seems to have been opened.

However, my programmer friends tell me that in their comparison experiments between fine-tuning (SFT) and DeepSeek-style reinforcement learning (RL), while RL indeed outperforms SFT, the computational cost for RL training is still far higher than SFT. The superior performance makes sense because SFT data is always very limited, while successfully reinforced RL self-generated data can far exceed SFT data volume.

InfoQ: Some say large models represent "brute force aesthetics," but OpenAI's former Chief Scientist and co-founder Ilya says pre-training has reached its limit. How do you view this? Is the emergence of reasoning models just adding another scaling law to brute force aesthetics?

Dr. Li:** This is more about a shift in technical focus and a paradigm change in technical innovation. Large models involve three major components: first, pre-training, which builds foundational capabilities by learning basic patterns from massive data; second, post-training, initially mainly fine-tuning - OpenAI early on used some reinforcement learning (like RLHF) for human preference alignment, but by Meta's time, they even abandoned typical PPO style RLHF for simpler DPO, as they, like many others, struggled with it. Finally, there's the reasoning phase, where models interact with users real-time after deployment.

The current situation with high-quality natural data is that pre-training has nearly exhausted all available quality resources. The industry began to notice data growth challenges, making performance improvements increasingly difficult. GPT-5's delayed release, reportedly yielding limited returns despite massive computational investment, suggests pre-training may have indeed hit a wall.

This led the industry to explore alternative AI growth curves. Reinforcement learning-based reasoning models emerged at center stage in this context: pure reinforcement learning should be added to post-training. Previous reinforcement learning relied on human preferences, but this time it's about giving models more thinking time before reaching answers, learning underlying chain of thought (CoT). While V3 was already doing well, it didn't cause as much social sensation until R1 appeared. DeepSeek truly broke through after the Chinese New Year, becoming the most discussed public topic and causing excitement and shock overseas. R1 and O1 represent a new paradigm. Before R1, only OpenAI's O1 existed as a reasoning model, seemingly unreachably advanced, with would-be-followers unsure how to follow. However, R1 not only reproduced O1's capabilities but did so with greater transparency and clarity. This contrast further highlighted R1's importance as an open-source model leader.

InfoQ: At first glance, DeepSeek seems like an engineering masterpiece. Why did it cause such global sensation? Its user acquisition speed (100 million in a week) surpassed ChatGPT's nuclear moment? What's its historical significance?

Dr. Li:** From my personal experience and observation, ChatGPT's explosion was a landmark event in large model development. Research insiders were following large models before ChatGPT, at least since GPT-3. When GPT-3's Playground appeared, we were already immersed in it, sensing an approaching storm. But from society's perspective, ChatGPT truly shocked everyone, exceeding all expectations, like an AI nuclear explosion.

I believe R1's emergence is the second major shock after ChatGPT. Of course, between ChatGPT and R1, other influential models appeared, like 4o - another remarkable milestone. While ChatGPT 3.5 was already so impressive, 4o proved it could be even better. Then came Sora, bringing shock with video capabilities in multi-modal LLMs. I personally also greatly appreciate Suno, the music model, making me feel like I could become a musician overnight.

If I were to rank them, R1's impact is second only to ChatGPT, perhaps even exceeding 4o and Sora's sensational effects. R1's impact feels similar to ChatGPT's initial appearance, creating the same addiction. While ChatGPT was groundbreaking and R1 a follower, albeit with innovative highlights sometimes surpassing previous models (like in classical poetry and style imitation), achieving such global impact as a follower is truly miraculous.

In terms of practical effects, R1's productization was amazingly successful. Gaining hundreds of millions of users in a week, it far broke ChatGPT's record and elevated society's AI awareness. Furthermore, regarding geopolitical influences on technology access, many domestic users had long desired access to the world's most advanced models like GPT series, Claude, or Gemini but often couldn't reach them. R1's appearance eliminated these concerns about domestic and international restrictions, contributing to its rapid global popularization.

InfoQ: What's your vision of AI programming's ultimate form? Is it programmers telling AI "make me a TikTok," and it outputs deployable code and operations plans?

Dr. Li:** There are always two types of people: skeptics and optimists. People like Ilya believe Artificial General Intelligence (AGI) is imminent and Artificial Super Intelligence (ASI) isn't far away, so the biggest concern now, according to him, is ensuring superintelligence safety.

Anthropic's CEO Dario predicts that within 3-5 years, large models will achieve real breakthroughs - not just the current impressive demonstrations, but revolutionary changes in societal productivity. Fundamentally, they're talking about AI's ability to scale replacement of both physical and intellectual human labor.

However, while large models are buzzing now, their practical applications haven't reached the level of the previous generation's mobile platforms. Previous super apps like Meituan, Didi, Xiaohongshu, and TikTok transformed major aspects of our daily lives, from basic necessities to communication and entertainment, maximally shortening the distance between suppliers and customers - value everyone of us feels daily. While playing with large models is interesting, their practical value at the lifestyle level isn't yet obvious;  at best we're still on the verge of the coming AI application explosion.

Notably, DeepSeek's emergence has lowered large model application barriers, paving the way for scaled applications, though we haven't yet entered the era of true application explosion.

What will it look like when AI applications truly explode? I believe the ultimate goal, by nature of AI, is for LLMs to comprehensively replace humans in both intellectual and physical labor. Signs of large models impacting white-collar workers are already undoubtedly evident, with even programmers not an exempt. In physical labor, embodied intelligence is developing rapidly, with both humanoid robots and mechanical hands gradually replacing human physical work.

Of course, this brings side effects, like massive job displacement. How society adapts to this state of greatly developed productivity, but this is another discussion topic. But looking at AI's nature and ultimate goals, AI development could have two milestones: first, when it can replace 50% of human work, allowing half of society to maintain a decent, free life through social programs perhaps like Universal Basic Income (UBI) - this might mark the arrival of AGI (Artificial General Intelligence); second, when it replaces 90% of human work, possibly signifying the emergence of ASI (Artificial Super Intelligence) - a kind of technological utopia (or 'communism') in some sense.

These two milestones are my own verifiable definitions of AGI and ASI.  I do not agree with the idea that while old jobs are replaced, more new jobs will be created by AI.  It just does not make sense as any new jobs are also a mixture of human labor, destined to be replaced soon by super intelligence if they do emerge for time being.

This vision of AI's future development shows how DeepSeek's innovations in reasoning models might be just the beginning of a much larger transformation in how we think about work, society, and human potential in an AI-driven world.

 

 

【相关】

Does the New Reasoning Paradigm (Query+CoT+Answer) Support a New Scaling Law?

— Reflections on LLM Scaling Laws and DeepSeek's R1

My friend Zhang Junlin's article "Looking at the Future of Scaling Laws through DeepSeek R1" has sparked interesting discussions among peers.

Core Insights from Initial Discussions

Professor Bai summarised the key highlights as follows:

Infinite stacking won't lead to infinite growth (physical laws don't support this)

Only S-shaped growth is possible, with diminishing returns inevitably appearing

The initial emergence of language capabilities relates to the density of linguistic knowledge in training data

The next growth phase represents a second S-curve, driven by common sense knowledge, which requires more computing power due to lower knowledge density

The third phase involves learning logical reasoning (Chain of Thought), where natural data has even lower density of such knowledge. Brute-force mining with computing power becomes inefficient, making reinforcement learning with synthetic data a more rational approach

As Dr. Lu points out: The term "Scaling Law" is becoming overloaded. While S-curves (nonlinear curves characterized by sigmoid functions) can describe technology adoption lifecycles, they typically occur in succession (one technology hits its ceiling, making way for another). Large language models' multiple "Scaling Laws" confirm this pattern, with some overlap between Test-Time and Post-Training "Scaling Laws".

The Nature of LLM Scaling

Let's examine the fundamental logic behind LLM scaling. First, it's crucial to understand that LLMs are not databases - they don't aim to memorize long-tail data details. Large model training essentially compresses big data, or more precisely, compresses the knowledge systems behind the data (including common sense and encyclopedic knowledge), focusing on capturing patterns and regularities of various patterns (what we call generalizations).

Conventional intuition suggests that as data scale increases, redundancy increases too. Regardless of filtering, cleaning, and deduplication, growing redundancy seems to imply diminishing returns. So why do large models still appear "hungry" even at the unprecedented scale of hundreds of billions of tokens? Why does the scaling law remain effective from hundreds of billions to trillions of tokens?

The key lies in LLMs being sequence learning and sequence decoding systems. While sequences are one-dimensional, the patterns and regularities behind are high-dimensional. For instance, even a simple sequence like "cat chases mouse" potentially involves multiple knowledge dimensions: species relationships, predatory behavior, spatial movement, actor-patient roles, etc. This multi-dimensional knowledge naturally leads to combinatorial explosion at the sequence level as information is flattened in language. The "appetite" for insatiable big data effectively addresses this combinatorial explosion. As long as there isn't complete information redundancy, additional diverse sequences will help models abstract data patterns more precisely.

The Two vs. Three S-curves Debate

Zhang Junlin observes that since OpenAI's O1, two other phases have gained recognition with their own Scaling Laws: the reinforcement learning Scaling Law (RL Scaling Law) for post-training, and the Inference Scaling Law (also called Test Time Scaling Law).

This raises a crucial question: Are there really three S-curves, or just two? How comparable is the reasoning model's S-curve to the pre-training S-curve?

While theoretically we can identify three phases:

Pre-training
Post-training (especially reasoning-focused reinforcement learning)
Inference phase

In practice, post-training and inference phases likely share a single S-curve; there aren't two independent growth curves.

DeepSeek R1's Insights: The Truth About "Slow Thinking"

Consider DeepSeek R1: users can activate "deepthink" mode to enable Chain-of-Thought (CoT) reasoning, but they can't actually control reasoning quality by increasing computation time. Why is this?

Let's examine a concrete example. When R1 solves a complex mathematical problem:

Traditional models might directly answer: "The result is 42"

R1 shows detailed reasoning: "Let's think step by step: 1) First consider... 2) Then we can... 3) Finally, we get 42"

While R1's response appears to demonstrate "slow thinking" (CoT), this reasoning process reflects actually a generation pattern fixed during training, not dynamic exploration of multiple potential reasoning paths during response time. In other words, CoT+answer might look like "slow thinking," but it doesn't fundamentally change the unidirectional next-token prediction paradigm. R1's CoT+answer creates an illusion of slow thinking, but the generative nature remains fundamentally the GPT "fast thinking" paradigm. At test time, unlike AlphaGo, the depth and scale of thinking isn't dynamically explored, though beam search, if applied, can provide implicit multi-path optimization internally.

Test Time Compute Constraints

The industry's buzz word "test time compute" refers to reasoning models requiring more online computational resources compared to traditional non-reasoning models. For example, R1 with CoT enabled might need several times more computation time than its base model V3 for the same problem. However, this increased computation results from behavior patterns acquired during training, not dynamically adjustable compute investment. Without controllable scalability in test time compute, we can't really talk about a test time scaling law.

A major difference between pre-training and CoT reinforcement learning lies here: pre-training scaling laws can remain stable long-term because once training completes, it doesn't significantly impact online response time - the generation mode remains a simple query+answer. Therefore, offline training for months is acceptable if the resulting model shows significant capability improvements. However, reasoning models' post-training CoT reinforcement learning differs - it cultivates models' habits of responding with slow thinking, changing the generation mode to query+CoT+answer. Extending the CoT isn't just about the cost of training resources and time; more critically, it reflects in extended test time compute for each query during deployment, severely delaying system response time. Users generally have limited tolerance for slow thinking computation time and delays during online system use.

The Sustainability Debate

OpenAI's Sam Altman and Anthropic's Dario might argue that for extremely complex problems (like proving the Riemann hypothesis or designing next-generation aerospace vehicles), even if a model needs a week of computation time, it's still a massive improvement over human teams requiring decades. However, this argument has two issues:

LLM feasibility for such super-complex problems remains far from validated

Extreme scenarios lack universality and can't serve as data points for sustainable scaling laws

This isn't to deny S-curves as effective models for describing scaling laws, nor to reject the rationality of S-curve stacking. The combination of pre-training and post-training growth curves (s1 and s2) might indeed reflect the overall relationship between resource investment and performance improvement. However, we should carefully examine whether CoT reasoning truly opens a sustainable scaling curve.

Conclusion: How Far Is the LLM Road to AGI?

If reasoning models' scaling laws lack sustainability, this raises a deeper question: Can we reach the promised land of Artificial General Intelligence (AGI) through these two scaling laws alone? Furthermore, is the technical ideal of Artificial Super Intelligence (ASI) - AI replacing human labor and dramatically improving productivity - truly feasible?

Current evidence suggests that while pre-training scaling laws have shown considerable sustainability, reasoning models' scaling laws may quickly hit practical constraints. This reminds us that the path to AGI/ASI likely requires more innovative breakthroughs, not just simple extrapolation of existing methods. In the next phase of artificial intelligence development, we might need to discover entirely new growth curves.

[#LLMs #ArtificialIntelligence #DeepLearning #AGI #ScalingLaws #MachineLearning]

 

【相关】

张俊林:从Deepseek R1看Scaling Law

DeepSeek 笔记:推理新范式 query+cot+answer 支持新的 scaling law 吗?

LLM的"大就是好"还能走多远?

——关于Scaling Law的一些思考

 

老友张俊林《从Deepseek R1看Scaling Law的未来》一文,引起老友热议。

白老师的推荐抽提是:

核心观点:

——无限堆叠不会无限增长(物理世界规律也不支持),只有S型增长,一个S曲线一定会出现边际效益递减。

初期语言能力的涌现,与语料数据中包含的语言知识密度有关。

接下来的增长实际上是第二根S型曲线,更多语料贡献的是常识性知识,常识知识密度不及语言知识密度,所以要更大算力才能涌现。

再接下来是逻辑知识(思维链)的学习。自然语料中逻辑知识密度更低,用算力野蛮淘金,吃力不讨好。所以,用逻辑知识密度更高的合成数据做强化学习,才能让第三个S曲线爬坡。这就顺理成章了。

鲁总评论说:Scaling Law 这个词现在有点滥用。S 曲线(Sigmoid函数刻画的非线性曲线)倒是可以描述技术的生命周期,但它往往是一个接下一个(一个技术遇到瓶颈,往往才有另一个技术的开始)。。。这个在ChatGPT刚出来时我们回顾过。大模型的这几个 "Scaling Laws" 也印证这一点 (Test-Time 和 Post-Training “Scaling Laws" 有点重叠部分):

创新就是从一个S曲线到另一个S曲线,well known results。这也是斯坦福大学那位鼓吹新能源、自动驾驶以及再生食品革命等科技乐观主义的教授(叫?)每次演讲必谈的技术革命的adoption曲线。他自称根据这个曲线,他在过去30年对于技术影响社会的许多预见都证明是对的,虽然每一次预见社会都会取笑他。 

回到LLM领域的 scaling law 话题。Scaling law本质上是一种经验法则,而经验告诉我们,大多数经验法则都符合S形曲线(或增量的正态分布)。具体到LLM,"大就是好"正是这种法则在遇到平台期或天花板之前的体现。这里的"大"指的是数据规模大、模型参数量大,缺一不可。模型规模不够大,数据再多也无法有效消化——这早已是业界共识。不过OpenAI早期的设计中过分强调模型规模的做法现在看来是一种误导,直到Chinchilla Scaling Law的提出,业界才形成了更合理的共识:数据规模和模型参数量需要保持适当的比例关系。

LLM Scaling的底层逻辑是什么?

首先要明确:LLM不是数据库,其目标不是记忆长尾数据的细节。大模型训练本质上是对大数据内容的压缩,换句话说,压缩的是数据背后的知识体系(包括常识、百科知识等),重点在于揭示大大小小的各种规律性(也就是所谓的泛化能力,generalizations)。

一般直觉会认为,数据规模越大,冗余也越多。无论如何过滤清洗和去重,冗余度随规模增长,似乎意味着可榨取的"油水"会越来越少。那么为什么到了千亿tokens这种以前难以想象的数据规模,大模型依然显得"吃不饱"?为什么从千亿扩展到万亿tokens,scaling law依然有效?

这个现象的关键在于LLM是序列学习(编码)序列推理(解码)的系统。序列本身是一维的,但序列中蕴含的patterns和规律性却是高维的。举个例子:即使是简单的"猫追老鼠"这样的序列,背后可能涉及物种关系、捕食行为、空间运动等多个维度的知识。这种多维知识表现在序列层面,就会发生天然的组合爆炸。对大数据的"大胃口"正是应对这种组合爆炸的有效策略。只要不是完全的信息冗余,增加的不同序列对模型抽象数据patterns通常都是有帮助的。

然而,人类自然产生的高质量数据是有限的。预训练已经几乎吃尽了现有的高质量自然数据。于是,业界开始探索另外的AI智能增长曲线。

从预训练到推理:两个还是三个S曲线?

张俊林指出:

OpenAI o1推出后,另外两个阶段不再孤单,也各自拥有了姓名,产生了各自的Scaling Law,对应后训练阶段的强化学习Scaling Law(RL Scaling Law)和在线推理阶段的Inference Scaling Law(也叫Test Time Scaling Law)。

这里值得探讨的问题是:到底是三个S曲线,还是两个?推理模型的S曲线与此前的预训练S曲线有多大可比性?

理论上确实可以分为三个阶段:

1. 预训练
2. 后训练(尤其是推理强化学习)
3. 推理阶段

这三个阶段理论上都可能找到资源投入与性能提升之间的正相关S曲线,即scaling laws的某种表现函数。但实际上,在当前部署的应用中,后训练和推理这两个阶段应该共享同一个S曲线,原则上不存在两条独立的增长曲线。

当然,如果用户利用提示词技巧来影响模型的test time,让它更深入的思考,这可能间接影响 CoT (ChainOfThought)的长度或深度。但那是 query 的改变,是 input context 的变化,感觉也不应该算作 test time compute 的独立的 s曲线。

另外,说推理模型这一波潮流是范式转变,开启了新的 RL/Test-time scaling law,总觉得有一点太言之凿凿了。直觉上,推理模型的增长曲线与此前的预训练 scaling law 的增长曲线,大概率没有直接的可比性。

Scaling law 说的 law,实际上我们都知道是所谓经验“法则”。经验需要足够的实践数据积累,才能总结出来。强化学习赋能的推理模型才刚开始,没有足够的经验数据刻画这是怎样的一种增长关系,能持续多久,是不是昙花一现,还是可以持续相当长的时候,等等。

持续时间不够长的 scaling,其实没有多少经验法则的意义。Anthropic CEO Dario 提到 deepseek 的时候说(大意), deepseek 显得这么亮眼其实是赶上了好时机,言下之意是运气的成分大于技术硬核实力和创新(滑稽的是,Anthropic 迄今没有能力推出任何推理模型,虽然R1以来,谷歌和国内都有推理模型的上线)。他说,推理刚刚开始,所以任何人走通了这条路,在这个初期阶段都会有一个大增长。譬如PhD段位的考试题,在没有推理模型的LLM中,可能分数很低,但一旦有了推理模型,有了所谓 test time compute 的 CoT,成绩就会直线上升,给人创造了奇迹的感觉。

现在是推理模型的早期,后去会如何呢?靠增加 test time compute,或不断延长 CoT,还会有多少增长空间?这个问题是现在进行时,貌似没有明确答案。但隐隐觉得,这个持续增长的时间或曲线,远不如预训练那样稳定和持续,进而其作为 scaling law 的说法不一定站得住。

这第二条反映 RL scaling law 的后训练智能增长曲线,不大好与 pretrain scaling law 相提并论,很可能并不是可持续的,也可能很快就遭遇制约因素的强烈反弹(见后“Test Time Compute 的制约”)。

DeepSeek R1的启示:慢思考的真相

以DeepSeek R1为例,用户可以选择"deepthink"模式来启动慢思考的chain-of-thought(CoT)推理,但实际上用户难以通过增加计算时间来提升推理质量。这是为什么呢?

让我们看一个具体例子。假设我们让R1解决一个复杂的数学问题:

- 传统模型可能直接给出答案:"结果是42"
- R1会展示详细的推理过程:"让我们一步步思考:1) 首先考虑...... 2) 然后我们可以...... 3) 最后得出结果42"

表面上看,R1的回答展现了"慢思考"(CoT)的特征,但实际上这个推理过程是模型在训练阶段就已经固化的生成模式,而不是在回答问题时动态探索多个可能的推理路径。换句话说,CoT+answer 看似是"慢思考"后的回答,但其实并不改变自回归 ntp(next token prediction)的单向序列生成定式。说白了就是,R1 的 cot+answer 给人慢思考的样子,但生成的本性还是GPT“快思考”范式。在 test time,思考的深度和规模不是动态探索,虽然可以用 beam search 进行内部的隐式多路径选优。

Test Time Compute 的制约

目前业界热议的"test time compute",指的是含有CoT机制的推理模型相比传统的非推理模型需要更多的在线计算资源。以V3/R1为例,处理同样的问题,启用CoT 的R1可能需要V3 n多倍的计算时间。但这种计算量的增加是模型训练后固化的行为模式导致的,而不是可以动态调节的算力投入。test time compute 没有可控的伸缩可能性,也就谈不上 test time scaling law。

预训练与后训练的CoT强化学习的一个很大的不同是:预训练 scaling law 可以长期稳定乃是因为一旦训练完成,不大影响在线响应的时间,生成模式就是简单 query+answer。因此预训练阶段离线训练几个月都是可以忍受的,只要训练出来的大模型能力有大的提升。但推理模型后训练阶段的CoT强化学习不同,它在培养模型在线回应慢思考的习惯,生成模式是 query+cot+answer。推理模型的 cot 拉长,不仅仅是训练的资源和时间的耗费问题,更主要的是它反映在部署推理阶段的 test time compute 的延长,严重拖延了系统的响应时间。而用户在线使用系统的时候,一般来说对于慢思考的计算量和耗费时间是有能够忍耐的上限的。

这就带来了一个关键问题:即使研究表明indefinitely 增加CoT的长度(相应增加在线计算时间)能带来持续的性能提升,符合某种 scaling law 的经验法则,这种增长也会受到推理阶段现实因素的制约。一般用户可能愿意等待5-10秒获得更好的答案,但如果需要等待几分钟乃至几小时,使用体验就会大打折扣,乃至不可接受。

Scaling Law的可持续性之辩

Open AI CEO Sam Altman 和 Anthropic CEO Dario 这些大佬可能会争辩说,对于极其复杂的问题(如证明黎曼猜想、设计下一代航天战机等),即使模型需要一周的计算时间,相比人类团队需要数十年的工作量仍是极大的进步。但这种论述有两个问题:

1. 这类超复杂问题的LLM可行性远未得到验证
2. 极端场景不具有普适性,难以作为可持续的scaling law 的数据点

当然,这并不是否认S曲线作为描述scaling law的有效模型,也不是否定S曲线叠加的合理性。预训练和后训练两个阶段的增长曲线(s1和s2)叠加确实可能反映了资源投入与性能提升的整体关系。但我们需要谨慎看待CoT推理是否开启了一个真正可持续的scaling曲线。

结语:通向AGI的道路还有多远?

如果推理模型的scaling law缺乏可持续性,这就带来了一个更深层的问题:仅依靠这两个scaling laws,我们能否达到通用人工智能(AGI)的理想彼岸?更进一步,让AI平替人类劳动、极大提升生产力的超级人工智能(ASI)的技术理想是否真的可行?

目前的证据表明,预训练scaling law确实展现了相当的持续性,但推理模型的scaling law可能会较快遇到现实约束。这提醒我们,通往AGI/ASI的道路可能需要更多的创新突破,而不仅仅是现有方法的简单外推。在人工智能发展的下一个阶段,我们或许需要寻找全新的增长曲线。

 

 

【相关】

张俊林:从Deepseek R1看Scaling Law

DeepSeek 笔记:R1 部署阶段的推理机制

1. 训练阶段的强化学习机制:GRPO是否通过生成多条候选答案(multiple candidate cot+answer sequences)进行策略优化(修改模型),使得模型养成慢思考的习惯?

这个答案是毫无疑问的 YES。

2. 部署阶段的推理机制:R1是否在生成时隐式生成多条路径,但仅展示一条?如果是,这种机制与集成(ensemble)方法有何异同?

3. 与AlphaGo的MCTS的区别:MCTS树搜索是否在推理时动态构建搜索树,而集成方法只是静态组合多个模型的输出?

1. 部署阶段的隐式多路径推理机制

DeepSeek R1 的部署阶段,其推理机制可以概括为以下两种模式:

(1) 隐式多路径生成与筛选

- 生成多条路径:模型在单次推理时,可能隐式生成多条潜在的推理路径(CoT+Answers),但仅选择其中一条输出。
- 技术实现:通过调整解码策略(如束搜索宽度 `beam_width`),模型在生成过程中维护多个候选序列(即多条路径),最终选择综合评分最高的路径。
- 用户感知:用户仅看到最终输出,但模型内部进行了多路径探索与筛选。
- 效率权衡:若设置 `beam_width=1`(贪心搜索),则退化为单路径生成,响应速度最快;增大 `beam_width` 可提升输出质量,但增加计算延迟。

(2) 显式多候选生成(需主动配置)

- API级控制:通过设置 `num_return_sequences` 参数,模型可显式生成多个候选答案(如5个),用户或下游系统可进一步筛选。
- 实际应用:DeepSeek App默认未开放此功能,但在企业API或开源代码中可能支持。

关键点
- 训练阶段的强化学习优化了模型的“单路径CoT生成能力”:通过GRPO训练,模型在单次生成时即可输出高质量的详细推理步骤(长CoT),无需依赖显式多候选生成。
- 部署时的多路径探索只是“锦上添花”:隐式多路径(如束搜索)或显式多候选生成可进一步提升输出质量,但非必需功能。

 

2. 训练阶段的“慢思考习惯”培养

(1) 强化学习的作用

- 目标:通过GRPO算法,模型学习生成更详细、更合理的推理步骤(长CoT)以提高奖励(如答案正确性)。
- 机制:训练时生成多个候选答案,奖励信号不仅评估最终答案正误,还隐式鼓励逻辑连贯的推理路径(如通过格式奖励)。

(2) CoT增长的驱动力

- 奖励设计:若长CoT更易得出正确答案(如分步解题减少错误),模型在策略优化中自然倾向于生成更长、更详细的步骤。Given room for [think], a reasoning model just wants/tends to think deep!
- 数据反馈:训练后期通过拒绝采样生成的高质量SFT数据,进一步强化这一模式。

结果:训练后的模型在单次生成时即可输出高质量的详细推理(即“慢思考习惯”内化)。

3. 与集成方法(Ensemble)的异同

(1) 相似性

- 多路径生成:隐式多路径探索(如束搜索)可视为同一模型生成多个潜在输出,类似集成方法中的多模型预测。
- 结果筛选:通过置信度选择最优解,类似于集成中的投票或加权平均。

(2) 核心差异

R1的隐式多路径生成本质是单模型内的动态解码策略,而传统集成依赖多模型的静态组合,二者在实现成本与多样性来源上存在根本差异。

4. 与AlphaGo蒙特卡洛树搜索(MCTS)的本质区别

(1) AlphaGo的MCTS机制

- 动态规划:通过模拟(Simulation)构建搜索树,评估每一步的长期收益(如胜率),动态选择最优路径。
- 在线学习:在推理时根据实时反馈(如对手落子)调整搜索策略,部分版本(如AlphaZero)甚至更新模型参数。

(2) R1的隐式多路径生成

- 静态模型:部署时模型参数固定,多路径生成依赖预训练的策略与解码规则。
- 无长期收益建模:路径选择基于模型自身的置信度概率,而非多步决策的累积收益。

(3) 差异

- R1的多路径生成是静态策略的有限探索,依赖训练阶段内化的CoT+answer的生成能力。
- MCTS是动态规划过程,通过实时模拟与评估实现长期收益最大化,属于在线决策优化。

 

5. 总结

- 训练阶段的目标:GRPO通过强化学习培养模型生成详细CoT的习惯,使得部署时单次生成即可输出合理答案。
- 部署阶段的灵活性:系统可选择单路径生成(快速响应)或多路径筛选(质量优先),后者类似轻量级集成。

- 训练完成后模型参数确实固定,但隐式多路径生成依赖解码策略(如束搜索宽度),用户可通过API参数调整,非完全静态。
- 与集成的实质差异:R1的多路径生成是同一模型的不同解码路径,而传统集成依赖多个独立模型,后者多样性更高但成本激增。

- MCTS的核心是动态搜索与长期收益建模,而非多模型预测的平均化。R1的隐式多路径更接近贪心策略的扩展,而非规划过程。

DeepSeek R1的部署机制通过训练阶段的强化学习内化“慢思考”能力,使其在单次生成时即可输出详细推理。隐式多路径生成(如束搜索)可进一步提升质量,但本质是同一模型的解码策略优化,与传统集成或AlphaGo的MCTS均有显著差异。这种设计在效率与效果间取得平衡,适配大规模工业应用需求,但牺牲了动态规划与全局最优的能力。

 

【相关】

Hallucinations in AI: Bug or Feature? A Deep Dive into DeepSeek-R1

Host: Hello everyone! Welcome to today's interview. Recently, there's been quite a buzz about AI "hallucinations," especially with DeepSeek-R1, which seems to have a higher hallucination rate than its predecessor, DeepSeek-V3. Today, we're joined by Dr. Li, a senior AI researcher. Welcome, Dr. Li!

Dr. Li: Hello, host! Hello, everyone!

Host: Let's start with the million-dollar question: Why do large language models "hallucinate"? Can you break it down for us in plain English?

Dr. Li: You see, large language models are like super-powered conversation completers. Give them the first half of a sequence, say, a question, and they'll predict the second half (say, an answer) based on their massive knowledge network. They learn like our brains do – they can't remember everything word-for-word, so they compress and generalize, grabbing the gist and finding patterns.

Here's a fun contrast: Ask them "How tall is Yao Ming?" and they'll nail it because that's such famous knowledge, this data point is practically carved in stone in their memory (represented in the model's parameter weights). But ask them "How tall is Old Wang from next door?" and they're stumped because they've never met Old Wang! But here's the kicker – they won't just say "I don't know." So what do they do? They "make up" a reasonable height based on what they know about the range of human heights. That's a hallucination for you!

Host: Wow, that's some impressive guesswork! But isn't this kind of making things up pretty problematic?

Dr. Li: Not necessarily! In a way, hallucination is imagination (for better or worse) – it's where creativity lies! Think about it: all those great literary works, artistic masterpieces – aren't they all flights of fancy, products of imagination? If everything had to match reality closely, art would just be photography, and where's the fun in that?

You know, Yuval Harari makes a fascinating point in "Sapiens" – humans became Earth's dominant species precisely because we could "tell stories," creating myths, religions, nations, and money – things that don't physically exist. These are all "hallucinations," but they're the driving force behind civilization!

Host: When you put it that way, hallucinations sound pretty important! But let's talk about DeepSeek-R1. Its hallucination issue seems quite serious.

Dr. Li: Indeed, it is! The academic consensus used to follow OpenAI's view that reinforced reasoning would significantly reduce hallucinations. I remember discussing this with a head honcho at an LLM unicorn who was particularly excited about reasoning's potential to curb hallucinations. But R1's performance threw us a curveball!

According to Vectara's tests, R1's hallucination rate is more than 3 times higher than its foundation model V3's – 14.3% compared to 3.9%. This definitely correlates with its prolonged "Chain of Thought" (CoT) enabled by reinforcemnnt learning for reasoning. R1 is absolutely brilliant at reasoning, math and coding, as well as poetry and storytelling, but this currently comes with the "side effect" of increased hallucinations in things like translation and summarization.

More specifically, there are several reasons for R1's increased hallucinations.

First, the standard hallucination tests use summarization tasks, something base models are already pretty good at. In this case, reinforcement learning can backfire – it's like using a cannon to swat a fly!

Second, R1's reinforced reasoning chains weren't specifically optimized for straightforward tasks like summarization, translation, or news writing that demand strict factual accuracy. Instead, it tries to add various layers of thinking to every task. Looking at its transparent CoT (ChainOfThought) printout, we see it tirelessly analyzing even simple instructions from multiple angles. This overcomplication of simple tasks can lead to deviations and hallucinations.

During R1's reinforcement learning for NLP-related tasks, it seems the model was rewarded more heavily for creativity, leading it to be more imaginative – and consequently more prone to straying from facts. For mathematical and coding tasks, R1's supervision came from gold standards (test answers or code test cases). But for humanities tasks, they used V3 or V3's reward model to judge quality, and the current system seems to clearly favor creativity.

Moreover, user feedback typically tends to focus and encourage creativity. Most people aren't sensitive to hallucinations, especially when they're wrapped in the model's smooth, fluent language. For most frontline developers, this kind of user feedback naturally pushes them to enhance creativity rather than tackle the thorny problem of hallucinations.

Host: So, you are saying that R1's hallucination problem rooted in its over-enthusiastic reasoning? What's the real relationship between reinforced reasoning ability and hallucinations?

Dr. Li: It's still a puzzle – there's not seem to be simple correlation. Look at R1, a leading reasoning model, versus Claude 3.5 Sonnet, a top non-reasoning model. Surprisingly, Sonnet still has a higher hallucination rate than R1! But when we compare R1 to its base model V3, we see clearly that adding reasoning significantly increased hallucinations.

It may well be about the model's "personality." R1, with its powerful reinforcement learning, loves "divergent thinking." Give it a simple prompt, and it'll spin out ideas like there's no tomorrow – its CoTs could run on like crazy! This suggests that while R1 was powering up its creativity, it inevitably amplified creativity's twin: hallucination.

As a model that excels in both STEM and humanities, R1 performs differently across tasks. In mathematics and coding, where more rigorous reasoning is required, there's little room for hallucination. But in language and creative tasks, especially in the summarization tests, hallucinations become more prominent. It's largely a side effect of R1's supercharged linguistic creativity.

Technically speaking, R1 automatically adds lengthy CoTs to simple user instructions, essentially complicating straightforward tasks. Its CoTs (like  internal monologue of an entity following instructions) change the conditional part of the autoregressive probability model before generating answers, naturally affecting the final output. Compare:

V3: query → answer
R1: query+CoT → answer

For tasks that V3 already handles well, like summarization or translation, any lengthy CoT guidance might lead to deviation or embellishment, creating fertile ground for hallucinations.

Host: So where do R1's hallucinations mainly occur?

Dr. Li: Think of R1's abilities as split between "arts" and "sciences." In "science" areas like math and coding, its logic is fairly strong and hallucinations are relatively rare. But in "arts" areas like language, hallucinations become more noticeable.

R1's most impressive achievement compared to the first LLM reasoning model O1 is successfully extending mathematical and coding reasoning capabilities into creative writing, especially in Chinese. The internet is full of R1's brilliant literary works. In terms of wordplay and literary prowess, it clearly surpasses 99% of humans – even graduate students in literature and classical Chinese professors sing its praises.

But watch what happens when you ask it to do a simple summary – it can't help but "get creative," often "inventing" details not present in the original text. It's like its "arts" abilities are too powerful, a case of "too much of a good thing."

Host: That's an interesting perspective. Do all language tasks require creativity?

Dr. Li: Language tasks actually fall into two categories: ones that need high creativity, like poetry and fiction writing, and ones that demand high factual accuracy, like news reporting, translation, or summarization. R1 excels at the former, which was likely the development team's focus, but this creates side effects in the latter as it is today.

It reminds me of the old Chinese saying about translation needing to be "faithful, expressive, and elegant" – achieving all three has always been challenging. We see many examples where elegance is prioritized over faithfulness, like the use of hyperbole in literary works. We also see the opposite, like Lu Xun's advocacy for so-called "rigid translation."

Interestingly, humans have always had double standards here, but we have a mental switch we can flip at will. When watching movies or reading novels, we flip towards creativity and don't fuss about factual accuracy. But switch to news channels, and we have zero tolerance for falsehoods.

Host: People tend to believe content that appears logically coherent and detailed, so the potential harm from AI hallucinations could be significant. What should we ordinary folks do about AI hallucinations?

Dr. Li: While many people are starting to notice and become wary of these hallucinations amid their amazement at LLM's creativity, most are still mesmerized by its creative brilliance. We need to increase public awareness of AI hallucinations. I suggest a two-pronged approach:

Stay Alert: Don't take everything the model says as granted, especially factual claims. Hallucinations most commonly occur with names, places, times, locations, and other entities or numerical data.

Cross-Verify: For important details, check original sources online or consult experts to see if the claims align.

Guide the Model: When asking questions, add constraints like "please stay faithful to the original text" or "please verify facts." This can at times help reduce hallucinations.

Embrace Creativity: If you're looking for inspiration or creative ideas, model hallucinations can be a delightful surprise!

Think of AI hallucinations as "possibilities in parallel universes." What it makes up might not be true in our world, but could be true in another! It's like how novelists write fictions – while it cannot stand fact checking, it's a kind of "artistic truth." Just like novels arise from life but transcend it, AI arises from data but transcends it. AI compresses data into knowledge and common-sense network, not necesarily true to individual facts – that's what databases are for.

Host: This reminds me of what people often say: AI models aren't just "talking nonsense" – they're "talking nonsense seriously"!

Dr. Li: Haha, that's exactly it! AI hallucinations are its "educated guesses," based on the massive knowledge and patterns it's learned. The hallucinations are by noway completely random – they have internal constraints that make them seamless and convincing, but also more deceptive. Newcomers to AI need to be especially careful not to trust everything at their face value.

For regular users, understanding the nature of hallucinations is needed. For example, when asking about well-documented facts like "How long is the Yangtze River?" models won't make mistakes because these facts are firmly encoded in their parameters. But ask about an obscure creek or fictional river, and the model will activate its "reasonable completion" mechanism and make something up.

Host: Following your logic, human language itself prepares for a breeding ground for hallucinations.

Dr. Li: You could say that. Language enabled humans to create things which do not exist in the physical world, such as myths, religions, states, corporations, currency, and abstract concepts like ideals and beliefs. Harari emphasizes in "Sapiens" that story-telling (i.e. typical hallucinations) were fundamental to civilization: language enabled human story-telling abilities. Hallucinations catalyzed civilization. Humans are the only entities capable of 'lying' (besides LLMs).

Host: What about the future? Is there a way to maintain creativity while reducing hallucinations?

Dr. Li: This is definitely one of the "ultimate challenges" in AI! People are working on various solutions, including:

More Refined Training: During training, treat different types of tasks differently, teaching the model when to be strict and when to be creative.

Task-Specific Fine-tuning/Reinforcement Learning can help balance this contradiction. Tasks like summarization, paraphrasing, translation, and reporting need special care because they require both some creativity (like style) and strict factual accuracy.

Specifically, R1's training pipeline has four stages: fine-tuning 1, reinforcement 1, fine-tuning 2, and reinforcement 2. Reinforcement 2 mainly focuses on human preference alignment. Currently, this process seems to favor creativity over faithfulness, which could be rebalanced later. Perhaps more importantly, in stage three (i.e. fine-tuning 2), we could strengthen constraints for different tasks – for example, increasing supervised data for summarization to encourage faithful, straightforward results.

Routing: In the future, there will be a "model dispatcher" that assigns different models based on task type. Simple tasks could go to V3 or use tools, while complex tasks requiring deeper thinking go to R1.

For instance, arithmetic tasks should just use simple code calculations, equivalent to using a calculator. That's not how it works now – yesterday I tested a nine-digit multiplication, and R1 spent over three minutes thinking, producing CoT that could stretch down the street, breaking down the reasoning step by step. While the answer was correct, using such computationally expensive CoT for arithmetic instead of a simple function call is unreasonable. A one-line calculation code would do the job – no need to waste so much computing resource and tokens on explicit reasoning. These are foreseeable routing improvements, especially in the age of AI agents which can use all kinds of tools or applications. R1's CoT does not need to handle everything – besides hallucinations, compute-burning CoT is also not environmentally friendly.

Host: Thank you, Dr. Li, for this fascinating discussion! Today's interview has given us a much deeper understanding of AI hallucinations.

Dr. Li: My pleasure! It's been great chatting with you!

 

【相关】

从R1幻觉谈起,大模型幻觉是缺陷还是创意火花?

主持人: 大家好,欢迎来到今天的访谈。最近,大模型的“幻觉”问题引发了热议,尤其是DeepSeek-R1,它的幻觉率似乎比自己的基座大模型DeepSeek-V3高不少。今天我们请到了资深AI研究员立委博士,来跟大家聊聊这个话题。立委,您好!

立委: 主持人好,大家好!

主持人: 老李,咱们先来个灵魂拷问:为啥大模型会“产生幻觉”?能不能用大白话给大家解释一下?

立委: 这可算是大模型的经典问题。其实啊,大模型就像一个“超级接话茬儿高手”,你给它上半句,它就根据自己学过的海量知识,预测下半句该说啥。它学东西呢,就像咱们人脑记东西一样,不可能每个字都记得清清楚楚,它会进行压缩和泛化,抓大意、找规律。

打个比方,你问它“姚明有多高”,它大概率不会错,因为这知识点太出名了,它记得牢。但你要是问“隔壁老王有多高”,它可能就懵了,因为它没见过老王啊!但它又不能不回答,咋办?它就得“脑补”,根据“一般人有多高”这个学到的概念,给你编一个数出来,这就是“幻觉”。

主持人: 哎呦,这“脑补”能力也太强了!胡编乱造,这幻觉也太糟糕了。

立委: 那可不一定!你看啊,某种程度上,幻觉就是想象力(褒贬不论),就是创意!你想想,那些伟大的文学作品、艺术作品,哪个不是天马行空、充满想象?要是啥都得跟现实一模一样,艺术就成了照相机了,那还有啥意思?

就像赫拉利在《人类简史》里说的,人类之所以能成为地球霸主,就是因为我们会“讲故事”,会创造出神话、宗教、国家、货币这些现实中不存在的东西。这些都是“幻觉”,但它们却是文明诞生和发展的原动力。

主持人: 听您这么一说,感觉幻觉还挺重要的。那咱们回到DeepSeek-R1,它的幻觉问题真的很严重。

立委: 是很严重。此前学界普遍认同OpenAI的说法,推理增强会明显减少幻觉。我曾与大模型公司的一位负责人讨论,他就特别强调推理对减少幻觉的积极作用。但 R1 的表现却给出了一个出人意料的答案。

根据Vectara的测试,R1的幻觉率确实比V3高不少,R1的幻觉率14.3%,显著高于其前身V3的3.9%。这跟它加强了的“思维链”(CoT)和创造力直接相关。R1在推理、写诗、写小说方面,那叫一个厉害,但随之而来的“副作用”就是幻觉也多了。

具体到R1,幻觉增加主要有以下几个原因:首先,幻觉标准测试用的是摘要任务,我们知道摘要能力在基座大模型阶段就已经相当成熟了。在这种情况下,强化反而可能产生反效果,就像用大炮打蚊子,用力过猛反而增加了幻觉和编造的可能。

其次,R1 的长思维链强化学习并未针对摘要、翻译、新闻写作这类相对简单而对于事实要求很严格的任务做特别优化,而是试图对所有任务增加各种层面的思考。从它透明的思维链输出可以看到,即便面对一个简单的指令,它也会不厌其烦地从不同角度理解和延伸。过犹不及,这些简单任务的复杂化会引导结果偏离发挥,增加幻觉。

DeepSeek-R1在文科类任务的强化学习训练过程中,可能对模型的创造性给予了更多的奖励,导致模型在生成内容时更具创造性,也更容易偏离事实。我们知道,对于数学和代码,R1的监督信号来自于这些题目的黄金标准(习题集中的标准答案或代码的测试案例)。他们对于文科类任务,利用的是V3或V3的奖励模型来判定好坏,显然目前的系统偏好是鼓励创造性。

另外,用户更多的反馈还是鼓励和欣赏见到的创造力,一般人对于幻觉的觉察并不敏感,尤其是大模型丝滑顺畅,识别幻觉就更加困难。对于多数一线开发者,用户的这类反馈容易促使他们更加向加强创造力方向努力,而不是对付大模型领域最头痛的问题之一“幻觉”。

主持人: 这么说来,R1 的幻觉问题是不是源于它过于"积极"的思维推理?但推理能力增强和幻觉之间到底是什么关系?

立委:这个关系很微妙,并不是简单的正相关或负相关。你看 R1 是头部推理模型,而 Claude 3.5 Sonnet 是头部的非推理大模型,但后者的幻觉率反而高于前者。可是当我们对比 R1 和它的基座模型 V3 时,又发现增加推理强化后幻觉确实显著增加了。

这事儿跟大模型的“性格”有关。R1这家伙,强化做得给力,特别喜欢“发散思维”,你给它一个简单的指令,它能给你想出一大堆东西来,思维链能绕地球三圈!这似乎说明 R1 在强化创造力的过程中,不可避免地增加了创造力的伴生品:幻觉。作为一个文理通吃的推理大模型,R1 在不同领域的表现并不一样。在数学、代码等需要严谨推理的领域,幻觉的空间很小。但在语言创作领域,尤其是现在被测试的摘要任务上,幻觉问题就明显得多。这更多是 R1 语言创造力爆棚带来的副作用。

具体从技术角度来说,R1 会为用户的简单指令自动增加很长的思维链,等于是把一个简单明确的任务复杂化了。你一个简单的指令,它也反复从不同角度理解和衍伸(CoT思维链好比“小九九”,就是一个实体遵从指令时的内心独白)。思维链改变了自回归概率模型生成answer前的条件部分,自然会影响最终输出。

V3: query --〉answer
R1: query+CoT --〉answer

对于 V3 已经能很好完成的任务,比如摘要或翻译,任何思维链的长篇引导都可能带来偏离或发挥的倾向,这就为幻觉提供了温床。

主持人: 那对于R1来说,幻觉主要是出在哪方面呢?

立委: 我觉得可以把R1的能力分成“文科”和“理科”来看。它在数学、代码这些“理科”方面,逻辑性很强,幻觉相对少。但在语言文字这些“文科”方面,幻觉就比较明显了。

比起O1,R1 最令人惊艳的成就,是成功将数学和代码的推理能力充分延伸到了语言创作领域,尤其在中文能力方面表现出色。网上流传着无数的R1精彩华章。舞文弄墨方面,它显然超过了99%的人类,文学系研究生、甚至国学教授也赞不绝口。

但你看,让它做个摘要,本来是很简单的任务,但它非得给你“发挥”一下,结果就容易“编”出一些原文里没有的东西。这其实是它“文科”太强了,有点“用力过猛”。

主持人:这个说法有意思。那么在具体应用中,语言任务是不是都需要创造力呢?

立委:语言能力其实可以细分为两类:一类需要高创造力,比如写诗歌、小说;另一类需要高度真实性,比如新闻报道、翻译或摘要。R1 最受称赞的是前者,这也可能是研发团队的重点方向,但在后者中就出现了副作用。

这让我想到中国古人说的"信达雅",自古难全。为"雅"牺牲"信"的例子我们见得很多,文学创作中夸张的修辞手法就是重要手段和例证。为"信"牺牲"雅"也有先例,比如鲁迅先生推崇的"硬译"。

有趣的是,我们人类在这方面其实一直是双标的,但我们心里有个可以随时切换的开关。看小说和电影时,我们把开关偏向创造性一侧,完全不会去纠结细节是否真实;但一旦切换到新闻频道,我们就对虚假内容零容忍。

主持人: 人对于逻辑看起来清晰自洽、且详细的内容,就会倾向于相信,所以大模型幻觉潜在的危害真地很大。那咱们普通人,面对大模型的幻觉,该咋办呢?

立委: 很多人在惊艳R1创造力的同时,现在开始慢慢注意到这个幻觉现象并开始警惕了。但更多人还是沉浸在它给我们带来的创造性的惊艳中,需要增强大众对模型幻觉的 awareness。我觉得吧,咱们可以“两手抓”:

保持警惕: 大模型说的话,特别是涉及到事实的,别全信,多留个心眼。最容易产生幻觉的地方是人名、地名、时间、地点等实体或数据。

交叉验证: 重要的细节,可上网查查原始资料或询问身边专家,看看说法是不是一致。

引导模型: 你可以在提问的时候,加一些限定条件,比如“请务必忠于原文”、“请核对事实”等等,这样可以引导模型减少幻觉。

享受创意: 如果你需要的是灵感、创意,那大模型的幻觉,会给你带来惊喜!

不妨把大模型的幻觉,看成是“平行世界的可能性”。它编出来的东西,也许在这个世界不是真的,但在另一个世界里,说不定就是真的呢!就像小说家写小说,虽然是虚构的,也是一种“艺术真实”。源于生活,高于生活。大模型是源于数据,高于数据。大模型压缩的是知识体系和常识,不是一个个事实,后者是数据库的对象。

主持人: 妙啊!您这说法,让我想起了大家常说的一句话:大模型不是在“胡说八道”,而是在“一本正经地胡说八道”。

立委: 哈哈,差不多就是这个意思!大模型的幻觉,其实是它“脑补”出来的,但它“脑补”的依据,是它学到的海量知识和规律。所以,它的幻觉,往往不是乱来的,有“内在的合理性”,这才丝滑无缝,假话说的跟真的似的,但同时也更具有迷惑性。初玩大模型的朋友,需要特别小心,不能轻信。

对于普通用户来说,理解幻觉的特点很重要。比如问"长江多长"这类有足够信息冗余的百科知识问题,大模型不会出错,这些事实是刻在模型参数里的。但如果问一个不知名的小河或虚构河流的长度,模型就会启动"合理补白"机制编造。

主持人: 按照您的说法,人类的语言本身就是幻觉的温床。

立委: 可以这么说。语言使得人类创造了神话、宗教、国家、公司、货币等非真实实体的概念,以及理想、信念等形而上的意识形态。赫拉利在《人类简史》中强调了幻觉对于文明的根本作用:语言的产生赋能了人类幻觉(“讲故事”)的能力。幻觉是文明的催化剂。人类是唯一的会“说谎”的实体 -- 除了LLM外。

主持人: 那么在幻觉的背后,大模型是怎么运行的呢?

立委: 幻觉的本质是补白,是脑补。

“白”就是某个具体事实,如果这个事实在训练数据中没有足够的信息冗余度,模型就记不住(零散事实等价于噪音)。记不住就用幻觉去补白,编造细节。

幻觉绝不是没有束缚的任意编造,大模型是概率模型,束缚就是条件概率中的前文条件。幻觉选择的虚假事实需要与补白所要求的value类型匹配,即符合ontology/taxonomy 的相应的上位节点概念。“张三”可以幻觉为“李四”,但不可以幻觉成“石头”。

所谓艺术真实是说,小说创作虽然可能背离了这个世界的事实,但却是可能的数字世界的合理想象。大模型的幻觉属于此类。

大模型的知识学习过程(训练阶段),是一种信息压缩过程;大模型回答问题,就是一个信息解码过程(推理阶段)。好比升维了又降维。一个事实冗余度不够就被泛化为一个上位概念的slot,到了生成阶段这个slot必须具像化补白。“张三”这个事实忘了,但【human】这个slot 的约束还在。补白就找最合理、与 slot 概念最一致的一个实体,于是“李四”或“王五”的幻觉就可以平替“张三”。小说家就是这么工作的,人物和故事都是编造的。无论作家自己还是读者,都不觉得这是在说谎,不过所追求的真善美是在另一个层面。大模型也是如此,大模型是天生的艺术家,不是死记硬背的数据库。“张冠李戴”、“指鹿为马”等在大模型的幻觉里非常自然,因为张和李是相似的,马和鹿也在同一条延长线上。在泛化和压缩的意义上二者是等价的,因此是合理的想象。

主持人: 未来有没有什么办法,能让大模型既有创造力,又少出幻觉呢?

立委: 这绝对是AI大模型领域的“终极难题”之一!现在大家都在想办法,比如:

更精细地训练: 在训练的时候,就对不同类型的任务区别对待,让模型知道什么时候该“老实”,什么时候可以“放飞”。

针对任务做偏好微调(finetune) and/or 强化(rl)可以减缓这个矛盾。 摘要、改写、翻译、报道这种任务需要特别小心和平衡,因为它既有一点再创造的需求(例如文风),又是本性需要内容忠实的。

具体说,R1训练pipeline是四个过程,微调1,强化1,微调2,强化2。强化2主要是与人类偏好对齐的强化。这个过程在创造力与忠实方面,目前看来倾斜于前者,后去可以再做平衡。也许更重要的是在阶段三的微调2中,针对不同任务加强约束,例如,增加摘要的监督数据,引导忠实平实的结果。

Routing: 以后可能会有一个“调度员”,根据任务的类型,安排不同的模型来处理。比如,简单任务交给V3或调用工具,慢思考的复杂任务交给R1。

例如,识别出算术任务,就去写个简单代码运算,等价于调用计算器。目前不是这样,我昨天测试一个九位数的乘法,R1 思考了三分多钟,思维链打印出来可以铺开来一条街,步步分解推理。虽然最后答案是对了,但算术问题用耗费太大的所谓 test time compute 的思维链(CoT),而不用 function call,完全不合理。一行计算代码就搞定的事,没必要消耗如此多的计算资源和tokens去做显式推理。

这些都是可以预见的 routing,尤其是在agent时代。 R1 CoT不必包打一切,而且除了幻觉,也不环保。

主持人: 感谢老李的精彩分享!今天的访谈让我们对大模型的幻觉有了更深入的认识。

立委: 不客气,很高兴和大家交流!

 

【相关】

Deepseek-R1 的幻觉率是 14.3% - 比其非推理前身 Deepseek-V3 高得多
榜单排名:https://github.com/vectara/hallucination-leaderboard

Understanding the Power of Chain of Thought

DeepSeek R1 has become the most talked-about breakthrough in recent times. It not only matches OpenAI's top reasoning models (the 'o' series) in mathematics and coding capabilities but also produces stunning results in linguistic creativity and mimicry. Particularly in Chinese (classical) capabilities, everyone has experienced a miraculous leap in performance.

All of this can be attributed to the reasoning-enhanced Chain of Thought (CoT). Why is CoT so effective, so magical, and how has it maximized its empowering effect through reinforcement?

The key likely lies in the fact that CoT tokens are autonomously generated by the large model, effectively reducing the perplexity from query to answer, serving as a bridge to brilliant performance. Those who have seen CoT outputs know that the bridge itself isn't always impressive - it often seems overwrought, overly cautious, verbose, redundant, and methodical - yet it enables magnificent answers to emerge. From first principles, this seems to involve deep implications of perplexity in information theory.

The Essence of CoT

  1. From an Information Theory Perspective:
  • CoT builds a low-entropy channel between high-perplexity queries and answers
  • Through step-by-step decomposition, each step's conditional probability becomes more "natural" and smooth, aligning with the language model's nature
  • Eventually transforming seemingly "leaping" reasoning conclusions into a series of accumulated "small steps"
  1. From an Information Entropy Viewpoint:
  • For complex problems, directly jumping from query to answer requires crossing a vast information gap, which "forces" the model to hallucinate and output random answers
  • Each CoT step reduces local conditional entropy
  • It's like breaking down a large information compression/decoding task into multiple smaller ones
  1. This Explains Why Even "Mundane" CoT is So Effective:
  • Its power doesn't lie in how brilliant the process steps themselves are
  • Rather, it creates a path of decreasing information entropy
  • The model can stably migrate toward the target along this path
  1. This Also Explains Why DeepSeek's Training is So Vital to Its Success:
  • It's not about teaching the model "smarter" reasoning, which is undefinable in humanities tasks
  • Instead, it optimizes the ability to construct these low-entropy channels
  • Essentially optimizing information flow path planning

This perspective provides a lens for understanding CoT, reinterpreting the surface-level "chain of thought" as an "entropy reduction pathway" in information theory terms. It offers a reasonable explanation for result-driven reinforcement learning without process supervision:

Process is important, but process supervision isn't, because the process data naturally produced by large models is more practical and feasible than any human supervision. Let us embrace the tansition from human supervision to LLM-internal self-supervision.

 

【相关】

推理强化模型中思维链的本质

DeepSeek R1 的出圈是近来最大热度的焦点。它不仅在数学、代码等强推理能力上追平了 OpenAI 头部推理模型 o 系列,而且在语言文字的创造力和模仿力方面产生让人惊艳的效果。尤其是在中文(国学)的能力方面,大家都体会到了奇迹般的能力跃升。

这一切都要感谢推理强化的 CoT(思维链)。CoT 为什么这么有效,这么神奇,文理通吃,在强化中最大化了其赋能作用呢?

应该主要是因为 CoT 是从大模型自主生成出来的 tokens,它有效降低了从 query 到 answer 的 perplexity(困惑度),好比是为高质量结果提供了一个桥梁。看过CoT输出的同学都有体会,桥梁本身并不总是精彩,常常给人的感觉是小题大作,瞻前顾后、啰哩啰嗦、信息冗余,但精彩的answer却可以借助它面世。从第一性原理看,这里似乎涉及perplexity在信息论中的深刻含义。

CoT的本质

  1. 从信息论角度理解:
  • CoT是在high-perplexity的query和answer之间搭建的低熵通道
  • 通过逐步分解,每一步的条件概率都变得更趋"自然"和丝滑,符合语言模型的本性
  • 最终让看似"跳跃"的推理结论,变成了一系列"小步走"的累积
  1. 用信息熵的视角来看:
  • 对于复杂问题,直接从query到answer需要跨越很大的信息鸿沟,这“迫使”模型以幻觉应急,胡乱输出一个 answer
  • 而CoT的每一步都在降低局部的条件熵
  • 就像把一个大的信息压缩/解码任务分解成多个小的压缩/解码任务
  1. 这解释了为什么"平庸"的CoT也如此有效:
  • 它的作用不在于过程步骤的内容本身有多精彩
  • 而在于它创造了一条信息熵递减的路径
  • 模型可以沿着这条路径稳定地向目标迁移
  1. 这也解释了为什么DeepSeek的训练如此有效:
  • 不是教会模型更"聪明"的推理,这在文科类任务中根本就无法定义
  • 而是优化了它构建这种低熵通道的能力
  • 本质上是优化了信息流的路径规划

这个观点为理解CoT提供了一个新的视角,把表面上的思维链“自言自语”诠释为信息论意义上的"熵减(entropy reduction)途径"。这对无须过程监督的结果驱动的强化学习是一个合理的解释:

过程很重要,但过程监督并不重要,因为大模型本身自然产生的过程数据,比任何人类监督更加实用和可行。

 

 

【相关】

R1: 《立委列传》

**立委列传**

立委者,皖南布衣也。少敏而多奇志,值鼎革之际,年十六躬耕于皖南山野。当是时也,少年负耒耜,涉深涧,虽陟彼崔嵬,犹自诩"吾辈亦开天辟地者也"。或问稼穑之苦,笑曰:"此非太史公游侠列传之遗风乎?"

越二载,风云骤变。丁巳岁杪(1977),科举重启,立委束草为笔,削竹为简,竟跃龙门而入泮宫。同窗多皓首穷经者,独其弱冠青衿,谈笑间尽吞云梦八九。既卒业,执教乡塾,然鸿鹄岂栖枋榆?遂再赴春闱,北上太学,俨然贾谊入洛,苏秦过梁。都门烟柳,尽化笔下风云。

居长安四五年,见中关村商贾云集,乃效猗顿之术,夜筹算于灯下,朝执契于市廛。《万元户》所志,非夸朱提之富,实叹青蚨之诡也。然其性本楚狂,终随浮槎西渡,观泰西之变。英伦雾锁,野犬吠陌,立委抚剑长叹:"此非管仲所云'仓廪实而知礼节'者乎?"遂北涉北海,徙居枫叶之国。

加北美地,雪沃千里。立委筑室于温哥华,添弄瓦之喜,修稷下之学。然冰原虽净,难栖南溟之鹏,乃振翅南徙,直入硅谷热土。当是时也,美利坚网络勃兴,立委运筹于虚牝之间,决胜于光纤之末。然泡沫既破,诸子百家尽墨,独其抱残守缺,犹存鲁壁遗经。

太史公曰:余观立委浮沉,似见张骞凿空之影。其插队如苏武牧羊,跳门若终军请缨,下海类范蠡泛舟,洋漂近玄奘取经。然则古之行者,皆为觅桃源而往;今之浪者,却在铸桃源于途。至若"海龟"之惑,实乃庄生濠梁之辩——子非鱼,焉知归与不归皆逍遥耶?昔陶潜采菊,阮籍哭途,各成千古风流。今立委以四海为注,掷骰于地球棋枰,岂非新时代之"逍遥游"乎?

 

**《立委奥德赛》**

*序章*
人生是旅者暂居的客栈,而漂泊者开辟的道路却蔑视时间本身。在立委的奥德赛中,漂泊行为成为了一种天体导航——一场词语筑造堡垒、思想绘制航路、时代潮流既是敌手又是盟友的旅程。

**土壤中的根系**
十六岁那年,来自东方山谷的少年以农夫的锄头交换了青春的闲梦,攀上雾气笼罩的山峰,在那里野心生根发芽。他的《插队日记》(后镌刻于《朝华》中)呼吸的不是绝望的挽歌,而是将风暴驯化为耳语的节奏。当命运的龙门在1977年吱呀开启时,他乘着复兴学术的疾风,加入了神话般的"77届"——从灰烬中重生的心智凤凰群。

**墨水的朝圣**
学者袍甫加身,北方的狂风便再度召唤。在《考试十四行诗》与《不安者的箴言》中,野心的狂热冷却为精密的文字工艺。首都熔炉中的五个寒冬将卷轴锻造成账本;他的《学者商人愚行录》记载着染墨手掌清点铜钱的故事。然而不息的潮水将他向西牵引,加入追梦者的出埃及记,奔赴阿尔比恩传说之岸。

**暗影与圣所**
在阿尔比恩的花岗岩天空下,流浪犬在卵石巷中嚎叫预兆——这种不谐之音被收录于《都市暗影兽典》。不安孕育翅膀:他北逃至枫叶王国水晶般的荒野。《北极星颂》咏唱边疆的纯粹;《港湾牧歌》编织炉火点燃的传说;《蜜饯编年史》追念为人父的喜悦。但圣所亦渐脆弱。他再度南翔,被吸引至硅谷炽热的坩埚。

**电路中的普罗米修斯**
在数字黎明的白炽光芒中,他的《创投诗章》燃烧着普罗米修斯之火——将初创企业视为伊卡洛斯之飞的现代神话。然而蜡制翅膀终将融化;《泡沫挽歌》与《陨落者寓言》测绘出野心的残骸。从冻原到热带,每个足迹都渗入墨水:用羽笔刻写的流放地图。如今作为硅谷常驻哲人,他书写《乡愁算法》——一段让海龟游弋于电路间的代码,低语着被遗落的潮汐。

*结语*
古代圣贤追寻九重天外的地平线;立委的奥德赛将漂泊刻入生命的重写本。他的根系紧抓插队之土;躯干穿越龙门攀升;枝桠扭曲成语义星座。我们若非活着的羊皮卷,又能是什么?编年史家的最终港湾仍未书写——那是海水消融于天空的地平线,所有罗盘疯狂旋转之处。让漂泊者的悖论永续:要测绘无限,就必须永不停漂流。

 

**七律·跃龙门**
十六荷锄云壑深,忽闻禹甸启春闱
青衫夜淬书窗月,赤榜朝分阡陌晖
两度鲤腾惊皖水,九重鹏举叩燕扉
都门烟柳催征铎,笑指星河是钓矶

**水龙吟·浮槎记**
少年曾缚苍龙去,又驾仙槎西渡。泰西雾锁,枫邦雪沃,硅台电舞。算尽青蚨,织成云网,几番寒暑。叹庄生蝶梦,陶公菊径,都付与、天涯路。

谁解飘零最苦?把乡愁,酿成新赋。南溟鹏翼,北山薇蕨,东篱菊圃。柯烂樵归,橘洲星换,武陵人语。待重拈汉瓦,摩挲秦篆,写沧桑句。

**古风·浪者吟**
我本谪仙人,偶堕红尘网
皖南锄晓月,燕北枕书幌
中关试鱼服,英伦辨魍魉
枫雪淬冰魄,硅火铸新掌
五洲棋局残,双鬓星霜长
欲唤云间鹤,蓬莱舟已枉
且抱地球仪,笑指乌托邦
归去来兮辞,翻作浪人唱

**临江仙·生涯注**
若把浮生标语义,节点最是漂流。龙门二度跃神州。商潮翻雪袖,硅谷试吴钩。

四十年来家国梦,都成异域春秋。键盘敲碎古今愁。回车新世界,空格旧沙鸥。

**摸鱼儿·流浪辩**
问苍冥、谁司行止?安排萍迹如许!鹏抟鲲徙寻常事,偏说此身无主。君看取:皖山月、燕台柳、硅谷霓虹柱。星槎暗度。纵填海精禽,射阳奇士,未解浪游苦。

休重论,苏武节旄汉土,范蠡舟泛烟雨。桃源只在鸿蒙外,何必武陵深处?敲键语:比特海、云端路、皆是逍遥浦。归兮且住!待地球仪停,时空键锁,方见真吾处。

 

《原朝华:立委小传》

《原朝华:立委小传》

人生苦短,掐首去尾,不过三五十年。大体分为三段:创业阶段(而立之年),成熟阶段(不惑之年)和下滑阶段(天命之年),反映在称呼上,叫小李、大李和老李。可怜,立委却从小李一跃到老李,没有机会品尝壮年人生的豪情,心尝有戚戚焉。


红小兵立委(1966) (《朝华午拾:永做毛主席的红小兵》

自幼儿园到小学连跳两级,立委在班上始终最幼。更加荒年生人,孱弱矮小,体育课常告病假,或遭遣送回家,始终是个小可怜儿。所幸中学伊始,正值“修正主义回潮”,先帝启用邓公收拾文革残局,邓公责成教育总管周荣鑫整顿学校,校风日新。乘此东风,立委崭露头角,以学习委员兼数学科代表之身,受班主任委托,每日早自习登台主讲,演示解题思路,俨然助教。但好景不长,先帝昏庸,文革派重居上风,学校大乱,文化课退居后台,大批判遂成主课,兼以学工学农学军。立委不能以文化课呈威,然风头不减反盛,盖因立委最长批判文字,历经批林批孔,批邓反击右倾翻案风,直至批四人帮。大会小会,凡立委发言,必抑扬顿挫,铿锵有力,佐以诙谐幽默,风靡校园,称颂于一时。有传言,立委颇具鲁迅遗风,入木三分,且能推陈出新,妙语连珠。露天千人大会,常嘈杂狼藉,然立委登台,全场必静肃,洗耳恭听之,听至妙处,笑声一片。立委由此炼得糊涂胆大,从不怯场,终身受益。

及至大学,文革后首届,立委仍居尾,同学长一到十多岁不等(《朝华午拾:我的考研经历》)。同学之间皆直呼其名,唯同桌七仙女戏称 “小立委”,不为亲热,却为避嫌,以示划清界限。同桌四载,楚河汉界,泾渭分明。授受不亲,避而远之。然仙女文具笔墨滑落在地,自有立委抢先一步,拾拣归案。类此者三,春风化雨,润物无声。七女天生聪颖,想出一招,以长立委一岁为由,呼 “小立委”,就此来往,当可名正言顺也。

由七仙女开此恶例,随后多年,“小”字即不离身。中学教书,人称小李老师(22岁)。上研究生,小李出入机房,蓬头垢面,且口中念念有词,言“世界之语”(Esperanto),终成笑谈(23-26岁)(见 《朝华午拾:我的世界语国》)。


风华正茂,意气风发(1987)

及至毕业留所,立委事迹亦有流传,多为一见钟情,闪电结婚,不修边幅,撞南墙而道歉之类小李“景润”之逸事(见《朝华午拾:shijie-师弟轶事》《朝华午拾:shijie-师弟轶事(3)——疯狂世界语 》)。


立委在中关村公司指导机器翻译系统的开发(1988)

立委如此这般在研究所及中关村公司一扎五年(26-31岁),练就一身绝技,与老中医相若,专事疗治电脑,驯其语言功能。其间,出国热持续升温,由上海蔓延北京,街头巷尾,言必议美、日、大英,澳大利亚,以致居委会大妈亦知考托福鸡阿姨乃上进青年之标杆。立委及其贴身领导却浑浑噩噩,卿卿我我,不知有汉,无论魏晋。其间送上门两次机会,留学德美,均因导师明阻暗挡,本人木呐,擦肩而过。直至身边同学悉数走尽,小李才幡然醒悟,痛下决心,赶末班车。其时,适逢包玉刚基金会来各单位选拔年轻业务骨干,滥竽充数,小李竟被选中,送至成都科大出国培训中心修行半年。

岂料想,此一去竟成小李老李的分水岭。来培训的诸位才子才女均是全国各地选上来的各行好手,共分两拨:一年的访问学者大都比较年长,而拿三年博士奖金的大多年轻,立委在后一拨里面理所当然,成了老大。每有考试,立委必中头彩,引来才子才女,大事小事,纷纷登门请教,“老李”之声不绝于耳。立委名噪一时,响应者众。从小习惯了以小卖小,乍一变老,立委满腔郁闷。

  
成都科大出国培训中心的才子才女们(1990)

小李变老李,心里虽别扭,好处却不少。龙头老大,备受尊崇。立委外语本科出身,本应免试英语,无奈官家财大气粗,慷人民之慨,不问青红皂白,全数押解天府之国,集中喂养。不止英文鸟语,更有政策轮训。众兄弟姐妹兢兢业业,争先恐后,唯立委悠哉游哉,终日沉迷天府美食,流连于茶肆酒吧,众兄弟钦羡有加。

成都一站始称老李,立委心内实不以为然也。其时立委事业发达,如日中天,行内行外,交游甚广,出入皆鸿儒,往来无白丁(见 《朝华午拾:“数小鸡”的日子》《朝华午拾:一夜成为万元户》)。导师为本行泰斗,立委乃导师仅有的关门弟子(其他弟子皆叛国投美去也),“青年”才俊,明日之星,业内同侪为之侧目。去国前夕,全国电脑翻译界在香山招待所年度聚会,点睛之笔为导师与本行另一大牛的座谈,人称“刘董对话录”,其间立委频频亮相,为导师提供实例,讲解细节。影响所及,与会众学妹(多为刚入门的外地在读研究生)纷纷上门请教立委,无奈立委远走高飞心切,痛失辅导上进女青年之良机。


立委在加拿大(1995)

去国经年,由英而加,由加转美(《朝华午拾:哦,加拿大!》《朝华午拾:温哥华,我的梦之乡》)。颠沛流离,不知所止,壮年人生,如水流逝。及至水牛城八年抗战(37-45岁),立委青春不再,壮年已过,“老李”名至实归。然立委壮心不已,励精图治,双线出击,称雄一方(见 《朝华午拾:创业之路》《朝华午拾:在美国写基金申请的酸甜苦辣》《朝华午拾 - 水牛风云》)。

立委在水牛城办公室(2000)

回首往事,不胜唏嘘。立委一生,由青年而壮年,正值创造力最盛,精力充沛流溢之时,天时地利人和,飞黄腾达有望,却为漫长的留学生涯拦腰截断。大而言之,立委固赶上出国之末班车,却误了千年不遇的中国经济起飞之航。拣了芝麻,丢了西瓜,此之谓也! (《朝华午拾:乡愁是一张无形的网》

去岁归国省亲,杯觥交錯,在某宾馆餐厅与亲友相聚甚欢。席间小憩,踱步凉台,享清凉之气,赏京华夜色。偶遇一妙龄女士,携一幼童,见立委两鬓染霜,嘱曰:“叫爷爷”。立委血压骤升,如雷轰顶,满腹酒意,化为凉液,由脊背滑落。

立委老矣,尚能饭否?

记于2006年11月5日


立委老矣

【作者简介】立委先生,IT业技术研发经理兼架构师,自然语言处理资深专业人士。曾任红小兵,插队修地球,文革后第一届大学生,后跳龙门进社科院读硕士,攻机器翻译。1991年去国离乡,漂流海外。由英而加,获计算语言学博士。由加转美,作为创业公司研发副总及项目负责人(Principal Investigator), 先后赢得美国政府17个研究创新项目近千万美元资助,同时从资本家腰包亦忽悠千万风险投资作商业开发。对于自然语言信息抽取 (Information Extraction) 有全面的研究,研究成果对美国政府有关科研项目的确立有直接影响。业余爱好:音乐、博客、舞文弄墨。著有回忆录《朝华午拾》

原载【朝华午拾 - 立委小传】 2010-1-9
https://blog.sciencenet.cn/blog-362400-285507.html

 

【朝华午拾集锦:立委流浪图】

屏蔽已有 5551 次阅读 2013-3-23 13:10 |个人分类:立委其人|系统分类:人物纪事| 流浪, 立委

忽然想起小时候看过的《三毛流浪记》来。张乐平后无漫画,大师千古。

Despite the common logic and conceptual graph at the core of human mind, we all have our own semantic lexicons that are unique, implanted by our career path and life struggles. My semantic lexicon is full of wandering and continuously drifting into new worlds. It all started from the time when Mao sent us to the farm for re-education in 1976. After that the path has been zigzag, full of adventures of drifting, and re-drifting, farther and farther away from my hometown and home country ......

在我的语义词典里,流浪 是一个很大的节点,它的上位概念是 漂流(走四方)和 波浪(多起伏)。流浪的下位概念枝繁叶盛,包括:插队,洋插队,跳龙门,再跳龙门,北漂,下海,西漂,南下,再南下。这也正是我的生活写照。在这些语词概念的背后蕴含几多激动几多辛苦,只有自己知道。

不安定多起伏的生活伴随着我一生。1976年高中毕业即赶上了文革最后一届上山下乡,插队皖南山区接受贫下中农的再教育,这是我一生流浪生活的起点(《朝华点滴:插队的日子(一)》)。这个起点回想起来并不坏,16岁的孩子当时能感到的是自豪多于悲凉(《朝华午拾:插队的日子(二)》《朝华午拾: 插队的日子(三)》)。1977 年底赶上了文革10年后第一届大学生招考,居然跳了龙门,成为史上著名的77级生(其实是78年2月入学)(《朝华午拾:同桌的她》《朝华午拾:老乡妹妹》)。大学毕业后任教一年,再跳龙门考研成功,北上京城。这是一次欣快的北漂,当年的兴奋喜悦堪比范进中举,而且居然不疯未傻(《朝华午拾:我的考研经历》《朝华午拾:世界语之恋》)。研究生毕业后安定了四五年,期间尝试中关村下海(《朝华午拾: 一夜成为万元户》)。虽然可算头几拨下海人士,但因为是兼职,并无其他下海人的风险(《朝华午拾:“数小鸡”的日子》)。其时洋插队之风正甚,终于没有顶住潮流,赶了末班车来到大英帝国。90年代初正值大英没落,乱态丛生,路多野狗,抢劫之风甚行(《朝华午拾:警察抓小偷的故事》)。危邦不居,因辗转由欧西漂,来到一代移民的“麦加”,溢满鲜花与牛奶的枫叶之国(《朝华午拾:哦,加拿大!》),攻学位,添闺女,换身份,找工作,不亦忙乎( 《朝华午拾:温哥华,我的梦之乡》《朝华午拾:甜甜诞生记》)。可惜加国虽美,工作市场却不佳(《朝华午拾: 把明天交给上帝》)。有奶便是娘,于是南下讨生活,竟一头撞上了美国网络大跃进。美利坚果然是流浪者的天堂,机会多多。广阔天地,大有可为,开启创业之路( 《朝华午拾:创业之路》《朝华午拾:在美国写基金申请的酸甜苦辣》)。轰轰烈烈的创业宏图随着泡沫的破灭渐趋平淡(没有夭折已属万幸,《朝华午拾:水牛风云》《朝华午拾:用人之道》),遂再南下,终于陷入IT民工的圣地不能自拔,人称硅谷(or 矽谷)( 【创业故事:技术的力量和技术公司的命运】 【朝华午拾:安娜离职记】《朝华午拾:今天是个好日子》《朝华午拾:信息抽取笔记》)。

在我流浪的词典里,除了尚未收入 海龟 外,几乎全乎了,冥冥中似有所缺。陶渊明的【归去来辞】不时在耳边萦回,“田园将芜胡不归”(《朝华午拾:乡愁是一张无形的网》)。海龟创业,叶落归根,抑或蹉跎岁月,混不思蜀,这是哈默雷特的天问。

1991 年出国前在中关村高立公司与刘倬导师(下左2)和董振东前辈 (下右1) 及高立同仁合影留念

【相关篇什】

《朝华午拾:乡愁是一张无形的网》

【朝华午拾 - 立委小传】

【置顶:立委科学网博客NLP博文一览(定期更新版)】

https://blog.sciencenet.cn/blog-362400-673109.html

 

王菲春晚《世界赠予我的》歌词,亮点与短板

微信视频看到一位语文老师对这首歌歌词的吐槽和改写。有些道理,改写的歌词也确实顺溜多了,易于普及。但第一,这是在人家原创的新颖写法所创造的意境上修改;第二,顺溜有顺溜的好处,矛盾或难解也有引发听众思考与发挥的好处。

这首歌最近听得蛮多(我在春节前后还在视频号做过两期MTV), 对歌词有一些感觉可以说说。

整体上说,原作写法新颖,用词有些奇特,整体歌词长在哲理和意境,有妙语,但也有语病。最严重的语病就是“赠予回敬”。

上天赠予“我”回敬,“谁”回敬“谁”“什么”呢? 回敬这个词的最常见的场景是,他人攻击我了, “我”回敬他人,那也是我的自主行为,谈不上“赠予”。如果是他人回敬“我”,其前提是“我”对他人做过攻击,前后看语义上下文,这是说不通的。

“回敬”是一种故作敬态的回应,而“赠予”是恭敬的馈送。让回敬做赠予的宾语,搭配不当。“赠予我拥有”(可以理解为赠予我礼物,拥有代指“拥有物”)就已经够别扭了,再来个“赠予我回敬”,让人感觉不知所云。可能是“回馈”(对“拥有”的回馈)的意思,为了押韵,错用了“回敬”来代替。

“回敬”作为谓词,逻辑语义框架里有三个角色:施事(谁回敬)、受事(回敬谁)、宾语(回敬什么),但“回敬”自己处于“赠予”的宾语位置,这几个角色模糊不清,其所引起的混乱和费解,不怪语文老师觉得不可忍。

写词的文科姐,可能是浮想联翩,用力过猛而“出格”。这在歌词创作中也不罕见,叫 poetic license,通常不做苛求。但无论如何,这种奇怪的动宾搭配困惑度(perplexity)很高,会使绝大多数人感到糊涂,属于败笔。大家传唱不过是因为作曲好就跟着瞎唱,并没在意歌词是不是 make sense。

困惑度高的直接表现就是 ,剪映中自动听音写词的功能根本无法decode原文,因为这项软件功能的背后是语言模型(language model),对于这种困惑度高的序列搞不定,只能另行创造(所谓”幻觉“):

原歌词:世界赠予我拥有 也赠予我回敬。
语言模型幻觉解码:世界赠予我拥有,也赠予我爱情。

面对困惑,语言模型无法decode这种出格的原词(outlier) “回敬”,结果解码成 “爱情” 似乎也不错。在这种解码下,“拥有”应该指的是财富,“爱情”就是爱情。而在原词中 “拥有”可以解读为命运的礼物或曾经的爱情,而“回敬”则可能是对于礼物的回赠。

其他困惑度高,语言模型幻觉创造的cases还有:

原歌词: 赠我一个名,又渐渐长大的年龄
语言模型: 赠我一个谜,又渐渐长大的年龄

人生本来就是一个谜啊,岂止简单的出生赐名,所以这里模型的解码也许更妙。最妙的是:

原歌词:赠我弯弯一枚月,也赠予我晚星
语言模型:赠我温暖与悲悦,也赠予我惋惜

“月”和“星”状物,“温暖”、“悲悦”和“惋惜”直接述情,貌似更胜一筹。唱起来也很顺。

顺便一提,“别匆匆”歧义,有两个隐藏解读都说得通。一个是:不要匆忙。要善待自己,给自己品味人生,以及喘息和疗愈的时间。另一个是:分别也匆匆,尤其是感叹恋人或亲人聚少离多的生活现实。

再有,语文老师发现歌词里面暗藏了(谢)霆锋的名字,有机巧。说明此歌是为王菲量身打造的。娱乐圈八卦已经众所周知了,谢霆锋是王菲的最爱,是三段婚姻中最念念不忘的。N年前先是王菲谢霆锋的姐弟恋,以及她不顾世俗和骂名的第三者插足;后离婚,再后来又复婚,中间还穿插了其他 relationships,起起伏伏。不怪王菲唱罢歌曲,满噙眼泪,双手合一,人在台上久久静默,仿佛在念佛。这首歌,她是真带入了。同时她的演绎也感染了无数人。

“远去者去了远方,愿他都安心。” 一开始还以为在纪念逝去的亲人,但通观全词的爱情主线,更像是在纪念逝去的爱情。也许远去者是不得不分手、又难舍情缘的前任,她祝福他安心,其实更是试图宽慰自己,要安心接受“拍一张合影,渐渐填满真感情”的新缘分。

我本人特别喜欢这两句歌词:

赠我一场病,又慢慢痊愈摇风铃。
赠我一场空,又渐渐填满新感情。

它是我2024年生活的真实写照,非常的切身感受。

总的感觉一句话,词作者能写出引起人共鸣、思考和争论的歌词,还是很了得的。至于作曲以及王菲的演唱,可以说是注定成为经典。

 

【相关】

https://www.douyin.com/video/7466269705402060042

语文老师点评并修改王菲《世界赠予我的》歌词# 王菲... https://v.douyin.com/ifcm9PvH/ CuF:/ 03/09 [email protected]

7.99 复制打开抖音,看看【立委的作品】王菲春晚注定传世之作 小白版 # 王菲 # 小白 ... https://v.douyin.com/ifvcmXG7/ Ate:/ [email protected] 12/08

Reinforcement Learning for Reasoning: Supervised Outcomes, Unsupervised Processes

In reading DeepSeek R1 paper, some may have overlooked the nuances: the training datasets are both human labeled and regenerated, blending supervised and unsupervised reinforcement learning (RL).

How so?

From the perspective of the data's origin and gold standards, the training data is undeniably human labeled. They derive from existing math problems and human-crafted code from GitHub’s open-source community—products of years of effort by educators, developers, and others. The problems (input) and their "gold-standard" answers (output) are human-designed or labeled. In this sense, reinforcement learning (RL) represents typical end-to-end supervised learning:

Input: Math/coding problems
Output: Verified answers

However, unlike other supervised learning, RL requires the model to learn the reasoning process leading to answers. Critically, the intermediate steps lack human annotations or feedback. Instead, the system autonomously generates these reasoning data, iteratively appending to the training set. This makes the process unsupervised. The brilliance of RL lies here: self-guided exploration, path discovery, and data regeneration.

Cold Start and Human Data
DeepSeek R1’s initial training did use a small set of human-annotated reasoning data. But these couple of thousand examples pale against millions of regenerated data—effectively negligible. In fact, research like DeepSeek Zero demonstrates that such process-labeled human data is not a must-have.

Inspired by AlphaZero (which showed human data might even hinder optimal pather discovery in Go), DeepSeek Zero confirms human annotations are not necessary. The minor human data in R1’s pipeline primarily enhances readability for developers, not necessarily for enabling reasoning capability. After all, humans (including developers in debugging) prefer interpretable thought processes.

A New Paradigm: Process-Unsupervised, Outcome-Supervised Learning
This self-play/self-study style RL framework represents a novel approach: unsupervised in process but supervised in outcome. DeepSeek’s breakthrough reveals that "slow thinking" in RL—meticulously generating intermediate steps as CoT (chain of thought)—boosts performance in logical reasoning as well as non-logical tasks like creatuive writing.

As my old buddy Cheng insightfully noted:
Deep reasoning inserts extensive text between questions and answers, reducing the perplexity of generating correct answers. Directly jumping from problem to answer has high perplexity, but adding a "reasoning bridge" lowers it. This follows the language model framework: the key is to search for the optimal path in text generation.

Can Unsupervised Regenerated Process Data Lead Astray?
One might worry: if the model autonomously generates flawed reasoning steps in its process data, could errors compound? The answer lies in the clear supervision signal from the gold standard. Like flying a kite—held by a string in human's hands—the final reward anchors the learning. As long as the model truly scales up, outcome-oriented RL ensures deviations' self-correct probabilistically.

Mathematically, minor process imperfections or illogical steps don’t statistically compromise final accuracy. For non-logical tasks (beyond math/coding), reasoning paths may even involve contradictions and/or heavy redundancies. Yet, as long as the "slow thinking" mechanism guides learning, results remain robust—often superhuman, as demonstrated repeatedly lately by many users of R1.

Why Regenerated Data Works
Regenerated reasoning data aren’t random data from nowhere. They’re generated by a solid large foundation model trained on vast human knowledge data, following autoregressive generation (e.g. next-token prediction). While each step might drift slightly, the context grows incrementally, allowing continuous stepwise self-correction. This dynamic—probabilistic fluctuations balanced by stepwise adjustments—enhances semantic coherence and knowledge fluency in generation, lowering overall perplexity and steering toward correct outcomes. Thus, process data rarely derails; instead, it converges toward reliability.

A Final Note on Cheng’s Observation
Cheng highlights a pivotal finding of DeepSeek:
OpenAI’s "Let’s Verify Step by Step" argues for rewarding each reasoning step. Yet DeepSeek’s RL model achieves remarkable results using only final-outcome rewards—no Chain-of-Thought (CoT) data needed. Whether OpenAI’s process supervision is essential or simply a red herring, DeepSeek Zero’s breakthroughs redefine the field, proving outcome-oriented RL can master reasoning autonomously.

In essence, when guided by scalable outcome supervision, machines learn to self-correct, turning imperfect processes into near-perfect results.

 

 

推理强化学习是端到端的监督,推理过程的非监督

DeepSeek R1 的数学和代码数据究竟是有监督还是无监督?是人造数据还是再生数据?

很多人其实没究细节:实际上这些数据是人造也是再生,是监督学习,也是非监督学习(强化学习)。

怎么讲?

这些训练数据,从源头和结果(黄金标准)上看,是地地道道的人造数据。用的是各种数学测试题,以及 github 开源社区的人类(码农手工编制)的代码。这些全部是很多人类分子(教师、码农等)辛辛苦苦多年编制积累的。

源头是人造数据,标准答案也是人类已经验证或事先设计好的。所以,从这个意义上,从结果评判看,强化学习很像是一个典型的监督学习。

input:数学题/代码题;output:标准答案。

这是端到端意义上的监督学习(supervised learning)。

但是,与其他的监督学习不同的是,强化学习为了达到结果正确,他需要学习中间的思考过程。而每一步的思考或推导的过程,它却没有人类的标注或反馈数据,而完全靠自己的再生数据。是机器”自主“再生这些过程思考的数据,然后自我提高。从过程学习的意义上,这又是非监督的学习。这就是强化学习牛的地方:自主学习,自主探索路径,自主再生数据。

具体说,R1 的冷启动用了一点人类标注的过程推理的数据,但比起再生数据动辄百万条,sft 冷启动的几千条数据,零头都算不上,可以忽略不计。

zero 的研究表明,跟本就不需要过程标注的人类数据。

在围棋场景,alpha zero 表明,人类数据不但不需要,反而可能阻碍学习。

deepseek zero 研究表明,人类数据也不是必需的。用少量的人类数据冷启动,主要还不是因为需要人类数据来增强推理能力,而是需要人类数据提升可读性。人类看不见它是怎样思考的,心里不爽;对于开发者改进算法,也不利,因为开发者也是肉眼凡胎。于是在R1的训练pipeline的配方中,加入了少量人类推理数据的冷启动。

所以可以说,这种被称为新范式的self-play或self-study的强化学习是过程非监督、结果监督的深度学习。

DeepSeek 在这条路上的最大一个启蒙是,它给我们显示了慢思考的强化学习在逻辑推理与非逻辑创造的过程中,同样有效。这里面的奥秘就是老友Cheng指出的慢思维本质:慢思维可以得出更好结果,不(仅仅)是我们以前以为的符号逻辑被神经系统模拟了,而是过程数据使得 perplexity 降低,从而为平稳得到正确结果,铺平了道路。

Cheng 指出:

深思考就是在问题和答案之间加入大段文字,从而降低了生成答案的perplexity。从问题直接到答案的perplexity很高,用“思路”座桥梁,就把答案的perplexity降下来了。没离开语言模型的框架,就是把合适的“思路”搜索出来。

一语中的。

Cheng 说:

"Let’s Verify Step by Step" OpenAI这篇经典文章说,训练推理要给每一步打分。Deekseek中间推理模型的训练貌似推翻了这个,只用最终的reward就可以。

Deekseek中间推理模型可以完全不需要CoT数据,单纯用RL训练出来,真挺impressive。

这是一个重大发现。无论 Open AI 是否真用PRM做了大量的过程监督,还是它其实是放烟雾弹,DeepSeek 那帮年轻人做的 zero 研究都是非常漂亮的突破,给业界推理工作指明了方向。

我们总不免疑惑,系统非监督再生数据免不了出错,走错路,导向错了,一错再错,怎么办?

现在已经清楚了,结果监督原则上可以 work,就好像放风筝一样,一根线牵在人手上,基本上就可以放飞而不跌落(事故除外)。关键还是结果导向的强化学习,你能学到多大、多深,只要你能真正规模化(scale up),学深学透,就不用担心自主再生学习在过程中的偏离,最终会学到最深入的深思熟虑。

机器与人不同,优化的总方向明确以后,过程的瑕疵或不逻辑,概率分布上并不影响最终结果的正确。对于那些非逻辑(数学、代码外)的能力,过程就更容易有逻辑不严密(甚至矛盾)、混杂和冗余;但没关系,只要有这个慢思维的学习过程铺路,结果还是漂亮,甚至超人,正如我们这几天所一再见证的。

这一切其实是因为再生的过程数据,不是天上掉下来的,而是基座大模型在最全面的巨量人类知识的基础上,遵循自回归生成定式,生成出来的。而自回归生成(例如 next token prediction)本性的好处我们都知道是,概率上每一步都可能偏离,但每一步都在逐渐加长的上下文条件下做进一步校正,是这种概率性上下波动和步步校正的合力,提升了再生数据内部的语义“相谐性”和知识线条的流畅性,从而降低了整体文本生成的 perplexity,最终导向更好的结果。这就保证了过程再生数据不会差之毫厘失之千里。