我的征尘是星辰大海。。。
The dirt and dust from my pilgrimage forms oceans of stars...
-------当记忆的篇章变得零碎,当追忆的图片变得模糊,我们只能求助于数字存储的永恒的回忆
作者:黄教授
手机视频列表
Transformer的范式真的可以被取代码
视频
音频
原始脚本
范式革命还是取舍游戏?新序列架构无法从底层颠覆 Transformer 时下大量观点鼓吹 Mamba 一类新型序列架构将彻底取代 Transformer。 这类论调混淆了工程优化与理论突破的边界。 所有新兴序列建模方案,就其本质都只是在既定约束下做出的近似折中。 并不存在能够绕开信息固有处理代价的捷径。 从信息熵与计算依赖的第一性原理展开分析,便能够看清这场架构迭代真正的边界与未来走向。 一、先厘清妈妈到底在做什么交换。 自注意力的核心代价是显示计算全部 token 两两之间的关联,复杂度 O。 N 二, Mamba SSM 通过状态空间模型,把长序列建模转换成递推式线性扫描,复杂度降到 O N。 这里非常关键的一点,他并不是找到了一条不需要计算两两关系的数学捷径,而是把显示的两两依赖转成隐式,经过参数拟合的持续状态依赖。 Transformer 每一步推理都实时显示的建立任意位置 token 的直接关联,没有预设的时序先验,所有两两关系是运行时动态生成。 Mamba 在训练阶段就用海量数据拟合出一套状态传递规则,用一个隐状态向量承载历史信息, token 和更早位置 token 的关联不再直接计算,全部封装进状态地推。 这刚好印证了算力转移的核心逻辑,它把大量本该在推理阶段动态完成的两两关系计算。 转嫁到训练阶段完成。 它不是消灭了这部分算力,只是转移了算力发生的时机,并且接受一个前提,现实世界的文本序列具备稳定的持续统计规律。 可以背影状态地推近似拟合。 一旦文本的长距离依赖跳出训练数据的统计分布,近似就会失效,精度损失就会显现。 这就是它固有的适用边界,只能处理具备可被拟合的时序规律的序列。 对于高度跳跃、长距离关联及不规则的文本,近似的误差会快速累积。 这里有一个极易传播的认知误区。 很多自媒体文章把 ON 复杂度直接宣传成理论上更优越的范式,混淆了渐进时间复杂度和信息完备度。 复杂度描述的是运算量规模,并不代表它捕获信息的能力更强。 更低的复杂度是以放弃对任意两两关联的无偏建模作为代价。 二、速度、精度、能耗的不可能三角以及预处理的天花板。 速度、输出精度、能耗构成的不可能三角约束始终存在。 每一次架构迭代本质上都只是调整三角内部的平衡点。 顺着这套框架可以进一步推导,预处理、训练能够转移算力。 但不可能消除固有的信息熵处理代价。 如果一个序列的长距离关联是高度可变、非确定性的,非确定性自动机 Non-deterministic Automaton 我们不可能在训练阶段预先枚举所有可能的关联模式。 只有当问题愈趋近于确定性自动机, Deterministic Automaton 预处理的收益才会达到最大。 文本语言本身恰好介于二者之间。 它有极强的统计规律,但又永远存在不可预知的全新的长距离逻辑跳转。 我们可以通过训练降低推理阶段的熵处理开销。 但是永远无法把全部熵消解在预处理阶段,这就是所有架构优化的硬上限。 两种算力置换形式,一、训练时间换推理时间。 Mamba Rwkv 这类架构走的路线,训练开销抬升,推理变快,以统计近似换取推理效率。 二、推理时空间换时间。 KV cache 稀疏注意力、滑动窗口注意力,仍然是 Transformer 体系内的工程优化,在推理阶段做取舍。 二者本质上都没有跳出三角权衡。 transformer 终将被抛弃这类流行论调大多犯了同一个错误,把某一类场景下的推理性能优势放大为通用范式的替代。 行业更可能走向的结局并不是替代,而是分工共存。 SSM 类架构擅长长文本流逝、日志叙事这类时序连续性很强的场景。 原生字注意力更适合需要远距离、非局部逻辑跳转的推理任务,例如数学证明、多文档交叉引用、复杂逻辑拆解。 三、序列依赖冯诺依曼瓶颈与并行的根本困局。 狼吃羊羊吃狼这个经典事例精准的点明了序列信息流的核心矛盾。 符号本身不携带顺序语义,顺序本身就是信息。 纯粹的自注意力矩阵本身是位置无关的,Token 集合打乱之后注意力矩阵不变。 位置编码 Positional Encoding 是人为注入的时序依赖,把线性信息流的先后顺序强行编码进向量,以此恢复顺序语义。 这里藏有一层更深的矛盾。 语言天然是因果有序的符号流,大量语义建立在先后依赖之上,依赖关系本身就是并行计算的天敌。 只要任务存在数据依赖,投机并行回滚机制的收益就会快速衰减。 CPU 的乱序执行就是典型,短依赖可以投机,长距离不可预判的依赖。 投机回滚带来的开销会超过并行带来的收益。 Transformer 已经做到了一个很了不起的突破,它打破了 RNN 式严格逐 token 地推的串行。 一个序列内部所有 token 可以并行做注意力计算。 但这个并行仅仅是单条序列内部的一层运算并行,它依然不能突破整条输入是一条有序因果流这个上层约束。 我们可以同时并行处理多条样本,但是单条样本内部的因果逻辑依赖,没有通用的并行捷径。 四、纯随机信息不存在优化空间。 智能的边界。 沿着底层逻辑可以提炼出一条清晰的核心命题。 算法优化的前提是待处理信号当中存在可以被提取的统计规律。 可压缩的熵。 对于完全独立同分布的纯随机信息流,不存在任何算法可以降低处理开销,所有算法的效率等价。 在这种信号值上也不存在智能。 智能本质就是寻找序列当中的模式,降低不确定性。 当信息完全随机,没有模式可以抓取,也就没有任何可供优化的空间。 大模型面对的真实输入永远不是纯随机的,但输入当中永远包含一部分不可预测、无稳定统计模式的长距离关联。 这一部分内容就是所有近似型架构无论如何也绕不开的硬骨头。 只要选择近似,这部分信息就会发生失真。 想要完整保留这部分信息,就无法避开两两关联的计算开销。 五。 对未来演化路径的推演一, Transformer 不会消亡,但原生稠密自注意力会越来越少直接使用。 未来主流会是 Transformer 的衍生变体。 稀疏注意力、动态注意力、路由注意力等,都是在自注意力完备建模能力的基础之上,做有条件的近似,保留随时可以建立任意长距离关联的通路。 这和 Mamba 从底层就放弃显示两两关联有本质区别。 二、架构混合将会成为常态。 而非单一架构一统天下。 一个模型内部同时存在 SSIM 模块,负责平稳长序列的快速便利,自注意力模块专门负责触发远距离逻辑跳转。 两套机制各司其职。 三、所有宣称从底层原理上更快,同时精度无损的新架构,从信息熵第一性原理上就不可能成立。 这类命题天然违背不可能三角。 新架构的价值在于开辟新的取舍点,而不是找到第三条不受三角约束的路径。 归根结底。 Mamba 以及后续一系列新序列模型是非常优秀的特定约束下的工程解,并不是序列问题的理论通解。 只要人类所要处理的符号流依然存在不可预判的长距离因果依赖。 完整的 token to token 关联建模就永远存在不可替代的价值。 Transformer 的核心范式很难被彻底推翻。 大量自媒体的判断往往是把一条很好的取舍路线误判成了范式革命。
修正脚本
范式革命还是取舍游戏?新序列架构无法从底层颠覆 Transformer 时下大量观点鼓吹 Mamba 一类新型序列架构将彻底取代 Transformer。 这类论调混淆了工程优化与理论突破的边界。 所有新兴序列建模方案,就其本质都只是在既定约束下做出的近似折中。 并不存在能够绕开信息固有处理代价的捷径。 从信息熵与计算依赖的第一性原理展开分析,便能够看清这场架构迭代真正的边界与未来走向。 一、先厘清Mamba到底在做什么取舍。 自注意力的核心代价是显式计算全部 token 两两之间的关联,复杂度O(N²)。 Mamba SSM 通过状态空间模型,把长序列建模转换成递推式线性扫描,复杂度降到 O(N)。 这里非常关键的一点,它并不是找到了一条不需要计算两两关系的数学捷径,而是把显式的两两依赖转成隐式,经过参数拟合的持续状态依赖。 Transformer 每一步推理都实时显式的建立任意位置 token 的直接关联,没有预设的时序先验,所有两两关系是运行时动态生成。 Mamba 在训练阶段就用海量数据拟合出一套状态传递规则,用一个隐状态向量承载历史信息, token 和更早位置 token 的关联不再直接计算,全部封装进状态递推。 这刚好印证了算力转移的核心逻辑,它把大量本该在推理阶段动态完成的两两关系计算。 转嫁到训练阶段完成。 它不是消灭了这部分算力,只是转移了算力发生的时机,并且接受一个前提,现实世界的文本序列具备稳定的持续统计规律。 可以被隐状态递推近似拟合。 一旦文本的长距离依赖跳出训练数据的统计分布,近似就会失效,精度损失就会显现。 这就是它固有的适用边界,只能处理具备可被拟合的时序规律的序列。 对于高度跳跃、长距离关联及不规则的文本,近似的误差会快速累积。 这里有一个极易传播的认知误区。 很多自媒体文章把O(N)复杂度直接宣传成理论上更优越的范式,混淆了渐进时间复杂度和信息完备度。 复杂度描述的是运算量规模,并不代表它捕获信息的能力更强。 更低的复杂度是以放弃对任意两两关联的无偏建模作为代价。 二、速度、精度、能耗的不可能三角以及预处理的天花板。 速度、输出精度、能耗构成的不可能三角约束始终存在。 每一次架构迭代本质上都只是调整三角内部的平衡点。 顺着这套框架可以进一步推导,预处理、训练能够转移算力。 但不可能消除固有的信息熵处理代价。 如果一个序列的长距离关联是高度可变、非确定性的,非确定性自动机 Non-deterministic Automaton,我们不可能在训练阶段预先枚举所有可能的关联模式。 只有当问题愈趋近于确定性自动机 Deterministic Automaton,预处理的收益才会达到最大。 文本语言本身恰好介于二者之间。 它有极强的统计规律,但又永远存在不可预知的全新的长距离逻辑跳转。 我们可以通过训练降低推理阶段的熵处理开销。 但是永远无法把全部熵消解在预处理阶段,这就是所有架构优化的硬上限。 两种算力置换形式,一、训练时间换推理时间。 Mamba Rwkv 这类架构走的路线,训练开销抬升,推理变快,以统计近似换取推理效率。 二、推理时空间换时间。 KV cache 稀疏注意力、滑动窗口注意力,仍然是 Transformer 体系内的工程优化,在推理阶段做取舍。 二者本质上都没有跳出三角权衡。 transformer 终将被抛弃这类流行论调大多犯了同一个错误,把某一类场景下的推理性能优势放大为通用范式的替代。 行业更可能走向的结局并不是替代,而是分工共存。 SSM 类架构擅长长文本流逝、日志叙事这类时序连续性很强的场景。 原生自注意力更适合需要远距离、非局部逻辑跳转的推理任务,例如数学证明、多文档交叉引用、复杂逻辑拆解。 三、序列依赖冯诺依曼瓶颈与并行的根本困局。 狼吃羊羊吃狼这个经典事例精准地点明了序列信息流的核心矛盾。 符号本身不携带顺序语义,顺序本身就是信息。 纯粹的自注意力矩阵本身是位置无关的,Token 集合打乱之后注意力矩阵不变。 位置编码 Positional Encoding 是人为注入的时序依赖,把线性信息流的先后顺序强行编码进向量,以此恢复顺序语义。 这里藏有一层更深的矛盾。 语言天然是因果有序的符号流,大量语义建立在先后依赖之上,依赖关系本身就是并行计算的天敌。 只要任务存在数据依赖,投机并行回滚机制的收益就会快速衰减。 CPU 的乱序执行就是典型,短依赖可以投机,长距离不可预判的依赖,投机回滚带来的开销会超过并行带来的收益。 Transformer 已经做到了一个很了不起的突破,它打破了 RNN 式严格逐 token 递推的串行。 一个序列内部所有 token 可以并行做注意力计算。 但这个并行仅仅是单条序列内部的一层运算并行,它依然不能突破整条输入是一条有序因果流这个上层约束。 我们可以同时并行处理多条样本,但是单条样本内部的因果逻辑依赖,没有通用的并行捷径。 四、纯随机信息不存在优化空间。 智能的边界。 沿着底层逻辑可以提炼出一条清晰的核心命题。 算法优化的前提是待处理信号当中存在可以被提取的统计规律。 可压缩的熵。 对于完全独立同分布的纯随机信息流,不存在任何算法可以降低处理开销,所有算法的效率等价。 在这种信号上也不存在智能。 智能本质就是寻找序列当中的模式,降低不确定性。 当信息完全随机,没有模式可以抓取,也就没有任何可供优化的空间。 大模型面对的真实输入永远不是纯随机的,但输入当中永远包含一部分不可预测、无稳定统计模式的长距离关联。 这一部分内容就是所有近似型架构无论如何也绕不开的硬骨头。 只要选择近似,这部分信息就会发生失真。 想要完整保留这部分信息,就无法避开两两关联的计算开销。 五、对未来演化路径的推演 一、Transformer 不会消亡,但原生稠密自注意力会越来越少直接使用。 未来主流会是 Transformer 的衍生变体。 稀疏注意力、动态注意力、路由注意力等,都是在自注意力完备建模能力的基础之上,做有条件的近似,保留随时可以建立任意长距离关联的通路。 这和 Mamba 从底层就放弃显式两两关联有本质区别。 二、架构混合将会成为常态。 而非单一架构一统天下。 一个模型内部同时存在 SSM 模块,负责平稳长序列的快速遍历,自注意力模块专门负责触发远距离逻辑跳转。 两套机制各司其职。 三、所有宣称从底层原理上更快,同时精度无损的新架构,从信息熵第一性原理上就不可能成立。 这类命题天然违背不可能三角。 新架构的价值在于开辟新的取舍点,而不是找到第三条不受三角约束的路径。 归根结底。 Mamba 以及后续一系列新序列模型是非常优秀的特定约束下的工程解,并不是序列问题的理论通解。 只要人类所要处理的符号流依然存在不可预判的长距离因果依赖。 完整的 token to token 关联建模就永远存在不可替代的价值。 Transformer 的核心范式很难被彻底推翻。 大量自媒体的判断往往是把一条很好的取舍路线误判成了范式革命。
英文翻译
Paradigm Revolution or Trade-off Game? New sequence architectures cannot subvert Transformer from the ground up. Nowadays, a large number of voices advocate that new sequence architectures like Mamba will completely replace Transformer. This argument confuses the boundary between engineering optimization and theoretical breakthrough. In essence, all emerging sequence modeling schemes are just approximate compromises made under established constraints. There is no shortcut that can bypass the inherent processing cost of information. Analyzing from the first principles of information entropy and computational dependency, we can clearly see the real boundary and future trend of this architecture iteration. I. First clarify what trade-offs Mamba is actually making. The core cost of self-attention is to explicitly calculate the correlation between every two tokens, with a complexity of O(N²). Mamba SSM converts long sequence modeling into recursive linear scanning through a state space model, reducing the complexity to O(N). A crucial point here is that it does not find a mathematical shortcut that eliminates the need to calculate pairwise relations, but converts explicit pairwise dependency into implicit continuous state dependency fitted through parameters. Transformer explicitly establishes direct correlation between tokens at any positions in real time during each inference step. There is no preset temporal prior, and all pairwise relations are dynamically generated at runtime. Mamba fits a set of state transition rules with massive data during the training phase, and uses a hidden state vector to carry historical information. The correlation between the current token and tokens at earlier positions is no longer calculated directly, and all such relations are encapsulated into state recursion. This perfectly confirms the core logic of computing power transfer: it shifts a large amount of pairwise relation calculation that should have been completed dynamically during the inference phase. to the training phase. It does not eliminate this part of computing power, but only transfers the timing of computing power occurrence, and accepts the premise that text sequences in the real world have stable continuous statistical laws. that can be approximately fitted by hidden state recursion. Once the long-distance dependency of text goes beyond the statistical distribution of training data, the approximation will fail and accuracy loss will become visible. This is its inherent application boundary: it can only process sequences with temporal rules that can be fitted. For highly jumping, long-distance correlated and irregular texts, the approximation error will accumulate rapidly. There is a widely spread cognitive misunderstanding. Many self-media articles directly promote O(N) complexity as a theoretically superior paradigm, confusing asymptotic time complexity with information completeness. Complexity describes the scale of computation, it does not mean that the ability of such architectures to capture information is stronger. Lower complexity comes at the cost of giving up unbiased modeling of arbitrary pairwise correlations. II. The impossible triangle of speed, accuracy, energy consumption and the ceiling of preprocessing. The impossible triangle constraint formed by speed, output accuracy and energy consumption always exists. In essence, every architecture iteration is just adjusting the equilibrium point inside the triangle. Following this framework, we can further deduce that preprocessing and training can transfer computing power. but cannot eliminate the inherent information entropy processing cost. If the long-distance correlation of a sequence is highly variable and non-deterministic, for Non-deterministic Automaton, we cannot pre-enumerate all possible correlation patterns in the training phase. Only when the problem gets closer to Deterministic Automaton, can the benefit of preprocessing reach its maximum. Text language itself is exactly between the two. It has strong statistical rules, but there are always unpredictable new long-distance logical jumps. We can reduce the entropy processing overhead in the inference phase through training. but we can never eliminate all entropy in the preprocessing stage, which is the hard upper limit of all architecture optimization. There are two forms of computing power replacement: 1. Training time in exchange for inference time. Architectures like Mamba Rwkv follow this route: training overhead increases, inference becomes faster, and inference efficiency is obtained at the cost of statistical approximation. 2. Inference time space in exchange for time. KV cache, sparse attention and sliding window attention are still engineering optimizations within the Transformer system, making trade-offs during the inference phase. Essentially, neither has gone beyond the triangle trade-off. Most popular arguments that "transformer will eventually be abandoned" mostly make the same mistake: magnifying the inference performance advantage in one specific scenario into a replacement for the general paradigm. The more likely outcome for the industry is not replacement, but coexistence with division of labor. SSM-type architectures are good at scenarios with strong temporal continuity such as long sequence streaming and log narration. Native self-attention is more suitable for inference tasks that require long-distance, non-local logical jumps, such as mathematical proof, multi-document cross-reference, and complex logical decomposition. III. Sequence dependency, the von Neumann bottleneck and the fundamental dilemma of parallelism. The classic example of "wolf eats sheep, sheep eats wolf" accurately points out the core contradiction of sequence information flow. Symbols themselves do not carry order semantics, order itself is information. A pure self-attention matrix itself is position-independent, and the attention matrix remains unchanged after the Token set is shuffled. Positional Encoding is artificially injected temporal dependency, which forcibly encodes the sequence of linear information flow into vectors to restore order semantics. There is a deeper hidden contradiction here. Language is naturally a causally ordered symbolic flow, a large amount of semantics is built on sequential dependency, and dependency itself is the natural enemy of parallel computing. As long as there is data dependency in the task, the benefit of the speculative parallel rollback mechanism will decay rapidly. CPU out-of-order execution is a typical example: short dependencies can be speculated, while for unpredictable long-distance dependencies, the overhead brought by speculative rollback will exceed the benefit brought by parallelism. Transformer has already made a remarkable breakthrough: it broke the strict token-by-token recursive serial mode of RNN. All tokens within a single sequence can perform attention calculation in parallel. But this parallelism is only one layer of operation parallelism within a single sequence, and it still cannot break the upper-level constraint that the entire input is an ordered causal flow. We can process multiple samples in parallel at the same time, but there is no general parallel shortcut for the causal logical dependency within a single sample. IV. There is no room for optimization in purely random information. The boundary of intelligence. Following the underlying logic, we can extract a clear core proposition. The premise of algorithm optimization is that there are extractable statistical rules in the signal to be processed. That is compressible entropy. For purely random information flow with independent and identical distribution, there is no algorithm that can reduce processing overhead, and all algorithms have equivalent efficiency. There is no intelligence on this kind of signal either. Intelligence essentially is to find patterns in sequences and reduce uncertainty. When information is completely random and there is no pattern to capture, there is no room for any optimization. The real input faced by large models is never purely random, but the input always contains some unpredictable long-distance correlations without stable statistical patterns. This part of content is a hard nut that all approximate architectures cannot avoid by any means. As long as approximation is adopted, this part of information will be distorted. To retain this part of information completely, the computational overhead of pairwise correlation cannot be avoided. V. Deduction of the future evolution path 1. Transformer will not die out, but native dense self-attention will be used less and less directly. The mainstream in the future will be derivative variants of Transformer. Sparse attention, dynamic attention, routing attention, etc., are all conditional approximations based on the complete modeling capability of self-attention, retaining the access to establish arbitrary long-distance correlations at any time. This is fundamentally different from Mamba, which abandons explicit pairwise correlation from the bottom level. 2. Hybrid architecture will become the norm. instead of a single architecture dominating the field. A model has both SSM modules responsible for fast traversal of stable long sequences, and self-attention modules specifically responsible for handling long-distance logical jumps. The two mechanisms perform their own functions. 3. All new architectures that claim to be faster based on underlying principles and have no accuracy loss cannot hold water from the first principle of information entropy. Such propositions naturally violate the impossible triangle. The value of a new architecture lies in opening up new trade-off points, not in finding a third path that is not constrained by the triangle. In the final analysis. Mamba and a series of subsequent new sequence models are excellent engineering solutions under specific constraints, not theoretical general solutions to sequence problems. As long as the symbol flow processed by humans still has unpredictable long-distance causal dependencies. Complete token to token correlation modeling will always have irreplaceable value. The core paradigm of Transformer is difficult to be completely overturned. The judgments of many self-media often misjudge a good trade-off route as a paradigm revolution.
back to top